9router-proxy 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 (1130) hide show
  1. package/README.md +73 -1
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +14 -12
  4. package/app/.next-cli-build/build-manifest.json +2 -2
  5. package/app/.next-cli-build/prerender-manifest.json +20 -20
  6. package/app/.next-cli-build/required-server-files.json +2 -1
  7. package/app/.next-cli-build/routes-manifest.json +12 -0
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +12 -8
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  78. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  88. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  89. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  90. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  91. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  92. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  93. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -29
  116. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  124. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
  126. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  132. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  140. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  148. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  150. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js +25 -0
  152. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -0
  153. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route_client-reference-manifest.js +1 -0
  154. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -26
  155. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +3 -3
  157. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  159. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +3 -3
  161. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  163. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  165. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
  167. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -2
  169. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  257. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  263. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  301. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  303. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +68 -0
  305. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -0
  306. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route_client-reference-manifest.js +1 -0
  307. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  312. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  314. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  316. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  318. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  320. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  322. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  324. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  326. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  342. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  364. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -6
  386. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  400. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  430. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  436. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  438. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  442. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  444. package/app/.next-cli-build/server/app/callback.html +1 -1
  445. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  446. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  447. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  448. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  449. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  451. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +5 -5
  452. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  453. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  454. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  455. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  456. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
  457. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  458. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  461. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +5 -5
  462. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  463. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  464. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
  466. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +8 -8
  467. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  468. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  470. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  471. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +5 -5
  472. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  473. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  474. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  476. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
  477. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  478. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  480. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  481. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +5 -5
  482. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  483. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  484. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  486. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +5 -5
  487. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  488. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  491. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +5 -5
  492. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  493. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  496. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  497. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  498. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  499. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  500. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  501. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +5 -5
  502. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  503. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  504. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  506. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +6 -6
  507. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  508. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  509. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  515. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  516. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  517. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  519. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +5 -5
  520. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  521. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  522. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  524. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +5 -5
  525. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  526. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  527. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  529. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +5 -5
  530. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  531. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  532. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  533. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  534. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +5 -5
  535. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  536. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  537. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  538. package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
  539. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +8 -8
  540. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
  541. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  542. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  543. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  544. package/app/.next-cli-build/server/app/index.html +1 -1
  545. package/app/.next-cli-build/server/app/index.rsc +5 -5
  546. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  547. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  548. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  549. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  550. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  551. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  552. package/app/.next-cli-build/server/app/landing.html +1 -1
  553. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  554. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  555. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  556. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +6 -6
  557. package/app/.next-cli-build/server/app/login/page.js +1 -1
  558. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  559. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  560. package/app/.next-cli-build/server/app/login.html +1 -1
  561. package/app/.next-cli-build/server/app/login.rsc +5 -5
  562. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  563. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  564. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  565. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  566. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  567. package/app/.next-cli-build/server/app/page.js +1 -1
  568. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  569. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  570. package/app/.next-cli-build/server/app-paths-manifest.json +14 -12
  571. package/app/.next-cli-build/server/chunks/{9402.js → 1051.js} +1 -1
  572. package/app/.next-cli-build/server/chunks/1306.js +1 -1
  573. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  574. package/app/.next-cli-build/server/chunks/1757.js +25 -0
  575. package/app/.next-cli-build/server/chunks/2214.js +4 -2
  576. package/app/.next-cli-build/server/chunks/2375.js +1 -0
  577. package/app/.next-cli-build/server/chunks/24.js +1 -1
  578. package/app/.next-cli-build/server/chunks/3210.js +2 -2
  579. package/app/.next-cli-build/server/chunks/3593.js +2 -2
  580. package/app/.next-cli-build/server/chunks/3711.js +1 -0
  581. package/app/.next-cli-build/server/chunks/3726.js +1 -1
  582. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  583. package/app/.next-cli-build/server/chunks/3966.js +1 -1
  584. package/app/.next-cli-build/server/chunks/4049.js +1 -1
  585. package/app/.next-cli-build/server/chunks/4055.js +2 -2
  586. package/app/.next-cli-build/server/chunks/412.js +2 -2
  587. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  588. package/app/.next-cli-build/server/chunks/4199.js +1 -0
  589. package/app/.next-cli-build/server/chunks/436.js +1 -1
  590. package/app/.next-cli-build/server/chunks/4730.js +3 -3
  591. package/app/.next-cli-build/server/chunks/4739.js +2 -2
  592. package/app/.next-cli-build/server/chunks/4780.js +2 -2
  593. package/app/.next-cli-build/server/chunks/4798.js +1 -0
  594. package/app/.next-cli-build/server/chunks/5026.js +1 -1
  595. package/app/.next-cli-build/server/chunks/507.js +2 -2
  596. package/app/.next-cli-build/server/chunks/5217.js +2 -2
  597. package/app/.next-cli-build/server/chunks/5258.js +2 -2
  598. package/app/.next-cli-build/server/chunks/5299.js +20 -19
  599. package/app/.next-cli-build/server/chunks/5330.js +7 -7
  600. package/app/.next-cli-build/server/chunks/5615.js +2 -2
  601. package/app/.next-cli-build/server/chunks/562.js +1 -1
  602. package/app/.next-cli-build/server/chunks/5827.js +1 -0
  603. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  604. package/app/.next-cli-build/server/chunks/615.js +1 -1
  605. package/app/.next-cli-build/server/chunks/6249.js +2 -2
  606. package/app/.next-cli-build/server/chunks/6555.js +1 -0
  607. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  608. package/app/.next-cli-build/server/chunks/6922.js +1 -1
  609. package/app/.next-cli-build/server/chunks/698.js +2 -2
  610. package/app/.next-cli-build/server/chunks/7211.js +1 -1
  611. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  612. package/app/.next-cli-build/server/chunks/7552.js +1 -0
  613. package/app/.next-cli-build/server/chunks/7716.js +1 -1
  614. package/app/.next-cli-build/server/chunks/7843.js +1 -1
  615. package/app/.next-cli-build/server/chunks/7911.js +1 -1
  616. package/app/.next-cli-build/server/chunks/7965.js +2 -2
  617. package/app/.next-cli-build/server/chunks/8251.js +1 -0
  618. package/app/.next-cli-build/server/chunks/8402.js +1 -1
  619. package/app/.next-cli-build/server/chunks/8416.js +1 -1
  620. package/app/.next-cli-build/server/chunks/8499.js +5 -5
  621. package/app/.next-cli-build/server/chunks/8520.js +2 -2
  622. package/app/.next-cli-build/server/chunks/8635.js +1 -1
  623. package/app/.next-cli-build/server/chunks/869.js +1 -1
  624. package/app/.next-cli-build/server/chunks/8895.js +4 -4
  625. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  626. package/app/.next-cli-build/server/chunks/9100.js +21 -0
  627. package/app/.next-cli-build/server/chunks/915.js +2 -2
  628. package/app/.next-cli-build/server/chunks/936.js +1 -0
  629. package/app/.next-cli-build/server/chunks/9604.js +1 -0
  630. package/app/.next-cli-build/server/chunks/9696.js +7 -0
  631. package/app/.next-cli-build/server/instrumentation.js +1 -1
  632. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  633. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  634. package/app/.next-cli-build/server/middleware.js +3 -3
  635. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  636. package/app/.next-cli-build/server/pages/404.html +1 -1
  637. package/app/.next-cli-build/server/pages/500.html +1 -1
  638. package/app/.next-cli-build/server/preview-props.json +3 -3
  639. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  640. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  641. package/app/.next-cli-build/static/Jv8v1dCqk7v7QSt2O1N5j/_buildManifest.js +1 -0
  642. package/app/.next-cli-build/static/chunks/1321-0350e12bcb603f07.js +1 -0
  643. package/app/.next-cli-build/static/chunks/5497-8852bfd593d10f0e.js +7 -0
  644. package/app/.next-cli-build/static/chunks/{761-620fbf946f547a62.js → 761-e9f1b4d71f823c81.js} +19 -18
  645. package/app/.next-cli-build/static/chunks/809-2c4d631176de6bd6.js +5 -0
  646. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-0825f811e863492d.js → page-5ef34a2a3c5981d8.js} +15 -11
  647. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-5587f1c75b205afa.js → page-2dbb710ca7621edc.js} +4 -4
  648. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-5545d5f7a6f26894.js +4 -0
  649. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-736db53272ee934c.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-a39c08212f881306.js → layout-95805ef9f057450e.js} +1 -1
  651. package/app/.next-cli-build/static/chunks/app/_global-error/page-7ee9602010473e2d.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-7ee9602010473e2d.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-7ee9602010473e2d.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-7ee9602010473e2d.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-7ee9602010473e2d.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-7ee9602010473e2d.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-7ee9602010473e2d.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-7ee9602010473e2d.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-7ee9602010473e2d.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-7ee9602010473e2d.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-7ee9602010473e2d.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-7ee9602010473e2d.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-7ee9602010473e2d.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-7ee9602010473e2d.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-7ee9602010473e2d.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-7ee9602010473e2d.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-7ee9602010473e2d.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-7ee9602010473e2d.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-7ee9602010473e2d.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-7ee9602010473e2d.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-7ee9602010473e2d.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-7ee9602010473e2d.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-7ee9602010473e2d.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-7ee9602010473e2d.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-7ee9602010473e2d.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-7ee9602010473e2d.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-7ee9602010473e2d.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-7ee9602010473e2d.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-7ee9602010473e2d.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-7ee9602010473e2d.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-profiles/route-7ee9602010473e2d.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-7ee9602010473e2d.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-7ee9602010473e2d.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-7ee9602010473e2d.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-7ee9602010473e2d.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-7ee9602010473e2d.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-7ee9602010473e2d.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-7ee9602010473e2d.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-7ee9602010473e2d.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-7ee9602010473e2d.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-7ee9602010473e2d.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/combos/route-7ee9602010473e2d.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-7ee9602010473e2d.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-7ee9602010473e2d.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-7ee9602010473e2d.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-7ee9602010473e2d.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-7ee9602010473e2d.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-7ee9602010473e2d.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/health/route-7ee9602010473e2d.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/init/route-7ee9602010473e2d.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-7ee9602010473e2d.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/keys/route-7ee9602010473e2d.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/locale/route-7ee9602010473e2d.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-7ee9602010473e2d.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-7ee9602010473e2d.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-7ee9602010473e2d.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-7ee9602010473e2d.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-7ee9602010473e2d.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-7ee9602010473e2d.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-7ee9602010473e2d.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-7ee9602010473e2d.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-7ee9602010473e2d.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-7ee9602010473e2d.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-7ee9602010473e2d.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-7ee9602010473e2d.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/models/route-7ee9602010473e2d.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/models/test/route-7ee9602010473e2d.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-7ee9602010473e2d.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-7ee9602010473e2d.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-7ee9602010473e2d.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-7ee9602010473e2d.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-7ee9602010473e2d.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-7ee9602010473e2d.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-7ee9602010473e2d.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-7ee9602010473e2d.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-7ee9602010473e2d.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-7ee9602010473e2d.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-7ee9602010473e2d.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-7ee9602010473e2d.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-7ee9602010473e2d.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-7ee9602010473e2d.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-7ee9602010473e2d.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-7ee9602010473e2d.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-7ee9602010473e2d.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-7ee9602010473e2d.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-7ee9602010473e2d.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-7ee9602010473e2d.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/pricing/route-7ee9602010473e2d.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-7ee9602010473e2d.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-7ee9602010473e2d.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-7ee9602010473e2d.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-7ee9602010473e2d.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-7ee9602010473e2d.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-7ee9602010473e2d.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-7ee9602010473e2d.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-7ee9602010473e2d.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-7ee9602010473e2d.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-7ee9602010473e2d.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/providers/route-7ee9602010473e2d.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-7ee9602010473e2d.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-7ee9602010473e2d.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-7ee9602010473e2d.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-7ee9602010473e2d.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-7ee9602010473e2d.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-7ee9602010473e2d.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-7ee9602010473e2d.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/netlify-deploy/route-7ee9602010473e2d.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-7ee9602010473e2d.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-7ee9602010473e2d.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-7ee9602010473e2d.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-7ee9602010473e2d.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-7ee9602010473e2d.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-7ee9602010473e2d.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-7ee9602010473e2d.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-7ee9602010473e2d.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-7ee9602010473e2d.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-7ee9602010473e2d.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-7ee9602010473e2d.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-7ee9602010473e2d.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-7ee9602010473e2d.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/settings/route-7ee9602010473e2d.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-7ee9602010473e2d.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/tags/route-7ee9602010473e2d.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-7ee9602010473e2d.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-7ee9602010473e2d.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-7ee9602010473e2d.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-7ee9602010473e2d.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-7ee9602010473e2d.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-7ee9602010473e2d.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-7ee9602010473e2d.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-7ee9602010473e2d.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-7ee9602010473e2d.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-7ee9602010473e2d.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-7ee9602010473e2d.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-7ee9602010473e2d.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-7ee9602010473e2d.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-7ee9602010473e2d.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-7ee9602010473e2d.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-7ee9602010473e2d.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-7ee9602010473e2d.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-7ee9602010473e2d.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-7ee9602010473e2d.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-7ee9602010473e2d.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-7ee9602010473e2d.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-7ee9602010473e2d.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-7ee9602010473e2d.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-7ee9602010473e2d.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-7ee9602010473e2d.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-7ee9602010473e2d.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-7ee9602010473e2d.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-7ee9602010473e2d.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-7ee9602010473e2d.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-7ee9602010473e2d.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-7ee9602010473e2d.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-7ee9602010473e2d.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-7ee9602010473e2d.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-7ee9602010473e2d.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-7ee9602010473e2d.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-7ee9602010473e2d.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-7ee9602010473e2d.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-7ee9602010473e2d.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/v1/route-7ee9602010473e2d.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-7ee9602010473e2d.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-7ee9602010473e2d.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-7ee9602010473e2d.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-7ee9602010473e2d.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-7ee9602010473e2d.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-7ee9602010473e2d.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-7ee9602010473e2d.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-7ee9602010473e2d.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-7ee9602010473e2d.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/api/version/route-7ee9602010473e2d.js +1 -0
  823. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-7ee9602010473e2d.js +1 -0
  824. package/app/.next-cli-build/static/chunks/app/api/version/update/route-7ee9602010473e2d.js +1 -0
  825. package/app/.next-cli-build/static/chunks/app/landing/page-5c7fee91d003980e.js +1 -0
  826. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-7ee9602010473e2d.js +1 -0
  827. package/app/.next-cli-build/static/chunks/app/page-7ee9602010473e2d.js +1 -0
  828. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-7ee9602010473e2d.js +1 -0
  829. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-7ee9602010473e2d.js +1 -0
  830. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-7ee9602010473e2d.js +1 -0
  831. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-7ee9602010473e2d.js +1 -0
  832. package/app/.next-cli-build/static/css/2e0bdc15d566d63b.css +1 -0
  833. package/app/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js +131 -0
  834. package/app/node_modules/@aws/lambda-invoke-store/package.json +55 -0
  835. package/app/node_modules/@aws-sdk/core/client.js +5 -0
  836. package/app/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +984 -0
  837. package/app/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +349 -0
  838. package/app/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +2949 -0
  839. package/app/node_modules/@aws-sdk/core/httpAuthSchemes.js +5 -0
  840. package/app/node_modules/@aws-sdk/core/package.json +146 -0
  841. package/app/node_modules/@aws-sdk/core/protocols.js +5 -0
  842. package/app/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js +202 -0
  843. package/app/node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/loadCognitoIdentity-v413cIIq.js +4 -0
  844. package/app/node_modules/@aws-sdk/credential-provider-cognito-identity/package.json +59 -0
  845. package/app/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +39 -0
  846. package/app/node_modules/@aws-sdk/credential-provider-env/package.json +63 -0
  847. package/app/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +179 -0
  848. package/app/node_modules/@aws-sdk/credential-provider-http/package.json +75 -0
  849. package/app/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +229 -0
  850. package/app/node_modules/@aws-sdk/credential-provider-ini/package.json +73 -0
  851. package/app/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +290 -0
  852. package/app/node_modules/@aws-sdk/credential-provider-login/package.json +66 -0
  853. package/app/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +166 -0
  854. package/app/node_modules/@aws-sdk/credential-provider-node/package.json +71 -0
  855. package/app/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +76 -0
  856. package/app/node_modules/@aws-sdk/credential-provider-process/package.json +63 -0
  857. package/app/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +192 -0
  858. package/app/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BGYXHf8s.js +3 -0
  859. package/app/node_modules/@aws-sdk/credential-provider-sso/package.json +67 -0
  860. package/app/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +58 -0
  861. package/app/node_modules/@aws-sdk/credential-provider-web-identity/package.json +71 -0
  862. package/app/node_modules/@aws-sdk/credential-providers/dist-cjs/index.js +284 -0
  863. package/app/node_modules/@aws-sdk/credential-providers/dist-cjs/loadSts-C4jOcYxJ.js +3 -0
  864. package/app/node_modules/@aws-sdk/credential-providers/package.json +85 -0
  865. package/app/node_modules/@aws-sdk/nested-clients/cognito-identity.js +5 -0
  866. package/app/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +616 -0
  867. package/app/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +590 -0
  868. package/app/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +468 -0
  869. package/app/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +674 -0
  870. package/app/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +881 -0
  871. package/app/node_modules/@aws-sdk/nested-clients/package.json +121 -0
  872. package/app/node_modules/@aws-sdk/nested-clients/signin.js +5 -0
  873. package/app/node_modules/@aws-sdk/nested-clients/sso-oidc.js +5 -0
  874. package/app/node_modules/@aws-sdk/nested-clients/sso.js +5 -0
  875. package/app/node_modules/@aws-sdk/nested-clients/sts.js +5 -0
  876. package/app/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +155 -0
  877. package/app/node_modules/@aws-sdk/signature-v4-multi-region/package.json +60 -0
  878. package/app/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +158 -0
  879. package/app/node_modules/@aws-sdk/token-providers/package.json +69 -0
  880. package/app/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +372 -0
  881. package/app/node_modules/@aws-sdk/xml-builder/package.json +63 -0
  882. package/app/node_modules/@smithy/core/cbor.js +5 -0
  883. package/app/node_modules/@smithy/core/checksum.js +5 -0
  884. package/app/node_modules/@smithy/core/client.js +5 -0
  885. package/app/node_modules/@smithy/core/config.js +5 -0
  886. package/app/node_modules/@smithy/core/dist-cjs/index.js +344 -0
  887. package/app/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +2550 -0
  888. package/app/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +577 -0
  889. package/app/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +1200 -0
  890. package/app/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +779 -0
  891. package/app/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +879 -0
  892. package/app/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +924 -0
  893. package/app/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1099 -0
  894. package/app/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +848 -0
  895. package/app/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +709 -0
  896. package/app/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +1765 -0
  897. package/app/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +189 -0
  898. package/app/node_modules/@smithy/core/endpoints.js +5 -0
  899. package/app/node_modules/@smithy/core/event-streams.js +5 -0
  900. package/app/node_modules/@smithy/core/package.json +258 -0
  901. package/app/node_modules/@smithy/core/protocols.js +5 -0
  902. package/app/node_modules/@smithy/core/retry.js +5 -0
  903. package/app/node_modules/@smithy/core/schema.js +5 -0
  904. package/app/node_modules/@smithy/core/serde.js +5 -0
  905. package/app/node_modules/@smithy/core/transport.js +5 -0
  906. package/app/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +370 -0
  907. package/app/node_modules/@smithy/credential-provider-imds/package.json +57 -0
  908. package/app/node_modules/@smithy/node-http-handler/dist-cjs/index.js +859 -0
  909. package/app/node_modules/@smithy/node-http-handler/package.json +56 -0
  910. package/app/node_modules/@smithy/signature-v4/dist-cjs/index.js +585 -0
  911. package/app/node_modules/@smithy/signature-v4/package.json +53 -0
  912. package/app/node_modules/@smithy/types/dist-cjs/index.js +96 -0
  913. package/app/node_modules/@smithy/types/package.json +50 -0
  914. package/app/node_modules/baseline-browser-mapping/dist/index.cjs +1 -1
  915. package/app/node_modules/baseline-browser-mapping/package.json +3 -3
  916. package/app/node_modules/bowser/es5.js +1 -0
  917. package/app/node_modules/bowser/package.json +93 -0
  918. package/app/package.json +4 -1
  919. package/app/public/providers/bedrock-xai.png +0 -0
  920. package/app/public/providers/bedrock.png +0 -0
  921. package/app/server.js +1 -1
  922. package/app/src/mitm/server.js +23 -23
  923. package/cli.js +7 -5
  924. package/package.json +1 -1
  925. package/src/cli/api/client.js +17 -4
  926. package/src/cli/commands/connect.js +156 -16
  927. package/src/cli/commands/connectTools.js +228 -8
  928. package/src/cli/commands/show.js +101 -0
  929. package/src/cli/menus/cliTools.js +116 -17
  930. package/src/cli/menus/combos.js +9 -2
  931. package/src/cli/menus/providers.js +8 -0
  932. package/src/cli/utils/comboModelId.js +10 -0
  933. package/src/cli/utils/modelSelector.js +10 -0
  934. package/app/.next-cli-build/server/chunks/1731.js +0 -1
  935. package/app/.next-cli-build/server/chunks/1839.js +0 -1
  936. package/app/.next-cli-build/server/chunks/4884.js +0 -21
  937. package/app/.next-cli-build/server/chunks/5069.js +0 -1
  938. package/app/.next-cli-build/server/chunks/5593.js +0 -1
  939. package/app/.next-cli-build/server/chunks/6623.js +0 -1
  940. package/app/.next-cli-build/server/chunks/6689.js +0 -1
  941. package/app/.next-cli-build/server/chunks/700.js +0 -1
  942. package/app/.next-cli-build/server/chunks/7220.js +0 -1
  943. package/app/.next-cli-build/server/chunks/9128.js +0 -1
  944. package/app/.next-cli-build/static/chunks/1321-abd569b871266a86.js +0 -1
  945. package/app/.next-cli-build/static/chunks/5497-2a0a87b4a8d5520f.js +0 -7
  946. package/app/.next-cli-build/static/chunks/809-e1f8430398963827.js +0 -3
  947. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-62191da25897532f.js +0 -4
  948. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-22ec969eb6c75f25.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/_global-error/page-11746d5d6532f1f0.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-11746d5d6532f1f0.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-11746d5d6532f1f0.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-11746d5d6532f1f0.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-11746d5d6532f1f0.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-11746d5d6532f1f0.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-11746d5d6532f1f0.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-11746d5d6532f1f0.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-11746d5d6532f1f0.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-11746d5d6532f1f0.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-11746d5d6532f1f0.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-11746d5d6532f1f0.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-11746d5d6532f1f0.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-11746d5d6532f1f0.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-11746d5d6532f1f0.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-11746d5d6532f1f0.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-11746d5d6532f1f0.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-11746d5d6532f1f0.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-11746d5d6532f1f0.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-11746d5d6532f1f0.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-11746d5d6532f1f0.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-11746d5d6532f1f0.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-11746d5d6532f1f0.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-11746d5d6532f1f0.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-11746d5d6532f1f0.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-11746d5d6532f1f0.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-11746d5d6532f1f0.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-11746d5d6532f1f0.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-11746d5d6532f1f0.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-11746d5d6532f1f0.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-11746d5d6532f1f0.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-11746d5d6532f1f0.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-11746d5d6532f1f0.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-11746d5d6532f1f0.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-11746d5d6532f1f0.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-11746d5d6532f1f0.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-11746d5d6532f1f0.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-11746d5d6532f1f0.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-11746d5d6532f1f0.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-11746d5d6532f1f0.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/combos/route-11746d5d6532f1f0.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-11746d5d6532f1f0.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-11746d5d6532f1f0.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-11746d5d6532f1f0.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-11746d5d6532f1f0.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-11746d5d6532f1f0.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-11746d5d6532f1f0.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/health/route-11746d5d6532f1f0.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/init/route-11746d5d6532f1f0.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-11746d5d6532f1f0.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/keys/route-11746d5d6532f1f0.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/locale/route-11746d5d6532f1f0.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-11746d5d6532f1f0.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-11746d5d6532f1f0.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-11746d5d6532f1f0.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-11746d5d6532f1f0.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-11746d5d6532f1f0.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-11746d5d6532f1f0.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-11746d5d6532f1f0.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-11746d5d6532f1f0.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-11746d5d6532f1f0.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-11746d5d6532f1f0.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-11746d5d6532f1f0.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-11746d5d6532f1f0.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/api/models/route-11746d5d6532f1f0.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/api/models/test/route-11746d5d6532f1f0.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-11746d5d6532f1f0.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-11746d5d6532f1f0.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-11746d5d6532f1f0.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-11746d5d6532f1f0.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-11746d5d6532f1f0.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-11746d5d6532f1f0.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-11746d5d6532f1f0.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-11746d5d6532f1f0.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-11746d5d6532f1f0.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-11746d5d6532f1f0.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-11746d5d6532f1f0.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-11746d5d6532f1f0.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-11746d5d6532f1f0.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-11746d5d6532f1f0.js +0 -1
  1029. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-11746d5d6532f1f0.js +0 -1
  1030. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-11746d5d6532f1f0.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-11746d5d6532f1f0.js +0 -1
  1032. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-11746d5d6532f1f0.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-11746d5d6532f1f0.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-11746d5d6532f1f0.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/api/pricing/route-11746d5d6532f1f0.js +0 -1
  1036. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-11746d5d6532f1f0.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-11746d5d6532f1f0.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-11746d5d6532f1f0.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-11746d5d6532f1f0.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-11746d5d6532f1f0.js +0 -1
  1041. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-11746d5d6532f1f0.js +0 -1
  1042. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-11746d5d6532f1f0.js +0 -1
  1043. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-11746d5d6532f1f0.js +0 -1
  1044. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-11746d5d6532f1f0.js +0 -1
  1045. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-11746d5d6532f1f0.js +0 -1
  1046. package/app/.next-cli-build/static/chunks/app/api/providers/route-11746d5d6532f1f0.js +0 -1
  1047. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-11746d5d6532f1f0.js +0 -1
  1048. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-11746d5d6532f1f0.js +0 -1
  1049. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-11746d5d6532f1f0.js +0 -1
  1050. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-11746d5d6532f1f0.js +0 -1
  1051. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-11746d5d6532f1f0.js +0 -1
  1052. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-11746d5d6532f1f0.js +0 -1
  1053. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-11746d5d6532f1f0.js +0 -1
  1054. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-11746d5d6532f1f0.js +0 -1
  1055. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-11746d5d6532f1f0.js +0 -1
  1056. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-11746d5d6532f1f0.js +0 -1
  1057. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-11746d5d6532f1f0.js +0 -1
  1058. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-11746d5d6532f1f0.js +0 -1
  1059. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-11746d5d6532f1f0.js +0 -1
  1060. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-11746d5d6532f1f0.js +0 -1
  1061. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-11746d5d6532f1f0.js +0 -1
  1062. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-11746d5d6532f1f0.js +0 -1
  1063. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-11746d5d6532f1f0.js +0 -1
  1064. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-11746d5d6532f1f0.js +0 -1
  1065. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-11746d5d6532f1f0.js +0 -1
  1066. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-11746d5d6532f1f0.js +0 -1
  1067. package/app/.next-cli-build/static/chunks/app/api/settings/route-11746d5d6532f1f0.js +0 -1
  1068. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-11746d5d6532f1f0.js +0 -1
  1069. package/app/.next-cli-build/static/chunks/app/api/tags/route-11746d5d6532f1f0.js +0 -1
  1070. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-11746d5d6532f1f0.js +0 -1
  1071. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-11746d5d6532f1f0.js +0 -1
  1072. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-11746d5d6532f1f0.js +0 -1
  1073. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-11746d5d6532f1f0.js +0 -1
  1074. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-11746d5d6532f1f0.js +0 -1
  1075. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-11746d5d6532f1f0.js +0 -1
  1076. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-11746d5d6532f1f0.js +0 -1
  1077. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-11746d5d6532f1f0.js +0 -1
  1078. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-11746d5d6532f1f0.js +0 -1
  1079. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-11746d5d6532f1f0.js +0 -1
  1080. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-11746d5d6532f1f0.js +0 -1
  1081. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-11746d5d6532f1f0.js +0 -1
  1082. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-11746d5d6532f1f0.js +0 -1
  1083. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-11746d5d6532f1f0.js +0 -1
  1084. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-11746d5d6532f1f0.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-11746d5d6532f1f0.js +0 -1
  1086. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-11746d5d6532f1f0.js +0 -1
  1087. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-11746d5d6532f1f0.js +0 -1
  1088. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-11746d5d6532f1f0.js +0 -1
  1089. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-11746d5d6532f1f0.js +0 -1
  1090. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-11746d5d6532f1f0.js +0 -1
  1091. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-11746d5d6532f1f0.js +0 -1
  1092. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-11746d5d6532f1f0.js +0 -1
  1093. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-11746d5d6532f1f0.js +0 -1
  1094. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-11746d5d6532f1f0.js +0 -1
  1095. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-11746d5d6532f1f0.js +0 -1
  1096. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-11746d5d6532f1f0.js +0 -1
  1097. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-11746d5d6532f1f0.js +0 -1
  1098. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-11746d5d6532f1f0.js +0 -1
  1099. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-11746d5d6532f1f0.js +0 -1
  1100. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-11746d5d6532f1f0.js +0 -1
  1101. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-11746d5d6532f1f0.js +0 -1
  1102. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-11746d5d6532f1f0.js +0 -1
  1103. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-11746d5d6532f1f0.js +0 -1
  1104. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-11746d5d6532f1f0.js +0 -1
  1105. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-11746d5d6532f1f0.js +0 -1
  1106. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-11746d5d6532f1f0.js +0 -1
  1107. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-11746d5d6532f1f0.js +0 -1
  1108. package/app/.next-cli-build/static/chunks/app/api/v1/route-11746d5d6532f1f0.js +0 -1
  1109. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-11746d5d6532f1f0.js +0 -1
  1110. package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-11746d5d6532f1f0.js +0 -1
  1111. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-11746d5d6532f1f0.js +0 -1
  1112. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-11746d5d6532f1f0.js +0 -1
  1113. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-11746d5d6532f1f0.js +0 -1
  1114. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-11746d5d6532f1f0.js +0 -1
  1115. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-11746d5d6532f1f0.js +0 -1
  1116. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-11746d5d6532f1f0.js +0 -1
  1117. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-11746d5d6532f1f0.js +0 -1
  1118. package/app/.next-cli-build/static/chunks/app/api/version/route-11746d5d6532f1f0.js +0 -1
  1119. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-11746d5d6532f1f0.js +0 -1
  1120. package/app/.next-cli-build/static/chunks/app/api/version/update/route-11746d5d6532f1f0.js +0 -1
  1121. package/app/.next-cli-build/static/chunks/app/landing/page-0185c25e389af607.js +0 -1
  1122. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-11746d5d6532f1f0.js +0 -1
  1123. package/app/.next-cli-build/static/chunks/app/page-11746d5d6532f1f0.js +0 -1
  1124. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-11746d5d6532f1f0.js +0 -1
  1125. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-11746d5d6532f1f0.js +0 -1
  1126. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-11746d5d6532f1f0.js +0 -1
  1127. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-11746d5d6532f1f0.js +0 -1
  1128. package/app/.next-cli-build/static/css/f723aac0941cbc9e.css +0 -1
  1129. package/app/.next-cli-build/static/ooRvF1KvhDkljuh_Y2M70/_buildManifest.js +0 -1
  1130. /package/app/.next-cli-build/static/{ooRvF1KvhDkljuh_Y2M70 → Jv8v1dCqk7v7QSt2O1N5j}/_ssgManifest.js +0 -0
