@rabbi696/ezrouter 0.6.7 → 0.6.8

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 (721) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +5 -5
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +5 -5
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  91. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  94. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  102. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  104. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  105. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  106. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  107. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  108. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  109. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  110. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  112. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +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.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/combos/export/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/combos/import/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/combos/test/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/convoy/rules/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/mcp-gateway/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/mcp-gateway/sse/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/oauth/callback/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/routing-health/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/token-saver/stats/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/token-saver/stream/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/tool-disclosure/stats/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  256. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/usage/error-logs/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/v1/codex/models/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  303. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  340. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  342. package/app/.next-cli-build/server/app/callback.html +1 -1
  343. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  344. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  345. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  347. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  348. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  349. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  350. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  352. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  353. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  356. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  357. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  359. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  360. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  362. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  363. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  364. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  366. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  367. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  369. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  370. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  372. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  373. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  374. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  376. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  377. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  378. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  379. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  380. package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/convoy.rsc +6 -6
  382. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
  384. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  386. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +6 -6
  387. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +4 -4
  389. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +2 -2
  390. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  392. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  393. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  394. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  396. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  397. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  399. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  400. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.html +1 -1
  401. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.rsc +6 -6
  402. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys/__PAGE__.segment.rsc +2 -2
  403. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  406. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  407. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_full.segment.rsc +6 -6
  408. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_head.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_index.segment.rsc +4 -4
  410. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +2 -2
  411. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.html +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.rsc +6 -6
  413. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers/__PAGE__.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  418. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_full.segment.rsc +6 -6
  419. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_head.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_index.segment.rsc +4 -4
  421. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +2 -2
  422. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +6 -6
  424. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/__PAGE__.segment.rsc +2 -2
  425. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_full.segment.rsc +6 -6
  429. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_head.segment.rsc +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_index.segment.rsc +4 -4
  431. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +2 -2
  432. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  434. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  435. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  438. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  439. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  440. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  442. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  443. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  445. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  446. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  450. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  452. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  453. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  455. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  458. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  460. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  462. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  463. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  465. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  467. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  471. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  473. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  474. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  476. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  477. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  481. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  483. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  484. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  486. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  487. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  489. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  491. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  493. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  496. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  497. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  498. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  499. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  501. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +4 -4
  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 +2 -2
  505. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  506. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  507. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  508. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  509. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  510. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  511. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  513. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  514. package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +6 -6
  516. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
  517. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  520. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +6 -6
  521. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +4 -4
  523. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +2 -2
  524. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  527. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  529. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  530. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  531. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  532. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  534. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  536. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  537. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  538. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  539. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  540. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  541. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  542. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  543. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  544. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  546. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  547. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  548. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  549. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  550. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  551. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  552. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  553. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  554. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  556. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  557. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  558. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  559. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  560. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  561. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  562. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  563. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  564. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  565. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  566. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  567. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  568. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  569. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  570. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  571. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  573. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  574. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  575. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  576. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  577. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  578. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  579. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  580. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  581. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  582. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  583. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  584. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  585. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  586. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  587. package/app/.next-cli-build/server/app/index.html +1 -1
  588. package/app/.next-cli-build/server/app/index.rsc +4 -4
  589. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  590. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  591. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  592. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  593. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  594. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  595. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  596. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  597. package/app/.next-cli-build/server/app/landing.html +1 -1
  598. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  599. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  600. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  601. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  602. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  603. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  604. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  605. package/app/.next-cli-build/server/app/login/page.js +1 -1
  606. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  607. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  608. package/app/.next-cli-build/server/app/login.html +1 -1
  609. package/app/.next-cli-build/server/app/login.rsc +5 -5
  610. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  611. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  612. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  613. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  614. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  615. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  616. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  617. package/app/.next-cli-build/server/app/page.js +1 -1
  618. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  619. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  620. package/app/.next-cli-build/server/app-paths-manifest.json +5 -5
  621. package/app/.next-cli-build/server/chunks/1273.js +1 -1
  622. package/app/.next-cli-build/server/chunks/1744.js +12 -12
  623. package/app/.next-cli-build/server/chunks/1847.js +1 -1
  624. package/app/.next-cli-build/server/chunks/2021.js +1 -1
  625. package/app/.next-cli-build/server/chunks/2348.js +1 -1
  626. package/app/.next-cli-build/server/chunks/2892.js +1 -1
  627. package/app/.next-cli-build/server/chunks/3216.js +1 -0
  628. package/app/.next-cli-build/server/chunks/3252.js +1 -0
  629. package/app/.next-cli-build/server/chunks/3583.js +1 -1
  630. package/app/.next-cli-build/server/chunks/369.js +20 -20
  631. package/app/.next-cli-build/server/chunks/3886.js +1 -1
  632. package/app/.next-cli-build/server/chunks/3977.js +2 -2
  633. package/app/.next-cli-build/server/chunks/412.js +3 -3
  634. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  635. package/app/.next-cli-build/server/chunks/436.js +1 -0
  636. package/app/.next-cli-build/server/chunks/4807.js +1 -1
  637. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  638. package/app/.next-cli-build/server/chunks/5130.js +1 -1
  639. package/app/.next-cli-build/server/chunks/5614.js +1 -0
  640. package/app/.next-cli-build/server/chunks/5875.js +1 -1
  641. package/app/.next-cli-build/server/chunks/{4924.js → 6399.js} +19 -19
  642. package/app/.next-cli-build/server/chunks/7239.js +3 -3
  643. package/app/.next-cli-build/server/chunks/7353.js +1 -1
  644. package/app/.next-cli-build/server/chunks/7603.js +1 -1
  645. package/app/.next-cli-build/server/chunks/7775.js +1 -1
  646. package/app/.next-cli-build/server/chunks/7828.js +1 -1
  647. package/app/.next-cli-build/server/chunks/8129.js +1 -1
  648. package/app/.next-cli-build/server/chunks/823.js +1 -1
  649. package/app/.next-cli-build/server/chunks/8243.js +4 -4
  650. package/app/.next-cli-build/server/chunks/8306.js +1 -1
  651. package/app/.next-cli-build/server/chunks/880.js +4 -4
  652. package/app/.next-cli-build/server/chunks/8976.js +1 -1
  653. package/app/.next-cli-build/server/chunks/9217.js +1 -1
  654. package/app/.next-cli-build/server/chunks/9303.js +1 -1
  655. package/app/.next-cli-build/server/chunks/9485.js +1 -1
  656. package/app/.next-cli-build/server/chunks/9865.js +1 -1
  657. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  658. package/app/.next-cli-build/server/middleware.js +2 -2
  659. package/app/.next-cli-build/server/pages/404.html +1 -1
  660. package/app/.next-cli-build/server/pages/500.html +1 -1
  661. package/app/.next-cli-build/static/chunks/1321-e4660a6601ad3949.js +1 -0
  662. package/app/.next-cli-build/static/chunks/5497-a2c327d5099234f0.js +17 -0
  663. package/app/.next-cli-build/static/chunks/8105-9b78b79b9ec0bad7.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-8236097df15d7be9.js → page-adc0e63e21c1fd33.js} +1 -1
  665. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-e43920245a9a5e37.js +27 -0
  666. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-60e7605e27ff50d0.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-065d2cde7176b5fc.js +1 -0
  668. package/app/.next-cli-build/static/css/3eaed7d6a98582e3.css +1 -0
  669. package/app/CHANGELOG.md +39 -0
  670. package/app/package.json +1 -1
  671. package/app/public/CHANGELOG.md +39 -0
  672. package/app/public/i18n/literals/ar.json +103 -2
  673. package/app/public/i18n/literals/bn.json +103 -2
  674. package/app/public/i18n/literals/cs.json +104 -3
  675. package/app/public/i18n/literals/da.json +103 -2
  676. package/app/public/i18n/literals/de.json +104 -3
  677. package/app/public/i18n/literals/el.json +103 -2
  678. package/app/public/i18n/literals/es.json +102 -1
  679. package/app/public/i18n/literals/fa.json +117 -3
  680. package/app/public/i18n/literals/fi.json +103 -2
  681. package/app/public/i18n/literals/fr.json +104 -3
  682. package/app/public/i18n/literals/he.json +103 -2
  683. package/app/public/i18n/literals/hi.json +104 -3
  684. package/app/public/i18n/literals/hu.json +103 -2
  685. package/app/public/i18n/literals/id.json +103 -1
  686. package/app/public/i18n/literals/it.json +104 -3
  687. package/app/public/i18n/literals/ja.json +102 -1
  688. package/app/public/i18n/literals/km.json +103 -1
  689. package/app/public/i18n/literals/ko.json +103 -2
  690. package/app/public/i18n/literals/nl.json +103 -2
  691. package/app/public/i18n/literals/no.json +103 -2
  692. package/app/public/i18n/literals/pl.json +103 -2
  693. package/app/public/i18n/literals/pt-BR.json +101 -2
  694. package/app/public/i18n/literals/pt-PT.json +103 -2
  695. package/app/public/i18n/literals/ro.json +105 -4
  696. package/app/public/i18n/literals/ru.json +104 -3
  697. package/app/public/i18n/literals/sv.json +104 -3
  698. package/app/public/i18n/literals/th.json +101 -3
  699. package/app/public/i18n/literals/tl.json +104 -3
  700. package/app/public/i18n/literals/tr.json +108 -9
  701. package/app/public/i18n/literals/uk.json +103 -2
  702. package/app/public/i18n/literals/ur.json +103 -2
  703. package/app/public/i18n/literals/vi.json +103 -2
  704. package/app/public/i18n/literals/zh-CN.json +99 -1
  705. package/app/public/i18n/literals/zh-TW.json +103 -2
  706. package/app/src/mitm/server.js +30 -30
  707. package/cli.js +41 -0
  708. package/package.json +1 -1
  709. package/src/cli/menus/combos.js +4 -1
  710. package/app/.next-cli-build/server/chunks/5224.js +0 -1
  711. package/app/.next-cli-build/server/chunks/6892.js +0 -1
  712. package/app/.next-cli-build/server/chunks/8299.js +0 -1
  713. package/app/.next-cli-build/static/chunks/1321-b8a4f80390cd3ea3.js +0 -1
  714. package/app/.next-cli-build/static/chunks/5497-a4fcd9746123edae.js +0 -17
  715. package/app/.next-cli-build/static/chunks/8105-914b0eb9e3a50b9d.js +0 -1
  716. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-11a1a4053a30913f.js +0 -27
  717. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-679ec0628cd9d54f.js +0 -1
  718. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-6f16a27a86240648.js +0 -1
  719. package/app/.next-cli-build/static/css/23be8b98c2bbb37d.css +0 -1
  720. /package/app/.next-cli-build/static/{caISOCVUmfRaqJe0JjnZh → 8dPzxL-dxwdChBbLdLZmV}/_buildManifest.js +0 -0
  721. /package/app/.next-cli-build/static/{caISOCVUmfRaqJe0JjnZh → 8dPzxL-dxwdChBbLdLZmV}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{1389:(e,t,a)=>{Promise.resolve().then(a.bind(a,13663))},13663:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>el});var s=a(95155),r=a(73321),n=a(98500),l=a.n(n),i=a(12115),o=a(35497),d=a(57250),c=a(88105),m=a(70217);[{voice_id:"9BWtsMINqrJLrRacOk9x",name:"Aria",free:!1,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"CwhRBWXzGAHq8TQ4Fs17",name:"Roger",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"EXAVITQu4vr4xnSDxMaL",name:"Sarah",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"FGY2WhTYpPnrIDTdsKH5",name:"Laura",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"IKne3meq5aSn9XLyUdCD",name:"Charlie",free:!0,labels:{gender:"male",accent:"australian",language:"en"}},{voice_id:"JBFqnCBsd6RMkjVDRZzb",name:"George",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"N2lVS1w4EtoT3dr4eOWO",name:"Callum",free:!0,labels:{gender:"male",accent:"transatlantic",language:"en"}},{voice_id:"SAz9YHcvj6GT2YYXdXww",name:"River",free:!0,labels:{gender:"neutral",accent:"american",language:"en"}},{voice_id:"TX3LPaxmHKxFdv7VOQHJ",name:"Liam",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"XB0fDUnXU5powFXDhCwa",name:"Charlotte",free:!1,labels:{gender:"female",accent:"swedish",language:"en"}},{voice_id:"Xb7hH8MSUJpSbSDYk0k2",name:"Alice",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"XrExE9yKIg1WjnnlVkGX",name:"Matilda",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"bIHbv24MWmeRgasZH58o",name:"Will",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"cgSgspJ2msm6clMCkdW9",name:"Jessica",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"cjVigY5qzO86Huf0OWal",name:"Eric",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"iP95p4xoKVk53GoZ742B",name:"Chris",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"nPczCjzI2devNBz1zQrb",name:"Brian",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"onwK4e9ZLuTAKqWW03F9",name:"Daniel",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"pFZP5JQG7iQjIQuC4Bku",name:"Lily",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"pqHfZKP75CvOlQylNhV4",name:"Bill",free:!0,labels:{gender:"male",accent:"american",language:"en"}}].map(e=>({...e,category:"premade",lang:e.labels.language,free_users_allowed:e.free}));let u="tts-generated",p={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices",defaultVoiceId:"pNInz6obpgDQGcFmaJgB"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0},"xiaomi-mimo":{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!1,hasStyleInput:!0,hasLanguageHint:!0,languageOptions:["Chinese","English"],voiceSource:"hardcoded",modelKey:"xiaomi-mimo-tts-models",voicesPerModel:!0}};var x=a(14051),h=a.n(x),g=a(78177),b=a(64827);function f({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}f.propTypes={until:h().string.isRequired};let y=e=>Number(e||0).toLocaleString();function v({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:n,onMoveUp:l,onMoveDown:d,onToggleActive:p,onUpdateProxy:x,onEdit:h,onDelete:j,onClearError:w}){let[N,k]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),[$,A]=(0,i.useState)(!1),[E,P]=(0,i.useState)(null),[I,_]=(0,i.useState)(!1),T=(0,i.useRef)(null);(0,i.useEffect)(()=>{let t=()=>_(!!e.lastError&&!1!==e.isActive&&!!e.lastErrorAt&&Date.now()-new Date(e.lastErrorAt).getTime()<6e5);if(t(),!e.lastError||!e.lastErrorAt)return;let a=6e5-(Date.now()-new Date(e.lastErrorAt).getTime());if(a<=0)return;let s=setTimeout(t,a);return()=>clearTimeout(s)},[e.lastError,e.lastErrorAt,e.isActive]),(0,i.useEffect)(()=>{if(a||!1===e.isActive||!c.jO.includes(e.provider))return;let t=!1,s=null,r=0,n=()=>{document.hidden||(r=Date.now(),fetch(`/api/usage/${e.id}`).then(e=>e.ok?e.json():null).then(e=>{if(t||!e?.quotas)return;let a=Object.entries(e.quotas)[0];a&&P({label:a[1]?.displayName||a[0],...a[1]})}).catch(()=>{}))};n();let l=()=>{!document.hidden&&Date.now()-r>6e4&&n()},i=t=>{t?.detail?.provider&&t.detail.provider!==e.provider||(clearTimeout(s),s=setTimeout(n,1500))};return document.addEventListener("visibilitychange",l),window.addEventListener(u,i),()=>{t=!0,clearTimeout(s),document.removeEventListener("visibilitychange",l),window.removeEventListener(u,i)}},[e.id,e.provider,a,e.isActive]);let R=new Map((t||[]).map(e=>[e.id,e])),L=e.providerSpecificData?.proxyPoolId||null,O=L?R.get(L):null,M=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,D=!!L||M,B=O?`Pool: ${O.name}`:L?`Pool: ${L} (inactive/missing)`:M?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",U="",K=O?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(K)try{let e=new URL(K);U=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{U=K}let F=O?.noProxy||e.providerSpecificData?.connectionNoProxy||"",q=O?.isActive===!0?"success":L||M?"error":"default",z=(0,b.kJ)(e);(0,i.useEffect)(()=>{let t=()=>{A(!!(0,b.kJ)(e))};t();let a=z?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[z]),(0,i.useEffect)(()=>{if(!N)return;let e=e=>{T.current&&!T.current.contains(e.target)&&k(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N]);let J="unavailable"!==e.testStatus||$?e.testStatus:"active",V=(0,g.XD)(e),H=a?e.name||e.email||e.displayName||"OAuth Account":e.name,W=async e=>{C(!0);try{await x("__none__"===e?null:e)}finally{C(!1),k(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:H}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(o.Ex,{variant:(0,m.g)(e.isActive,J),size:"sm",dot:!0,children:!1===e.isActive?"disabled":J||"Unknown"}),D&&(0,s.jsx)(o.Ex,{variant:q,size:"sm",children:"Proxy"}),$&&!1!==e.isActive&&(0,s.jsx)(f,{until:z}),V.paused&&!1!==e.isActive&&(0,s.jsx)(o.Ex,{variant:"warning",size:"sm",children:"Paused (quota)"}),I&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 max-w-[320px]",children:[(0,s.jsx)("span",{className:"text-xs text-red-500 truncate",title:e.lastError,children:e.lastError}),(0,s.jsx)("button",{type:"button",onClick:w,title:"Dismiss this error",className:"shrink-0 text-red-400 hover:text-red-600 transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),E&&(0,s.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",title:E.resetAt?`Reset: ${new Date(E.resetAt).toLocaleString()}`:void 0,children:[!E.unlimited&&E.total>0&&(0,s.jsx)("div",{className:"h-1.5 w-24 rounded-full bg-black/10 dark:bg-white/10 overflow-hidden shrink-0",children:(0,s.jsx)("div",{className:`h-full ${E.remainingPercentage<=10?"bg-red-500":E.remainingPercentage<=30?"bg-amber-500":"bg-primary"}`,style:{width:`${E.remainingPercentage}%`}})}),(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:[E.unlimited?"Credits: Unlimited":(0,s.jsxs)(s.Fragment,{children:[y(E.remaining)," / ",y(E.total)," ","credits left"]}),E.resetAt&&(0,s.jsxs)("span",{className:"text-text-muted/70",children:[" \xb7 ","resets"," ",new Date(E.resetAt).toLocaleDateString()]})]})]}),D&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:B,children:B}),U&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:U}),F&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:F,children:["no_proxy: ",F]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:T,children:[(0,s.jsxs)("button",{onClick:()=>k(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${D?"text-primary":"text-text-muted hover:text-primary"}`,disabled:S,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:S?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),N&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>W("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!L?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>W(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${L===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:j,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(o.lM,{size:"sm",checked:e.isActive??!0,onChange:p,title:e.isActive??!0?"Disable":"Enable"})]})]})}function j({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:n,onClose:l}){let d="__none__",[c,m]=(0,i.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,p]=(0,i.useState)(!1),[x,h]=(0,i.useState)(null),[g,b]=(0,i.useState)(!1),f=async()=>{p(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),a=await e.json();h(a.valid?"success":"failed")}catch{h("failed")}finally{p(!1)}},y=async()=>{if(t&&c.apiKey){b(!0);try{let e=!1;try{p(!0),h(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await a.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{p(!1)}await n({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{b(!1)}}};return t?(0,s.jsx)(o.aF,{isOpen:e,title:`Add ${a||t} API Key`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(o.$n,{onClick:f,disabled:!c.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),x&&(0,s.jsx)(o.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(o.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:y,fullWidth:!0,disabled:!c.name||!c.apiKey||g,children:g?"Saving...":"Save"}),(0,s.jsx)(o.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({providerId:e,isOAuth:t}){let[a,r]=(0,i.useState)([]),[n,l]=(0,i.useState)([]),[d,c]=(0,i.useState)(!0),[m,u]=(0,i.useState)(!1),[p,x]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),[b,f]=(0,i.useState)(null),[y,N]=(0,i.useState)("1"),[k,S]=(0,i.useState)(null),C=(0,i.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),n=await t.json(),i=await a.json(),o=s.ok?await s.json():{};t.ok&&r((n.connections||[]).filter(t=>t.provider===e)),a.ok&&l(i.proxyPools||[]);let d=(o.providerStrategies||{})[e]||{};f(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,i.useEffect)(()=>{C()},[C]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},n={};t&&(n.fallbackStrategy=t),"round-robin"===t&&""!==a&&(n.stickyRoundRobinLimit=Number(a)||3);let l={...r};0===Object.keys(n).length?delete l[e]:l[e]=n,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("saveStrategy error:",e)}},A=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(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{await C()}},E=async e=>{S({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{S(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},P=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},I=async e=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({lastError:null,lastErrorAt:null})})).ok&&r(t=>t.map(t=>t.id===e?{...t,lastError:null,lastErrorAt:null}:t))}catch(e){console.log("clear error:",e)}},_=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},T=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await C(),u(!1))}catch(e){console.log("save apikey error:",e)}},R=async e=>{try{(await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await C(),x(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(o.Zp,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(o.lM,{checked:"round-robin"===b,onChange:e=>{let t=e?"round-robin":null;f(t),e&&!y&&N("1"),$(t,e?y||"1":y)}}),"round-robin"===b&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:y,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:a.map((e,r)=>(0,s.jsx)(v,{connection:e,proxyPools:n,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>A(r,r-1),onMoveDown:()=>A(r,r+1),onToggleActive:t=>P(e.id,t),onUpdateProxy:t=>_(e.id,t),onEdit:()=>{g(e),x(!0)},onDelete:()=>E(e.id),onClearError:()=>I(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,s.jsx)(j,{isOpen:m,provider:e,proxyPools:n,onSave:T,onClose:()=>u(!1)}),(0,s.jsx)(o.wI,{isOpen:p,connection:h,proxyPools:n,onSave:R,onClose:()=>x(!1)}),(0,s.jsx)(o.uo,{isOpen:!!k,onClose:()=>S(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}v.propTypes={connection:h().shape({id:h().string,name:h().string,email:h().string,displayName:h().string,testStatus:h().string,isActive:h().bool,lastError:h().string,priority:h().number}).isRequired,proxyPools:h().array,isOAuth:h().bool.isRequired,isFirst:h().bool.isRequired,isLast:h().bool.isRequired,onMoveUp:h().func.isRequired,onMoveDown:h().func.isRequired,onToggleActive:h().func.isRequired,onUpdateProxy:h().func,onEdit:h().func.isRequired,onDelete:h().func.isRequired,onClearError:h().func},j.propTypes={isOpen:h().bool.isRequired,provider:h().string,providerName:h().string,proxyPools:h().array,onSave:h().func.isRequired,onClose:h().func.isRequired},w.propTypes={providerId:h().string.isRequired,isOAuth:h().bool};var N=a(28777),k=a(11059);function S({model:e,fullModel:t,copied:a,onCopy:r,testStatus:n,isCustom:l,isFree:i,onDeleteAlias:o,onTest:d,isTesting:c}){let m="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.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"})]}),i&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),l&&(0,s.jsx)("button",{onClick:o,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function C({isOpen:e,onSave:t,onClose:a}){let[r,n]=(0,i.useState)(""),l=()=>{r.trim()&&(t(r.trim()),n(""))};return(0,s.jsx)(o.aF,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&l(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:l,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(o.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function $({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:n}=(0,k.C)(),[l,d]=(0,i.useState)({}),[m,u]=(0,i.useState)([]),[p,x]=(0,i.useState)({}),[h,g]=(0,i.useState)(()=>new Set),[b,f]=(0,i.useState)(""),[y,v]=(0,i.useState)(!1),j=a||(0,c.wG)(e),w=t||"llm",A=(0,i.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),a=await e.json(),s=await t.json();e.ok&&d(a.aliases||{}),t.ok&&u(s.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,i.useEffect)(()=>{A()},[A]);let E=async(e,t)=>{let a=`${j}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await A()}catch(e){console.log("set alias error:",e)}},P=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await A()}catch(e){console.log("delete alias error:",e)}},I=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:j,id:e,type:w})})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},_=async e=>{try{let t=new URLSearchParams({providerAlias:j,id:e,type:w});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},T=async e=>{if(!h.has(e)){g(t=>new Set(t).add(e));try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${j}/${e}`,kind:t})}),s=await a.json();x(t=>({...t,[e]:s.ok?"ok":"error"})),f(s.ok?"":s.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),f("Network error")}finally{g(t=>{let a=new Set(t);return a.delete(e),a})}}},R=(0,N.KC)(e),L=t?R.filter(e=>e.kinds?e.kinds.includes(t):(0,N.CP)(e,"llm")===t):R,O=m.filter(e=>e.providerAlias===j&&(0,N.CP)(e,"llm")===w&&!L.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),b&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:b}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[L.map(e=>{let t=`${j}/${e.id}`,a=Object.entries(l).find(([,e])=>e===t)?.[0];return(0,s.jsx)(S,{model:e,fullModel:`${j}/${e.id}`,alias:a,copied:r,onCopy:n,onSetAlias:t=>E(e.id,t),onDeleteAlias:()=>P(a),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h.has(e.id),isFree:e.isFree},e.id)}),O.map(e=>(0,s.jsx)(S,{model:{id:e.id,name:e.name},fullModel:`${j}/${e.id}`,copied:r,onCopy:n,onSetAlias:()=>{},onDeleteAlias:()=>_(e.id),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h.has(e.id),isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(C,{isOpen:y,onSave:async e=>{await I(e),v(!1)},onClose:()=>v(!1)})]})}function A({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}S.propTypes={model:h().shape({id:h().string.isRequired}).isRequired,fullModel:h().string.isRequired,copied:h().string,onCopy:h().func.isRequired,testStatus:h().oneOf(["ok","error"]),isCustom:h().bool,isFree:h().bool,onDeleteAlias:h().func,onTest:h().func,isTesting:h().bool},C.propTypes={isOpen:h().bool.isRequired,onSave:h().func.isRequired,onClose:h().func.isRequired},$.propTypes={providerId:h().string.isRequired,kindFilter:h().string,providerAliasOverride:h().string};let E={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{1389:(e,t,a)=>{Promise.resolve().then(a.bind(a,13663))},13663:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>el});var s=a(95155),r=a(73321),n=a(98500),l=a.n(n),i=a(12115),o=a(35497),d=a(57250),c=a(88105),m=a(70217);[{voice_id:"9BWtsMINqrJLrRacOk9x",name:"Aria",free:!1,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"CwhRBWXzGAHq8TQ4Fs17",name:"Roger",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"EXAVITQu4vr4xnSDxMaL",name:"Sarah",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"FGY2WhTYpPnrIDTdsKH5",name:"Laura",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"IKne3meq5aSn9XLyUdCD",name:"Charlie",free:!0,labels:{gender:"male",accent:"australian",language:"en"}},{voice_id:"JBFqnCBsd6RMkjVDRZzb",name:"George",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"N2lVS1w4EtoT3dr4eOWO",name:"Callum",free:!0,labels:{gender:"male",accent:"transatlantic",language:"en"}},{voice_id:"SAz9YHcvj6GT2YYXdXww",name:"River",free:!0,labels:{gender:"neutral",accent:"american",language:"en"}},{voice_id:"TX3LPaxmHKxFdv7VOQHJ",name:"Liam",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"XB0fDUnXU5powFXDhCwa",name:"Charlotte",free:!1,labels:{gender:"female",accent:"swedish",language:"en"}},{voice_id:"Xb7hH8MSUJpSbSDYk0k2",name:"Alice",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"XrExE9yKIg1WjnnlVkGX",name:"Matilda",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"bIHbv24MWmeRgasZH58o",name:"Will",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"cgSgspJ2msm6clMCkdW9",name:"Jessica",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"cjVigY5qzO86Huf0OWal",name:"Eric",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"iP95p4xoKVk53GoZ742B",name:"Chris",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"nPczCjzI2devNBz1zQrb",name:"Brian",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"onwK4e9ZLuTAKqWW03F9",name:"Daniel",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"pFZP5JQG7iQjIQuC4Bku",name:"Lily",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"pqHfZKP75CvOlQylNhV4",name:"Bill",free:!0,labels:{gender:"male",accent:"american",language:"en"}}].map(e=>({...e,category:"premade",lang:e.labels.language,free_users_allowed:e.free}));let u="tts-generated",p={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices",defaultVoiceId:"pNInz6obpgDQGcFmaJgB"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0},"xiaomi-mimo":{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!1,hasStyleInput:!0,hasLanguageHint:!0,languageOptions:["Chinese","English"],voiceSource:"hardcoded",modelKey:"xiaomi-mimo-tts-models",voicesPerModel:!0}};var x=a(14051),h=a.n(x),g=a(78177),b=a(64827);function f({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}f.propTypes={until:h().string.isRequired};let y=e=>Number(e||0).toLocaleString();function v({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:n,onMoveUp:l,onMoveDown:d,onToggleActive:p,onUpdateProxy:x,onEdit:h,onDelete:j,onClearError:w}){let[N,k]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),[$,A]=(0,i.useState)(!1),[E,P]=(0,i.useState)(null),[I,_]=(0,i.useState)(!1),T=(0,i.useRef)(null);(0,i.useEffect)(()=>{let t=()=>_(!!e.lastError&&!1!==e.isActive&&!!e.lastErrorAt&&Date.now()-new Date(e.lastErrorAt).getTime()<6e5);if(t(),!e.lastError||!e.lastErrorAt)return;let a=6e5-(Date.now()-new Date(e.lastErrorAt).getTime());if(a<=0)return;let s=setTimeout(t,a);return()=>clearTimeout(s)},[e.lastError,e.lastErrorAt,e.isActive]),(0,i.useEffect)(()=>{if(a||!1===e.isActive||!c.jO.includes(e.provider))return;let t=!1,s=null,r=0,n=()=>{document.hidden||(r=Date.now(),fetch(`/api/usage/${e.id}`).then(e=>e.ok?e.json():null).then(e=>{if(t||!e?.quotas)return;let a=Object.entries(e.quotas)[0];a&&P({label:a[1]?.displayName||a[0],...a[1]})}).catch(()=>{}))};n();let l=()=>{!document.hidden&&Date.now()-r>6e4&&n()},i=t=>{t?.detail?.provider&&t.detail.provider!==e.provider||(clearTimeout(s),s=setTimeout(n,1500))};return document.addEventListener("visibilitychange",l),window.addEventListener(u,i),()=>{t=!0,clearTimeout(s),document.removeEventListener("visibilitychange",l),window.removeEventListener(u,i)}},[e.id,e.provider,a,e.isActive]);let R=new Map((t||[]).map(e=>[e.id,e])),L=e.providerSpecificData?.proxyPoolId||null,O=L?R.get(L):null,M=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,D=!!L||M,B=O?`Pool: ${O.name}`:L?`Pool: ${L} (inactive/missing)`:M?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",U="",K=O?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(K)try{let e=new URL(K);U=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{U=K}let F=O?.noProxy||e.providerSpecificData?.connectionNoProxy||"",q=O?.isActive===!0?"success":L||M?"error":"default",z=(0,b.kJ)(e);(0,i.useEffect)(()=>{let t=()=>{A(!!(0,b.kJ)(e))};t();let a=z?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[z]),(0,i.useEffect)(()=>{if(!N)return;let e=e=>{T.current&&!T.current.contains(e.target)&&k(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N]);let J="unavailable"!==e.testStatus||$?e.testStatus:"active",V=(0,g.XD)(e),H=a?e.name||e.email||e.displayName||"OAuth Account":e.name,W=async e=>{C(!0);try{await x("__none__"===e?null:e)}finally{C(!1),k(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:H}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(o.Ex,{variant:(0,m.g)(e.isActive,J),size:"sm",dot:!0,children:!1===e.isActive?"disabled":J||"Unknown"}),D&&(0,s.jsx)(o.Ex,{variant:q,size:"sm",children:"Proxy"}),$&&!1!==e.isActive&&(0,s.jsx)(f,{until:z}),V.paused&&!1!==e.isActive&&(0,s.jsx)(o.Ex,{variant:"warning",size:"sm",children:"Paused (quota)"}),I&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 max-w-[320px]",children:[(0,s.jsx)("span",{className:"text-xs text-red-500 truncate",title:e.lastError,children:e.lastError}),(0,s.jsx)("button",{type:"button",onClick:w,title:"Dismiss this error",className:"shrink-0 text-red-400 hover:text-red-600 transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),E&&(0,s.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",title:E.resetAt?`Reset: ${new Date(E.resetAt).toLocaleString()}`:void 0,children:[!E.unlimited&&E.total>0&&(0,s.jsx)("div",{className:"h-1.5 w-24 rounded-full bg-black/10 dark:bg-white/10 overflow-hidden shrink-0",children:(0,s.jsx)("div",{className:`h-full ${E.remainingPercentage<=10?"bg-red-500":E.remainingPercentage<=30?"bg-amber-500":"bg-primary"}`,style:{width:`${E.remainingPercentage}%`}})}),(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:[E.unlimited?"Credits: Unlimited":(0,s.jsxs)(s.Fragment,{children:[y(E.remaining)," / ",y(E.total)," ","credits left"]}),E.resetAt&&(0,s.jsxs)("span",{className:"text-text-muted/70",children:[" \xb7 ","resets"," ",new Date(E.resetAt).toLocaleDateString()]})]})]}),D&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:B,children:B}),U&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:U}),F&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:F,children:["no_proxy: ",F]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:T,children:[(0,s.jsxs)("button",{onClick:()=>k(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${D?"text-primary":"text-text-muted hover:text-primary"}`,disabled:S,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:S?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),N&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>W("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!L?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>W(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${L===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:j,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(o.lM,{size:"sm",checked:e.isActive??!0,onChange:p,title:e.isActive??!0?"Disable":"Enable"})]})]})}function j({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:n,onClose:l}){let d="__none__",c=()=>({name:"",apiKey:"",cx:"",priority:1,proxyPoolId:d}),[m,u]=(0,i.useState)(c),[p,x]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),[b,f]=(0,i.useState)(!1),y="google-pse"===t,v=y&&!m.cx.trim(),w=y?{cx:m.cx.trim()}:void 0,N=()=>{u(c()),g(null),l()},k=async()=>{if(!v){x(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:m.apiKey,providerSpecificData:w})}),a=await e.json();g(a.valid?"success":"failed")}catch{g("failed")}finally{x(!1)}}},S=async()=>{if(t&&m.apiKey&&!v){f(!0);try{let e=!1;try{x(!0),g(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:m.apiKey,providerSpecificData:w})});e=!!(await a.json()).valid,g(e?"success":"failed")}catch{g("failed")}finally{x(!1)}await n({providerSpecificData:w,name:m.name,apiKey:m.apiKey,priority:m.priority,proxyPoolId:m.proxyPoolId===d?null:m.proxyPoolId,testStatus:e?"active":"unknown"})&&N()}finally{f(!1)}}};return t?(0,s.jsx)(o.aF,{isOpen:e,title:`Add ${a||t} API Key`,onClose:N,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:m.name,onChange:e=>u({...m,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:m.apiKey,onChange:e=>u({...m,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(o.$n,{onClick:k,disabled:!m.apiKey||v||p||b,variant:"secondary",children:p?"Checking...":"Check"})})]}),y&&(0,s.jsx)(o.pd,{label:"Search Engine ID (cx)",value:m.cx,onChange:e=>{u({...m,cx:e.target.value}),g(null)},hint:"Find this in your Google Programmable Search Engine control panel."}),h&&(0,s.jsx)(o.Ex,{variant:"success"===h?"success":"error",children:"success"===h?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:m.priority,onChange:e=>u({...m,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(o.l6,{label:"Proxy Pool",value:m.proxyPoolId,onChange:e=>u({...m,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:S,fullWidth:!0,disabled:!m.name||!m.apiKey||v||b,children:b?"Saving...":"Save"}),(0,s.jsx)(o.$n,{onClick:N,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({providerId:e,isOAuth:t}){let[a,r]=(0,i.useState)([]),[n,l]=(0,i.useState)([]),[d,c]=(0,i.useState)(!0),[m,u]=(0,i.useState)(!1),[p,x]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),[b,f]=(0,i.useState)(null),[y,N]=(0,i.useState)("1"),[k,S]=(0,i.useState)(null),C=(0,i.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),n=await t.json(),i=await a.json(),o=s.ok?await s.json():{};t.ok&&r((n.connections||[]).filter(t=>t.provider===e)),a.ok&&l(i.proxyPools||[]);let d=(o.providerStrategies||{})[e]||{};f(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,i.useEffect)(()=>{C()},[C]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},n={};t&&(n.fallbackStrategy=t),"round-robin"===t&&""!==a&&(n.stickyRoundRobinLimit=Number(a)||3);let l={...r};0===Object.keys(n).length?delete l[e]:l[e]=n,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("saveStrategy error:",e)}},A=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(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{await C()}},E=async e=>{S({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{S(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},P=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},I=async e=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({lastError:null,lastErrorAt:null})})).ok&&r(t=>t.map(t=>t.id===e?{...t,lastError:null,lastErrorAt:null}:t))}catch(e){console.log("clear error:",e)}},_=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},T=async t=>{try{if((await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok)return await C(),!0}catch(e){console.log("save apikey error:",e)}return!1},R=async e=>{try{(await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await C(),x(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(o.Zp,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(o.lM,{checked:"round-robin"===b,onChange:e=>{let t=e?"round-robin":null;f(t),e&&!y&&N("1"),$(t,e?y||"1":y)}}),"round-robin"===b&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:y,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:a.map((e,r)=>(0,s.jsx)(v,{connection:e,proxyPools:n,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>A(r,r-1),onMoveDown:()=>A(r,r+1),onToggleActive:t=>P(e.id,t),onUpdateProxy:t=>_(e.id,t),onEdit:()=>{g(e),x(!0)},onDelete:()=>E(e.id),onClearError:()=>I(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,s.jsx)(j,{isOpen:m,provider:e,proxyPools:n,onSave:T,onClose:()=>u(!1)}),(0,s.jsx)(o.wI,{isOpen:p,connection:h,proxyPools:n,onSave:R,onClose:()=>x(!1)}),(0,s.jsx)(o.uo,{isOpen:!!k,onClose:()=>S(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}v.propTypes={connection:h().shape({id:h().string,name:h().string,email:h().string,displayName:h().string,testStatus:h().string,isActive:h().bool,lastError:h().string,priority:h().number}).isRequired,proxyPools:h().array,isOAuth:h().bool.isRequired,isFirst:h().bool.isRequired,isLast:h().bool.isRequired,onMoveUp:h().func.isRequired,onMoveDown:h().func.isRequired,onToggleActive:h().func.isRequired,onUpdateProxy:h().func,onEdit:h().func.isRequired,onDelete:h().func.isRequired,onClearError:h().func},j.propTypes={isOpen:h().bool.isRequired,provider:h().string,providerName:h().string,proxyPools:h().array,onSave:h().func.isRequired,onClose:h().func.isRequired},w.propTypes={providerId:h().string.isRequired,isOAuth:h().bool};var N=a(28777),k=a(11059);function S({model:e,fullModel:t,copied:a,onCopy:r,testStatus:n,isCustom:l,isFree:i,onDeleteAlias:o,onTest:d,isTesting:c}){let m="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.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"})]}),i&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),l&&(0,s.jsx)("button",{onClick:o,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function C({isOpen:e,onSave:t,onClose:a}){let[r,n]=(0,i.useState)(""),l=()=>{r.trim()&&(t(r.trim()),n(""))};return(0,s.jsx)(o.aF,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&l(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:l,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(o.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function $({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:n}=(0,k.C)(),[l,d]=(0,i.useState)({}),[m,u]=(0,i.useState)([]),[p,x]=(0,i.useState)({}),[h,g]=(0,i.useState)(()=>new Set),[b,f]=(0,i.useState)(""),[y,v]=(0,i.useState)(!1),j=a||(0,c.wG)(e),w=t||"llm",A=(0,i.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),a=await e.json(),s=await t.json();e.ok&&d(a.aliases||{}),t.ok&&u(s.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,i.useEffect)(()=>{A()},[A]);let E=async(e,t)=>{let a=`${j}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await A()}catch(e){console.log("set alias error:",e)}},P=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await A()}catch(e){console.log("delete alias error:",e)}},I=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:j,id:e,type:w})})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},_=async e=>{try{let t=new URLSearchParams({providerAlias:j,id:e,type:w});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},T=async e=>{if(!h.has(e)){g(t=>new Set(t).add(e));try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${j}/${e}`,kind:t})}),s=await a.json();x(t=>({...t,[e]:s.ok?"ok":"error"})),f(s.ok?"":s.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),f("Network error")}finally{g(t=>{let a=new Set(t);return a.delete(e),a})}}},R=(0,N.KC)(e),L=t?R.filter(e=>e.kinds?e.kinds.includes(t):(0,N.CP)(e,"llm")===t):R,O=m.filter(e=>e.providerAlias===j&&(0,N.CP)(e,"llm")===w&&!L.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),b&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:b}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[L.map(e=>{let t=`${j}/${e.id}`,a=Object.entries(l).find(([,e])=>e===t)?.[0];return(0,s.jsx)(S,{model:e,fullModel:`${j}/${e.id}`,alias:a,copied:r,onCopy:n,onSetAlias:t=>E(e.id,t),onDeleteAlias:()=>P(a),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h.has(e.id),isFree:e.isFree},e.id)}),O.map(e=>(0,s.jsx)(S,{model:{id:e.id,name:e.name},fullModel:`${j}/${e.id}`,copied:r,onCopy:n,onSetAlias:()=>{},onDeleteAlias:()=>_(e.id),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h.has(e.id),isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(C,{isOpen:y,onSave:async e=>{await I(e),v(!1)},onClose:()=>v(!1)})]})}function A({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}S.propTypes={model:h().shape({id:h().string.isRequired}).isRequired,fullModel:h().string.isRequired,copied:h().string,onCopy:h().func.isRequired,testStatus:h().oneOf(["ok","error"]),isCustom:h().bool,isFree:h().bool,onDeleteAlias:h().func,onTest:h().func,isTesting:h().bool},C.propTypes={isOpen:h().bool.isRequired,onSave:h().func.isRequired,onClose:h().func.isRequired},$.propTypes={providerId:h().string.isRequired,kindFilter:h().string,providerAliasOverride:h().string};let E={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
2
2
  "results": [
3
3
  { "title": "...", "url": "...", "snippet": "..." }
4
4
  ]
@@ -0,0 +1,27 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{64827:(e,t,a)=>{"use strict";function i(e){if(!e)return null;let t=null,a=Date.now();for(let[i,s]of Object.entries(e)){if(!i.startsWith("modelLock_")||!s)continue;let e=new Date(s).getTime();e<=a||(!t||e<t)&&(t=e)}return t?new Date(t).toISOString():null}a.d(t,{kJ:()=>i}),a(10904)},70217:(e,t,a)=>{"use strict";function i(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>i})},79355:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>er});var i=a(95155),s=a(12115),l=a(73321),r=a(98500),n=a.n(r),o=a(5772),d=a(8247),c=a(35497),m=a(88105),p=a(28777),u=a(57151),x=a(47224),h=a(40228);let f=["none","low","medium","high"],g=["none","thinking"],y=["none","low","medium","high","max"],b=["none","low","medium","high","xhigh","max"],v=["none","low","medium","high","xhigh","max"],j={qoder:v,openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":y,"claude-budget":v,"gemini-level":["minimal","low","medium","high"],"gemini-budget":f,zai:g,qwen:f,kimi:y,opencode:y,deepseek:["none","high","max"],minimax:g,hunyuan:f,step:f,nous:f,meta:["minimal","low","medium","high","xhigh"],ollama:y},w=["none","minimal","low","medium","high","xhigh","max"],k=[{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"claude",pattern:"claude-opus-5*",levels:b},{provider:"claude",pattern:"claude-opus-4-7*",levels:b},{provider:"claude",pattern:"claude-opus-4-8*",levels:b},{provider:"claude",pattern:"claude-sonnet-5*",levels:b},{provider:"claude",pattern:"claude-fable-5*",levels:b},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{providers:["openai","codex"],pattern:"*gpt-5.6*",levels:["none","minimal","low","medium","high","xhigh","max","ultra"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"ollama",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"ollama-local",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{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"]}];function N(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 a=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!a)return null;let[,i,s]=a,l=Number(i),r=void 0===s?null:Number(s);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let a=(0,u.nl)(e,t);if(!a.reasoning)return null;let i=k.find(a=>(!a.providers||!e||a.providers.includes(e))&&(!a.provider||a.provider===e)&&(0,x.gH)(a.pattern,t)),s=(e?h.xq[e]?.thinkingFormat:null)||a.thinkingFormat,l=a.thinkingLevels||i?.levels||j[s]||f;return!1===a.thinkingCanDisable&&(l=l.filter(e=>"none"!==e)),l}var C=a(11059),S=a(929),A=a(73006);let T=new Map;async function $(e){if(e?.type==="static")return e.models||[];if(!e?.url||!e?.type)return[];let t=T.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),a=await fetch(`/api/providers/suggested-models?${t}`);if(!a.ok)return[];let i=(await a.json()).data??[];return T.set(e.url,{data:i,expiresAt:Date.now()+6e5}),i}catch{return[]}}function O({customModels:e=[],modelAliases:t={},providerAlias:a,builtInModels:i=[],type:s="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!==a)continue;let e=t?.kind||t?.type||"llm";if(s&&e!==s||r.has(t.id))continue;let i=`${a}/${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=`${a}/`;for(let[e,a]of Object.entries(t||{})){if("string"!=typeof a||!a.startsWith(d))continue;let t=a.slice(d.length);!t||r.has(t)||n.has(a)||(n.add(a),o.push({id:t,alias:e,fullModel:a,source:"legacyAlias",type:s||"llm"}))}return o}var P=a(14051),I=a.n(P);function E({model:e,fullModel:t,alias:a,copied:s,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":"slow"===r||"rate_limited"===r?"#f59e0b":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":"slow"===r||"rate_limited"===r?"border-amber-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":"slow"===r||"rate_limited"===r?"warning":"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:s===`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:s===`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 R({modelId:e,fullModel:t,copied:a,onCopy:s,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:()=>s(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:a===`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:a===`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:a,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u,onTestModel:x,externalTestResults:h,externalTestingModelIds:f,disabledModelIds:g=[]}){let y,b,[v,j]=(0,s.useState)(""),[w,k]=(0,s.useState)(!1),[N,C]=(0,s.useState)(!1),[S,A]=(0,s.useState)([]),[T,$]=(0,s.useState)(()=>new Set),[P,I]=(0,s.useState)({});(0,s.useEffect)(()=>{let e=p.find(e=>!1!==e.isActive);if(!e)return;let t=!1;return(async()=>{try{let a=await fetch(`/api/providers/${e.id}/models`);if(!a.ok)return;let i=await a.json();if(t)return;let s=(i.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(s)])}catch{}})(),()=>{t=!0}},[p]);let E=async t=>{if(x)return void await x(t);if(!T.has(t)){$(e=>new Set(e).add(t));try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),i=await a.json();I(e=>({...e,[t]:i.ok?"ok":"error"}))}catch{I(e=>({...e,[t]:"error"}))}finally{$(e=>{let a=new Set(e);return a.delete(t),a})}}},_=O({customModels:l,modelAliases:a,providerAlias:e,type:"llm"}),U=_.filter(e=>!g.includes(e.id)),q=async()=>{if(!v.trim()||w)return;let e=v.trim();if(_.some(t=>t.id===e))return void alert("Model already exists for this provider.");k(!0);try{await d(e),j("")}catch(e){console.log("Error adding model:",e)}finally{k(!1)}},z=async()=>{if(N)return;let e=p.find(e=>!1!==e.isActive);if(e){C(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||"Failed to fetch models");let i=(a.models||[]).map(e=>e.id||e.name||e.model).filter(e=>"string"==typeof e&&""!==e.trim());A([...new Set(i)])}catch(e){console.log("Error fetching models:",e)}finally{C(!1)}}},M=async e=>{_.some(t=>t.id===e)||(await d(e),A(t=>t.filter(t=>t!==e)))},J=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 discover 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:v,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&q(),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:q,disabled:!v.trim()||w,children:w?"Adding...":"Add"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"search",onClick:z,disabled:!J||N,children:N?"Fetching...":"Fetch /models"})]}),!J&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to discover models from /models."}),U.length>0&&(0,i.jsx)("div",{className:"flex flex-col gap-3",children:U.map(({id:a,alias:s,source:l})=>(0,i.jsx)(R,{modelId:a,fullModel:`${t}/${a}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(a):o(s),onTest:p.length>0?()=>E(a):void 0,testStatus:h?.[a]||P[a],isTesting:f?.has(a)||T.has(a)},`${l}-${e}/${a}`))}),S.length>0&&(y=new Set(_.map(e=>e.id)),0===(b=S.filter(e=>!y.has(e))).length?null:(0,i.jsxs)("div",{className:"w-full mt-2",children:[(0,i.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Suggested models from /models (",b.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,i.jsxs)("button",{onClick:()=>M(e),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,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e]},e))})]}))]})}E.propTypes={model:I().shape({id:I().string.isRequired}).isRequired,fullModel:I().string.isRequired,alias:I().string,copied:I().string,onCopy:I().func.isRequired,testStatus:I().oneOf(["ok","error","slow","rate_limited","not_tested"]),isCustom:I().bool,isFree:I().bool,onDeleteAlias:I().func,onTest:I().func,isTesting:I().bool,onDisable:I().func,caps:I().object,thinkingSuffix:I().string},I().string.isRequired,I().string.isRequired,I().string,I().func.isRequired,I().func.isRequired,I().func,I().oneOf(["ok","error"]),I().bool,I().string.isRequired,I().object.isRequired,I().arrayOf(I().object),I().string,I().func.isRequired,I().func.isRequired,I().func.isRequired,I().func.isRequired,D.propTypes={providerStorageAlias:I().string.isRequired,providerDisplayAlias:I().string.isRequired,modelAliases:I().object.isRequired,customModels:I().arrayOf(I().object),copied:I().string,onCopy:I().func.isRequired,onDeleteAlias:I().func.isRequired,onAddCustomModel:I().func.isRequired,onDeleteCustomModel:I().func.isRequired,connections:I().arrayOf(I().shape({id:I().string,isActive:I().bool})).isRequired,isAnthropic:I().bool,onTestModel:I().func,externalTestResults:I().object,externalTestingModelIds:I().instanceOf(Set),disabledModelIds:I().arrayOf(I().string)};var _=a(70217);function U({until:e}){let[t,a]=(0,s.useState)("");return((0,s.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let i=Math.floor(t/1e3);if(i<60)a(`${i}s`);else if(i<3600)a(`${Math.floor(i/60)}m ${i%60}s`);else{let e=Math.floor(i/3600),t=Math.floor(i%3600/60);a(`${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}U.propTypes={until:I().string.isRequired};var q=a(64827);let z=["invalid_grant","refresh_token_expired","reauth_required","unrecoverable_refresh_error","refresh_token_reused","refresh_token_invalidated"];function M(e){if(!e||"string"!=typeof e)return!1;let t=e.toLowerCase();return z.some(e=>t.includes(e))}function J({connection:e,plan:t=null,proxyPools:a,isOAuth:l,isFirst:r,isLast:n,onMoveUp:o,onMoveDown:d,onToggleActive:m,onUpdateProxy:p,onEdit:u,onDelete:x,onReconnect:h=null,oneByOneStatus:f=null,autoPing:g=null}){let[y,b]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),w=(0,s.useRef)(null),k=new Map((a||[]).map(e=>[e.id,e])),N=e.providerSpecificData?.proxyPoolId||null,C=N?k.get(N):null,S=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,A=!!N||S,T=C?`Pool: ${C.name}`:N?`Pool: ${N} (inactive/missing)`:S?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",$=g?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny request to an available model. 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.",O="";if(C?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=C?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);O=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{O=t}}let P=C?.noProxy||e.providerSpecificData?.connectionNoProxy||"",I="default";C?.isActive===!0?I="success":(N||S)&&(I="error"),(0,s.useEffect)(()=>{if(!y)return;let e=e=>{w.current&&!w.current.contains(e.target)&&b(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[y]);let E=async e=>{j(!0);try{await p("__none__"===e?null:e)}finally{j(!1),b(!1)}},R=e.authType||(l?"oauth":"apikey"),D="oauth"===R,z="cookie"===R,K=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(D?"OAuth Account":z?"Cookie Account":"API Key"),F=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,L=t?.trim(),H=e.providerSpecificData?.chatgptPlanType?.trim(),B="codex"===e.provider?L&&"unknown"!==L.toLowerCase()?L:H:null,[W,G]=(0,s.useState)(!1),Q=(0,q.kJ)(e);(0,s.useEffect)(()=>{let t=()=>{G(!!(0,q.kJ)(e))};t();let a=Q?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[Q]);let V="unavailable"!==e.testStatus||W?e.testStatus:"active",Z=(D||z)&&"unavailable"===e.testStatus&&function(e,t){if(401===e||403===e)return!0;if(!t||"string"!=typeof t)return!1;let a=t.toLowerCase();return a.includes("unauthorized")||a.includes("token")||a.includes("invalid api key")||a.includes("revoked")||a.includes("auth")||M(t)}(e.errorCode,e.lastError),X=M(e.lastError)?"Auth expired — reconnect required":e.lastError,Y=()=>f?"queued"===f.state?"queued":"testing"===f.state?"testing":"success"===f.state?"success":"failed"===f.state?f.error?`failed: ${f.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: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_up"})}),(0,i.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"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:z?"cookie":D?"lock":"key"}),(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-medium truncate",children:K}),F&&(0,i.jsx)("p",{className:"text-xs text-text-muted truncate",children:F}),(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,_.g)(e.isActive,V),size:"sm",dot:!0,children:!1===e.isActive?"disabled":V||"Unknown"}),(0,i.jsx)(c.Ex,{variant:"default",size:"sm",children:D?"OAuth":z?"Cookie":"API Key"}),B&&"unknown"!==B.toLowerCase()&&(0,i.jsx)(c.Ex,{variant:"primary",size:"sm",children:B}),A&&(0,i.jsx)(c.Ex,{variant:I,size:"sm",children:"Proxy"}),W&&!1!==e.isActive&&(0,i.jsx)(U,{until:Q}),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:X}),(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]}),Y()&&(0,i.jsx)(c.Ex,{variant:f?"success"===f.state?"success":"failed"===f.state?"error":"testing"===f.state?"primary":"default":"default",size:"sm",children:Y()})]}),A&&(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:T,children:T}),O&&(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:O}),P&&(0,i.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:P,children:["no_proxy: ",P]})]})]})]}),(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:[(a||[]).length>0&&(0,i.jsxs)("div",{className:"relative",ref:w,children:[(0,i.jsxs)("button",{onClick:()=>b(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 ${A?"text-primary":"text-text-muted hover:text-primary"}`,disabled:v,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:v?"progress_activity":"lan"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),y&&(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:()=>E("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!N?"text-primary font-medium":"text-text-main"}`,children:"None"}),(a||[]).map(e=>(0,i.jsx)("button",{onClick:()=>E(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${N===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),g&&(0,i.jsx)(c.m_,{text:$,children:(0,i.jsxs)("button",{onClick:()=>g.onToggle(!g.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 ${g.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"})]})}),Z&&h&&(0,i.jsxs)("button",{onClick:()=>h(e),className:"flex flex-col items-center rounded px-2 py-1 text-amber-600 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:bg-amber-500/20 transition-colors",title:"Reconnect account",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_reset"}),(0,i.jsx)("span",{className:"text-[10px] leading-tight font-semibold",children:"Reconnect"})]}),(0,i.jsxs)("button",{onClick:u,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:x,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:m,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}J.propTypes={connection:I().shape({id:I().string,name:I().string,email:I().string,displayName:I().string,modelLockUntil:I().string,testStatus:I().string,isActive:I().bool,lastError:I().string,priority:I().number,globalPriority:I().number}).isRequired,plan:I().string,proxyPools:I().arrayOf(I().shape({id:I().string,name:I().string,proxyUrl:I().string,noProxy:I().string,isActive:I().bool})),isOAuth:I().bool.isRequired,isFirst:I().bool.isRequired,isLast:I().bool.isRequired,onMoveUp:I().func.isRequired,onMoveDown:I().func.isRequired,onToggleActive:I().func.isRequired,onUpdateProxy:I().func,onEdit:I().func.isRequired,onDelete:I().func.isRequired,onReconnect:I().func,oneByOneStatus:I().shape({state:I().string,error:I().string}),autoPing:I().shape({on:I().bool,onToggle:I().func,provider:I().string})};let K=`name1|sk-key1
2
+ name2|sk-key2
3
+ sk-key-only-auto-named`,F="__none__",L=()=>({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:F,baseUrl:"",ollamaHostUrl:""}),H=()=>({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""});function B({isOpen:e,provider:t,providerName:a,isCompatible:l,isAnthropic:r,providerNode:n,authType:o,authHint:d,website:p,proxyPools:u,error:x,existingNames:h,onSave:f,onBulkDone:g,onClose:y}){let b="ollama-local"===t,v="cookie"===o,j="xai"===t&&!v,w=v?"Cookie Value":"qoder"===t?"Personal Access Token (PAT)":"API Key",k=m.Q2?.[t]?.baseUrlField||null,N="azure"===t,C="cloudflare-ai"===t,S="vertex"===t||"vertex-partner"===t,A=m.Q2?.[t]?.regions||null,T=m.Q2?.[t]?.defaultRegion||A?.[0]?.id||"",[$,O]=(0,s.useState)(L),[P,I]=(0,s.useState)(H),[E,R]=(0,s.useState)({accountId:""}),[D,_]=(0,s.useState)({location:"global",reasoningEffort:"high"}),[U,q]=(0,s.useState)(T),[z,M]=(0,s.useState)(!1),[J,W]=(0,s.useState)(null),[G,Q]=(0,s.useState)(!1),V=C?`name1|sk-key1|acc123456
4
+ name2|sk-key2|def789012
5
+ sk-key-only-auto-named`:"qoder"===t?`name1|pt-xxxxx
6
+ name2|pt-yyyyy
7
+ pt-only-auto-named`:K,[Z,X]=(0,s.useState)("single"),[Y,ee]=(0,s.useState)(""),[et,ea]=(0,s.useState)(null),ei=()=>{O(L()),I(H()),R({accountId:""}),_({location:"global",reasoningEffort:"high"}),q(T),W(null),X("single"),ee(""),ea(null),y()},es=()=>l&&n?{prefix:n.prefix,...n.apiType?{apiType:n.apiType}:{},baseUrl:n.baseUrl,nodeName:n.name,clientIdentityProfile:n.clientIdentityProfile||"default",clientIdentityHeaders:n.clientIdentityHeaders||{}}:S?{location:D.location||"global",reasoningEffort:D.reasoningEffort||"high"}:function({hasBaseUrlField:e=!1,baseUrl:t="",isAzure:a=!1,azureData:i=null,isCloudflareAi:s=!1,cloudflareData:l=null,region:r="",hasRegions:n=!1}={}){if(e){let e=String(t||"").trim();return e?{baseUrl:e}:void 0}return a?{azureEndpoint:i?.azureEndpoint,apiVersion:i?.apiVersion,deployment:i?.deployment,organization:i?.organization}:s?{accountId:l?.accountId}:n&&r?{region:r}:void 0}({hasBaseUrlField:!!k,baseUrl:$.baseUrl,isAzure:N,azureData:P,isCloudflareAi:C,cloudflareData:E,region:U,hasRegions:!!A}),el=async()=>{if(l&&!$.defaultModel.trim())return void W("failed");M(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,defaultModel:l?$.defaultModel.trim():void 0,providerSpecificData:es()})}),a=await e.json();W(a.valid?"success":"failed")}catch{W("failed")}finally{M(!1)}},er=async()=>{if(t&&(b||$.apiKey)&&(b||$.name)&&(!l||$.defaultModel.trim())){Q(!0);try{let e=!1;try{M(!0),W(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:$.apiKey,defaultModel:l?$.defaultModel.trim():void 0,providerSpecificData:es()})});e=!!(await a.json()).valid,W(e?"success":"failed")}catch{W("failed")}finally{M(!1)}await f({name:$.name||(b?"Ollama Local":""),apiKey:$.apiKey,defaultModel:l?$.defaultModel.trim():void 0,priority:$.priority,proxyPoolId:$.proxyPoolId===F?null:$.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:es()})&&ei()}finally{Q(!1)}}},en=async()=>{let e=Y.split("\n");if(!e.length)return;let a=function(e,t,a={}){let{isCloudflareAi:i=!1}=a,s=new Set((Array.isArray(t)?t:[]).map(e=>"string"==typeof e?e.toLowerCase():"")),l=[];for(let t of e){let e,a="string"==typeof t?t.trim():"";if(!a)continue;let r=function(e,t={}){let{isCloudflareAi:a=!1}=t,i=e.split("|");if(a&&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()}}(a,{isCloudflareAi:i});if(!r||!r.apiKey)continue;let n=r.baseName,o=1;for(;e=`${n} ${o}`,s.has(e.toLowerCase());)o+=1;s.add(e.toLowerCase());let d={name:e,apiKey:r.apiKey,skipped:!1};r.providerSpecificData&&(d.providerSpecificData=r.providerSpecificData),l.push(d)}return l}(e,h,{isCloudflareAi:C});if(!a.length)return;Q(!0),ea(null);let i=0,s=0;for(let e of a)try{let a=!1;try{let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e.apiKey})});a=!!(await i.json().catch(()=>({}))).valid}catch{a=!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:a?"active":"unknown",...e.providerSpecificData?{providerSpecificData:e.providerSpecificData}:{}})})).ok?i++:s++}catch{s++}Q(!1),ea({success:i,failed:s}),i>0&&g&&g()};return t?(0,i.jsx)(c.aF,{isOpen:e,title:`Add ${a||t} ${w}`,onClose:ei,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"===Z?"primary":"ghost",onClick:()=>{X("single"),ea(null)},children:"Single"}),(0,i.jsx)(c.$n,{size:"sm",variant:"bulk"===Z?"primary":"ghost",onClick:()=>{X("bulk"),ea(null)},children:"Bulk Add"})]}),"bulk"===Z&&(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:C?(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?(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:V,value:Y,onChange:e=>ee(e.target.value)}),et&&(0,i.jsxs)("div",{className:`text-sm font-medium ${et.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",et.success," added",et.failed>0?`, ✗ ${et.failed} failed`:""]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.$n,{onClick:en,fullWidth:!0,disabled:G||!Y.trim(),children:G?"Adding...":"Add All Keys"}),(0,i.jsx)(c.$n,{onClick:ei,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===Z&&(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"}),k&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:k.label,value:$.baseUrl,onChange:e=>O({...$,baseUrl:e.target.value}),placeholder:k.placeholder,hint:k.help,className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:el,disabled:z||G,variant:"secondary",children:z?"Checking...":"Check"})})]}),!b&&(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(c.pd,{label:w,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?"pt-...":"",className:"flex-1"}),(0,i.jsx)("div",{className:"pt-6",children:(0,i.jsx)(c.$n,{onClick:el,disabled:!$.apiKey||z||G,variant:"secondary",children:z?"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&&d&&(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:[d,p&&(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",p.replace(/^https?:\/\//,"")]})]})]}),A&&(0,i.jsx)(c.l6,{label:"Region",value:U,onChange:e=>q(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"}),x&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),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."}),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:"Cloudflare Workers AI"}),(0,i.jsx)(c.pd,{label:"Account ID",value:E.accountId,onChange:e=>R({...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"})]})]}),S&&(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:"Vertex AI Configuration"}),(0,i.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,i.jsx)(c.l6,{label:"Location",value:D.location,onChange:e=>_({...D,location:e.target.value}),options:[{value:"global",label:"global (recommended for Gemini 3.x)"},{value:"us-central1",label:"us-central1"},{value:"us-east4",label:"us-east4"},{value:"europe-west1",label:"europe-west1"},{value:"europe-west4",label:"europe-west4"},{value:"asia-east1",label:"asia-east1"},{value:"asia-northeast1",label:"asia-northeast1"}]}),(0,i.jsx)(c.l6,{label:"Reasoning Effort (default)",value:D.reasoningEffort,onChange:e=>_({...D,reasoningEffort:e.target.value}),options:[{value:"high",label:"high (32k tokens — default for Pro)"},{value:"medium",label:"medium (8k tokens)"},{value:"low",label:"low (1k tokens)"},{value:"",label:"none (let model decide)"}]}),(0,i.jsxs)("p",{className:"text-xs text-text-muted",children:["Location ",(0,i.jsx)("code",{children:"global"})," is required for Gemini 3.1 Pro Preview. Reasoning effort sets the default ",(0,i.jsx)("code",{children:"thinkingBudget"}),"; clients can override per-request via ",(0,i.jsx)("code",{children:"reasoning_effort"}),"."]})]})]}),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:"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:F,label:"None"},...(u||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(u||[]).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:er,fullWidth:!0,disabled:G||!b&&(!$.name||!$.apiKey)||l&&!$.defaultModel.trim()||N&&(!P.azureEndpoint||!P.deployment||!P.organization)||C&&!E.accountId,children:G?"Saving...":"Save"}),(0,i.jsx)(c.$n,{onClick:ei,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}B.propTypes={isOpen:I().bool.isRequired,provider:I().string,providerName:I().string,isCompatible:I().bool,isAnthropic:I().bool,providerNode:I().shape({name:I().string,prefix:I().string,apiType:I().string,baseUrl:I().string,clientIdentityProfile:I().string,clientIdentityHeaders:I().object}),authType:I().string,authHint:I().string,website:I().string,proxyPools:I().arrayOf(I().shape({id:I().string,name:I().string})),error:I().string,existingNames:I().arrayOf(I().string),onSave:I().func.isRequired,onBulkDone:I().func,onClose:I().func.isRequired};let W=[{value:"default",label:"Default"},{value:"claude-cli",label:"Claude CLI"},{value:"codex-cli",label:"Codex CLI"},{value:"openclaw",label:"OpenClaw"},{value:"custom",label:"Custom Headers"}],G=new Set(["authorization","x-api-key","api-key","cookie"]);function Q(e){let t=String(e||"").trim();if(!t)return{headers:{}};try{let e;if(t.startsWith("{")){let a=JSON.parse(t);if(!a||"object"!=typeof a||Array.isArray(a))return{error:"Use a JSON object or Header: value lines."};e=Object.entries(a)}else for(let a of(e=[],t.split(/\r?\n/))){let t=a.trim();if(!t||t.startsWith("#"))continue;let i=t.indexOf(":");if(i<=0)return{error:"Each custom header line must use Header: value."};e.push([t.slice(0,i),t.slice(i+1)])}let a={};for(let[t,i]of e){let e=String(t||"").trim(),s=String(i||"").trim();!e||!s||G.has(e.toLowerCase())||(a[e]=s)}return{headers:a}}catch{return{error:"Use valid JSON or Header: value lines."}}}function V({isOpen:e,node:t,onSave:a,onClose:l,isAnthropic:r}){let[n,o]=(0,s.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1",clientIdentityProfile:"default",clientIdentityHeadersText:""}),[d,m]=(0,s.useState)(!1),[p,u]=(0,s.useState)(""),[x,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(!1),[y,b]=(0,s.useState)(null);(0,s.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"),clientIdentityProfile:t.clientIdentityProfile||"default",clientIdentityHeadersText:t.clientIdentityHeaders?JSON.stringify(t.clientIdentityHeaders,null,2):""})},[t,r]);let v=async()=>{if(!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim())return;let e="custom"===n.clientIdentityProfile?Q(n.clientIdentityHeadersText):{headers:{}};if(e.error)return void b("failed");m(!0);try{let t={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl,clientIdentityProfile:n.clientIdentityProfile,clientIdentityHeaders:e.headers};r||(t.apiType=n.apiType),await a(t)}finally{m(!1)}},j=async()=>{let e="custom"===n.clientIdentityProfile?Q(n.clientIdentityHeadersText):{headers:{}};if(e.error)return void b("failed");g(!0);try{let t=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,clientIdentityProfile:n.clientIdentityProfile,clientIdentityHeaders:e.headers})}),a=await t.json();b(a.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.jsx)(c.l6,{label:"Client Identity",options:W,value:n.clientIdentityProfile,onChange:e=>o({...n,clientIdentityProfile:e.target.value}),hint:"Optional. Adds client fingerprint headers for compatible gateways."}),"custom"===n.clientIdentityProfile&&(0,i.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,i.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Custom Headers"}),(0,i.jsx)("textarea",{value:n.clientIdentityHeadersText,onChange:e=>o({...n,clientIdentityHeadersText:e.target.value}),placeholder:'{\n "User-Agent": "custom/1.0"\n}',rows:5,className:"w-full resize-y rounded-[10px] border border-transparent bg-surface-2 px-3 py-2.5 text-[16px] text-text-main placeholder-text-muted/70 transition-all duration-150 focus:border-brand-500/40 focus:outline-none focus:ring-2 focus:ring-brand-500/30 sm:text-sm"}),(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"JSON object or Header: value lines. Auth headers are ignored."})]}),(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}V.propTypes={isOpen:I().bool.isRequired,node:I().shape({id:I().string,name:I().string,prefix:I().string,apiType:I().string,baseUrl:I().string,clientIdentityProfile:I().string,clientIdentityHeaders:I().object}),onSave:I().func.isRequired,onClose:I().func.isRequired,isAnthropic:I().bool};let Z=()=>Object.fromEntries(Object.keys(p.bs).map(e=>[e,!1]));function X({isOpen:e,providerAlias:t,providerDisplayAlias:a,notice:l,onSave:r,onClose:n}){let[o,d]=(0,s.useState)(""),[m,u]=(0,s.useState)(Z),[x,h]=(0,s.useState)(null),[f,g]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(d(""),u(Z()),h(null),g(""))},[e]);let v=e=>{let a=`${t}/`;return e.startsWith(a)?e.slice(a.length):e},j=async()=>{let e=v(o.trim());if(e){h("testing"),g("");try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),i=await a.json();h(i.ok?"ok":"error"),g(i.error||"")}catch(e){h("error"),g(e.message)}}},w=async()=>{let e=v(o.trim());if(e&&!y){b(!0);try{await r(e,m)}finally{b(!1)}}};return(0,i.jsx)(c.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[l&&(0,i.jsxs)("div",{className:"flex items-start gap-2 text-xs text-text-muted bg-sidebar rounded-lg p-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"info"}),(0,i.jsx)("span",{children:l})]}),(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:o,onChange:e=>{d(e.target.value),h(null),g("")},onKeyDown:e=>{"Enter"===e.key&&j()},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"===x,onClick:j,disabled:!o.trim()||"testing"===x,children:"testing"===x?"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:v(o.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:!!m[e],onChange:t=>u(a=>({...a,[e]:t})),label:t.label,description:t.desc,size:"sm"},e))})]}),"ok"===x&&(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"===x&&(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:f||"Model not reachable"})]}),(0,i.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,i.jsx)(c.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,i.jsx)(c.$n,{onClick:w,fullWidth:!0,size:"sm",disabled:!o.trim()||y,children:y?"Adding...":"Add Model"})]})]})})}X.propTypes={isOpen:I().bool.isRequired,providerAlias:I().string.isRequired,providerDisplayAlias:I().string.isRequired,notice:I().string,onSave:I().func.isRequired,onClose:I().func.isRequired};let Y=`[
8
+ {
9
+ "accessToken": "eyJhbGc...",
10
+ "refreshToken": "rt_...",
11
+ "idToken": "eyJhbGc...",
12
+ "email": "user@example.com"
13
+ }
14
+ ]`;function ee({isOpen:e,onClose:t,onSuccess:a}){let[l,r]=(0,s.useState)(""),[n,o]=(0,s.useState)(!1),[d,m]=(0,s.useState)(""),[p,u]=(0,s.useState)(null),x=()=>{n||(r(""),m(""),u(null),t())},h=async()=>{var e;let t;m(""),u(null);let i=l.trim();if(!i)return;try{t=JSON.parse(i)}catch(e){m(`${(0,A.Tl)("Invalid JSON")}: ${e.message}`);return}let s=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!s||0===s.length)return void m((0,A.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:s})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);u(t),t.success>0&&"function"==typeof a&&a()}catch(e){m(e.message||(0,A.Tl)("Request failed"))}finally{o(!1)}},f=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,A.Tl)("Bulk Add Codex Accounts"),onClose:x,children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("p",{className:"text-xs text-text-muted",children:(0,A.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,i.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:Y,value:l,onChange:e=>r(e.target.value),disabled:n}),d&&(0,i.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,A.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,A.Tl)("failed")}`:""]}),f.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:f.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:h,fullWidth:!0,disabled:n||!l.trim(),children:n?(0,A.Tl)("Importing..."):(0,A.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:x,variant:"ghost",fullWidth:!0,disabled:n,children:(0,A.Tl)("Close")})]})]})})}ee.propTypes={isOpen:I().bool.isRequired,onClose:I().func.isRequired,onSuccess:I().func};let et=`[
15
+ {
16
+ "access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
17
+ "refresh_token": "LZhriF9bf88pPykpXCuZ9...",
18
+ "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
19
+ "email": "account1@example.com"
20
+ },
21
+ {
22
+ "access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
23
+ "refresh_token": "LZhriF9bf88pPykpXCuZ9...",
24
+ "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
+ "email": "account2@example.com"
26
+ }
27
+ ]`;function ea(e){let t,a=e.trim();if(!a)return[];try{t=JSON.parse(a)}catch(e){try{let e=a;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 ei({isOpen:e,onClose:t,onSuccess:a}){let[l,r]=(0,s.useState)(""),[n,o]=(0,s.useState)(!1),[d,m]=(0,s.useState)(""),[p,u]=(0,s.useState)(null),[x,h]=(0,s.useState)(!1),[f,g]=(0,s.useState)(null),y=(0,s.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,A.Tl)("Please select valid .json files"));try{let e=[];for(let a of t){let t=await a.text(),i=ea(t);Array.isArray(i)?e.push(...i):i&&e.push(i)}if(0===e.length)return void m((0,A.Tl)("No accounts found in selected files"));r(JSON.stringify(e,null,2)),g({filesCount:t.length,accountsCount:e.length})}catch(e){m(`${(0,A.Tl)("Error reading files")}: ${e.message}`)}},j=async()=>{let e;m(""),u(null);try{e=ea(l)}catch(e){m(`${(0,A.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void m((0,A.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 a&&a()}catch(e){m(e.message||(0,A.Tl)("Request failed"))}finally{o(!1)}},w=p?.results?.filter(e=>!e.ok)||[];return(0,i.jsx)(c.aF,{isOpen:e,title:(0,A.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,A.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,A.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:et,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,A.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,A.Tl)("Loaded")," ",f.accountsCount," ",(0,A.Tl)("account(s) from")," ",f.filesCount," ",(0,A.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,A.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,A.Tl)("Importing..."):(0,A.Tl)("Import All")}),(0,i.jsx)(c.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:n,children:(0,A.Tl)("Close")})]})]})})}let es={claude:"claudeAutoPing",codex:"codexAutoPing"},el=[{value:"auto",label:"Retry: Auto"},{value:"15",label:"Retry: 15s"},{value:"30",label:"Retry: 30s"},{value:"60",label:"Retry: 1m"},{value:"120",label:"Retry: 2m"},{value:"300",label:"Retry: 5m"},{value:"600",label:"Retry: 10m"},{value:"1800",label:"Retry: 30m"},{value:"3600",label:"Retry: 1h"}];function er(){let e,t=(0,l.useParams)(),a=(0,l.useRouter)(),r=t.id,{getCaps:u}=(0,S.y)(),[x,h]=(0,s.useState)([]),[f,g]=(0,s.useState)(1),[y,b]=(0,s.useState)(10),[v,j]=(0,s.useState)(!0),[w,k]=(0,s.useState)(null),[T,P]=(0,s.useState)([]),[I,R]=(0,s.useState)(!1),[_,U]=(0,s.useState)(!1),[q,z]=(0,s.useState)(!1),[M,K]=(0,s.useState)(!1),[F,L]=(0,s.useState)(""),[H,W]=(0,s.useState)(!1),[G,Q]=(0,s.useState)(!1),[Z,Y]=(0,s.useState)(!1),[et,ea]=(0,s.useState)(!1),[er,en]=(0,s.useState)(!1),[eo,ed]=(0,s.useState)(null),[ec,em]=(0,s.useState)({}),[ep,eu]=(0,s.useState)([]),[ex,eh]=(0,s.useState)(!1),[ef,eg]=(0,s.useState)({}),[ey,eb]=(0,s.useState)(""),[ev,ej]=(0,s.useState)(()=>new Set),[ew,ek]=(0,s.useState)(!1),[eN,eC]=(0,s.useState)([]),[eS,eA]=(0,s.useState)("__none__"),[eT,e$]=(0,s.useState)(!1),[eO,eP]=(0,s.useState)(null),[eI,eE]=(0,s.useState)(""),[eR,eD]=(0,s.useState)("auto"),[e_,eU]=(0,s.useState)("auto"),[eq,ez]=(0,s.useState)(""),[eM,eJ]=(0,s.useState)({enabled:!1,connections:{}}),[eK,eF]=(0,s.useState)([]),[eL,eH]=(0,s.useState)([]),[eB,eW]=(0,s.useState)([]),[eG,eQ]=(0,s.useState)([]),[eV,eZ]=(0,s.useState)(null),[eX,eY]=(0,s.useState)(!1),[e0,e1]=(0,s.useState)(!1),[e2,e5]=(0,s.useState)(!1),[e3,e4]=(0,s.useState)(null),[e6,e8]=(0,s.useState)({}),[e7,e9]=(0,s.useState)(null),te=(0,s.useRef)(!1),[tt,ta]=(0,s.useState)(!1),[ti,ts]=(0,s.useState)(!1),{copied:tl,copy:tr}=(0,C.C)(),tn="ag_risk_confirmed",to=()=>{R(!0)},td=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(tn)?eY(!0):"xiaomi-mimo"===r?U(!0):tx?to():(L(""),K(!0))},tc=()=>{L(""),K(!0)},tm=()=>{tx?td():tc()},tp=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[r]||m.fg[r]||m.IS[r]||m.nJ[r]||m.br[r],tu=tp?.authModes||[],tx=!!m.zN[r]||!!m.IS[r]||tu.includes("oauth"),th=!!m.fg[r]||tu.includes("apikey"),tf=!!m.IS[r]?.noAuth,tg=(0,p.KC)(r),ty="cursor"===r&&eL.length>0?eL:tg,tb=(0,m.wG)(r),tv=(0,m.mq)(r),tj=(0,m.gb)(r),tw=tv||tj,tk=!tw&&tx&&th,tN="xai"===r?"Grok Build OAuth":"grok-cli"===r?"Grok CLI Device Login":"kimi"===r?"Kimi Coding OAuth":"OAuth",tC="xai"===r?"xAI API Key":"kimi"===r?"Kimi API Key":"API Key",tS=e=>{if(!eR||"auto"===eR)return null;let t=N(r,e);return t&&t.includes(eR)?eR:null},tA=tw?r:tb,tT=(()=>{let e=new Set,t=new Set,a=a=>{if(!a||t.has(a))return;t.add(a);let i=N(r,a);i&&i.forEach(t=>{"none"!==t&&e.add(t)})};for(let e of ty)a(e.id);for(let e of eB)a(e.id);for(let e of ep)e.providerAlias===tA&&"llm"===(e.kind||e.type||"llm")&&a(e.id);return e.size?["auto",...e]:null})(),t$=tw?w?.prefix||r:tb,tO=(0,s.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}`,{cache:"no-store"}),t=await e.json();e.ok&&eQ(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&&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)}}})},tR=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tA)}`,{method:"DELETE"})).ok&&await tO()}catch(e){console.log("Error enabling all models:",e)}},tD=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&em(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),t_=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&eu(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,s.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eW(e.models)}).catch(()=>{})},[r]);let tU=(0,s.useCallback)(async()=>{try{let[e,t,a,i]=await Promise.all([fetch(`/api/providers?provider=${encodeURIComponent(r)}`,{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"})]),s=await e.json(),l=await t.json(),n=await a.json(),o=i.ok?await i.json():{};e.ok&&h(s.connections||[]),a.ok&&P(n.proxyPools||[]);let d=(o.providerStrategies||{})[r]||{};eP(d.fallbackStrategy||null),eE(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[r]||{};eD(c.mode||"auto");let m=(o.retryDelayByProvider||{})[r];eU(null!=m&&"auto"!==m?String(m):"auto");let p=(o.rpmByProvider||{})[r];ez(null!=p?String(p):"");let u=es[r],x=u&&o[u]||{};if(eJ({enabled:!0===x.enabled,connections:x.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||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===r)||null))break}k(e)}}catch(e){console.log("Error fetching connections:",e)}finally{j(!1)}},[r,tw]),tq=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&(k(a.node),await tU(),ea(!1))}catch(e){console.log("Error updating provider node:",e)}},tz=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),i=(a.ok?await a.json():{}).providerStrategies||{},s={};e&&(s.fallbackStrategy=e),"round-robin"===e&&""!==t&&(s.stickyRoundRobinLimit=Number(t)||3);let l={...i};0===Object.keys(s).length?delete l[r]:l[r]=s,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"}),a={...(t.ok?await t.json():{}).providerThinking||{}};e&&"auto"!==e?a[r]={mode:e}:delete a[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:a})})}catch(e){console.log("Error saving thinking config:",e)}},tJ=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).retryDelayByProvider||{}};e&&"auto"!==e?a[r]=Number(e):delete a[r],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({retryDelayByProvider:a})})}catch(e){console.log("Error saving retry delay:",e)}},tK=async e=>{try{let t=await fetch("/api/settings",{cache:"no-store"}),a={...(t.ok?await t.json():{}).rpmByProvider||{}},i=String(e??"").trim();""===i?delete a[r]:a[r]=Math.max(0,Number(i)||0),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpmByProvider:a})})}catch(e){console.log("Error saving RPM limit:",e)}},tF=async e=>{let t=es[r];if(t){eJ(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,s.useEffect)(()=>{tU(),tD(),t_(),tO()},[tU,tD,t_,tO]),(0,s.useEffect)(()=>{if("cursor"!==r)return void eH([]);let e=x.find(e=>!1!==e.isActive);if(!e?.id)return void eH([]);let t=!1;return fetch(`/api/providers/${e.id}/models`,{cache:"no-store"}).then(async e=>({ok:e.ok,data:await e.json()})).then(({ok:e,data:a})=>{!t&&e&&Array.isArray(a.models)&&a.models.length>0&&eH(a.models)}).catch(()=>{}),()=>{t=!0}},[r,x]),(0,s.useEffect)(()=>{let e=(m.zN[r]||m.fg[r]||m.IS[r]||m.nJ[r])?.modelsFetcher;e&&$(e).then(eF)},[r]);let tL=async(e,t,a=tb)=>{let i=`${a}/${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 tD();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tH=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tD()}catch(e){console.log("Error deleting alias:",e)}},tB=async(e,t="llm",a=tA,i)=>{try{let s=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t,...i?{caps:i}:{}})}),l=await s.json().catch(()=>({}));s.ok?(!1===l.added&&alert("Model already exists (duplicate). Check built-in or custom list."),await t_(),window.dispatchEvent(new CustomEvent("customModelChanged"))):alert(l.error||"Failed to add custom model")}catch(e){console.log("Error adding custom model:",e),alert(e.message||"Failed to add custom model")}},tW=async(e,t="llm",a=tA)=>{try{let i=new URLSearchParams({providerAlias:a,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)}},tG=async()=>{if(tt)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,A.Tl)("Please add an active Qoder connection first"));ta(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,A.Tl)("Failed to fetch models"));let i=a.models||[];if(0===i.length)return void alert((0,A.Tl)("No models returned"));let s=0;for(let e of i){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");ep.some(e=>e.providerAlias===tA&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tA}/${a}`)||(await tB(a,"llm",tA),s+=1)}0===s?alert((0,A.Tl)("All models already exist, no new models added")):alert((0,A.Tl)("Successfully added")+` ${s} `+(0,A.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,A.Tl)("Error fetching models")+": "+e.message)}finally{ta(!1)}},tQ=async()=>{if(ti)return;let e=x.find(e=>!1!==e.isActive);if(!e)return void alert((0,A.Tl)("Please add an active Cline connection first"));ts(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,A.Tl)("Failed to fetch models"));let i=a.models||[];if(0===i.length)return void alert((0,A.Tl)("No models returned"));let s=0;for(let e of i){let t=e.id||e.name;t&&(ep.some(e=>e.providerAlias===tA&&e.id===t&&"llm"===(e.kind||e.type||"llm"))||Object.values(ec).includes(`${tA}/${t}`)||(await tB(t,"llm",tA),s+=1))}0===s?alert((0,A.Tl)("All models already exist, no new models added")):alert((0,A.Tl)("Successfully added")+` ${s} `+(0,A.Tl)("models"))}catch(e){console.log("Error importing Cline models:",e),alert((0,A.Tl)("Error fetching models")+": "+e.message)}finally{ts(!1)}},tV=async()=>{if(e0||0===x.length)return;let e=Object.fromEntries(x.map(e=>[e.id,{state:"queued",error:null}]));te.current=!1,e1(!0),e5(!1),e4(null),e8(e),e9({total:x.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<x.length;e+=1){if(te.current){e9({total:x.length,completed:e,passed:t,failed:a,stopped:!0});break}let i=x[e];e4(i.id),e8(e=>({...e,[i.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${i.id}/test`,{method:"POST"}),s=await e.json(),l=!!s.valid;l?t+=1:a+=1,e8(e=>({...e,[i.id]:{state:l?"success":"failed",error:l?null:s.error||null}}))}catch(e){a+=1,e8(t=>({...t,[i.id]:{state:"failed",error:e.message||"Test failed"}}))}e9({total:x.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<x.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{e4(null),e1(!1),e5(!1),te.current=!1}},tZ=async e=>{eZ({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eZ(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tX=()=>{tU(),R(!1)},tY=async e=>{L("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok)return await tU(),!0;L(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),L("Failed to save connection")}return!1},t0=async e=>{try{(await fetch(`/api/providers/${eo.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tU(),Y(!1))}catch(e){console.log("Error updating connection:",e)}},t1=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},t2=async(e,t)=>{let a=[...x];[a[e],a[t]]=[a[t],a[e]],h(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tU()}},t5=x.filter(e=>eN.includes(e.id));(0,s.useEffect)(()=>{eC(e=>e.filter(e=>x.some(t=>t.id===e)))},[x]),(()=>{if(0===t5.length)return;let e=new Set(t5.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let a=T.find(e=>e.id===t);return a?.name}})();let t3=()=>{eT||en(!1)},t4=async e=>{e$(!0);try{let t=0;for(let{connectionId:a,proxyPoolId:i}of e)try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:i})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",a,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tU(),en(!1)}finally{e$(!1)}},t6=e=>t4(x.map(t=>({connectionId:t.id,proxyPoolId:e}))),{currentPage:t8,items:t7,start:t9}=function(e=[],t=1,a=10){let i=Array.isArray(e)?e:[],s=Number.isFinite(a)&&a>=1?Math.floor(a):10,l=i.length,r=Math.max(1,Math.ceil(l/s)),n=Math.floor(Number(t)),o=Math.min(Number.isFinite(n)&&n>0?n:1,r),d=(o-1)*s,c=i.slice(d,d+s);return{currentPage:o,totalPages:r,totalItems:l,start:d,items:c,pageSize:s}}(x,f,y),ae=new Set(t7.map(e=>e.id)),at=t7.length>0&&t7.every(e=>eN.includes(e.id)),aa=(0,i.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[t7.map((e,t)=>{let a,s=t9+t;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:(a=e.id,eN.includes(a)),onChange:()=>{var t;return t=e.id,void eC(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)(J,{connection:e,proxyPools:T,isOAuth:tx,isFirst:0===s,isLast:s===x.length-1,onMoveUp:()=>t2(s,s-1),onMoveDown:()=>t2(s,s+1),onToggleActive:t=>t1(e.id,t),autoPing:es[r]&&"oauth"===e.authType?{on:!0===eM.connections[e.id],onToggle:t=>{var a;return a=e.id,void tF({...eM,connections:{...eM.connections,[a]:t}})},provider:r}: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&&h(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{ed(e),Y(!0)},onReconnect:()=>{"iflow"===r?z(!0):R(!0)},onDelete:()=>tZ(e.id),oneByOneStatus:e6[e.id]||null})})]},e.id)}),x.length>10&&(0,i.jsx)(c.dK,{currentPage:t8,pageSize:y,totalItems:x.length,onPageChange:g,onPageSizeChange:e=>{b(e),g(1)},allowCustomPageSize:!0,maxPageSize:200})]}),ai=T.filter(e=>!0===e.isActive),as=(0,i.jsx)(c.aF,{isOpen:er,onClose:t3,title:`Apply Proxy (${x.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=T.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):t4(x.map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:eT||0===ai.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:()=>t6(null),disabled:eT,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)"})]}),T.map(e=>(0,i.jsxs)("button",{onClick:()=>t6(e.id),disabled:eT||!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))]}),eT&&(0,i.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,i.jsx)(c.$n,{onClick:t3,variant:"ghost",fullWidth:!0,disabled:eT,children:"Cancel"})]})}),al=async e=>{if(!ev.has(e)){ej(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}`})}),a=await t.json();eg(t=>({...t,[e]:a.ok?"ok":"error"})),eb(a.ok?"":a.error||"Model not reachable")}catch{eg(t=>({...t,[e]:"error"})),eb("Network error")}finally{ej(t=>{let a=new Set(t);return a.delete(e),a})}}};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(!tp)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 ar=()=>tv&&tp.apiType?"responses"===tp.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tj?"/providers/anthropic-m.png":(0,d.HY)(tp.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:`${tp.color}15`},children:ex||!ar()?(0,i.jsx)("span",{className:"text-sm font-bold",style:{color:tp.color},children:tp.textIcon||tp.id.slice(0,2).toUpperCase()}):(0,i.jsx)(o.default,{src:ar(),alt:tp.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,d.Kw)(tp.id),eh(!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:tp.name}),(tp.notice?.apiKeyUrl||tp.notice?.signupUrl||tp.website)&&(0,i.jsxs)("a",{href:tp.notice?.apiKeyUrl||tp.notice?.signupUrl||tp.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"}),tp.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,i.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]}),(0,i.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,i.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"RPM / account"}),(0,i.jsx)("input",{type:"number",min:"0",value:eq,placeholder:String(m.W[r]||0),onChange:e=>ez(e.target.value),onBlur:e=>tK(e.target.value),title:"Max requests per minute per account. Accounts over the cap are skipped before a request is sent, so the provider never sees a 429. Blank = provider default, 0 = unlimited.",className:"w-16 rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none"}),(0,i.jsx)("span",{className:"hidden text-xs text-text-muted sm:inline",children:"Retry delay"}),(0,i.jsx)("select",{value:e_,onChange:e=>{var t;eU(t=e.target.value),tJ(t)},title:"Cooldown after a rate-limit/error when the provider reports no reset time of its own. Auto = honor the provider's reported delay, else built-in backoff.",className:"rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",children:el.map(e=>(0,i.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]}),tp.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:tp.deprecationNotice})]}),tp.notice?.text&&!tp.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:tp.notice.text}),tp.notice.apiKeyUrl&&(0,i.jsx)("a",{href:tp.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:()=>{L(""),K(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ea(!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/${r}`,{method:"DELETE"})).ok&&a.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:r}):(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:[x.length>0&&T.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>en(!0),children:"Apply Proxy"}),x.length>0&&(0,i.jsxs)(i.Fragment,{children:[eN.length>0&&(0,i.jsxs)(c.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=eN.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=[...eN];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}h(e=>e.filter(e=>!t.includes(e.id))),eC([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",eN.length,")"]}),(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tV,disabled:e0,children:e0?"Testing Connection One-by-One...":"Test Connection One-by-One"}),e0&&(0,i.jsx)(c.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{e0&&(te.current=!0,e5(!0))},disabled:e2,children:e2?"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"===eO,onChange:e=>{let t=e?"round-robin":null,a=e?eI||"1":eI;e&&!eI&&eE("1"),eP(t),tz(t,a)}}),"round-robin"===eO&&(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;eE(t=e.target.value),tz("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===x.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:tx?"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:td,children:tN}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:tc,children:tC})]}):(0,i.jsxs)(i.Fragment,{children:[!tw&&"iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>z(!0),children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),children:(0,A.Tl)("Bulk Add")}),"grok-cli"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),children:(0,A.Tl)("Bulk Add")}),(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tm,children:tw?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,i.jsxs)(i.Fragment,{children:[e7&&(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: ",e7.total]}),(0,i.jsxs)("span",{children:["Completed: ",e7.completed]}),(0,i.jsxs)("span",{children:["Passed: ",e7.passed]}),(0,i.jsxs)("span",{children:["Failed: ",e7.failed]}),e7.stopped&&(0,i.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),e0&&e3&&(0,i.jsxs)("span",{children:["Running: ",x.find(e=>e.id===e3)?.name||e3]})]})}),x.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:at,onChange:()=>{at?eC(e=>e.filter(e=>!ae.has(e))):eC(e=>{let t=new Set(e);for(let e of ae)t.add(e);return[...t]})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),aa,!tw&&(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>z(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),title:(0,A.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,A.Tl)("Bulk Add")}),"grok-cli"===r&&(0,i.jsx)(c.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Q(!0),title:(0,A.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,A.Tl)("Bulk Add")}),tk?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:td,className:"w-full sm:w-auto",children:tN}),(0,i.jsx)(c.$n,{size:"sm",icon:"key",onClick:tc,className:"w-full sm:w-auto",children:tC})]}):(0,i.jsx)(c.$n,{size:"sm",icon:"add",onClick:tm,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(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;eD(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,...eB.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=>!eG.includes(e)),(0,i.jsxs)("div",{className:"flex gap-2",children:[eG.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tR,children:"Active All"}),e.length>0&&(0,i.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tE(e),children:"Disable All"})]}))]}),!!ey&&(0,i.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:ey}),(()=>{let e,t,a;if(tw)return(0,i.jsx)(D,{providerStorageAlias:tA,providerDisplayAlias:t$,modelAliases:ec,customModels:ep,copied:tl,onCopy:tr,onSetAlias:tL,onDeleteAlias:tH,onAddCustomModel:e=>tB(e,"llm",tA),onDeleteCustomModel:e=>tW(e,"llm",tA),connections:x,isAnthropic:tj});let s=[...ty,...eB.filter(e=>!ty.some(t=>t.id===e.id))].filter(e=>{let t=(0,p.CP)(e);return!t||"llm"===t}),l=new Set(eG),n=s.filter(e=>!l.has(e.id)),o=s.filter(e=>l.has(e.id)),d=O({customModels:ep,modelAliases:ec,providerAlias:tA,builtInModels:ty,type:"llm"});return(0,i.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,i.jsx)(E,{model:{id:e.id,name:e.name},fullModel:`${t$}/${e.id}`,alias:e.alias,copied:tl,onCopy:tr,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tW(e.id,"llm",tA):tH(e.alias)},testStatus:ef[e.id],onTest:x.length>0||tf?()=>al(e.id):void 0,isTesting:ev.has(e.id),isCustom:!0,isFree:!1,caps:u(`${r}/${e.id}`),thinkingSuffix:tS(e.id)},`${e.source}-${e.fullModel}`)),n.map(e=>{let t=`${tA}/${e.id}`,a=`${r}/${e.id}`,s=Object.entries(ec).find(([,e])=>e===t||e===a)?.[0];return(0,i.jsx)(E,{model:e,fullModel:`${t$}/${e.id}`,alias:s,copied:tl,onCopy:tr,onSetAlias:t=>tL(e.id,t,tA),onDeleteAlias:()=>tH(s),testStatus:ef[e.id],onTest:x.length>0||tf?()=>al(e.id):void 0,isTesting:ev.has(e.id),isFree:e.isFree,onDisable:()=>tP(e.id),caps:u(`${r}/${e.id}`),thinkingSuffix:tS(e.id)},e.id)}),(0,i.jsxs)("button",{onClick:()=>ek(!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"]}),"qoder"===r&&x.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tG,disabled:tt,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:tt?{animation:"spin 1s linear infinite"}:void 0,children:tt?"progress_activity":"download"}),tt?(0,A.Tl)("Fetching..."):(0,A.Tl)("Fetch Qoder Models")]}),("cline"===r||"clinepass"===r)&&x.some(e=>!1!==e.isActive)&&(0,i.jsxs)("button",{onClick:tQ,disabled:ti,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:ti?{animation:"spin 1s linear infinite"}:void 0,children:ti?"progress_activity":"download"}),ti?(0,A.Tl)("Fetching..."):(0,A.Tl)("Import from /models")]}),eK.length>0&&(e=new Set([...Object.values(ec),...d.map(e=>e.fullModel)]),t=new Set(ty.map(e=>e.id)),0===(a=eK.filter(a=>!e.has(`${tA}/${a.id}`)&&!t.has(a.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 free models (≥200k context):"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,i.jsxs)("button",{onClick:async()=>{await tB(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.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.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 (",o.length,"):"]}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:o.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))})]})]})})()]}),as,"kiro"===r?(0,i.jsx)(c.Mh,{isOpen:I,providerInfo:tp,onSuccess:tX,onClose:()=>R(!1)}):"cursor"===r?(0,i.jsx)(c.G9,{isOpen:I,onSuccess:tX,onClose:()=>R(!1)}):"gitlab"===r?(0,i.jsx)(c.vj,{isOpen:I,providerInfo:tp,onSuccess:tX,onClose:()=>R(!1)}):(0,i.jsx)(c.LF,{isOpen:I,provider:r,providerInfo:tp,onSuccess:tX,onClose:()=>R(!1)}),(0,i.jsx)(c.LH,{isOpen:_,onSuccess:tX,onClose:()=>U(!1)}),"iflow"===r&&(0,i.jsx)(c.vE,{isOpen:q,onSuccess:()=>{tU(),z(!1)},onClose:()=>z(!1)}),(0,i.jsx)(B,{isOpen:M,provider:r,providerName:tp.name,isCompatible:tw,isAnthropic:tj,authType:tp?.authType,authHint:tp?.authHint,website:tp?.website,proxyPools:T,error:F,existingNames:x.map(e=>e.name).filter(Boolean),onSave:tY,onBulkDone:tU,onClose:()=>{L(""),K(!1)}}),(0,i.jsx)(c.wI,{isOpen:Z,connection:eo,proxyPools:T,onSave:t0,onClose:()=>Y(!1)}),tw&&(0,i.jsx)(V,{isOpen:et,node:w,onSave:tq,onClose:()=>ea(!1),isAnthropic:tj}),!tw&&(0,i.jsx)(X,{isOpen:ew,providerAlias:tA,providerDisplayAlias:t$,onSave:async(e,t)=>{await tB(e,"llm",tA,t),ek(!1)},onClose:()=>ek(!1)}),"codex"===r&&(0,i.jsx)(ee,{isOpen:H,onClose:()=>W(!1),onSuccess:tU}),"grok-cli"===r&&(0,i.jsx)(ei,{isOpen:G,onClose:()=>Q(!1),onSuccess:tU}),(0,i.jsx)(c.uo,{isOpen:eX,onClose:()=>eY(!1),onConfirm:()=>{(window.localStorage.setItem(tn,"true"),eY(!1),tx)?to():tc()},title:"Risk Notice",message:tp?.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"})]})}},85295:(e,t,a)=>{Promise.resolve().then(a.bind(a,79355))}},e=>{e.O(0,[8010,5772,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=85295)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{28915:(e,t,r)=>{"use strict";r.d(t,{E2:()=>a,gs:()=>s});function a(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function s(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let r=Math.floor(t/60);if(r<24)return`${r}h ago`;let a=Math.floor(r/24);return`${a}d ago`}r(8247)},62622:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>I});var a=r(95155),s=r(12115),l=r(14051),i=r.n(l),n=r(35497),o=r(57250),d=r(8247),c=r(90620),p=r(88105),m=r(98500),u=r.n(m),x=r(28915),h=r(65921),f=r(38003),b=r(73006);let g={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function y(){let[e,t]=(0,s.useState)(null),[r,l]=(0,s.useState)(!0),[i,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null),p=(0,s.useRef)(null),m=(0,h.i)(),u=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let r=await e.json();t(r)}}catch{}finally{l(!1)}},[]);(0,s.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let x=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await u()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(r)return null;let f=e?.models||[],b=0===(e?.unavailableCount||f.filter(e=>"available"!==e.status).length),y={};return f.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";y[t]||(y[t]=[]),y[t].push(e)}),(0,a.jsx)("div",{className:"relative",ref:p,children:i&&(0,a.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:b?"#22c55e":"#f59e0b"},children:b?"verified":"warning"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,a.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,a.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:b?(0,a.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,a.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(y).map(([e,t])=>(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,a.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=g[e.status]||g.unknown,r=d===`${e.provider}:${e.model}`;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,a.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>x(e.provider,e.model),disabled:r,className:"text-[10px] px-1.5! py-0.5! ml-2",children:r?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}let v={openai:{title:"Add OpenAI Compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the base URL (ending in /v1) for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic Compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},j=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],N=[{value:"default",label:"Default"},{value:"claude-cli",label:"Claude CLI"},{value:"codex-cli",label:"Codex CLI"},{value:"openclaw",label:"OpenClaw"},{value:"custom",label:"Custom Headers"}],w=new Set(["authorization","x-api-key","api-key","cookie"]);function k(e){let t=String(e||"").trim();if(!t)return{headers:{}};try{let e;if(t.startsWith("{")){let r=JSON.parse(t);if(!r||"object"!=typeof r||Array.isArray(r))return{error:"Use a JSON object or Header: value lines."};e=Object.entries(r)}else for(let r of(e=[],t.split(/\r?\n/))){let t=r.trim();if(!t||t.startsWith("#"))continue;let a=t.indexOf(":");if(a<=0)return{error:"Each custom header line must use Header: value."};e.push([t.slice(0,a),t.slice(a+1)])}let r={};for(let[t,a]of e){let e=String(t||"").trim(),s=String(a||"").trim();!e||!s||w.has(e.toLowerCase())||(r[e]=s)}return{headers:r}}catch{return{error:"Use valid JSON or Header: value lines."}}}function C({variant:e,isOpen:t,onClose:r,onCreated:l}){let i=v[e],o=()=>({name:"",prefix:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl,clientIdentityProfile:"default",clientIdentityHeadersText:""}),[d,c]=(0,s.useState)(o),[p,m]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),[h,f]=(0,s.useState)(""),[b,g]=(0,s.useState)(!1),[y,w]=(0,s.useState)(null);(0,s.useEffect)(()=>{i.hasApiType?c(e=>({...e,baseUrl:i.defaultBaseUrl})):t&&(w(null),x(""),f(""))},[i.hasApiType?d.apiType:t]);let T=()=>{c(o()),x(""),f(""),w(null),r()},A=async()=>{if(!d.name.trim()||!d.prefix.trim()||!d.baseUrl.trim())return;let e="custom"===d.clientIdentityProfile?k(d.clientIdentityHeadersText):{headers:{}};if(e.error)return void w({valid:!1,error:e.error});m(!0);try{let t=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name,prefix:d.prefix,...i.hasApiType?{apiType:d.apiType}:{},baseUrl:d.baseUrl,type:i.type,clientIdentityProfile:d.clientIdentityProfile,clientIdentityHeaders:e.headers})}),r=await t.json();t.ok&&(l(r.node),T())}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e)}finally{m(!1)}},I=async()=>{let e="custom"===d.clientIdentityProfile?k(d.clientIdentityHeadersText):{headers:{}};if(e.error)return void w({valid:!1,error:e.error});g(!0);try{let t=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d.baseUrl,apiKey:u,type:i.type,modelId:h.trim()||void 0,clientIdentityProfile:d.clientIdentityProfile,clientIdentityHeaders:e.headers})}),r=await t.json();w(r)}catch{w({valid:!1,error:"Network error"})}finally{g(!1)}};return(0,a.jsx)(n.aF,{isOpen:t,title:i.title,onClose:T,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(n.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,a.jsx)(n.pd,{label:"Prefix",value:d.prefix,onChange:e=>c({...d,prefix:e.target.value}),placeholder:i.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),i.hasApiType&&(0,a.jsx)(n.l6,{label:"API Type",options:j,value:d.apiType,onChange:e=>c({...d,apiType:e.target.value})}),(0,a.jsx)(n.pd,{label:"Base URL",value:d.baseUrl,onChange:e=>c({...d,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,a.jsx)(n.l6,{label:"Client Identity",options:N,value:d.clientIdentityProfile,onChange:e=>c({...d,clientIdentityProfile:e.target.value}),hint:"Optional. Adds client fingerprint headers for compatible gateways."}),"custom"===d.clientIdentityProfile&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Custom Headers"}),(0,a.jsx)("textarea",{value:d.clientIdentityHeadersText,onChange:e=>c({...d,clientIdentityHeadersText:e.target.value}),placeholder:'{\n "User-Agent": "custom/1.0"\n}',rows:5,className:"w-full resize-y rounded-[10px] border border-transparent bg-surface-2 px-3 py-2.5 text-[16px] text-text-main placeholder-text-muted/70 transition-all duration-150 focus:border-brand-500/40 focus:outline-none focus:ring-2 focus:ring-brand-500/30 sm:text-sm"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"JSON object or Header: value lines. Auth headers are ignored."})]}),(0,a.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:u,onChange:e=>x(e.target.value)}),(0,a.jsx)(n.pd,{label:"Model ID (optional)",value:h,onChange:e=>f(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,a.jsx)(n.$n,{onClick:I,disabled:!u||b||!d.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:b?"Checking...":"Check"}),(()=>{if(!y)return null;let{valid:e,error:t,method:r}=y;return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===r&&(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,a.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(n.$n,{onClick:A,fullWidth:!0,disabled:!d.name.trim()||!d.prefix.trim()||!d.baseUrl.trim()||p,children:p?"Creating...":"Create"}),(0,a.jsx)(n.$n,{onClick:T,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}C.propTypes={variant:i().oneOf(["openai","anthropic"]).isRequired,isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired};let T=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"none",label:"No connection"}];function A(e,t,r){let s=[];if(e>0&&s.push((0,a.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=r?`${t} Error (${r})`:`${t} Error`;s.push((0,a.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===s.length?(0,a.jsx)("span",{className:"text-text-muted",children:"No connections"}):s}function I(){let e,t,[r,l]=(0,s.useState)([]),[i,o]=(0,s.useState)([]),[d,m]=(0,s.useState)(!0),[u,g]=(0,s.useState)(!1),[v,j]=(0,s.useState)(!1),[N,w]=(0,s.useState)(!1),[k,A]=(0,s.useState)(null),[I,E]=(0,s.useState)(null),[$,U]=(0,s.useState)("all"),R=(0,h.i)(),_=(0,f.C)(e=>e.query),z=(0,f.C)(e=>e.register),D=(0,f.C)(e=>e.unregister);(0,s.useEffect)(()=>(z("Search providers..."),()=>D()),[z,D]);let H=e=>!_.trim()||!!e&&e.toLowerCase().includes(_.trim().toLowerCase());(0,s.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),a=await t.json();e.ok&&l(r.connections||[]),t.ok&&o(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}})()},[]);let q=(e,t)=>{let a=Array.isArray(t)?t:t?[t]:null,s=r.filter(t=>t.provider===e&&(!!(!a||a.includes("all")||a.includes("freeTier")||a.includes("free")||a.includes("apikey")&&("apikey"===t.authType||"api_key"===t.authType))||a.includes(t.authType))),l=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=s.filter(e=>{let t=l(e);return"active"===t||"success"===t}).length,n=s.filter(e=>{let t=l(e);return"error"===t||"expired"===t||"unavailable"===t}),o=n.length,d=s.length,c=d>0&&s.every(e=>!1===e.isActive),p=n.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:o,total:d,errorCode:p?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let r=Number(e.errorCode);if(Number.isFinite(r)&&r>=400)return String(r);let a=(0,x.E2)(e.lastError);if("401"===a||"403"===a)return"AUTH";if(a&&"ERR"!==a)return a;let s=(e.lastError||"").toLowerCase();return s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")?"RUNTIME":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.includes("unauthorized")?"AUTH":"ERR"}(p):null,errorTime:p?.lastErrorAt?(0,x.gs)(p.lastErrorAt):null,allDisabled:c}},L=(e,t)=>(function(e,t,r=!1){return"all"===e||function(e,t=!1){return t?"active":e&&0!==e.total?e.allDisabled?"inactive":"active":"none"}(t,r)===e})($,e,t),M=async(e,t,a)=>{let s=Array.isArray(t)?t:t?[t]:null,i=t=>t.provider===e&&(!!(!s||s.includes("all")||s.includes("freeTier")||s.includes("free")||s.includes("apikey")&&("apikey"===t.authType||"api_key"===t.authType))||s.includes(t.authType)),n=r.filter(i);l(e=>e.map(e=>i(e)?{...e,isActive:a}:e)),await Promise.allSettled(n.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},F=async(e,t=null)=>{if(!k){A("provider"===e?t:e),E(null);try{let r=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),a=await r.json();if(E(a),a.summary){let{passed:e,failed:t,total:r}=a.summary;0===t?R.success(`All ${r} tests passed`):R.warning(`${e}/${r} passed, ${t} failed`)}}catch(e){E({error:"Test request failed"}),R.error("Provider test failed")}finally{A(null)}}},J=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>H(e.name)&&L(q(e.id,"apikey"))),K=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>H(e.name)&&L(q(e.id,"apikey"))),W=(e,t)=>{if("kiro"===t)return["oauth","apikey","api_key"];let r=e?.authModes;return Array.isArray(r)?r.includes("apikey")?["oauth","apikey","api_key"]:"oauth":t in p.nJ||t in c.fg?["oauth","apikey","api_key"]:"oauth"},B=(e=Object.entries(c.zN).filter(([e,t])=>!t.hidden&&H(t.name)&&L(q(e,W(t,e)),t.noAuth)),t="oauth",[...e].sort(([e,r],[a,s])=>{let l=q(e,t),i=q(a,t),n=l.total>0&&!l.allDisabled,o=i.total>0&&!i.allDisabled;if(n!==o)return Number(o)-Number(n);let d=r.priority??999,c=s.priority??999;if(d!==c)return d-c;let p=+(l.connected>0),m=+(i.connected>0);return p!==m?m-p:(r.name||"").localeCompare(s.name||"")})),Q=Object.entries(p.IS).filter(([e,t])=>!t.hidden&&H(t.name)&&L(q(e,W(t,e)),t.noAuth)).sort(([,e],[,t])=>!!t.noAuth-!!e.noAuth),X=Object.entries(p.nJ).filter(([e,t])=>!t.hidden&&H(t.name)&&(t.serviceKinds??["llm"]).includes("llm")&&L(q(e,W(t,e)),t.noAuth)).sort(([e,t],[r,a])=>{let s=t.priority??999,l=a.priority??999;if(s!==l)return s-l;let i=!!a.noAuth-!!t.noAuth;if(0!==i)return i;let n=q(e,W(t,e)).connected>0?0:1,o=q(r,W(a,r)).connected>0?0:1;return n!==o?n-o:(t.name||"").localeCompare(a.name||"")}),Z=Object.entries(c.fg).filter(([e,t])=>!t.hidden&&(t.serviceKinds??["llm"]).includes("llm")&&H(t.name)&&L(q(e,"apikey"),t.noAuth)).sort(([e,t],[r,a])=>{let s=q(e,"apikey").total>0?0:1,l=q(r,"apikey").total>0?0:1;return s!==l?s-l:(t.name||"").localeCompare(a.name||"")}),V=!!_.trim()||"all"!==$,Y=V||u?Z:Z.slice(0,20),G=Z.length-20;if(d)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(n.Qv,{}),(0,a.jsx)(n.Qv,{})]});let ee=B.length>0||Q.length>0||X.length>0||Z.length>0||J.length>0||K.length>0;return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsx)("div",{className:"flex items-center justify-end",children:(0,a.jsx)("select",{value:$,onChange:e=>U(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter providers by connection status",children:T.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})}),!ee&&(0,a.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search or filters"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,a.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>w(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>j(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===J.length&&0===K.length?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,a.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...J,...K].map(e=>(0,a.jsx)(O,{providerId:e.id,provider:e,stats:q(e.id,"apikey"),authType:"compatible",onToggle:t=>M(e.id,"apikey",t)},e.id))})]}),B.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,a.jsx)(y,{}),(0,a.jsxs)("button",{onClick:()=>F("oauth"),disabled:!!k,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===k?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===k?" animate-spin":""}`,children:"play_arrow"}),"oauth"===k?"Testing...":"Test All"]})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:B.map(([e,t])=>(0,a.jsx)(P,{providerId:e,provider:t,stats:q(e,"oauth"),authType:"oauth",onToggle:t=>M(e,"oauth",t)},e))})]}),(Q.length>0||X.length>0)&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,a.jsxs)("button",{onClick:()=>F("free"),disabled:!!k,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===k?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===k?" animate-spin":""}`,children:"play_arrow"}),"free"===k?"Testing...":"Test All"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[Q.map(([e,t])=>{let r="kiro"===e?["oauth","apikey","api_key"]:"oauth";return(0,a.jsx)(P,{providerId:e,provider:t,stats:q(e,r),authType:"free",onToggle:t=>M(e,r,t)},e)}),X.map(([e,t])=>{let r=!!t.hasOAuth||"oauth"===t.authType||(t.authModes||[]).includes("oauth"),s=r?P:O,l=["oauth","apikey","api_key","cookie"];return(0,a.jsx)(s,{providerId:e,provider:t,stats:q(e,l),authType:r?"oauth":"apikey",onToggle:t=>M(e,l,t)},e)})]})]}),Z.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,a.jsxs)("button",{onClick:()=>F("apikey"),disabled:!!k,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===k?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===k?" animate-spin":""}`,children:"play_arrow"}),"apikey"===k?"Testing...":"Test All"]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:Y.map(([e,t])=>(0,a.jsx)(O,{providerId:e,provider:t,stats:q(e,"apikey"),authType:"apikey",onToggle:t=>M(e,"apikey",t)},e))}),!V&&!u&&G>0&&(0,a.jsxs)("button",{onClick:()=>g(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),(0,b.Tl)("Show all")," ",Z.length," ",(0,b.Tl)("providers")]})]}),(0,a.jsx)(C,{variant:"openai",isOpen:v,onClose:()=>j(!1),onCreated:e=>{o(t=>[...t,e]),j(!1)}}),(0,a.jsx)(C,{variant:"anthropic",isOpen:N,onClose:()=>w(!1),onCreated:e=>{o(t=>[...t,e]),w(!1)}}),I&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>E(null),children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,a.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,a.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,a.jsx)("button",{onClick:()=>E(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,a.jsx)("div",{className:"p-5",children:(0,a.jsx)(S,{results:I})})]})]})]})}function P({providerId:e,provider:t,stats:r,authType:s,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:m}=r,x=!!t.noAuth;return(0,a.jsx)(u(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,a.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${m?"opacity-50":""}`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,a.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:m?(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):x?(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,a.jsxs)(a.Fragment,{children:[A(i,d,c),p&&(0,a.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r.total>0&&(0,a.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!m)},children:(0,a.jsx)(n.lM,{size:"sm",checked:!m,onChange:()=>{},title:m?"Enable provider":"Disable provider"})})})]})})})}function O({providerId:e,provider:t,stats:r,authType:s,onToggle:l}){let{connected:i,error:c,errorCode:m,errorTime:x,allDisabled:h}=r,f=e.startsWith(p.JH),b=e.startsWith(p.DI);return(0,a.jsx)(u(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,a.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${h?"opacity-50":""}`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,a.jsx)(o.A,{src:f&&t.apiType?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":b?"/providers/anthropic-m.png":(0,d.HY)(t.id),alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,a.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:h?(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,a.jsxs)(a.Fragment,{children:[A(i,c,m),f&&(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),b&&(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,a.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r.total>0&&(0,a.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!h)},children:(0,a.jsx)(n.lM,{size:"sm",checked:!h,onChange:()=>{},title:h?"Enable provider":"Disable provider"})})})]})})})}function S({results:e}){if(e.error&&!e.results)return(0,a.jsxs)("div",{className:"text-center py-6",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:r}=e,s=e.results||[];return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,a.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[r]||r," Test"]}),(0,a.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,a.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,a.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),s.map((e,t)=>(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,a.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,a.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,a.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,a.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,a.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===s.length&&(0,a.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}P.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},O.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},S.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},69671:(e,t,r)=>{Promise.resolve().then(r.bind(r,62622))}},e=>{e.O(0,[8010,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=69671)),_N_E=e.O()}]);