@@ -1,10 +1,10 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{69929:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>ee});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468),s(60950);var h=s(45564);let f=["none","low","medium","high"],g=["none","thinking"],y=["none","low","medium","high","xhigh","max"],b={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":y,"claude-budget":y,"gemini-level":["minimal","low","medium","high"],"gemini-budget":f,zai:g,qwen:f,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:g,hunyuan:f,step:f},v=["none","minimal","low","medium","high","xhigh","max"],j=["none","low","medium","high","max"],w=[{pattern:"*claude*4.6*",levels:j},{pattern:"*claude*4-6*",levels:j},{provider:"codex",pattern:"*gpt-6*",levels:v},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:v},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3*",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"hy3*",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4*",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]}];function k(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:i,minor:a}=s;return i<4||4===i&&(null===a||a<=5||null!==a&&a>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=String(t||"").replace(/\([^()]+\)\s*$/,""),a="codex"===e?(0,h.SM)("cx").find(e=>e.id===i)?.thinkingLevels:null,l=w.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),r=a||l?.levels||b[s.thinkingFormat]||f;return!1===s.thinkingCanDisable&&(r=r.filter(e=>"none"!==e)),r}var N=s(11059),C=s(929),S=s(73006);let A=new Map;async function T(e){if(!e?.url||!e?.type)return[];let t=A.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return A.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function $({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:l=!0}){let r=new Set(i.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(a&&e!==a||r.has(t.id))continue;let i=`${s}/${t.id}`;n.has(i)||(n.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!l)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}var O=s(14051),P=s.n(O);function E({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:f}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,i.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function I({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function D({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,k]=(0,a.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();k(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=$({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},A=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},T=p.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!T||y,children:y?"Importing...":"Import from /models"})]}),!T&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(I,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:w[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}E.propTypes={model:P().shape({id:P().string.isRequired}).isRequired,fullModel:P().string.isRequired,alias:P().string,copied:P().string,onCopy:P().func.isRequired,testStatus:P().oneOf(["ok","error"]),isCustom:P().bool,isFree:P().bool,onDeleteAlias:P().func,onTest:P().func,isTesting:P().bool,onDisable:P().func,caps:P().object,thinkingSuffix:P().string},P().string.isRequired,P().string.isRequired,P().string,P().func.isRequired,P().func.isRequired,P().func,P().oneOf(["ok","error"]),P().bool,P().string.isRequired,P().object.isRequired,P().arrayOf(P().object),P().string,P().func.isRequired,P().func.isRequired,P().func.isRequired,P().func.isRequired,D.propTypes={providerStorageAlias:P().string.isRequired,providerDisplayAlias:P().string.isRequired,modelAliases:P().object.isRequired,customModels:P().arrayOf(P().object),copied:P().string,onCopy:P().func.isRequired,onDeleteAlias:P().func.isRequired,onAddCustomModel:P().func.isRequired,onDeleteCustomModel:P().func.isRequired,connections:P().arrayOf(P().shape({id:P().string,isActive:P().bool})).isRequired,isAnthropic:P().bool};var R=s(70217);function _({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function z({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),w=e.providerSpecificData?.proxyPoolId||null,k=w?j.get(w):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!w||N,S=k?`Pool: ${k.name}`:w?`Pool: ${w} (inactive/missing)`:N?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",T="";if(k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=k?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=k?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";k?.isActive===!0?O="success":(w||N)&&(O="error"),(0,a.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},E=e.authType||(s?"oauth":"apikey"),I="oauth"===E,D="cookie"===E,q=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(I?"OAuth Account":D?"Cookie Account":"API Key"),U=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[M,K]=(0,a.useState)(!1),F=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{K(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=F?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[F]);let J="unavailable"!==e.testStatus||M?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:D?"cookie":I?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:q}),U&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:U}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(c.Ex,{variant:(0,R.g)(e.isActive,J),size:"sm",dot:!0,children:!1===e.isActive?"disabled":J||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:I?"OAuth":D?"Cookie":"API Key"}),C&&(0,i.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),M&&!1!==e.isActive&&(0,i.jsx)(_,{until:F}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),L()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),T&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:T}),$&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:v,children:[(0,i.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,i.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!w?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${w===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,i.jsx)(c.m_,{text:A,children:(0,i.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}_.propTypes={until:P().string.isRequired},z.propTypes={connection:P().shape({id:P().string,name:P().string,email:P().string,displayName:P().string,modelLockUntil:P().string,testStatus:P().string,isActive:P().bool,lastError:P().string,priority:P().number,globalPriority:P().number}).isRequired,proxyPools:P().arrayOf(P().shape({id:P().string,name:P().string,proxyUrl:P().string,noProxy:P().string,isActive:P().bool})),isOAuth:P().bool.isRequired,isFirst:P().bool.isRequired,isLast:P().bool.isRequired,onMoveUp:P().func.isRequired,onMoveDown:P().func.isRequired,onToggleActive:P().func.isRequired,onUpdateProxy:P().func,onEdit:P().func.isRequired,onDelete:P().func.isRequired,oneByOneStatus:P().shape({state:P().string,error:P().string}),autoPing:P().shape({on:P().bool,onToggle:P().func,provider:P().string})};let q=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{69929:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>ee});var i=s(95155),a=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468),s(60950);var h=s(13097);let f=["none","low","medium","high"],g=["none","thinking"],y=["none","low","medium","high","xhigh","max"],b={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":y,"claude-budget":y,"gemini-level":["minimal","low","medium","high"],"gemini-budget":f,zai:g,qwen:f,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:g,hunyuan:f,step:f},v=["none","minimal","low","medium","high","xhigh","max"],j=["none","low","medium","high","max"],k=[{pattern:"*claude*4.6*",levels:j},{pattern:"*claude*4-6*",levels:j},{provider:"codex",pattern:"*gpt-6*",levels:v},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...v,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:v},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}];function w(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return t?{major:Number(t[1]),minor:void 0===t[2]?null:Number(t[2])}:null}(e);if(!s)return null;let{major:i,minor:a}=s;return i<4||4===i&&(null===a||a<=5||null!==a&&a>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let i=String(t||"").replace(/\([^()]+\)\s*$/,""),a="codex"===e?(0,h.SM)("cx").find(e=>e.id===i)?.thinkingLevels:null,l=k.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),r=a||l?.levels||b[s.thinkingFormat]||f;return!1===s.thinkingCanDisable&&(r=r.filter(e=>"none"!==e)),r}var N=s(11059),C=s(929),S=s(73006);let A=new Map;async function T(e){if(!e?.url||!e?.type)return[];let t=A.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let i=(await s.json()).data??[];return A.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function $({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:i=[],type:a="llm",includeLegacyAliases:l=!0}){let r=new Set(i.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(a&&e!==a||r.has(t.id))continue;let i=`${s}/${t.id}`;n.has(i)||(n.add(i),o.push({id:t.id,name:t.name||t.id,fullModel:i,source:"custom",type:e}))}if(!l)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:a||"llm"}))}return o}var O=s(14051),P=s.n(O);function I({model:e,fullModel:t,alias:s,copied:a,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,i.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,i.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:f}),(0,i.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,i.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,i.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[m&&(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,i.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,i.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,i.jsx)("button",{onClick:d,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,i.jsx)("button",{onClick:u,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function E({modelId:e,fullModel:t,copied:s,onCopy:a,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,i.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,i.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,i.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,i.jsxs)("div",{className:"relative group/btn",children:[(0,i.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,i.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,i.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function D({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[k,w]=(0,a.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await s.json();w(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=$({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},A=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let i=s.models||[];if(0===i.length)return void alert("No models returned from /models.");let a=0;for(let e of i){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),a+=1))}0===a&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},T=p.some(e=>!1!==e.isActive);return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,i.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,i.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,i.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,i.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!T||y,children:y?"Importing...":"Import from /models"})]}),!T&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:a,source:l})=>(0,i.jsx)(E,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(a),onTest:p.length>0?()=>N(s):void 0,testStatus:k[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}I.propTypes={model:P().shape({id:P().string.isRequired}).isRequired,fullModel:P().string.isRequired,alias:P().string,copied:P().string,onCopy:P().func.isRequired,testStatus:P().oneOf(["ok","error"]),isCustom:P().bool,isFree:P().bool,onDeleteAlias:P().func,onTest:P().func,isTesting:P().bool,onDisable:P().func,caps:P().object,thinkingSuffix:P().string},P().string.isRequired,P().string.isRequired,P().string,P().func.isRequired,P().func.isRequired,P().func,P().oneOf(["ok","error"]),P().bool,P().string.isRequired,P().object.isRequired,P().arrayOf(P().object),P().string,P().func.isRequired,P().func.isRequired,P().func.isRequired,P().func.isRequired,D.propTypes={providerStorageAlias:P().string.isRequired,providerDisplayAlias:P().string.isRequired,modelAliases:P().object.isRequired,customModels:P().arrayOf(P().object),copied:P().string,onCopy:P().func.isRequired,onDeleteAlias:P().func.isRequired,onAddCustomModel:P().func.isRequired,onDeleteCustomModel:P().func.isRequired,connections:P().arrayOf(P().shape({id:P().string,isActive:P().bool})).isRequired,isAnthropic:P().bool};var R=s(70217);function _({until:e}){let[t,s]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let i=Math.floor(t/1e3);if(i<60)s(`${i}s`);else if(i<3600)s(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);s(`${e}h ${t}m`)}};t();let i=setInterval(t,1e3);return()=>clearInterval(i)},[e]),t)?(0,i.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function z({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),k=e.providerSpecificData?.proxyPoolId||null,w=k?j.get(k):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!k||N,S=w?`Pool: ${w.name}`:k?`Pool: ${k} (inactive/missing)`:N?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",T="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";w?.isActive===!0?O="success":(k||N)&&(O="error"),(0,a.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},I=e.authType||(s?"oauth":"apikey"),E="oauth"===I,D="cookie"===I,q=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(E?"OAuth Account":D?"Cookie Account":"API Key"),M=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[U,K]=(0,a.useState)(!1),F=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{K(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=F?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[F]);let J="unavailable"!==e.testStatus||U?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,i.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,i.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,i.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,i.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,i.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:D?"cookie":E?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:q}),M&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:M}),(0,i.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,i.jsx)(c.Ex,{variant:(0,R.g)(e.isActive,J),size:"sm",dot:!0,children:!1===e.isActive?"disabled":J||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:E?"OAuth":D?"Cookie":"API Key"}),C&&(0,i.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),U&&!1!==e.isActive&&(0,i.jsx)(_,{until:F}),e.lastError&&!1!==e.isActive&&(0,i.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,i.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),L()&&(0,i.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,i.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),T&&(0,i.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:T}),$&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,i.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:v,children:[(0,i.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,i.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,i.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!k?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,i.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${k===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,i.jsx)(c.m_,{text:A,children:(0,i.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,i.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,i.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,i.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}_.propTypes={until:P().string.isRequired},z.propTypes={connection:P().shape({id:P().string,name:P().string,email:P().string,displayName:P().string,modelLockUntil:P().string,testStatus:P().string,isActive:P().bool,lastError:P().string,priority:P().number,globalPriority:P().number}).isRequired,proxyPools:P().arrayOf(P().shape({id:P().string,name:P().string,proxyUrl:P().string,noProxy:P().string,isActive:P().bool})),isOAuth:P().bool.isRequired,isFirst:P().bool.isRequired,isLast:P().bool.isRequired,onMoveUp:P().func.isRequired,onMoveDown:P().func.isRequired,onToggleActive:P().func.isRequired,onUpdateProxy:P().func,onEdit:P().func.isRequired,onDelete:P().func.isRequired,oneByOneStatus:P().shape({state:P().string,error:P().string}),autoPing:P().shape({on:P().bool,onToggle:P().func,provider:P().string})};let q=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function U({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t||"qoder-cn"===t?"Personal Access Token (PAT)":"API Key",k="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.regions||null,S=m.Q2?.[t]?.defaultRegion||C?.[0]?.id||"",[A,T]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[$,O]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[P,E]=(0,a.useState)({accountId:""}),[I,D]=(0,a.useState)(S),[R,_]=(0,a.useState)(!1),[z,M]=(0,a.useState)(null),[K,F]=(0,a.useState)(!1),J=N?`name1|sk-key1|acc123456
3
+ sk-key-only-auto-named`;function M({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,k=v?"Cookie Value":"qoder"===t||"qoder-cn"===t?"Personal Access Token (PAT)":"API Key",w="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.credentialForm==="aws",S=m.Q2?.[t]?.apiKeyOptionalWith||null,A=m.Q2?.[t]?.regions||null,T=m.Q2?.[t]?.defaultRegion||A?.[0]?.id||"",[$,O]=(0,a.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[P,I]=(0,a.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[E,D]=(0,a.useState)({accountId:""}),[R,_]=(0,a.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[z,U]=(0,a.useState)(T),[K,F]=(0,a.useState)(!1),[J,L]=(0,a.useState)(null),[W,B]=(0,a.useState)(!1),H=N?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
5
5
  sk-key-only-auto-named`:"qoder"===t||"qoder-cn"===t?`name1|pt-xxxxx
6
6
  name2|pt-yyyyy
7
- pt-only-auto-named`:q,[L,W]=(0,a.useState)("single"),[B,H]=(0,a.useState)(""),[G,V]=(0,a.useState)(null),Z=()=>b&&A.ollamaHostUrl.trim()?{baseUrl:A.ollamaHostUrl.trim()}:k?{azureEndpoint:$.azureEndpoint,apiVersion:$.apiVersion,deployment:$.deployment,organization:$.organization}:N?{accountId:P.accountId}:C&&I?{region:I}:void 0,Q=async()=>{_(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Z()})}),s=await e.json();M(s.valid?"success":"failed")}catch{M("failed")}finally{_(!1)}},X=async()=>{if(t&&(b||A.apiKey)&&(b||A.name)&&(!l||A.defaultModel.trim())){F(!0);try{let e=!1;try{_(!0),M(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:A.apiKey,providerSpecificData:Z()})});e=!!(await s.json()).valid,M(e?"success":"failed")}catch{M("failed")}finally{_(!1)}await h({name:A.name||(b?"Ollama Local":""),apiKey:A.apiKey,defaultModel:l?A.defaultModel.trim():void 0,priority:A.priority,proxyPoolId:A.proxyPoolId===y?null:A.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:Z()})}finally{F(!1)}}},Y=async()=>{let e=B.split("\n");if(!e.length)return;let s=function(e,t,s={}){let{isCloudflareAi:i=!1}=s,a=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,s="string"==typeof t?t.trim():"";if(!s)continue;let r=function(e,t={}){let{isCloudflareAi:s=!1}=t,i=e.split("|");if(s&&i.length>=3){let e=i[0].trim();return{baseName:e||"Key",apiKey:i.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:i[i.length-1].trim()}}}return i.length>=2?{baseName:i[0].trim()||"Key",apiKey:i.slice(1).join("|").trim()}:{baseName:"Key",apiKey:i[0].trim()}}(s,{isCloudflareAi:i});if(!r||!r.apiKey)continue;let n=r.baseName,o=1;for(;e=`${n} ${o}`,a.has(e.toLowerCase());)o+=1;a.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,x,{isCloudflareAi:N});if(!s.length)return;F(!0),V(null);let i=0,a=0;for(let e of s)try{let s=!1;try{let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});s=!!(await i.json().catch(()=>({}))).valid}catch{s=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:s?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?i++:a++}catch{a++}F(!1),V({success:i,failed:a}),i>0&&f&&f()};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Add ${s||t} ${w}`,onClose:g,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{size:"sm",variant:"single"===L?"primary":"ghost",onClick:()=>{W("single"),V(null)},children:"Single"}),(0,i.jsx)(c.$n,{size:"sm",variant:"bulk"===L?"primary":"ghost",onClick:()=>{W("bulk"),V(null)},children:"Bulk Add"})]}),"bulk"===L&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:N?(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===t||"qoder-cn"===t?(0,i.jsxs)(i.Fragment,{children:["One PAT per line. Format: ",(0,i.jsx)("code",{children:"name|pt-..."})," or just ",(0,i.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:J,value:B,onChange:e=>H(e.target.value)}),G&&(0,i.jsxs)("div",{className:`text-sm font-medium ${G.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",G.success," added",G.failed>0?`, ✗ ${G.failed} failed`:""]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:Y,fullWidth:!0,disabled:K||!B.trim(),children:K?"Adding...":"Add All Keys"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===L&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.pd,{label:"Name",value:A.name,onChange:e=>T({...A,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"Ollama Host URL",value:A.ollamaHostUrl,onChange:e=>T({...A,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:Q,disabled:R||K,variant:"secondary",children:R?"Checking...":"Check"})})]}),!b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:w,type:v?"text":"password",value:A.apiKey,onChange:e=>T({...A,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"qoder"===t||"qoder-cn"===t?"pt-...":"",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:Q,disabled:!A.apiKey||R||K,variant:"secondary",children:R?"Checking...":"Check"})})]}),j&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),v&&o&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[o,d&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",d.replace(/^https?:\/\//,"")]})]})]}),C&&(0,i.jsx)(c.l6,{label:"Region",value:I,onChange:e=>D(e.target.value),options:C.map(e=>({value:e.id,label:e.label}))}),l&&(0,i.jsx)(c.pd,{label:"Default Model",value:A.defaultModel,onChange:e=>T({...A,defaultModel:e.target.value}),placeholder:r?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),z&&(0,i.jsx)(c.Ex,{variant:"success"===z?"success":"error",children:"success"===z?"Valid":"Invalid"}),u&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),l&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),N&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(c.pd,{label:"Account ID",value:P.accountId,onChange:e=>E({...P,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),k&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.pd,{label:"Azure Endpoint",value:$.azureEndpoint,onChange:e=>O({...$,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(c.pd,{label:"Deployment Name",value:$.deployment,onChange:e=>O({...$,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(c.pd,{label:"API Version",value:$.apiVersion,onChange:e=>O({...$,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(c.pd,{label:"Organization",value:$.organization,onChange:e=>O({...$,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(c.pd,{label:"Priority",type:"number",value:A.priority,onChange:e=>T({...A,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(c.l6,{label:"Proxy Pool",value:A.proxyPoolId,onChange:e=>T({...A,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:X,fullWidth:!0,disabled:K||!b&&(!A.name||!A.apiKey)||l&&!A.defaultModel.trim()||k&&(!$.azureEndpoint||!$.deployment||!$.organization)||N&&!P.accountId,children:K?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function M({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:r}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,r]);let v=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){m(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};r||(e.apiType=n.apiType),await s(e)}finally{m(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:p,type:r?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(c.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(c.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,i.jsx)(c.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,i.jsx)(c.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:j,disabled:!p||f||!n.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(c.pd,{label:"Model ID (optional)",value:x,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),y&&(0,i.jsx)(c.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}U.propTypes={isOpen:P().bool.isRequired,provider:P().string,providerName:P().string,isCompatible:P().bool,isAnthropic:P().bool,authType:P().string,authHint:P().string,website:P().string,proxyPools:P().arrayOf(P().shape({id:P().string,name:P().string})),error:P().string,existingNames:P().arrayOf(P().string),onSave:P().func.isRequired,onBulkDone:P().func,onClose:P().func.isRequired},M.propTypes={isOpen:P().bool.isRequired,node:P().shape({id:P().string,name:P().string,prefix:P().string,apiType:P().string,baseUrl:P().string}),onSave:P().func.isRequired,onClose:P().func.isRequired,isAnthropic:P().bool};let K=()=>Object.fromEntries(Object.keys(p.bs).map(e=>[e,!1]));function F({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:r}){let[n,o]=(0,a.useState)(""),[d,m]=(0,a.useState)(K),[u,x]=(0,a.useState)(null),[h,f]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),[b,v]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(o(""),m(K()),v(""),x(null),f(""))},[e]);let j=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},w=async()=>{let e=j(n.trim());if(e){x("testing"),f("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),i=await s.json();x(i.ok?"ok":"error"),f(i.error||"")}catch(e){x("error"),f(e.message)}}},k=async()=>{let e=j(n.trim());if(e&&!g){y(!0);try{await l(e,d,d.stt?b:null)}finally{y(!1)}}};return(0,i.jsx)(c.aF,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:n,onChange:e=>{o(e.target.value),x(null),f("")},onKeyDown:e=>{"Enter"===e.key&&w()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,i.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===u,onClick:w,disabled:!n.trim()||"testing"===u,children:"testing"===u?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:j(n.trim())||"model-id"})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([e,t])=>(0,i.jsx)(c.lM,{checked:!!d[e],onChange:t=>m(s=>({...s,[e]:t})),label:t.label,description:t.desc,size:"sm"},e))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(c.lM,{checked:!!d.stt,onChange:e=>{m(t=>({...t,stt:e})),e||v("")},label:"Speech to text",description:"Transcribes audio via /v1/audio/transcriptions",size:"sm"}),d.stt&&(0,i.jsx)("div",{className:"mt-3",children:(0,i.jsx)(c.l6,{label:"Transport",value:b,onChange:e=>v(e.target.value),placeholder:"Provider default (REST)",options:p.vp.map(e=>({value:e,label:p.qw[e].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."})})]}),"ok"===u&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===u&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:h||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(c.$n,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(c.$n,{onClick:k,fullWidth:!0,size:"sm",disabled:!n.trim()||g,children:g?"Adding...":"Add Model"})]})]})})}F.propTypes={isOpen:P().bool.isRequired,providerAlias:P().string.isRequired,providerDisplayAlias:P().string.isRequired,onSave:P().func.isRequired,onClose:P().func.isRequired};let J=`[
7
+ pt-only-auto-named`:q,[G,Z]=(0,a.useState)("single"),[Q,V]=(0,a.useState)(""),[X,Y]=(0,a.useState)(null),ee=()=>{if(b&&$.ollamaHostUrl.trim())return{baseUrl:$.ollamaHostUrl.trim()};if(w)return{azureEndpoint:P.azureEndpoint,apiVersion:P.apiVersion,deployment:P.deployment,organization:P.organization};if(N)return{accountId:E.accountId};if(C){let e={};return R.profile.trim()&&(e.profile=R.profile.trim()),R.region.trim()&&(e.region=R.region.trim()),R.accessKeyId.trim()&&(e.accessKeyId=R.accessKeyId.trim()),R.sessionToken.trim()&&(e.sessionToken=R.sessionToken.trim()),Object.keys(e).length?e:void 0}if(A&&z)return{region:z}},et=()=>{let e=ee();return!!(S&&e?.[S])||(C?!!$.apiKey&&!!e?.accessKeyId:!!$.apiKey)},es=async()=>{F(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:ee()})}),s=await e.json();L(s.valid?"success":"failed")}catch{L("failed")}finally{F(!1)}},ei=async()=>{if(t&&(b||et())&&(b||$.name)&&(!l||$.defaultModel.trim())){B(!0);try{let e=!1;try{F(!0),L(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,providerSpecificData:ee()})});e=!!(await s.json()).valid,L(e?"success":"failed")}catch{L("failed")}finally{F(!1)}await h({name:$.name||(b?"Ollama Local":""),apiKey:$.apiKey,defaultModel:l?$.defaultModel.trim():void 0,priority:$.priority,proxyPoolId:$.proxyPoolId===y?null:$.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:ee()})}finally{B(!1)}}},ea=async()=>{let e=Q.split("\n");if(!e.length)return;let s=function(e,t,s={}){let{isCloudflareAi:i=!1}=s,a=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,s="string"==typeof t?t.trim():"";if(!s)continue;let r=function(e,t={}){let{isCloudflareAi:s=!1}=t,i=e.split("|");if(s&&i.length>=3){let e=i[0].trim();return{baseName:e||"Key",apiKey:i.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:i[i.length-1].trim()}}}return i.length>=2?{baseName:i[0].trim()||"Key",apiKey:i.slice(1).join("|").trim()}:{baseName:"Key",apiKey:i[0].trim()}}(s,{isCloudflareAi:i});if(!r||!r.apiKey)continue;let n=r.baseName,o=1;for(;e=`${n} ${o}`,a.has(e.toLowerCase());)o+=1;a.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,x,{isCloudflareAi:N});if(!s.length)return;B(!0),Y(null);let i=0,a=0;for(let e of s)try{let s=!1;try{let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});s=!!(await i.json().catch(()=>({}))).valid}catch{s=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey,name:e.name,priority:1,testStatus:s?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?i++:a++}catch{a++}B(!1),Y({success:i,failed:a}),i>0&&f&&f()};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Add ${s||t} ${k}`,onClose:g,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[!C&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{size:"sm",variant:"single"===G?"primary":"ghost",onClick:()=>{Z("single"),Y(null)},children:"Single"}),(0,i.jsx)(c.$n,{size:"sm",variant:"bulk"===G?"primary":"ghost",onClick:()=>{Z("bulk"),Y(null)},children:"Bulk Add"})]}),"bulk"===G&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:N?(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===t||"qoder-cn"===t?(0,i.jsxs)(i.Fragment,{children:["One PAT per line. Format: ",(0,i.jsx)("code",{children:"name|pt-..."})," or just ",(0,i.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,i.jsxs)(i.Fragment,{children:["One key per line. Format: ",(0,i.jsx)("code",{children:"name|apiKey"})," or just ",(0,i.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:H,value:Q,onChange:e=>V(e.target.value)}),X&&(0,i.jsxs)("div",{className:`text-sm font-medium ${X.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",X.success," added",X.failed>0?`, ✗ ${X.failed} failed`:""]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:ea,fullWidth:!0,disabled:W||!Q.trim(),children:W?"Adding...":"Add All Keys"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===G&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.pd,{label:"Name",value:$.name,onChange:e=>O({...$,name:e.target.value}),placeholder:b?"Ollama Local":"Production Key"}),b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"Ollama Host URL",value:$.ollamaHostUrl,onChange:e=>O({...$,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:es,disabled:K||W,variant:"secondary",children:K?"Checking...":"Check"})})]}),!b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:k,type:v?"text":"password",value:$.apiKey,onChange:e=>O({...$,apiKey:e.target.value}),placeholder:v?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":j?"xai-...":"qoder"===t||"qoder-cn"===t?"pt-...":"",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:es,disabled:!et()||K||W,variant:"secondary",children:K?"Checking...":"Check"})})]}),j&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),v&&o&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[o,d&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",d.replace(/^https?:\/\//,"")]})]})]}),A&&(0,i.jsx)(c.l6,{label:"Region",value:z,onChange:e=>U(e.target.value),options:A.map(e=>({value:e.id,label:e.label}))}),l&&(0,i.jsx)(c.pd,{label:"Default Model",value:$.defaultModel,onChange:e=>O({...$,defaultModel:e.target.value}),placeholder:r?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),b&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,i.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,i.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),J&&(0,i.jsx)(c.Ex,{variant:"success"===J?"success":"error",children:"success"===J?"Valid":"Invalid"}),u&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:u}),l&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),N&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,i.jsx)(c.pd,{label:"Account ID",value:E.accountId,onChange:e=>D({...E,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,i.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),C&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.pd,{label:"AWS Profile (SSO — recommended)",value:R.profile,onChange:e=>_({...R,profile:e.target.value}),placeholder:"my-sso-profile"}),(0,i.jsx)(c.pd,{label:"Region",value:R.region,onChange:e=>_({...R,region:e.target.value}),placeholder:"us-east-1"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Set a profile from ",(0,i.jsx)("code",{children:"~/.aws/config"})," and leave the API key empty, then run"," ",(0,i.jsxs)("code",{children:["aws sso login --profile ",R.profile||"my-sso-profile"]}),". Credentials refresh automatically."]}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,i.jsx)(c.pd,{label:"Access Key ID (only for static keys)",value:R.accessKeyId,onChange:e=>_({...R,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,i.jsx)(c.pd,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:R.sessionToken,onChange:e=>_({...R,sessionToken:e.target.value}),placeholder:"FwoGZXIvYXdz..."})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["For static keys instead: put the AWS ",(0,i.jsx)("strong",{children:"secret"})," access key in the API Key field above and the access key id here. A profile, if set, takes precedence."]})]}),w&&(0,i.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,i.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.pd,{label:"Azure Endpoint",value:P.azureEndpoint,onChange:e=>I({...P,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,i.jsx)(c.pd,{label:"Deployment Name",value:P.deployment,onChange:e=>I({...P,deployment:e.target.value}),placeholder:"gpt-4"}),(0,i.jsx)(c.pd,{label:"API Version",value:P.apiVersion,onChange:e=>I({...P,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,i.jsx)(c.pd,{label:"Organization",value:P.organization,onChange:e=>I({...P,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,i.jsx)(c.pd,{label:"Priority",type:"number",value:$.priority,onChange:e=>O({...$,priority:Number.parseInt(e.target.value)||1})}),(0,i.jsx)(c.l6,{label:"Proxy Pool",value:$.proxyPoolId,onChange:e=>O({...$,proxyPoolId:e.target.value}),options:[{value:y,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:ei,fullWidth:!0,disabled:W||!b&&(!$.name||!et())||l&&!$.defaultModel.trim()||w&&(!P.azureEndpoint||!P.deployment||!P.organization)||N&&!E.accountId,children:W?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:g,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function U({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:r}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,r]);let v=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){m(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};r||(e.apiType=n.apiType),await s(e)}finally{m(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:p,type:r?"anthropic-compatible":"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(c.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,i.jsx)(c.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,i.jsx)(c.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,i.jsx)(c.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>u(e.target.value),className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:j,disabled:!p||f||!n.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,i.jsx)(c.pd,{label:"Model ID (optional)",value:x,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),y&&(0,i.jsx)(c.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}M.propTypes={isOpen:P().bool.isRequired,provider:P().string,providerName:P().string,isCompatible:P().bool,isAnthropic:P().bool,authType:P().string,authHint:P().string,website:P().string,proxyPools:P().arrayOf(P().shape({id:P().string,name:P().string})),error:P().string,existingNames:P().arrayOf(P().string),onSave:P().func.isRequired,onBulkDone:P().func,onClose:P().func.isRequired},U.propTypes={isOpen:P().bool.isRequired,node:P().shape({id:P().string,name:P().string,prefix:P().string,apiType:P().string,baseUrl:P().string}),onSave:P().func.isRequired,onClose:P().func.isRequired,isAnthropic:P().bool};let K=()=>Object.fromEntries(Object.keys(p.bs).map(e=>[e,!1]));function F({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:r}){let[n,o]=(0,a.useState)(""),[d,m]=(0,a.useState)(K),[u,x]=(0,a.useState)(null),[h,f]=(0,a.useState)(""),[g,y]=(0,a.useState)(!1),[b,v]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(o(""),m(K()),v(""),x(null),f(""))},[e]);let j=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},k=async()=>{let e=j(n.trim());if(e){x("testing"),f("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),i=await s.json();x(i.ok?"ok":"error"),f(i.error||"")}catch(e){x("error"),f(e.message)}}},w=async()=>{let e=j(n.trim());if(e&&!g){y(!0);try{await l(e,d,d.stt?b:null)}finally{y(!1)}}};return(0,i.jsx)(c.aF,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("input",{type:"text",value:n,onChange:e=>{o(e.target.value),x(null),f("")},onKeyDown:e=>{"Enter"===e.key&&k()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,i.jsx)(c.$n,{variant:"secondary",icon:"science",loading:"testing"===u,onClick:k,disabled:!n.trim()||"testing"===u,children:"testing"===u?"Testing...":"Test"})]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,i.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:j(n.trim())||"model-id"})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(p.bs).map(([e,t])=>(0,i.jsx)(c.lM,{checked:!!d[e],onChange:t=>m(s=>({...s,[e]:t})),label:t.label,description:t.desc,size:"sm"},e))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(c.lM,{checked:!!d.stt,onChange:e=>{m(t=>({...t,stt:e})),e||v("")},label:"Speech to text",description:"Transcribes audio via /v1/audio/transcriptions",size:"sm"}),d.stt&&(0,i.jsx)("div",{className:"mt-3",children:(0,i.jsx)(c.l6,{label:"Transport",value:b,onChange:e=>v(e.target.value),placeholder:"Provider default (REST)",options:p.vp.map(e=>({value:e,label:p.qw[e].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."})})]}),"ok"===u&&(0,i.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===u&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,i.jsx)("span",{children:h||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(c.$n,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(c.$n,{onClick:w,fullWidth:!0,size:"sm",disabled:!n.trim()||g,children:g?"Adding...":"Add Model"})]})]})})}F.propTypes={isOpen:P().bool.isRequired,providerAlias:P().string.isRequired,providerDisplayAlias:P().string.isRequired,onSave:P().func.isRequired,onClose:P().func.isRequired};let J=`[
8
8
  {
9
9
  "accessToken": "eyJhbGc...",
10
10
  "refreshToken": "rt_...",
@@ -24,4 +24,4 @@ pt-only-auto-named`:q,[L,W]=(0,a.useState)("single"),[B,H]=(0,a.useState)(""),[G
24
24
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
25
  "email": "account2@example.com"
26
26
  }
27
- ]`;function B(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function H({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),y=(0,a.useRef)(null),b=()=>{n||(r(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,S.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),i=B(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,S.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,S.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=B(l)}catch(e){m(`${(0,S.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,S.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),i=await t.json();if(!t.ok)return void m(i?.error||`Request failed: ${t.status}`);u(i),i.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,S.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,S.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,S.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,i.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,i.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,S.Tl)("Upload JSON Files")})]}),(0,i.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,i.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:W,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,i.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,S.Tl)("Drop .json files here")})]})]}),f&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,i.jsxs)("span",{children:[(0,S.Tl)("Loaded")," ",f.accountsCount," ",(0,S.Tl)("account(s) from")," ",f.filesCount," ",(0,S.Tl)("file(s)")]})]}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,S.Tl)("failed")]}),w.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:w.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,S.Tl)("Importing..."):(0,S.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,S.Tl)("Close")})]})]})})}var G=s(65921);let V=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],Z=/^[A-Za-z0-9-]+$/;function Q({providerId:e}){let t=(0,G.i)(),[s,l]=(0,a.useState)(!1),[r,n]=(0,a.useState)([{name:"",value:""}]),[o,d]=(0,a.useState)({}),[m,p]=(0,a.useState)(!1),[u,x]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},i=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(i.length?i:[{name:"",value:""}]),p(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(i=>i.map((i,a)=>a===e?{...i,[t]:s}:i))},f=(0,a.useCallback)(async()=>{let s={};for(let e of r.filter(e=>e.name.trim())){let i=e.name.trim();if(!Z.test(i))return void t.error(`Invalid header name: ${i}`);if(V.includes(i.toLowerCase()))return void t.error(`Header ${i} cannot be overridden`);if(i in s)return void t.error(`Duplicate header name: ${i}`);e.value!==o[i]&&(s[i]=e.value)}x(!0);try{let i=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!i.ok){let e=await i.json().catch(()=>({}));t.error(e.error||"Failed to save");return}p(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[r,o,e,t]);return 0!==Object.keys(o).length||m?(0,i.jsxs)(c.Zp,{padding:"xs",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,i.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,i.jsx)(c.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,i.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,i.jsx)("div",{className:"flex flex-col gap-2",children:r.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,i.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${s?"border-amber-400/60":"border-border"}`}),(0,i.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,i.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(Object.entries(o).map(([e,t])=>({name:e,value:t})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,i.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}Q.propTypes={providerId:P().string.isRequired};let X={claude:"claudeAutoPing",codex:"codexAutoPing"},Y={qoder:"Fetch Qoder Models","qoder-cn":"Fetch Qoder Models","trae-enterprise":"Fetch Trae Enterprise Models",codearts:"Fetch CodeArts Models",minimax:"Fetch MiniMax Models","minimax-cn":"Fetch MiniMax Models"};function ee(){let e,t,s,r,u,x=(0,l.useParams)(),h=(0,l.useRouter)(),f=x.id,{getCaps:g}=(0,C.y)(),[y,b]=(0,a.useState)([]),[v,j]=(0,a.useState)(!0),[w,A]=(0,a.useState)(null),[O,P]=(0,a.useState)([]),[I,R]=(0,a.useState)(!1),[_,q]=(0,a.useState)(!1),[K,J]=(0,a.useState)(!1),[W,B]=(0,a.useState)(!1),[G,V]=(0,a.useState)(""),[Z,ee]=(0,a.useState)(!1),[et,es]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(!1),[el,er]=(0,a.useState)(!1),[en,eo]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(null),[em,ep]=(0,a.useState)({}),[eu,ex]=(0,a.useState)([]),[eh,ef]=(0,a.useState)(!1),[eg,ey]=(0,a.useState)({}),[eb,ev]=(0,a.useState)(""),[ej,ew]=(0,a.useState)(()=>new Set),[ek,eN]=(0,a.useState)(!1),[eC,eS]=(0,a.useState)([]),[eA,eT]=(0,a.useState)("__none__"),[e$,eO]=(0,a.useState)(!1),[eP,eE]=(0,a.useState)(null),[eI,eD]=(0,a.useState)(""),[eR,e_]=(0,a.useState)("auto"),[ez,eq]=(0,a.useState)({enabled:!1,connections:{}}),[eU,eM]=(0,a.useState)([]),[eK,eF]=(0,a.useState)([]),[eJ,eL]=(0,a.useState)(null),[eW,eB]=(0,a.useState)([]),[eH,eG]=(0,a.useState)([]),[eV,eZ]=(0,a.useState)(null),[eQ,eX]=(0,a.useState)(!1),[eY,e0]=(0,a.useState)(!1),[e1,e2]=(0,a.useState)(!1),[e5,e3]=(0,a.useState)(null),[e4,e6]=(0,a.useState)({}),[e9,e7]=(0,a.useState)(null),e8=(0,a.useRef)(!1),[te,tt]=(0,a.useState)(!1),[ts,ti]=(0,a.useState)(!1),{copied:ta,copy:tl}=(0,N.C)(),tr="ag_risk_confirmed",tn=()=>{R(!0)},to=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tr)?eX(!0):"xiaomi-mimo"===f?q(!0):tu?tn():(V(""),B(!0))},td=()=>{V(""),B(!0)},tc=()=>{tu?to():td()},tm=w?{id:w.id,name:w.name||("anthropic-compatible"===w.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===w.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===w.type?"AC":"OC",apiType:w.apiType,baseUrl:w.baseUrl,type:w.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],tp=tm?.authModes||[],tu=!!m.zN[f]||!!m.IS[f]||tp.includes("oauth"),tx=!!m.fg[f]||tp.includes("apikey"),th=!!m.IS[f]?.noAuth,tf="antigravity"===f||"gemini-cli"===f,tg=(0,p.KC)(f),ty=("cursor"===f||"zed"===f)&&eK.length>0?eK:tg,tb=(0,m.wG)(f),tv=(0,m.mq)(f),tj=(0,m.gb)(f),tw=tv||tj,tk=!tw&&tu&&tx,tN="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tC="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tS=e=>{if(!eR||"auto"===eR)return null;let t=k(f,e);return t&&t.includes(eR)?eR:null},tA=tw?f:tb,tT=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=k(f,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of ty)s(e.id);for(let e of eW)s(e.id);for(let e of eu)e.providerAlias===tA&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),t$=tw?w?.prefix||f:tb,tO=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}`,{cache:"no-store"}),t=await e.json();e.ok&&eG(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tA]),tP=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tA,ids:[e]})})).ok&&await tO()}catch(e){console.log("Error disabling model:",e)}},tE=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tO()}catch(e){console.log("Error enabling model:",e)}},tI=async e=>{e.length&&eZ({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eZ(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tA,ids:e})})).ok&&await tO()}catch(e){console.log("Error disabling all models:",e)}}})},tD=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}`,{method:"DELETE"})).ok&&await tO()}catch(e){console.log("Error enabling all models:",e)}},tR=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ep(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),t_=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ex(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eB(e.models)}).catch(()=>{})},[f]);let tz=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=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"})]),a=await e.json(),l=await t.json(),r=await s.json(),n=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===f);b(e)}s.ok&&P(r.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};eE(o.fallbackStrategy||null),eD(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};e_(d.mode||"auto");let c=X[f],m=c&&n[c]||{};if(eq({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===f)||null;if(!e&&tw)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===f)||null))break}A(e)}}catch(e){console.log("Error fetching connections:",e)}finally{j(!1)}},[f,tw]),tq=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(A(s.node),await tz(),er(!1))}catch(e){console.log("Error updating provider node:",e)}},tU=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(a).length?delete l[f]:l[f]=a,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)}},tM=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tK=async e=>{let t=X[f];if(t){eq(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,a.useEffect)(()=>{tz(),tR(),t_(),tO()},[tz,tR,t_,tO]),(0,a.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eF([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eF([]),"zed"===f&&eL(null);return}let t=!1;return"zed"===f&&eL(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eF(s.models),"zed"===f&&s?.warning&&eL(s.warning);return}"zed"===f&&(eF([]),eL(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eF([]),eL("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,a.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&T(e).then(eM)},[f]);let tF=async(e,t,s=tb)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tR();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tJ=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tR()}catch(e){console.log("Error deleting alias:",e)}},tL=async(e,t="llm",s=tA,i,a)=>{try{let l=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...i?{caps:i}:{},...a?{transport:a}:{}})});if(l.ok)await t_(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await l.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tW=async(e,t="llm",s=tA)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await t_(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tB=async()=>{if(te)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,S.Tl)("Please add an active connection first"));tt(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,S.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,S.Tl)("No models returned"));let a=0,l=new Set(tg.map(e=>e.id));for(let e of i){let t=e.id||e.name;if(!t)continue;let s=`${f}/`,i=t.startsWith(s)?t.slice(s.length):t;eu.some(e=>e.providerAlias===tA&&e.id===i&&"llm"===(e.kind||e.type||"llm"))||Object.values(em).includes(`${tA}/${i}`)||l.has(i)||(await tL(i,"llm",tA),a+=1)}0===a?alert((0,S.Tl)("All models already exist, no new models added")):alert((0,S.Tl)("Successfully added")+` ${a} `+(0,S.Tl)("models"))}catch(e){console.log("Error importing live models:",e),alert((0,S.Tl)("Error fetching models")+": "+e.message)}finally{tt(!1)}},tH=async()=>{if(ts)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,S.Tl)("Please add an active Cline connection first"));ti(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,S.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,S.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;t&&(eu.some(e=>e.providerAlias===tA&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(em).includes(`${tA}/${t}`)||(await tL(t,"llm",tA),a+=1))}0===a?alert((0,S.Tl)("All models already exist, no new models added")):alert((0,S.Tl)("Successfully added")+` ${a} `+(0,S.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,S.Tl)("Error fetching models")+": "+e.message)}finally{ti(!1)}},tG=async()=>{if(eY||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));e8.current=!1,e0(!0),e2(!1),e3(null),e6(e),e7({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(e8.current){e7({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=y[e];e3(i.id),e6(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,e6(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,e6(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e7({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{e3(null),e0(!1),e2(!1),e8.current=!1}},tV=async e=>{eZ({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eZ(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tZ=()=>{tz(),R(!1)},tQ=async e=>{V("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tz(),B(!1);return}V(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),V("Failed to save connection")}},tX=async e=>{try{(await fetch(`/api/providers/${ed.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tz(),ea(!1))}catch(e){console.log("Error updating connection:",e)}},tY=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t0=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(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 tz()}},t1=y.filter(e=>eC.includes(e.id)),t2=y.length>0&&eC.length===y.length;(0,a.useEffect)(()=>{eS(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===t1.length)return;let e=new Set(t1.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=O.find(e=>e.id===t);return s?.name}})();let t5=()=>{e$||eo(!1)},t3=async e=>{eO(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).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 tz(),eo(!1)}finally{eO(!1)}},t4=e=>t3(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),t6=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:y.map((e,t)=>{let s;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(s=e.id,eC.includes(s)),onChange:()=>{var t;return t=e.id,void eS(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,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(z,{connection:e,proxyPools:O,isOAuth:tu,isFirst:0===t,isLast:t===y.length-1,onMoveUp:()=>t0(t,t-1),onMoveDown:()=>t0(t,t+1),onToggleActive:t=>tY(e.id,t),autoPing:X[f]&&"oauth"===e.authType?{on:!0===ez.connections[e.id],onToggle:t=>{var s;return s=e.id,void tK({...ez,connections:{...ez.connections,[s]:t}})},provider:f}: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&&b(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:()=>{ec(e),ea(!0)},onDelete:()=>tV(e.id),oneByOneStatus:e4[e.id]||null})})]},e.id)})}),t9=O.filter(e=>!0===e.isActive),t7=(0,i.jsx)(c.aF,{isOpen:en,onClose:t5,title:`Apply Proxy (${y.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=O.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t3(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:e$||0===t9.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>t4(null),disabled:e$,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),O.map(e=>(0,i.jsxs)("button",{onClick:()=>t4(e.id),disabled:e$||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),e$&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:t5,variant:"ghost",fullWidth:!0,disabled:e$,children:"Cancel"})]})}),t8=async e=>{if(!ej.has(e)){ew(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:`${tA}/${e}`})}),s=await t.json();ey(t=>({...t,[e]:s.ok?"ok":"error"})),ev(s.ok?"":s.error||"Model not reachable")}catch{ey(t=>({...t,[e]:"error"})),ev("Network error")}finally{ew(t=>{let s=new Set(t);return s.delete(e),s})}}};if(v)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!tm)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let se=()=>tv&&tm.apiType?"responses"===tm.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tj?"/providers/anthropic-m.png":(0,d.HY)(tm.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tm.color}15`},children:eh||!se()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tm.color},children:tm.textIcon||tm.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.A,{src:se(),alt:tm.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tm.id),ef(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tm.name}),(tm.notice?.apiKeyUrl||tm.notice?.signupUrl||tm.website)&&(0,i.jsxs)("a",{href:tm.notice?.apiKeyUrl||tm.notice?.signupUrl||tm.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tm.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]})]})]}),tm.deprecated&&(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tm.deprecationNotice})]}),tm.notice?.text&&!tm.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tm.notice.text}),tm.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tm.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 →"})]}),tw&&w&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tj?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tj?"Messages API":"responses"===w.apiType?"Responses API":"Chat Completions"," \xb7 ",(w.baseUrl||"").replace(/\/$/,""),"/",tj?"messages":"responses"===w.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{V(""),B(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>er(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eZ({title:"Delete Compatible Node",message:`Delete this ${tj?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eZ(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tf&&(0,i.jsx)(c.gw,{providerId:f,title:"Proxy pool for connecting",description:"The OAuth connect flow itself calls Google endpoints. Route it through the selected proxy pool; the pool is then saved onto the new connection."}),th?(0,i.jsx)(c.gw,{providerId:f}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&O.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>eo(!0),children:"Apply Proxy"}),y.length>0&&(0,i.jsxs)(i.Fragment,{children:[eC.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eC.length;0!==e&&eZ({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eZ(null);let e=0,t=[...eC];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}b(e=>e.filter(e=>!t.includes(e.id))),eS([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eC.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tG,disabled:eY,children:eY?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eY&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eY&&(e8.current=!0,e2(!0))},disabled:e1,children:e1?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===eP,onChange:e=>{let t=e?"round-robin":null,s=e?eI||"1":eI;e&&!eI&&eD("1"),eE(t),tU(t,s)}}),"round-robin"===eP&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eI,onChange:e=>{var t;eD(t=e.target.value),tU("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===y.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tu?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tk&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tN," or ",tC,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tk?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:to,children:tN}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:td,children:tC})]}):(0,i.jsxs)(i.Fragment,{children:[!tw&&"iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ee(!0),children:(0,S.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>es(!0),children:(0,S.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tc,children:tw?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[e9&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",e9.total]}),(0,i.jsxs)("span",{children:["Completed: ",e9.completed]}),(0,i.jsxs)("span",{children:["Passed: ",e9.passed]}),(0,i.jsxs)("span",{children:["Failed: ",e9.failed]}),e9.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eY&&e5&&(0,i.jsxs)("span",{children:["Running: ",y.find(e=>e.id===e5)?.name||e5]})]})}),y.length>0&&(0,i.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,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:t2,onChange:()=>{t2?eS([]):eS(y.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t6,!tw&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ee(!0),title:(0,S.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,S.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>es(!0),title:(0,S.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,S.Tl)("Bulk Add")}),tk?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:to,className:"w-full sm:w-auto",children:tN}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:td,className:"w-full sm:w-auto",children:tC})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tc,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsx)(Q,{providerId:f}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tT&&(0,i.jsx)("select",{value:eR,onChange:e=>{var t;e_(t=e.target.value),tM(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tT.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tw&&(e=[...ty,...eW.filter(e=>!ty.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eH.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eH.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tD,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tI(e),children:"Disable All"})]}))]}),!!eb&&(0,i.jsxs)("div",{className:"mb-3",children:[(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:eb}),/RegionError|hosted in China|regionNotAllowed/i.test(eb)&&(s=(t="string"==typeof eb?eb:JSON.stringify(eb)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),r=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:r?`https://opencode.ai/workspace/${r[0]}/go`:"https://opencode.ai",(0,i.jsx)("div",{className:"mt-1.5",children:(0,i.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,i.jsx)("span",{children:"Allow China-hosted models"}),(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eJ&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eJ}),(()=>{let e,t,s;if(tw)return(0,i.jsx)(D,{providerStorageAlias:tA,providerDisplayAlias:t$,modelAliases:em,customModels:eu,copied:ta,onCopy:tl,onSetAlias:tF,onDeleteAlias:tJ,onAddCustomModel:e=>tL(e,"llm",tA),onDeleteCustomModel:e=>tW(e,"llm",tA),connections:y,isAnthropic:tj});let a=[...ty,...eW.filter(e=>!ty.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eH),r=a.filter(e=>!l.has(e.id)),n=a.filter(e=>l.has(e.id)),o=$({customModels:eu,modelAliases:em,providerAlias:tA,builtInModels:ty,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,i.jsx)(E,{model:{id:e.id,name:e.name},fullModel:`${t$}/${e.id}`,alias:e.alias,copied:ta,onCopy:tl,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tW(e.id,"llm",tA):tJ(e.alias)},testStatus:eg[e.id],onTest:y.length>0||th?()=>t8(e.id):void 0,isTesting:ej.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tS(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tA}/${e.id}`,s=`${f}/${e.id}`,a=Object.entries(em).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(E,{model:e,fullModel:`${t$}/${e.id}`,alias:a,copied:ta,onCopy:tl,onSetAlias:t=>tF(e.id,t,tA),onDeleteAlias:()=>tJ(a),testStatus:eg[e.id],onTest:y.length>0||th?()=>t8(e.id):void 0,isTesting:ej.has(e.id),isFree:e.isFree,onDisable:()=>tP(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tS(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>eN(!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,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),Y[f]&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tB,disabled:te,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-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:te?{animation:"spin 1s linear infinite"}:void 0,children:te?"progress_activity":"download"}),te?(0,S.Tl)("Fetching..."):(0,S.Tl)(Y[f])]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tH,disabled:ts,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-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:ts?{animation:"spin 1s linear infinite"}:void 0,children:ts?"progress_activity":"download"}),ts?(0,S.Tl)("Fetching..."):(0,S.Tl)("Import from /models")]}),eU.length>0&&(e=new Set([...Object.values(em),...o.map(e=>e.fullModel)]),t=new Set(ty.map(e=>e.id)),0===(s=eU.filter(s=>!e.has(`${tA}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested models:"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tL(e.id,"llm",tA)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:e.contextLength?`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`:e.name,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,i.jsxs)("button",{onClick:()=>tE(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),t7,"kiro"===f?(0,i.jsx)(c.Mh,{isOpen:I,providerInfo:tm,onSuccess:tZ,onClose:()=>R(!1)}):"cursor"===f?(0,i.jsx)(c.G9,{isOpen:I,onSuccess:tZ,onClose:()=>R(!1)}):"zed"===f?(0,i.jsx)(c.TE,{isOpen:I,providerInfo:tm,onSuccess:tZ,onClose:()=>R(!1)}):"gitlab"===f?(0,i.jsx)(c.vj,{isOpen:I,providerInfo:tm,onSuccess:tZ,onClose:()=>R(!1)}):(0,i.jsx)(c.LF,{isOpen:I,provider:f,providerInfo:tm,onSuccess:tZ,onClose:()=>R(!1)}),(0,i.jsx)(c.LH,{isOpen:_,onSuccess:tZ,onClose:()=>q(!1)}),"iflow"===f&&(0,i.jsx)(c.vE,{isOpen:K,onSuccess:()=>{tz(),J(!1)},onClose:()=>J(!1)}),(0,i.jsx)(U,{isOpen:W,provider:f,providerName:tm.name,isCompatible:tw,isAnthropic:tj,authType:tm?.authType,authHint:tm?.authHint,website:tm?.website,proxyPools:O,error:G,existingNames:y.map(e=>e.name).filter(Boolean),onSave:tQ,onBulkDone:tz,onClose:()=>{V(""),B(!1)}}),(0,i.jsx)(c.wI,{isOpen:ei,connection:ed,proxyPools:O,onSave:tX,onClose:()=>ea(!1)}),tw&&(0,i.jsx)(M,{isOpen:el,node:w,onSave:tq,onClose:()=>er(!1),isAnthropic:tj}),!tw&&(0,i.jsx)(F,{isOpen:ek,providerAlias:tA,providerDisplayAlias:t$,onSave:async(e,t,s)=>{await tL(e,t?.stt?"stt":"llm",tA,t,s),eN(!1)},onClose:()=>eN(!1)}),"codex"===f&&(0,i.jsx)(L,{isOpen:Z,onClose:()=>ee(!1),onSuccess:tz}),"grok-cli"===f&&(0,i.jsx)(H,{isOpen:et,onClose:()=>es(!1),onSuccess:tz}),(0,i.jsx)(c.uo,{isOpen:eQ,onClose:()=>eX(!1),onConfirm:()=>{(window.localStorage.setItem(tr,"true"),eX(!1),tu)?tn():td()},title:"Risk Notice",message:tm?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eV,onClose:()=>eZ(null),onConfirm:eV?.onConfirm,title:eV?.title||"Confirm",message:eV?.message,variant:"danger"})]})}},70217:(e,t,s)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>i})},82837:(e,t,s)=>{Promise.resolve().then(s.bind(s,69929))}},e=>{e.O(0,[763,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=82837)),_N_E=e.O()}]);
27
+ ]`;function B(e){let t,s=e.trim();if(!s)return[];try{t=JSON.parse(s)}catch(e){try{let e=s;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),t=JSON.parse(e)}catch{throw e}}if(Array.isArray(t))return t;if(t&&"object"==typeof t)return Array.isArray(t.accounts)?t.accounts:[t];throw Error("Input must be a JSON object or array of objects")}function H({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,a.useState)(""),[n,o]=(0,a.useState)(!1),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),y=(0,a.useRef)(null),b=()=>{n||(r(""),m(""),u(null),g(null),h(!1),t())},v=async e=>{if(!e||0===e.length)return;m("");let t=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===t.length)return void m((0,S.Tl)("Please select valid .json files"));try{let e=[];for(let s of t){let t=await s.text(),i=B(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,S.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,S.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=B(l)}catch(e){m(`${(0,S.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,S.Tl)("No accounts found in input"));o(!0);try{let t=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),i=await t.json();if(!t.ok)return void m(i?.error||`Request failed: ${t.status}`);u(i),i.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,S.Tl)("Request failed"))}finally{o(!1)}},k=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,S.Tl)("Bulk Add Grok CLI Accounts"),onClose:b,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,S.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,i.jsx)("input",{ref:y,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{v(e.target.files),e.target&&(e.target.value="")}}),(0,i.jsx)(c.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>y.current?.click(),disabled:n,children:(0,S.Tl)("Upload JSON Files")})]}),(0,i.jsxs)("div",{onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:e=>{e.preventDefault(),h(!1)},onDrop:e=>{e.preventDefault(),h(!1),e.dataTransfer?.files?.length>0&&v(e.dataTransfer.files)},className:`relative rounded border transition-colors ${x?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,i.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:W,value:l,onChange:e=>{r(e.target.value),g(null)},disabled:n}),x&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-sidebar/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,i.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,S.Tl)("Drop .json files here")})]})]}),f&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-green-400 font-medium bg-green-500/10 border border-green-500/20 px-2.5 py-1.5 rounded",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,i.jsxs)("span",{children:[(0,S.Tl)("Loaded")," ",f.accountsCount," ",(0,S.Tl)("account(s) from")," ",f.filesCount," ",(0,S.Tl)("file(s)")]})]}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&p.failed>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",p.failed," ",(0,S.Tl)("failed")]}),k.length>0&&(0,i.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:k.map(e=>(0,i.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:j,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,S.Tl)("Importing..."):(0,S.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,S.Tl)("Close")})]})]})})}var G=s(65921);let Z=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],Q=/^[A-Za-z0-9-]+$/;function V({providerId:e}){let t=(0,G.i)(),[s,l]=(0,a.useState)(!1),[r,n]=(0,a.useState)([{name:"",value:""}]),[o,d]=(0,a.useState)({}),[m,p]=(0,a.useState)(!1),[u,x]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=!1;return fetch(`/api/providers/${e}/overrides`,{cache:"no-store"}).then(e=>e.ok?e.json():null).then(e=>{if(t||!e)return;let s=e.builtinHeaders||{},i=Object.entries({...s,...e.headers||{}}).map(([e,t])=>({name:e,value:t}));d(s),n(i.length?i:[{name:"",value:""}]),p(Object.keys(e.headers||{}).length>0)}).catch(()=>{}),()=>{t=!0}},[e]);let h=(e,t,s)=>{n(i=>i.map((i,a)=>a===e?{...i,[t]:s}:i))},f=(0,a.useCallback)(async()=>{let s={};for(let e of r.filter(e=>e.name.trim())){let i=e.name.trim();if(!Q.test(i))return void t.error(`Invalid header name: ${i}`);if(Z.includes(i.toLowerCase()))return void t.error(`Header ${i} cannot be overridden`);if(i in s)return void t.error(`Duplicate header name: ${i}`);e.value!==o[i]&&(s[i]=e.value)}x(!0);try{let i=await fetch(`/api/providers/${e}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:s})});if(!i.ok){let e=await i.json().catch(()=>({}));t.error(e.error||"Failed to save");return}p(Object.keys(s).length>0),t.success("Custom headers saved")}finally{x(!1)}},[r,o,e,t]);return 0!==Object.keys(o).length||m?(0,i.jsxs)(c.Zp,{padding:"xs",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex w-full items-center justify-between text-left",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,i.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),m&&(0,i.jsx)(c.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:s?"expand_less":"expand_more"})]}),s&&(0,i.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,i.jsx)("div",{className:"flex flex-col gap-2",children:r.map((e,t)=>{let s=e.name.trim()in o&&e.value!==o[e.name.trim()];return(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("input",{value:e.name,onChange:e=>h(t,"name",e.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,i.jsx)("input",{value:e.value,onChange:e=>h(t,"value",e.target.value),placeholder:"Value",spellCheck:!1,title:s?"Overridden":e.name.trim()in o?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${s?"border-amber-400/60":"border-border"}`}),(0,i.jsx)("button",{type:"button",title:"Remove header",onClick:()=>n(e=>e.length>1?e.filter((e,s)=>s!==t):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},t)})}),(0,i.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>n(e=>[...e,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("button",{type:"button",disabled:u,onClick:()=>{n(Object.entries(o).map(([e,t])=>({name:e,value:t})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,i.jsx)("button",{type:"button",disabled:u,onClick:f,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:u?"Saving...":"Save"})]})]})]})]}):null}V.propTypes={providerId:P().string.isRequired};let X={claude:"claudeAutoPing",codex:"codexAutoPing"},Y={qoder:"Fetch Qoder Models","qoder-cn":"Fetch Qoder Models","trae-enterprise":"Fetch Trae Enterprise Models",codearts:"Fetch CodeArts Models",minimax:"Fetch MiniMax Models","minimax-cn":"Fetch MiniMax Models"};function ee(){let e,t,s,r,u,x=(0,l.useParams)(),h=(0,l.useRouter)(),f=x.id,{getCaps:g}=(0,C.y)(),[y,b]=(0,a.useState)([]),[v,j]=(0,a.useState)(!0),[k,A]=(0,a.useState)(null),[O,P]=(0,a.useState)([]),[E,R]=(0,a.useState)(!1),[_,q]=(0,a.useState)(!1),[K,J]=(0,a.useState)(!1),[W,B]=(0,a.useState)(!1),[G,Z]=(0,a.useState)(""),[Q,ee]=(0,a.useState)(!1),[et,es]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(!1),[el,er]=(0,a.useState)(!1),[en,eo]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(null),[em,ep]=(0,a.useState)({}),[eu,ex]=(0,a.useState)([]),[eh,ef]=(0,a.useState)(!1),[eg,ey]=(0,a.useState)({}),[eb,ev]=(0,a.useState)(""),[ej,ek]=(0,a.useState)(()=>new Set),[ew,eN]=(0,a.useState)(!1),[eC,eS]=(0,a.useState)([]),[eA,eT]=(0,a.useState)("__none__"),[e$,eO]=(0,a.useState)(!1),[eP,eI]=(0,a.useState)(null),[eE,eD]=(0,a.useState)(""),[eR,e_]=(0,a.useState)("auto"),[ez,eq]=(0,a.useState)({enabled:!1,connections:{}}),[eM,eU]=(0,a.useState)([]),[eK,eF]=(0,a.useState)([]),[eJ,eL]=(0,a.useState)(null),[eW,eB]=(0,a.useState)([]),[eH,eG]=(0,a.useState)([]),[eZ,eQ]=(0,a.useState)(null),[eV,eX]=(0,a.useState)(!1),[eY,e0]=(0,a.useState)(!1),[e1,e2]=(0,a.useState)(!1),[e5,e3]=(0,a.useState)(null),[e4,e6]=(0,a.useState)({}),[e9,e8]=(0,a.useState)(null),e7=(0,a.useRef)(!1),[te,tt]=(0,a.useState)(!1),[ts,ti]=(0,a.useState)(!1),{copied:ta,copy:tl}=(0,N.C)(),tr="ag_risk_confirmed",tn=()=>{R(!0)},to=()=>{"antigravity"===f&&"true"!==window.localStorage.getItem(tr)?eX(!0):"xiaomi-mimo"===f?q(!0):tu?tn():(Z(""),B(!0))},td=()=>{Z(""),B(!0)},tc=()=>{tu?to():td()},tm=k?{id:k.id,name:k.name||("anthropic-compatible"===k.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===k.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===k.type?"AC":"OC",apiType:k.apiType,baseUrl:k.baseUrl,type:k.type}:m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f]||m.br[f],tp=tm?.authModes||[],tu=!!m.zN[f]||!!m.IS[f]||tp.includes("oauth"),tx=!!m.fg[f]||tp.includes("apikey"),th=!!m.IS[f]?.noAuth,tf="antigravity"===f||"gemini-cli"===f,tg=(0,p.KC)(f),ty=("cursor"===f||"zed"===f)&&eK.length>0?eK:tg,tb=(0,m.wG)(f),tv=(0,m.mq)(f),tj=(0,m.gb)(f),tk=tv||tj,tw=!tk&&tu&&tx,tN="xai"===f?"Grok Build OAuth":"grok-cli"===f?"Grok CLI Device Login":"kimi"===f?"Kimi Coding OAuth":"OAuth",tC="xai"===f?"xAI API Key":"kimi"===f?"Kimi API Key":"qoder"===f||"qoder-cn"===f?"PAT":"API Key",tS=e=>{if(!eR||"auto"===eR)return null;let t=w(f,e);return t&&t.includes(eR)?eR:null},tA=tk?f:tb,tT=(()=>{let e=new Set,t=new Set,s=s=>{if(!s||t.has(s))return;t.add(s);let i=w(f,s);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of ty)s(e.id);for(let e of eW)s(e.id);for(let e of eu)e.providerAlias===tA&&"llm"===(e.kind||e.type||"llm")&&s(e.id);return e.size?["auto",...e]:null})(),t$=tk?k?.prefix||f:tb,tO=(0,a.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}`,{cache:"no-store"}),t=await e.json();e.ok&&eG(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tA]),tP=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tA,ids:[e]})})).ok&&await tO()}catch(e){console.log("Error disabling model:",e)}},tI=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tO()}catch(e){console.log("Error enabling model:",e)}},tE=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:tA,ids:e})})).ok&&await tO()}catch(e){console.log("Error disabling all models:",e)}}})},tD=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}`,{method:"DELETE"})).ok&&await tO()}catch(e){console.log("Error enabling all models:",e)}},tR=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&ep(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),t_=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ex(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===f&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eB(e.models)}).catch(()=>{})},[f]);let tz=(0,a.useCallback)(async()=>{try{let[e,t,s,i]=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"})]),a=await e.json(),l=await t.json(),r=await s.json(),n=i.ok?await i.json():{};if(e.ok){let e=(a.connections||[]).filter(e=>e.provider===f);b(e)}s.ok&&P(r.proxyPools||[]);let o=(n.providerStrategies||{})[f]||{};eI(o.fallbackStrategy||null),eD(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let d=(n.providerThinking||{})[f]||{};e_(d.mode||"auto");let c=X[f],m=c&&n[c]||{};if(eq({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===f)||null;if(!e&&tk)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===f)||null))break}A(e)}}catch(e){console.log("Error fetching connections:",e)}finally{j(!1)}},[f,tk]),tq=async e=>{try{let t=await fetch(`/api/provider-nodes/${f}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(A(s.node),await tz(),er(!1))}catch(e){console.log("Error updating provider node:",e)}},tM=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),i=(s.ok?await s.json():{}).providerStrategies||{},a={};e&&(a.fallbackStrategy=e),"round-robin"===e&&""!==t&&(a.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(a).length?delete l[f]:l[f]=a,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)}},tU=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?s[f]={mode:e}:delete s[f],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:s})})}catch(e){console.log("Error saving thinking config:",e)}},tK=async e=>{let t=X[f];if(t){eq(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,a.useEffect)(()=>{tz(),tR(),t_(),tO()},[tz,tR,t_,tO]),(0,a.useEffect)(()=>{if("cursor"!==f&&"zed"!==f)return void eF([]);let e=y.find(e=>!1!==e.isActive);if(!e?.id){eF([]),"zed"===f&&eL(null);return}let t=!1;return"zed"===f&&eL(null),fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json().catch(()=>null)})).then(({ok:e,data:s})=>{if(!t){if(e&&Array.isArray(s?.models)&&s.models.length>0){eF(s.models),"zed"===f&&s?.warning&&eL(s.warning);return}"zed"===f&&(eF([]),eL(s?.warning||s?.error||"Zed returned no live models."))}}).catch(()=>{t||"zed"!==f||(eF([]),eL("Failed to reach the Zed model catalog."))}),()=>{t=!0}},[f,y]),(0,a.useEffect)(()=>{let e=(m.zN[f]||m.fg[f]||m.IS[f]||m.nJ[f])?.modelsFetcher;e&&T(e).then(eU)},[f]);let tF=async(e,t,s=tb)=>{let i=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:i,alias:t})});if(e.ok)await tR();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tJ=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tR()}catch(e){console.log("Error deleting alias:",e)}},tL=async(e,t="llm",s=tA,i,a)=>{try{let l=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t,...i?{caps:i}:{},...a?{transport:a}:{}})});if(l.ok)await t_(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await l.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tW=async(e,t="llm",s=tA)=>{try{let i=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${i}`,{method:"DELETE"})).ok&&(await t_(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tB=async()=>{if(te)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,S.Tl)("Please add an active connection first"));tt(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,S.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,S.Tl)("No models returned"));let a=0,l=new Set(tg.map(e=>e.id));for(let e of i){let t=e.id||e.name;if(!t)continue;let s=`${f}/`,i=t.startsWith(s)?t.slice(s.length):t;eu.some(e=>e.providerAlias===tA&&e.id===i&&"llm"===(e.kind||e.type||"llm"))||Object.values(em).includes(`${tA}/${i}`)||l.has(i)||(await tL(i,"llm",tA),a+=1)}0===a?alert((0,S.Tl)("All models already exist, no new models added")):alert((0,S.Tl)("Successfully added")+` ${a} `+(0,S.Tl)("models"))}catch(e){console.log("Error importing live models:",e),alert((0,S.Tl)("Error fetching models")+": "+e.message)}finally{tt(!1)}},tH=async()=>{if(ts)return;let e=y.find(e=>!1!==e.isActive);if(!e)return void alert((0,S.Tl)("Please add an active Cline connection first"));ti(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,S.Tl)("Failed to fetch models"));let i=s.models||[];if(0===i.length)return void alert((0,S.Tl)("No models returned"));let a=0;for(let e of i){let t=e.id||e.name;t&&(eu.some(e=>e.providerAlias===tA&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(em).includes(`${tA}/${t}`)||(await tL(t,"llm",tA),a+=1))}0===a?alert((0,S.Tl)("All models already exist, no new models added")):alert((0,S.Tl)("Successfully added")+` ${a} `+(0,S.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,S.Tl)("Error fetching models")+": "+e.message)}finally{ti(!1)}},tG=async()=>{if(eY||0===y.length)return;let e=Object.fromEntries(y.map(e=>[e.id,{state:"queued",error:null}]));e7.current=!1,e0(!0),e2(!1),e3(null),e6(e),e8({total:y.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<y.length;e+=1){if(e7.current){e8({total:y.length,completed:e,passed:t,failed:s,stopped:!0});break}let i=y[e];e3(i.id),e6(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),a=await e.json(),l=!!a.valid;l?t+=1:s+=1,e6(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:a.error||null}}))}catch(e){s+=1,e6(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e8({total:y.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<y.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{e3(null),e0(!1),e2(!1),e7.current=!1}},tZ=async e=>{eQ({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eQ(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&b(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tQ=()=>{tz(),R(!1)},tV=async e=>{Z("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:f,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tz(),B(!1);return}Z(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),Z("Failed to save connection")}},tX=async e=>{try{(await fetch(`/api/providers/${ed.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tz(),ea(!1))}catch(e){console.log("Error updating connection:",e)}},tY=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&b(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},t0=async(e,t)=>{let s=[...y];[s[e],s[t]]=[s[t],s[e]],b(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 tz()}},t1=y.filter(e=>eC.includes(e.id)),t2=y.length>0&&eC.length===y.length;(0,a.useEffect)(()=>{eS(e=>e.filter(e=>y.some(t=>t.id===e)))},[y]),(()=>{if(0===t1.length)return;let e=new Set(t1.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=O.find(e=>e.id===t);return s?.name}})();let t5=()=>{e$||eo(!1)},t3=async e=>{eO(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).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 tz(),eo(!1)}finally{eO(!1)}},t4=e=>t3(y.map(t=>({connectionId:t.id,proxyPoolId:e}))),t6=(0,i.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:y.map((e,t)=>{let s;return(0,i.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,i.jsx)("input",{type:"checkbox",checked:(s=e.id,eC.includes(s)),onChange:()=>{var t;return t=e.id,void eS(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,i.jsx)("div",{className:"flex-1 min-w-0",children:(0,i.jsx)(z,{connection:e,proxyPools:O,isOAuth:tu,isFirst:0===t,isLast:t===y.length-1,onMoveUp:()=>t0(t,t-1),onMoveDown:()=>t0(t,t+1),onToggleActive:t=>tY(e.id,t),autoPing:X[f]&&"oauth"===e.authType?{on:!0===ez.connections[e.id],onToggle:t=>{var s;return s=e.id,void tK({...ez,connections:{...ez.connections,[s]:t}})},provider:f}: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&&b(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:()=>{ec(e),ea(!0)},onDelete:()=>tZ(e.id),oneByOneStatus:e4[e.id]||null})})]},e.id)})}),t9=O.filter(e=>!0===e.isActive),t8=(0,i.jsx)(c.aF,{isOpen:en,onClose:t5,title:`Apply Proxy (${y.length} connections)`,children:(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("button",{onClick:()=>{let e=O.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t3(y.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:e$||0===t9.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,i.jsxs)("button",{onClick:()=>t4(null),disabled:e$,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,i.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),O.map(e=>(0,i.jsxs)("button",{onClick:()=>t4(e.id),disabled:e$||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,i.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,i.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),e$&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:t5,variant:"ghost",fullWidth:!0,disabled:e$,children:"Cancel"})]})}),t7=async e=>{if(!ej.has(e)){ek(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:`${tA}/${e}`})}),s=await t.json();ey(t=>({...t,[e]:s.ok?"ok":"error"})),ev(s.ok?"":s.error||"Model not reachable")}catch{ey(t=>({...t,[e]:"error"})),ev("Network error")}finally{ek(t=>{let s=new Set(t);return s.delete(e),s})}}};if(v)return(0,i.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,i.jsx)(c.Qv,{}),(0,i.jsx)(c.Qv,{})]});if(!tm)return(0,i.jsxs)("div",{className:"text-center py-20",children:[(0,i.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,i.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let se=()=>tv&&tm.apiType?"responses"===tm.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tj?"/providers/anthropic-m.png":(0,d.HY)(tm.id);return(0,i.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,i.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${tm.color}15`},children:eh||!se()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tm.color},children:tm.textIcon||tm.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.A,{src:se(),alt:tm.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tm.id),ef(!0)},loading:"lazy",decoding:"async"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,i.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:tm.name}),(tm.notice?.apiKeyUrl||tm.notice?.signupUrl||tm.website)&&(0,i.jsxs)("a",{href:tm.notice?.apiKeyUrl||tm.notice?.signupUrl||tm.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),tm.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[y.length," connection",1===y.length?"":"s"]})]})]})]}),tm.deprecated&&(0,i.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,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,i.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:tm.deprecationNotice})]}),tm.notice?.text&&!tm.deprecated&&(0,i.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,i.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:tm.notice.text}),tm.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tm.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 →"})]}),tk&&k&&(0,i.jsx)(c.Zp,{children:(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:tj?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,i.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tj?"Messages API":"responses"===k.apiType?"Responses API":"Chat Completions"," \xb7 ",(k.baseUrl||"").replace(/\/$/,""),"/",tj?"messages":"responses"===k.apiType?"responses":"chat/completions"]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:()=>{Z(""),B(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>er(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eQ({title:"Delete Compatible Node",message:`Delete this ${tj?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eQ(null);try{(await fetch(`/api/provider-nodes/${f}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),tf&&(0,i.jsx)(c.gw,{providerId:f,title:"Proxy pool for connecting",description:"The OAuth connect flow itself calls Google endpoints. Route it through the selected proxy pool; the pool is then saved onto the new connection."}),th?(0,i.jsx)(c.gw,{providerId:f}):(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[y.length>0&&O.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>eo(!0),children:"Apply Proxy"}),y.length>0&&(0,i.jsxs)(i.Fragment,{children:[eC.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eC.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=[...eC];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}b(e=>e.filter(e=>!t.includes(e.id))),eS([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eC.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tG,disabled:eY,children:eY?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eY&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eY&&(e7.current=!0,e2(!0))},disabled:e1,children:e1?"Stopping...":"Stop"})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,i.jsx)(c.lM,{checked:"round-robin"===eP,onChange:e=>{let t=e?"round-robin":null,s=e?eE||"1":eE;e&&!eE&&eD("1"),eI(t),tM(t,s)}}),"round-robin"===eP&&(0,i.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,i.jsx)("input",{type:"number",min:1,value:eE,onChange:e=>{var t;eD(t=e.target.value),tM("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===y.length?(0,i.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:tu?"lock":"key"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tw&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",tN," or ",tC,"."]})]})]}),(0,i.jsx)("div",{className:"flex gap-2",children:tw?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:to,children:tN}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:td,children:tC})]}):(0,i.jsxs)(i.Fragment,{children:[!tk&&"iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ee(!0),children:(0,S.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>es(!0),children:(0,S.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tc,children:tk?"Add API Key":"iflow"===f?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[e9&&(0,i.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsxs)("span",{children:["Total: ",e9.total]}),(0,i.jsxs)("span",{children:["Completed: ",e9.completed]}),(0,i.jsxs)("span",{children:["Passed: ",e9.passed]}),(0,i.jsxs)("span",{children:["Failed: ",e9.failed]}),e9.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eY&&e5&&(0,i.jsxs)("span",{children:["Running: ",y.find(e=>e.id===e5)?.name||e5]})]})}),y.length>0&&(0,i.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,i.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,i.jsx)("input",{type:"checkbox",checked:t2,onChange:()=>{t2?eS([]):eS(y.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),t6,!tk&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>J(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ee(!0),title:(0,S.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,S.Tl)("Bulk Add")}),"grok-cli"===f&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>es(!0),title:(0,S.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,S.Tl)("Bulk Add")}),tw?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:to,className:"w-full sm:w-auto",children:tN}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:td,className:"w-full sm:w-auto",children:tC})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tc,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,i.jsx)(V,{providerId:f}),(0,i.jsxs)(c.Zp,{children:[(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),tT&&(0,i.jsx)("select",{value:eR,onChange:e=>{var t;e_(t=e.target.value),tU(t)},title:"Appends (level) suffix to copied model names",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:tT.map(e=>(0,i.jsx)("option",{value:e,children:`Thinking: ${e.charAt(0).toUpperCase()+e.slice(1)}`},e))})]}),!tk&&(e=[...ty,...eW.filter(e=>!ty.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eH.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eH.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tD,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tE(e),children:"Disable All"})]}))]}),!!eb&&(0,i.jsxs)("div",{className:"mb-3",children:[(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:eb}),/RegionError|hosted in China|regionNotAllowed/i.test(eb)&&(s=(t="string"==typeof eb?eb:JSON.stringify(eb)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),r=t.match(/wrk_[0-9A-Za-z]+/),u=s?s[0].endsWith("/go")?s[0]:`${s[0]}/go`:r?`https://opencode.ai/workspace/${r[0]}/go`:"https://opencode.ai",(0,i.jsx)("div",{className:"mt-1.5",children:(0,i.jsxs)("a",{href:u,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,i.jsx)("span",{children:"Allow China-hosted models"}),(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===f&&!!eJ&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:eJ}),(()=>{let e,t,s;if(tk)return(0,i.jsx)(D,{providerStorageAlias:tA,providerDisplayAlias:t$,modelAliases:em,customModels:eu,copied:ta,onCopy:tl,onSetAlias:tF,onDeleteAlias:tJ,onAddCustomModel:e=>tL(e,"llm",tA),onDeleteCustomModel:e=>tW(e,"llm",tA),connections:y,isAnthropic:tj});let a=[...ty,...eW.filter(e=>!ty.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eH),r=a.filter(e=>!l.has(e.id)),n=a.filter(e=>l.has(e.id)),o=$({customModels:eu,modelAliases:em,providerAlias:tA,builtInModels:ty,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o.map(e=>(0,i.jsx)(I,{model:{id:e.id,name:e.name},fullModel:`${t$}/${e.id}`,alias:e.alias,copied:ta,onCopy:tl,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tW(e.id,"llm",tA):tJ(e.alias)},testStatus:eg[e.id],onTest:y.length>0||th?()=>t7(e.id):void 0,isTesting:ej.has(e.id),isCustom:!0,isFree:!1,caps:g(`${f}/${e.id}`),thinkingSuffix:tS(e.id)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tA}/${e.id}`,s=`${f}/${e.id}`,a=Object.entries(em).find(([,e])=>e===t||e===s)?.[0];return(0,i.jsx)(I,{model:e,fullModel:`${t$}/${e.id}`,alias:a,copied:ta,onCopy:tl,onSetAlias:t=>tF(e.id,t,tA),onDeleteAlias:()=>tJ(a),testStatus:eg[e.id],onTest:y.length>0||th?()=>t7(e.id):void 0,isTesting:ej.has(e.id),isFree:e.isFree,onDisable:()=>tP(e.id),caps:g(`${f}/${e.id}`),thinkingSuffix:tS(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>eN(!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,i.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),Y[f]&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tB,disabled:te,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-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:te?{animation:"spin 1s linear infinite"}:void 0,children:te?"progress_activity":"download"}),te?(0,S.Tl)("Fetching..."):(0,S.Tl)(Y[f])]}),("cline"===f||"clinepass"===f)&&y.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tH,disabled:ts,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-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-sm",style:ts?{animation:"spin 1s linear infinite"}:void 0,children:ts?"progress_activity":"download"}),ts?(0,S.Tl)("Fetching..."):(0,S.Tl)("Import from /models")]}),eM.length>0&&(e=new Set([...Object.values(em),...o.map(e=>e.fullModel)]),t=new Set(ty.map(e=>e.id)),0===(s=eM.filter(s=>!e.has(`${tA}/${s.id}`)&&!t.has(s.id))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested models:"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tL(e.id,"llm",tA)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:e.contextLength?`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`:e.name,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),n.length>0&&(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",n.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,i.jsxs)("button",{onClick:()=>tI(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),t8,"kiro"===f?(0,i.jsx)(c.Mh,{isOpen:E,providerInfo:tm,onSuccess:tQ,onClose:()=>R(!1)}):"cursor"===f?(0,i.jsx)(c.G9,{isOpen:E,onSuccess:tQ,onClose:()=>R(!1)}):"zed"===f?(0,i.jsx)(c.TE,{isOpen:E,providerInfo:tm,onSuccess:tQ,onClose:()=>R(!1)}):"gitlab"===f?(0,i.jsx)(c.vj,{isOpen:E,providerInfo:tm,onSuccess:tQ,onClose:()=>R(!1)}):(0,i.jsx)(c.LF,{isOpen:E,provider:f,providerInfo:tm,onSuccess:tQ,onClose:()=>R(!1)}),(0,i.jsx)(c.LH,{isOpen:_,onSuccess:tQ,onClose:()=>q(!1)}),"iflow"===f&&(0,i.jsx)(c.vE,{isOpen:K,onSuccess:()=>{tz(),J(!1)},onClose:()=>J(!1)}),(0,i.jsx)(M,{isOpen:W,provider:f,providerName:tm.name,isCompatible:tk,isAnthropic:tj,authType:tm?.authType,authHint:tm?.authHint,website:tm?.website,proxyPools:O,error:G,existingNames:y.map(e=>e.name).filter(Boolean),onSave:tV,onBulkDone:tz,onClose:()=>{Z(""),B(!1)}}),(0,i.jsx)(c.wI,{isOpen:ei,connection:ed,proxyPools:O,onSave:tX,onClose:()=>ea(!1)}),tk&&(0,i.jsx)(U,{isOpen:el,node:k,onSave:tq,onClose:()=>er(!1),isAnthropic:tj}),!tk&&(0,i.jsx)(F,{isOpen:ew,providerAlias:tA,providerDisplayAlias:t$,onSave:async(e,t,s)=>{await tL(e,t?.stt?"stt":"llm",tA,t,s),eN(!1)},onClose:()=>eN(!1)}),"codex"===f&&(0,i.jsx)(L,{isOpen:Q,onClose:()=>ee(!1),onSuccess:tz}),"grok-cli"===f&&(0,i.jsx)(H,{isOpen:et,onClose:()=>es(!1),onSuccess:tz}),(0,i.jsx)(c.uo,{isOpen:eV,onClose:()=>eX(!1),onConfirm:()=>{(window.localStorage.setItem(tr,"true"),eX(!1),tu)?tn():td()},title:"Risk Notice",message:tm?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,i.jsx)(c.uo,{isOpen:!!eZ,onClose:()=>eQ(null),onConfirm:eZ?.onConfirm,title:eZ?.title||"Confirm",message:eZ?.message,variant:"danger"})]})}},70217:(e,t,s)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}s.d(t,{g:()=>i})},82837:(e,t,s)=>{Promise.resolve().then(s.bind(s,69929))}},e=>{e.O(0,[763,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=82837)),_N_E=e.O()}]);