9router 0.5.112 → 0.5.119

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 (1244) hide show
  1. package/README.md +2 -2
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +12 -11
  4. package/app/.next-cli-build/build-manifest.json +2 -2
  5. package/app/.next-cli-build/prerender-manifest.json +4 -4
  6. package/app/.next-cli-build/required-server-files.json +7 -1
  7. package/app/.next-cli-build/routes-manifest.json +6 -0
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +16 -16
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +4 -4
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  78. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  88. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  89. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  90. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  91. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  92. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  93. package/app/.next-cli-build/server/app/api/auth/login/route.js +2 -2
  94. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +2 -2
  108. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  116. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
  126. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  132. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  140. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  142. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  146. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  148. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js +2 -2
  152. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  156. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  158. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +3 -3
  160. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  162. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  164. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
  166. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -2
  168. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  198. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/commandcode/auto-import/route.js +4 -0
  232. package/app/.next-cli-build/server/app/api/oauth/commandcode/auto-import/route.js.nft.json +1 -0
  233. package/app/.next-cli-build/server/app/api/oauth/commandcode/auto-import/route_client-reference-manifest.js +1 -0
  234. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  259. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
  265. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/providers/web-login/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/providers/web-login/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  305. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  307. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +2 -2
  309. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  314. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  316. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  318. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  320. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  322. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  324. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  326. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  328. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  344. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  366. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +4 -4
  394. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +6 -3
  402. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  430. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  436. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  438. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  442. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  444. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  445. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  446. package/app/.next-cli-build/server/app/callback.html +1 -1
  447. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  448. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  449. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  450. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
  451. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +4 -4
  453. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +4 -4
  454. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +4 -4
  455. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  458. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +5 -5
  459. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  460. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/combos.rsc +4 -4
  463. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +4 -4
  464. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +4 -4
  465. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  467. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +4 -4
  468. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +4 -4
  469. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +4 -4
  470. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  471. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +4 -4
  473. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +4 -4
  474. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +4 -4
  475. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  476. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  478. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +5 -5
  479. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  480. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  481. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/profile.rsc +4 -4
  483. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +4 -4
  484. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
  485. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  486. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  487. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +4 -4
  488. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +4 -4
  489. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +4 -4
  490. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  491. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/providers.rsc +4 -4
  493. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +4 -4
  494. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
  495. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  496. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  498. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  499. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  500. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  501. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +4 -4
  503. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +4 -4
  504. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +4 -4
  505. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  506. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  507. package/app/.next-cli-build/server/app/dashboard/quota.rsc +5 -5
  508. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +5 -5
  509. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +5 -5
  510. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  511. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  516. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  517. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
  519. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  520. package/app/.next-cli-build/server/app/dashboard/skills.rsc +4 -4
  521. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +4 -4
  522. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +4 -4
  523. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  524. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +4 -4
  526. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +4 -4
  527. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +4 -4
  528. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  529. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  530. package/app/.next-cli-build/server/app/dashboard/translator.rsc +4 -4
  531. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +4 -4
  532. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +4 -4
  533. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  534. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  536. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
  537. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  538. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  539. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  540. package/app/.next-cli-build/server/app/dashboard.rsc +4 -4
  541. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +4 -4
  542. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +4 -4
  543. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  544. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  545. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  546. package/app/.next-cli-build/server/app/index.html +1 -1
  547. package/app/.next-cli-build/server/app/index.rsc +4 -4
  548. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  549. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  550. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  551. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  552. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  553. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  554. package/app/.next-cli-build/server/app/landing.html +1 -1
  555. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  556. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  557. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  558. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
  559. package/app/.next-cli-build/server/app/login/page.js +1 -1
  560. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  561. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  562. package/app/.next-cli-build/server/app/login.html +1 -1
  563. package/app/.next-cli-build/server/app/login.rsc +4 -4
  564. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  565. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  566. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  567. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  568. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  569. package/app/.next-cli-build/server/app/page.js +1 -1
  570. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  571. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  572. package/app/.next-cli-build/server/app-paths-manifest.json +12 -11
  573. package/app/.next-cli-build/server/chunks/1051.js +1 -1
  574. package/app/.next-cli-build/server/chunks/1133.js +1 -1
  575. package/app/.next-cli-build/server/chunks/1297.js +29 -0
  576. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  577. package/app/.next-cli-build/server/chunks/1356.js +1 -1
  578. package/app/.next-cli-build/server/chunks/1757.js +1 -1
  579. package/app/.next-cli-build/server/chunks/{2365.js → 1866.js} +1 -1
  580. package/app/.next-cli-build/server/chunks/238.js +1 -1
  581. package/app/.next-cli-build/server/chunks/24.js +1 -1
  582. package/app/.next-cli-build/server/chunks/2598.js +1 -1
  583. package/app/.next-cli-build/server/chunks/2822.js +1 -1
  584. package/app/.next-cli-build/server/chunks/2840.js +1 -0
  585. package/app/.next-cli-build/server/chunks/3225.js +1 -1
  586. package/app/.next-cli-build/server/chunks/3697.js +1 -1
  587. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  588. package/app/.next-cli-build/server/chunks/412.js +5 -5
  589. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  590. package/app/.next-cli-build/server/chunks/4279.js +1 -1
  591. package/app/.next-cli-build/server/chunks/4882.js +1 -1
  592. package/app/.next-cli-build/server/chunks/5299.js +1 -1
  593. package/app/.next-cli-build/server/chunks/5330.js +40 -40
  594. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  595. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  596. package/app/.next-cli-build/server/chunks/615.js +1 -1
  597. package/app/.next-cli-build/server/chunks/6297.js +1 -0
  598. package/app/.next-cli-build/server/chunks/6576.js +1 -0
  599. package/app/.next-cli-build/server/chunks/6690.js +1 -1
  600. package/app/.next-cli-build/server/chunks/6724.js +1 -1
  601. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  602. package/app/.next-cli-build/server/chunks/6877.js +1 -1
  603. package/app/.next-cli-build/server/chunks/7187.js +1 -1
  604. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  605. package/app/.next-cli-build/server/chunks/7373.js +1 -1
  606. package/app/.next-cli-build/server/chunks/7525.js +1 -1
  607. package/app/.next-cli-build/server/chunks/7552.js +1 -1
  608. package/app/.next-cli-build/server/chunks/7716.js +1 -1
  609. package/app/.next-cli-build/server/chunks/7843.js +51 -0
  610. package/app/.next-cli-build/server/chunks/8251.js +1 -1
  611. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  612. package/app/.next-cli-build/server/chunks/8402.js +1 -1
  613. package/app/.next-cli-build/server/chunks/8416.js +1 -1
  614. package/app/.next-cli-build/server/chunks/8623.js +1 -1
  615. package/app/.next-cli-build/server/chunks/866.js +1 -0
  616. package/app/.next-cli-build/server/chunks/869.js +1 -1
  617. package/app/.next-cli-build/server/chunks/8895.js +4 -4
  618. package/app/.next-cli-build/server/chunks/8896.js +1 -0
  619. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  620. package/app/.next-cli-build/server/chunks/9128.js +1 -1
  621. package/app/.next-cli-build/server/chunks/9198.js +1 -0
  622. package/app/.next-cli-build/server/chunks/9489.js +1 -1
  623. package/app/.next-cli-build/server/chunks/9604.js +1 -1
  624. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  625. package/app/.next-cli-build/server/chunks/9696.js +1 -1
  626. package/app/.next-cli-build/server/instrumentation.js +1 -1
  627. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  628. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  629. package/app/.next-cli-build/server/middleware.js +14 -14
  630. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  631. package/app/.next-cli-build/server/pages/404.html +1 -1
  632. package/app/.next-cli-build/server/pages/500.html +1 -1
  633. package/app/.next-cli-build/server/preview-props.json +3 -3
  634. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  635. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  636. package/app/.next-cli-build/server/webpack-runtime.js +1 -1
  637. package/app/.next-cli-build/static/5PG9DiG39fbvOpgKSnR7p/_buildManifest.js +1 -0
  638. package/app/.next-cli-build/static/chunks/1321-2fde166305caeddb.js +1 -0
  639. package/app/.next-cli-build/static/chunks/5497-2d39b4ce6857f490.js +7 -0
  640. package/app/.next-cli-build/static/chunks/{761-f671b0371daf6356.js → 761-4ab39a76a6565658.js} +8 -8
  641. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-0f55372821920062.js → page-899c85a4a09b87cc.js} +15 -15
  642. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-c13b42f0dbad8fcd.js +27 -0
  643. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-8f7c68a9ddffe74b.js +4 -0
  644. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-6923bda560bbc869.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-3b1b5d8e342d932f.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/_global-error/{page-a70f643786fb402f.js → page-4e22949b210a2492.js} +1 -1
  647. package/app/.next-cli-build/static/chunks/app/api/auth/login/{route-a70f643786fb402f.js → route-4e22949b210a2492.js} +1 -1
  648. package/app/.next-cli-build/static/chunks/app/api/auth/logout/{route-a70f643786fb402f.js → route-4e22949b210a2492.js} +1 -1
  649. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/{route-a70f643786fb402f.js → route-4e22949b210a2492.js} +1 -1
  650. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-4e22949b210a2492.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-4e22949b210a2492.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-4e22949b210a2492.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-4e22949b210a2492.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-4e22949b210a2492.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-4e22949b210a2492.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-4e22949b210a2492.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-4e22949b210a2492.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-4e22949b210a2492.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-4e22949b210a2492.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-4e22949b210a2492.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-4e22949b210a2492.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-4e22949b210a2492.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-4e22949b210a2492.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-4e22949b210a2492.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-4e22949b210a2492.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-4e22949b210a2492.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-4e22949b210a2492.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-4e22949b210a2492.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-4e22949b210a2492.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-4e22949b210a2492.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-4e22949b210a2492.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-4e22949b210a2492.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-4e22949b210a2492.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-4e22949b210a2492.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-4e22949b210a2492.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-profiles/route-4e22949b210a2492.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-4e22949b210a2492.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-4e22949b210a2492.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-4e22949b210a2492.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-4e22949b210a2492.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-4e22949b210a2492.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-4e22949b210a2492.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-4e22949b210a2492.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-4e22949b210a2492.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-4e22949b210a2492.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-4e22949b210a2492.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/combos/route-4e22949b210a2492.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-4e22949b210a2492.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-4e22949b210a2492.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-4e22949b210a2492.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-4e22949b210a2492.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-4e22949b210a2492.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-4e22949b210a2492.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/health/route-4e22949b210a2492.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/init/route-4e22949b210a2492.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-4e22949b210a2492.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/keys/route-4e22949b210a2492.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/locale/route-4e22949b210a2492.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-4e22949b210a2492.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-4e22949b210a2492.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-4e22949b210a2492.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-4e22949b210a2492.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-4e22949b210a2492.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-4e22949b210a2492.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-4e22949b210a2492.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-4e22949b210a2492.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-4e22949b210a2492.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-4e22949b210a2492.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-4e22949b210a2492.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-4e22949b210a2492.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/models/route-4e22949b210a2492.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/models/test/route-4e22949b210a2492.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-4e22949b210a2492.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-4e22949b210a2492.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-4e22949b210a2492.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/oauth/commandcode/auto-import/route-4e22949b210a2492.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-4e22949b210a2492.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-4e22949b210a2492.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-4e22949b210a2492.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-4e22949b210a2492.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-4e22949b210a2492.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-4e22949b210a2492.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-4e22949b210a2492.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-4e22949b210a2492.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-4e22949b210a2492.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-4e22949b210a2492.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-4e22949b210a2492.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-4e22949b210a2492.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-4e22949b210a2492.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-4e22949b210a2492.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-4e22949b210a2492.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-4e22949b210a2492.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-4e22949b210a2492.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/pricing/route-4e22949b210a2492.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-4e22949b210a2492.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-4e22949b210a2492.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-4e22949b210a2492.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-4e22949b210a2492.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-4e22949b210a2492.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-4e22949b210a2492.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-4e22949b210a2492.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-4e22949b210a2492.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-4e22949b210a2492.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-4e22949b210a2492.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/providers/route-4e22949b210a2492.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-4e22949b210a2492.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-4e22949b210a2492.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-4e22949b210a2492.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/providers/web-login/route-4e22949b210a2492.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-4e22949b210a2492.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-4e22949b210a2492.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-4e22949b210a2492.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-4e22949b210a2492.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/netlify-deploy/route-4e22949b210a2492.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-4e22949b210a2492.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-4e22949b210a2492.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-4e22949b210a2492.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-4e22949b210a2492.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-4e22949b210a2492.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-4e22949b210a2492.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-4e22949b210a2492.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-4e22949b210a2492.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-4e22949b210a2492.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-4e22949b210a2492.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-4e22949b210a2492.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-4e22949b210a2492.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-4e22949b210a2492.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/settings/route-4e22949b210a2492.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-4e22949b210a2492.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/tags/route-4e22949b210a2492.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-4e22949b210a2492.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-4e22949b210a2492.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-4e22949b210a2492.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-4e22949b210a2492.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-4e22949b210a2492.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-4e22949b210a2492.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-4e22949b210a2492.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-4e22949b210a2492.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-4e22949b210a2492.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-4e22949b210a2492.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-4e22949b210a2492.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-4e22949b210a2492.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-4e22949b210a2492.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-4e22949b210a2492.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-4e22949b210a2492.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-4e22949b210a2492.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-4e22949b210a2492.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-4e22949b210a2492.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-4e22949b210a2492.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-4e22949b210a2492.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-4e22949b210a2492.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-4e22949b210a2492.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-4e22949b210a2492.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-4e22949b210a2492.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-4e22949b210a2492.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-4e22949b210a2492.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-4e22949b210a2492.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-4e22949b210a2492.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-4e22949b210a2492.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-4e22949b210a2492.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-4e22949b210a2492.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-4e22949b210a2492.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-4e22949b210a2492.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-4e22949b210a2492.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-4e22949b210a2492.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-4e22949b210a2492.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-4e22949b210a2492.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-4e22949b210a2492.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/v1/route-4e22949b210a2492.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-4e22949b210a2492.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-4e22949b210a2492.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-4e22949b210a2492.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-4e22949b210a2492.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-4e22949b210a2492.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-4e22949b210a2492.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-4e22949b210a2492.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-4e22949b210a2492.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-4e22949b210a2492.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/version/route-4e22949b210a2492.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-4e22949b210a2492.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/version/update/route-4e22949b210a2492.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-4e22949b210a2492.js +1 -0
  823. package/app/.next-cli-build/static/chunks/app/page-4e22949b210a2492.js +1 -0
  824. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-4e22949b210a2492.js +1 -0
  825. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-4e22949b210a2492.js +1 -0
  826. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-4e22949b210a2492.js +1 -0
  827. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-4e22949b210a2492.js +1 -0
  828. package/app/.next-cli-build/static/css/836344dc90be2bb4.css +1 -0
  829. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  830. package/app/node_modules/undici/LICENSE +21 -0
  831. package/app/node_modules/undici/README.md +741 -0
  832. package/app/node_modules/undici/docs/docs/api/Agent.md +84 -0
  833. package/app/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
  834. package/app/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
  835. package/app/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
  836. package/app/node_modules/undici/docs/docs/api/Client.md +290 -0
  837. package/app/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
  838. package/app/node_modules/undici/docs/docs/api/Connector.md +115 -0
  839. package/app/node_modules/undici/docs/docs/api/ContentType.md +57 -0
  840. package/app/node_modules/undici/docs/docs/api/Cookies.md +128 -0
  841. package/app/node_modules/undici/docs/docs/api/Debug.md +62 -0
  842. package/app/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +317 -0
  843. package/app/node_modules/undici/docs/docs/api/Dispatcher.md +1393 -0
  844. package/app/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
  845. package/app/node_modules/undici/docs/docs/api/Errors.md +49 -0
  846. package/app/node_modules/undici/docs/docs/api/EventSource.md +45 -0
  847. package/app/node_modules/undici/docs/docs/api/Fetch.md +60 -0
  848. package/app/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
  849. package/app/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
  850. package/app/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
  851. package/app/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
  852. package/app/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
  853. package/app/node_modules/undici/docs/docs/api/MockClient.md +81 -0
  854. package/app/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
  855. package/app/node_modules/undici/docs/docs/api/MockPool.md +555 -0
  856. package/app/node_modules/undici/docs/docs/api/Pool.md +84 -0
  857. package/app/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
  858. package/app/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
  859. package/app/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
  860. package/app/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
  861. package/app/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
  862. package/app/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
  863. package/app/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
  864. package/app/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
  865. package/app/node_modules/undici/docs/docs/api/Util.md +25 -0
  866. package/app/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
  867. package/app/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
  868. package/app/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
  869. package/app/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
  870. package/app/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
  871. package/app/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
  872. package/app/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
  873. package/app/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
  874. package/app/node_modules/undici/index-fetch.js +65 -0
  875. package/app/node_modules/undici/index.d.ts +3 -0
  876. package/app/node_modules/undici/index.js +234 -0
  877. package/app/node_modules/undici/lib/api/abort-signal.js +59 -0
  878. package/app/node_modules/undici/lib/api/api-connect.js +110 -0
  879. package/app/node_modules/undici/lib/api/api-pipeline.js +252 -0
  880. package/app/node_modules/undici/lib/api/api-request.js +214 -0
  881. package/app/node_modules/undici/lib/api/api-stream.js +209 -0
  882. package/app/node_modules/undici/lib/api/api-upgrade.js +111 -0
  883. package/app/node_modules/undici/lib/api/index.js +7 -0
  884. package/app/node_modules/undici/lib/api/readable.js +580 -0
  885. package/app/node_modules/undici/lib/cache/memory-cache-store.js +279 -0
  886. package/app/node_modules/undici/lib/cache/sqlite-cache-store.js +469 -0
  887. package/app/node_modules/undici/lib/core/connect.js +159 -0
  888. package/app/node_modules/undici/lib/core/constants.js +143 -0
  889. package/app/node_modules/undici/lib/core/diagnostics.js +227 -0
  890. package/app/node_modules/undici/lib/core/errors.js +477 -0
  891. package/app/node_modules/undici/lib/core/request.js +485 -0
  892. package/app/node_modules/undici/lib/core/socks5-client.js +422 -0
  893. package/app/node_modules/undici/lib/core/socks5-utils.js +212 -0
  894. package/app/node_modules/undici/lib/core/symbols.js +76 -0
  895. package/app/node_modules/undici/lib/core/tree.js +160 -0
  896. package/app/node_modules/undici/lib/core/util.js +1013 -0
  897. package/app/node_modules/undici/lib/dispatcher/agent.js +162 -0
  898. package/app/node_modules/undici/lib/dispatcher/balanced-pool.js +221 -0
  899. package/app/node_modules/undici/lib/dispatcher/client-h1.js +1769 -0
  900. package/app/node_modules/undici/lib/dispatcher/client-h2.js +1056 -0
  901. package/app/node_modules/undici/lib/dispatcher/client.js +669 -0
  902. package/app/node_modules/undici/lib/dispatcher/dispatcher-base.js +196 -0
  903. package/app/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  904. package/app/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  905. package/app/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  906. package/app/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
  907. package/app/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  908. package/app/node_modules/undici/lib/dispatcher/pool.js +118 -0
  909. package/app/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
  910. package/app/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  911. package/app/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
  912. package/app/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +260 -0
  913. package/app/node_modules/undici/lib/encoding/index.js +33 -0
  914. package/app/node_modules/undici/lib/global.js +59 -0
  915. package/app/node_modules/undici/lib/handler/cache-handler.js +1181 -0
  916. package/app/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
  917. package/app/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  918. package/app/node_modules/undici/lib/handler/deduplication-handler.js +504 -0
  919. package/app/node_modules/undici/lib/handler/redirect-handler.js +273 -0
  920. package/app/node_modules/undici/lib/handler/retry-handler.js +504 -0
  921. package/app/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
  922. package/app/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  923. package/app/node_modules/undici/lib/interceptor/cache.js +746 -0
  924. package/app/node_modules/undici/lib/interceptor/decompress.js +567 -0
  925. package/app/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
  926. package/app/node_modules/undici/lib/interceptor/dns.js +571 -0
  927. package/app/node_modules/undici/lib/interceptor/dump.js +99 -0
  928. package/app/node_modules/undici/lib/interceptor/redirect.js +21 -0
  929. package/app/node_modules/undici/lib/interceptor/response-error.js +95 -0
  930. package/app/node_modules/undici/lib/interceptor/retry.js +19 -0
  931. package/app/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  932. package/app/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
  933. package/app/node_modules/undici/lib/llhttp/constants.js +531 -0
  934. package/app/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  935. package/app/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  936. package/app/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
  937. package/app/node_modules/undici/lib/llhttp/utils.js +12 -0
  938. package/app/node_modules/undici/lib/mock/mock-agent.js +232 -0
  939. package/app/node_modules/undici/lib/mock/mock-call-history.js +248 -0
  940. package/app/node_modules/undici/lib/mock/mock-client.js +68 -0
  941. package/app/node_modules/undici/lib/mock/mock-errors.js +29 -0
  942. package/app/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  943. package/app/node_modules/undici/lib/mock/mock-pool.js +68 -0
  944. package/app/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  945. package/app/node_modules/undici/lib/mock/mock-utils.js +486 -0
  946. package/app/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  947. package/app/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
  948. package/app/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
  949. package/app/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
  950. package/app/node_modules/undici/lib/util/cache.js +709 -0
  951. package/app/node_modules/undici/lib/util/date.js +670 -0
  952. package/app/node_modules/undici/lib/util/promise.js +28 -0
  953. package/app/node_modules/undici/lib/util/runtime-features.js +124 -0
  954. package/app/node_modules/undici/lib/util/stats.js +32 -0
  955. package/app/node_modules/undici/lib/util/timers.js +425 -0
  956. package/app/node_modules/undici/lib/web/cache/cache.js +864 -0
  957. package/app/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  958. package/app/node_modules/undici/lib/web/cache/util.js +45 -0
  959. package/app/node_modules/undici/lib/web/cookies/constants.js +12 -0
  960. package/app/node_modules/undici/lib/web/cookies/index.js +201 -0
  961. package/app/node_modules/undici/lib/web/cookies/parse.js +315 -0
  962. package/app/node_modules/undici/lib/web/cookies/util.js +371 -0
  963. package/app/node_modules/undici/lib/web/eventsource/eventsource-stream.js +575 -0
  964. package/app/node_modules/undici/lib/web/eventsource/eventsource.js +504 -0
  965. package/app/node_modules/undici/lib/web/eventsource/util.js +29 -0
  966. package/app/node_modules/undici/lib/web/fetch/LICENSE +21 -0
  967. package/app/node_modules/undici/lib/web/fetch/body.js +518 -0
  968. package/app/node_modules/undici/lib/web/fetch/constants.js +131 -0
  969. package/app/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  970. package/app/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
  971. package/app/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  972. package/app/node_modules/undici/lib/web/fetch/global.js +40 -0
  973. package/app/node_modules/undici/lib/web/fetch/headers.js +719 -0
  974. package/app/node_modules/undici/lib/web/fetch/index.js +2413 -0
  975. package/app/node_modules/undici/lib/web/fetch/request.js +1115 -0
  976. package/app/node_modules/undici/lib/web/fetch/response.js +641 -0
  977. package/app/node_modules/undici/lib/web/fetch/util.js +1522 -0
  978. package/app/node_modules/undici/lib/web/infra/index.js +243 -0
  979. package/app/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
  980. package/app/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
  981. package/app/node_modules/undici/lib/web/webidl/index.js +1006 -0
  982. package/app/node_modules/undici/lib/web/websocket/connection.js +339 -0
  983. package/app/node_modules/undici/lib/web/websocket/constants.js +126 -0
  984. package/app/node_modules/undici/lib/web/websocket/events.js +331 -0
  985. package/app/node_modules/undici/lib/web/websocket/frame.js +133 -0
  986. package/app/node_modules/undici/lib/web/websocket/permessage-deflate.js +105 -0
  987. package/app/node_modules/undici/lib/web/websocket/receiver.js +520 -0
  988. package/app/node_modules/undici/lib/web/websocket/sender.js +109 -0
  989. package/app/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
  990. package/app/node_modules/undici/lib/web/websocket/stream/websocketstream.js +496 -0
  991. package/app/node_modules/undici/lib/web/websocket/util.js +347 -0
  992. package/app/node_modules/undici/lib/web/websocket/websocket.js +758 -0
  993. package/app/node_modules/undici/package.json +152 -0
  994. package/app/node_modules/undici/scripts/strip-comments.js +10 -0
  995. package/app/node_modules/undici/types/README.md +6 -0
  996. package/app/node_modules/undici/types/agent.d.ts +32 -0
  997. package/app/node_modules/undici/types/api.d.ts +43 -0
  998. package/app/node_modules/undici/types/balanced-pool.d.ts +30 -0
  999. package/app/node_modules/undici/types/cache-interceptor.d.ts +179 -0
  1000. package/app/node_modules/undici/types/cache.d.ts +36 -0
  1001. package/app/node_modules/undici/types/client-stats.d.ts +15 -0
  1002. package/app/node_modules/undici/types/client.d.ts +153 -0
  1003. package/app/node_modules/undici/types/connector.d.ts +36 -0
  1004. package/app/node_modules/undici/types/content-type.d.ts +21 -0
  1005. package/app/node_modules/undici/types/cookies.d.ts +30 -0
  1006. package/app/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
  1007. package/app/node_modules/undici/types/dispatcher.d.ts +275 -0
  1008. package/app/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
  1009. package/app/node_modules/undici/types/errors.d.ts +177 -0
  1010. package/app/node_modules/undici/types/eventsource.d.ts +66 -0
  1011. package/app/node_modules/undici/types/fetch.d.ts +231 -0
  1012. package/app/node_modules/undici/types/formdata.d.ts +114 -0
  1013. package/app/node_modules/undici/types/global-dispatcher.d.ts +9 -0
  1014. package/app/node_modules/undici/types/global-origin.d.ts +7 -0
  1015. package/app/node_modules/undici/types/h2c-client.d.ts +73 -0
  1016. package/app/node_modules/undici/types/handlers.d.ts +14 -0
  1017. package/app/node_modules/undici/types/header.d.ts +160 -0
  1018. package/app/node_modules/undici/types/index.d.ts +91 -0
  1019. package/app/node_modules/undici/types/interceptors.d.ts +82 -0
  1020. package/app/node_modules/undici/types/mock-agent.d.ts +68 -0
  1021. package/app/node_modules/undici/types/mock-call-history.d.ts +111 -0
  1022. package/app/node_modules/undici/types/mock-client.d.ts +27 -0
  1023. package/app/node_modules/undici/types/mock-errors.d.ts +12 -0
  1024. package/app/node_modules/undici/types/mock-interceptor.d.ts +94 -0
  1025. package/app/node_modules/undici/types/mock-pool.d.ts +27 -0
  1026. package/app/node_modules/undici/types/patch.d.ts +29 -0
  1027. package/app/node_modules/undici/types/pool-stats.d.ts +19 -0
  1028. package/app/node_modules/undici/types/pool.d.ts +41 -0
  1029. package/app/node_modules/undici/types/proxy-agent.d.ts +29 -0
  1030. package/app/node_modules/undici/types/readable.d.ts +68 -0
  1031. package/app/node_modules/undici/types/retry-agent.d.ts +8 -0
  1032. package/app/node_modules/undici/types/retry-handler.d.ts +125 -0
  1033. package/app/node_modules/undici/types/round-robin-pool.d.ts +41 -0
  1034. package/app/node_modules/undici/types/snapshot-agent.d.ts +109 -0
  1035. package/app/node_modules/undici/types/socks5-proxy-agent.d.ts +25 -0
  1036. package/app/node_modules/undici/types/util.d.ts +18 -0
  1037. package/app/node_modules/undici/types/utility.d.ts +7 -0
  1038. package/app/node_modules/undici/types/webidl.d.ts +347 -0
  1039. package/app/node_modules/undici/types/websocket.d.ts +188 -0
  1040. package/app/open-sse/lib/deepseek-pow-hash.js +136 -0
  1041. package/app/package.json +5 -2
  1042. package/app/public/providers/sensenova-intl.png +0 -0
  1043. package/app/server.js +1 -1
  1044. package/app/src/shared/services/quotaAutoPing.js +17 -2
  1045. package/cli.js +112 -55
  1046. package/hooks/sqliteRuntime.js +2 -1
  1047. package/package.json +2 -2
  1048. package/src/cli/tray/tray.js +88 -9
  1049. package/src/cli/utils/launcherProcess.js +186 -0
  1050. package/app/.next-cli-build/server/chunks/2132.js +0 -1
  1051. package/app/.next-cli-build/server/chunks/2380.js +0 -79
  1052. package/app/.next-cli-build/server/chunks/436.js +0 -1
  1053. package/app/.next-cli-build/server/chunks/4480.js +0 -1
  1054. package/app/.next-cli-build/server/chunks/7557.js +0 -1
  1055. package/app/.next-cli-build/server/chunks/7774.js +0 -120
  1056. package/app/.next-cli-build/server/chunks/7995.js +0 -120
  1057. package/app/.next-cli-build/server/chunks/8128.js +0 -1
  1058. package/app/.next-cli-build/server/chunks/8499.js +0 -1
  1059. package/app/.next-cli-build/static/Mwpv7kpqnhzp2SJMtsIA1/_buildManifest.js +0 -1
  1060. package/app/.next-cli-build/static/chunks/1321-02944667ec55f586.js +0 -1
  1061. package/app/.next-cli-build/static/chunks/5497-870732fd9d818574.js +0 -7
  1062. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-f9897bc47dce7e8f.js +0 -27
  1063. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-e5d73ba422004783.js +0 -4
  1064. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-2b2fe8a972d455af.js +0 -1
  1065. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-888c58ee93724e20.js +0 -1
  1066. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-a70f643786fb402f.js +0 -1
  1067. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-a70f643786fb402f.js +0 -1
  1068. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-a70f643786fb402f.js +0 -1
  1069. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-a70f643786fb402f.js +0 -1
  1070. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-a70f643786fb402f.js +0 -1
  1071. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-a70f643786fb402f.js +0 -1
  1072. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-a70f643786fb402f.js +0 -1
  1073. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-a70f643786fb402f.js +0 -1
  1074. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-a70f643786fb402f.js +0 -1
  1075. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-a70f643786fb402f.js +0 -1
  1076. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-a70f643786fb402f.js +0 -1
  1077. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-a70f643786fb402f.js +0 -1
  1078. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-a70f643786fb402f.js +0 -1
  1079. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-a70f643786fb402f.js +0 -1
  1080. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-a70f643786fb402f.js +0 -1
  1081. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-a70f643786fb402f.js +0 -1
  1082. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-a70f643786fb402f.js +0 -1
  1083. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-a70f643786fb402f.js +0 -1
  1084. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-a70f643786fb402f.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-a70f643786fb402f.js +0 -1
  1086. package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-a70f643786fb402f.js +0 -1
  1087. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-a70f643786fb402f.js +0 -1
  1088. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-a70f643786fb402f.js +0 -1
  1089. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-a70f643786fb402f.js +0 -1
  1090. package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-a70f643786fb402f.js +0 -1
  1091. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-a70f643786fb402f.js +0 -1
  1092. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-profiles/route-a70f643786fb402f.js +0 -1
  1093. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-a70f643786fb402f.js +0 -1
  1094. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-a70f643786fb402f.js +0 -1
  1095. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-a70f643786fb402f.js +0 -1
  1096. package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-a70f643786fb402f.js +0 -1
  1097. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-a70f643786fb402f.js +0 -1
  1098. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-a70f643786fb402f.js +0 -1
  1099. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-a70f643786fb402f.js +0 -1
  1100. package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-a70f643786fb402f.js +0 -1
  1101. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-a70f643786fb402f.js +0 -1
  1102. package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-a70f643786fb402f.js +0 -1
  1103. package/app/.next-cli-build/static/chunks/app/api/combos/route-a70f643786fb402f.js +0 -1
  1104. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-a70f643786fb402f.js +0 -1
  1105. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-a70f643786fb402f.js +0 -1
  1106. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-a70f643786fb402f.js +0 -1
  1107. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-a70f643786fb402f.js +0 -1
  1108. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-a70f643786fb402f.js +0 -1
  1109. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-a70f643786fb402f.js +0 -1
  1110. package/app/.next-cli-build/static/chunks/app/api/health/route-a70f643786fb402f.js +0 -1
  1111. package/app/.next-cli-build/static/chunks/app/api/init/route-a70f643786fb402f.js +0 -1
  1112. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-a70f643786fb402f.js +0 -1
  1113. package/app/.next-cli-build/static/chunks/app/api/keys/route-a70f643786fb402f.js +0 -1
  1114. package/app/.next-cli-build/static/chunks/app/api/locale/route-a70f643786fb402f.js +0 -1
  1115. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-a70f643786fb402f.js +0 -1
  1116. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-a70f643786fb402f.js +0 -1
  1117. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-a70f643786fb402f.js +0 -1
  1118. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-a70f643786fb402f.js +0 -1
  1119. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-a70f643786fb402f.js +0 -1
  1120. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-a70f643786fb402f.js +0 -1
  1121. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-a70f643786fb402f.js +0 -1
  1122. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-a70f643786fb402f.js +0 -1
  1123. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-a70f643786fb402f.js +0 -1
  1124. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-a70f643786fb402f.js +0 -1
  1125. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-a70f643786fb402f.js +0 -1
  1126. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-a70f643786fb402f.js +0 -1
  1127. package/app/.next-cli-build/static/chunks/app/api/models/route-a70f643786fb402f.js +0 -1
  1128. package/app/.next-cli-build/static/chunks/app/api/models/test/route-a70f643786fb402f.js +0 -1
  1129. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-a70f643786fb402f.js +0 -1
  1130. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-a70f643786fb402f.js +0 -1
  1131. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-a70f643786fb402f.js +0 -1
  1132. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-a70f643786fb402f.js +0 -1
  1133. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-a70f643786fb402f.js +0 -1
  1134. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-a70f643786fb402f.js +0 -1
  1135. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-a70f643786fb402f.js +0 -1
  1136. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-a70f643786fb402f.js +0 -1
  1137. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-a70f643786fb402f.js +0 -1
  1138. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-a70f643786fb402f.js +0 -1
  1139. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-a70f643786fb402f.js +0 -1
  1140. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-a70f643786fb402f.js +0 -1
  1141. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-a70f643786fb402f.js +0 -1
  1142. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-a70f643786fb402f.js +0 -1
  1143. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-a70f643786fb402f.js +0 -1
  1144. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-a70f643786fb402f.js +0 -1
  1145. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-a70f643786fb402f.js +0 -1
  1146. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-a70f643786fb402f.js +0 -1
  1147. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-a70f643786fb402f.js +0 -1
  1148. package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-a70f643786fb402f.js +0 -1
  1149. package/app/.next-cli-build/static/chunks/app/api/pricing/route-a70f643786fb402f.js +0 -1
  1150. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-a70f643786fb402f.js +0 -1
  1151. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-a70f643786fb402f.js +0 -1
  1152. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-a70f643786fb402f.js +0 -1
  1153. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-a70f643786fb402f.js +0 -1
  1154. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-a70f643786fb402f.js +0 -1
  1155. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-a70f643786fb402f.js +0 -1
  1156. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-a70f643786fb402f.js +0 -1
  1157. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-a70f643786fb402f.js +0 -1
  1158. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-a70f643786fb402f.js +0 -1
  1159. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-a70f643786fb402f.js +0 -1
  1160. package/app/.next-cli-build/static/chunks/app/api/providers/route-a70f643786fb402f.js +0 -1
  1161. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-a70f643786fb402f.js +0 -1
  1162. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-a70f643786fb402f.js +0 -1
  1163. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-a70f643786fb402f.js +0 -1
  1164. package/app/.next-cli-build/static/chunks/app/api/providers/web-login/route-a70f643786fb402f.js +0 -1
  1165. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-a70f643786fb402f.js +0 -1
  1166. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-a70f643786fb402f.js +0 -1
  1167. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-a70f643786fb402f.js +0 -1
  1168. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-a70f643786fb402f.js +0 -1
  1169. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/netlify-deploy/route-a70f643786fb402f.js +0 -1
  1170. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-a70f643786fb402f.js +0 -1
  1171. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-a70f643786fb402f.js +0 -1
  1172. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-a70f643786fb402f.js +0 -1
  1173. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-a70f643786fb402f.js +0 -1
  1174. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-a70f643786fb402f.js +0 -1
  1175. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-a70f643786fb402f.js +0 -1
  1176. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-a70f643786fb402f.js +0 -1
  1177. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-a70f643786fb402f.js +0 -1
  1178. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-a70f643786fb402f.js +0 -1
  1179. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-a70f643786fb402f.js +0 -1
  1180. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-a70f643786fb402f.js +0 -1
  1181. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-a70f643786fb402f.js +0 -1
  1182. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-a70f643786fb402f.js +0 -1
  1183. package/app/.next-cli-build/static/chunks/app/api/settings/route-a70f643786fb402f.js +0 -1
  1184. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-a70f643786fb402f.js +0 -1
  1185. package/app/.next-cli-build/static/chunks/app/api/tags/route-a70f643786fb402f.js +0 -1
  1186. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-a70f643786fb402f.js +0 -1
  1187. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-a70f643786fb402f.js +0 -1
  1188. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-a70f643786fb402f.js +0 -1
  1189. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-a70f643786fb402f.js +0 -1
  1190. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-a70f643786fb402f.js +0 -1
  1191. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-a70f643786fb402f.js +0 -1
  1192. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-a70f643786fb402f.js +0 -1
  1193. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-a70f643786fb402f.js +0 -1
  1194. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-a70f643786fb402f.js +0 -1
  1195. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-a70f643786fb402f.js +0 -1
  1196. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-a70f643786fb402f.js +0 -1
  1197. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-a70f643786fb402f.js +0 -1
  1198. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-a70f643786fb402f.js +0 -1
  1199. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-a70f643786fb402f.js +0 -1
  1200. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-a70f643786fb402f.js +0 -1
  1201. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-a70f643786fb402f.js +0 -1
  1202. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-a70f643786fb402f.js +0 -1
  1203. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-a70f643786fb402f.js +0 -1
  1204. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-a70f643786fb402f.js +0 -1
  1205. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-a70f643786fb402f.js +0 -1
  1206. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-a70f643786fb402f.js +0 -1
  1207. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-a70f643786fb402f.js +0 -1
  1208. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-a70f643786fb402f.js +0 -1
  1209. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-a70f643786fb402f.js +0 -1
  1210. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-a70f643786fb402f.js +0 -1
  1211. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-a70f643786fb402f.js +0 -1
  1212. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-a70f643786fb402f.js +0 -1
  1213. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-a70f643786fb402f.js +0 -1
  1214. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-a70f643786fb402f.js +0 -1
  1215. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-a70f643786fb402f.js +0 -1
  1216. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-a70f643786fb402f.js +0 -1
  1217. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-a70f643786fb402f.js +0 -1
  1218. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-a70f643786fb402f.js +0 -1
  1219. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-a70f643786fb402f.js +0 -1
  1220. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-a70f643786fb402f.js +0 -1
  1221. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-a70f643786fb402f.js +0 -1
  1222. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-a70f643786fb402f.js +0 -1
  1223. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-a70f643786fb402f.js +0 -1
  1224. package/app/.next-cli-build/static/chunks/app/api/v1/route-a70f643786fb402f.js +0 -1
  1225. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-a70f643786fb402f.js +0 -1
  1226. package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-a70f643786fb402f.js +0 -1
  1227. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-a70f643786fb402f.js +0 -1
  1228. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-a70f643786fb402f.js +0 -1
  1229. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-a70f643786fb402f.js +0 -1
  1230. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-a70f643786fb402f.js +0 -1
  1231. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-a70f643786fb402f.js +0 -1
  1232. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-a70f643786fb402f.js +0 -1
  1233. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-a70f643786fb402f.js +0 -1
  1234. package/app/.next-cli-build/static/chunks/app/api/version/route-a70f643786fb402f.js +0 -1
  1235. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-a70f643786fb402f.js +0 -1
  1236. package/app/.next-cli-build/static/chunks/app/api/version/update/route-a70f643786fb402f.js +0 -1
  1237. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-a70f643786fb402f.js +0 -1
  1238. package/app/.next-cli-build/static/chunks/app/page-a70f643786fb402f.js +0 -1
  1239. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-a70f643786fb402f.js +0 -1
  1240. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-a70f643786fb402f.js +0 -1
  1241. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-a70f643786fb402f.js +0 -1
  1242. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-a70f643786fb402f.js +0 -1
  1243. package/app/.next-cli-build/static/css/eca85123800ee802.css +0 -1
  1244. /package/app/.next-cli-build/static/{Mwpv7kpqnhzp2SJMtsIA1 → 5PG9DiG39fbvOpgKSnR7p}/_ssgManifest.js +0 -0
@@ -1,10 +1,10 @@
1
- (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},7934:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12138:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>ae});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(29225),k=c(50412),l=c(92592),m=c(91431),n=c(70552),o=c(18982);c(87592);var p=c(60757);let q=["none","low","medium","high"],r=["none","thinking"],s=["none","low","medium","high","xhigh","max"],t={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":s,"claude-budget":s,"gemini-level":["minimal","low","medium","high"],"gemini-budget":q,zai:r,qwen:q,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:r,hunyuan:q,step:q,nous:q},u=["none","minimal","low","medium","high","xhigh","max"],v=["none","low","medium","high","max"],w=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:v},{pattern:"*claude*4-6*",levels:v},{provider:"codex",pattern:"*gpt-6*",levels:u},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...u,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...u,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:u},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"opencode",pattern:"*mimo*v2.6*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.1-flash-free*",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}],x=/(?:^|\/)gpt-(?:5\.6|6)(?:[.-]|$)/i;function y(a,b){if("kiro"===a&&null===function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(b))return"reasoning";if(!b.includes("claude"))return null;let c=function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return b?{major:Number(b[1]),minor:void 0===b[2]?null:Number(b[2])}:null}(a);if(!c)return null;let{major:d,minor:e}=c;return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}(b))return null;let c=(0,n.nl)(a,b);if(!c.reasoning)return null;let d=String(b||"").replace(/\([^()]+\)\s*$/,""),e="codex"===a?(0,p.SM)("cx").find(a=>a.id===d)?.thinkingLevels:null,f=w.find(c=>(!c.provider||c.provider===a)&&(0,o.gH)(c.pattern,b)),g=e||f?.levels||(String(a||"").startsWith("openai-compatible-")&&x.test(d)?u:null)||t[c.thinkingFormat]||q;return!1===c.thinkingCanDisable&&(g=g.filter(a=>"none"!==a)),g}var z=c(50377),A=c(29476),B=c(99258);function C({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}var D=c(49885),E=c.n(D);function F({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:l,isTesting:m,onDisable:n,caps:o,thinkingSuffix:p}){let q=p?`${b}(${p})`:b,r="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0;return(0,d.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:r?{color:r}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:q}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:a.name}),(0,d.jsx)(k.nh,{caps:o,colorOverride:"text-text-muted/70",size:12})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[l&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:l,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,d.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:m?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(q,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):n?(0,d.jsx)("button",{onClick:n,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function G({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function H({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:j,onDeleteCustomModel:l,connections:m,isAnthropic:n}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)({}),y=async b=>{if(!u){v(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();x(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{x(a=>({...a,[b]:"error"}))}finally{v(null)}}},z=C({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),A=async()=>{if(!o.trim()||q)return;let a=o.trim();if(z.some(b=>b.id===a))return void alert("Model already exists for this provider.");r(!0);try{await j(a),p("")}catch(a){console.log("Error adding model:",a)}finally{r(!1)}},B=async()=>{if(s)return;let a=m.find(a=>!1!==a.isActive);if(a){t(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(z.some(a=>a.id===b)||(await j(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{t(!1)}}},D=m.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>"Enter"===a.key&&A(),placeholder:n?"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,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:A,disabled:!o.trim()||q,children:q?"Adding...":"Add"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"download",onClick:B,disabled:!D||s,children:s?"Importing...":"Import from /models"})]}),!D&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),z.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:z.map(({id:c,alias:e,source:f})=>(0,d.jsx)(G,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?l(c):i(e),onTest:m.length>0?()=>y(c):void 0,testStatus:w[c],isTesting:u===c},`${f}-${a}/${c}`))})]})}F.propTypes={model:E().shape({id:E().string.isRequired}).isRequired,fullModel:E().string.isRequired,alias:E().string,copied:E().string,onCopy:E().func.isRequired,testStatus:E().oneOf(["ok","error"]),isCustom:E().bool,isFree:E().bool,onDeleteAlias:E().func,onTest:E().func,isTesting:E().bool,onDisable:E().func,caps:E().object,thinkingSuffix:E().string},E().string.isRequired,E().string.isRequired,E().string,E().func.isRequired,E().func.isRequired,E().func,E().oneOf(["ok","error"]),E().bool,E().string.isRequired,E().object.isRequired,E().arrayOf(E().object),E().string,E().func.isRequired,E().func.isRequired,E().func.isRequired,E().func.isRequired,H.propTypes={providerStorageAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,modelAliases:E().object.isRequired,customModels:E().arrayOf(E().object),copied:E().string,onCopy:E().func.isRequired,onDeleteAlias:E().func.isRequired,onAddCustomModel:E().func.isRequired,onDeleteCustomModel:E().func.isRequired,connections:E().arrayOf(E().shape({id:E().string,isActive:E().bool})).isRequired,isAnthropic:E().bool};var I=c(74429),J=c(74875);function K({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function L({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:j,onUpdateProxy:l,onEdit:m,onDelete:n,oneByOneStatus:o=null,autoPing:p=null}){let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=(0,e.useRef)(null),[w,x]=(0,e.useState)(null),y=new Map((b||[]).map(a=>[a.id,a])),z=a.providerSpecificData?.proxyPoolId||null,A=z?y.get(z):null,B=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,C=!!z||B,D=A?`Pool: ${A.name}`:z?`Pool: ${z} (inactive/missing)`:B?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",E=(()=>{if(!p)return"";let a=[];return(p.reactiveOn&&a.push("On reset"),p.scheduleOn&&a.push(`Scheduled (${p.scheduleSummary||"active"})`),a.length>0)?`Auto-ping active: ${a.join(" + ")}. Click to configure.`:"codex"===p.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),F="";if(A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);F=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{F=b}}let G=A?.noProxy||a.providerSpecificData?.connectionNoProxy||"",H="default";A?.isActive===!0?H="success":(z||B)&&(H="error");let M=async a=>{t(!0);try{await l("__none__"===a?null:a)}finally{t(!1),r(!1)}},N=a.authType||(c?"oauth":"apikey"),O="oauth"===N,P="cookie"===N,Q="mcode-lease"===N,R=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(Q?"Desktop Lease":O?"OAuth Account":P?"Cookie Account":"API Key"),S=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,[T,U]=(0,e.useState)(!1),V=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>a).filter(a=>!!a).sort()[0]||null,W="unavailable"!==a.testStatus||T?a.testStatus:"active",X=()=>o?"queued"===o.state?"queued":"testing"===o.state?"testing":"success"===o.state?"success":"failed"===o.state?o.error?`failed: ${o.error}`:"failed":null:null;return(0,d.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===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:Q?"desktop_windows":P?"cookie":O?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:R}),S&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:S}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(k.Ex,{variant:(0,J.g)(a.isActive,W),size:"sm",dot:!0,children:!1===a.isActive?"disabled":W||"Unknown"}),(0,d.jsx)(k.Ex,{variant:"default",size:"sm",children:Q?"Desktop Lease":O?"OAuth":P?"Cookie":"API Key"}),C&&(0,d.jsx)(k.Ex,{variant:H,size:"sm",children:"Proxy"}),T&&!1!==a.isActive&&(0,d.jsx)(K,{until:V}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),X()&&(0,d.jsx)(k.Ex,{variant:o?"success"===o.state?"success":"failed"===o.state?"error":"testing"===o.state?"primary":"default":"default",size:"sm",children:X()})]}),C&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),F&&(0,d.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:F}),G&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:G,children:["no_proxy: ",G]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(b||[]).length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{ref:v,onClick:()=>{if(q)return void r(!1);let a=v.current?.getBoundingClientRect();if(!a)return void r(!0);let c=((b?.length||0)+1)*34+8,d=window.innerHeight-a.bottom,e=d<c&&a.top>d;x({position:"fixed",right:window.innerWidth-a.right,...e?{bottom:window.innerHeight-a.top+4,maxHeight:Math.max(a.top-8,120)}:{top:a.bottom+4,maxHeight:Math.max(d-8,120)}}),r(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),q&&(0,I.createPortal)((0,d.jsxs)("div",{ref:u,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>M("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!z?"text-primary font-medium":"text-text-main"}`,children:"None"}),(b||[]).map(a=>(0,d.jsx)("button",{onClick:()=>M(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${z===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]}),document.body)]}),p&&(0,d.jsx)(k.m_,{text:E,children:(0,d.jsxs)("button",{onClick:p.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,d.jsxs)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(k.lM,{size:"sm",checked:a.isActive??!0,onChange:j,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}K.propTypes={until:E().string.isRequired},L.propTypes={connection:E().shape({id:E().string,name:E().string,email:E().string,displayName:E().string,modelLockUntil:E().string,testStatus:E().string,isActive:E().bool,lastError:E().string,priority:E().number,globalPriority:E().number}).isRequired,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string,proxyUrl:E().string,noProxy:E().string,isActive:E().bool})),isOAuth:E().bool.isRequired,isFirst:E().bool.isRequired,isLast:E().bool.isRequired,onMoveUp:E().func.isRequired,onMoveDown:E().func.isRequired,onToggleActive:E().func.isRequired,onUpdateProxy:E().func,onEdit:E().func.isRequired,onDelete:E().func.isRequired,oneByOneStatus:E().shape({state:E().string,error:E().string}),autoPing:E().shape({isActive:E().bool,provider:E().string,reactiveOn:E().bool,scheduleOn:E().bool,scheduleSummary:E().string,onConfigure:E().func})};let M=`name1|sk-key1
1
+ (()=>{var a={};a.id=2134,a.ids=[2134],a.modules={1708:a=>{"use strict";a.exports=require("node:process")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},7934:(a,b,c)=>{Promise.resolve().then(c.bind(c,93110))},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},9956:a=>{"use strict";a.exports=require("undici")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11883:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>af});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(29225),k=c(50412),l=c(92592),m=c(91431),n=c(70552),o=c(18982);c(87592);var p=c(60757);let q=["none","low","medium","high"],r=["none","thinking"],s=["none","low","medium","high","xhigh","max"],t={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":s,"claude-budget":s,"gemini-level":["minimal","low","medium","high"],"gemini-budget":q,zai:r,qwen:q,kimi:["none","low","medium","high","max"],deepseek:["none","high","max"],commandcode:["none","low","medium","high","xhigh","max"],minimax:r,hunyuan:q,step:q,nous:q},u=["none","minimal","low","medium","high","xhigh","max"],v=["none","low","medium","high","max"],w=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:v},{pattern:"*claude*4-6*",levels:v},{provider:"codex",pattern:"*gpt-6*",levels:u},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...u,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...u,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:u},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"opencode",pattern:"*mimo*v2.6*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.1-flash-free*",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]}],x=/(?:^|\/)gpt-(?:5\.6|6)(?:[.-]|$)/i;function y(a,b){if("kiro"===a&&null===function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(b))return"reasoning";if(!b.includes("claude"))return null;let c=function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return b?{major:Number(b[1]),minor:void 0===b[2]?null:Number(b[2])}:null}(a);if(!c)return null;let{major:d,minor:e}=c;return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}(b))return null;let c=(0,n.nl)(a,b);if(!c.reasoning)return null;let d=String(b||"").replace(/\([^()]+\)\s*$/,""),e="codex"===a?(0,p.SM)("cx").find(a=>a.id===d)?.thinkingLevels:null,f=w.find(c=>(!c.provider||c.provider===a)&&(0,o.gH)(c.pattern,b)),g=e||f?.levels||(String(a||"").startsWith("openai-compatible-")&&x.test(d)?u:null)||t[c.thinkingFormat]||q;return!1===c.thinkingCanDisable&&(g=g.filter(a=>"none"!==a)),g}var z=c(50377),A=c(29476),B=c(99258),C=c(18753),D=c(49885),E=c.n(D);function F({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:l,isTesting:m,onDisable:n,caps:o,thinkingSuffix:p}){let q=p?`${b}(${p})`:b,r="ok"===g?"#22c55e":"error"===g?"#ef4444":void 0;return(0,d.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:r?{color:r}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:q}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:a.name}),(0,d.jsx)(k.nh,{caps:o,colorOverride:"text-text-muted/70",size:12})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[l&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:l,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,d.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:m?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(q,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):n?(0,d.jsx)("button",{onClick:n,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function G({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/40":"error"===h?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.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:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.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:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function H({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:j,onDeleteCustomModel:l,connections:m,isAnthropic:n}){let[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)({}),y=async b=>{if(!u){v(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();x(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{x(a=>({...a,[b]:"error"}))}finally{v(null)}}},z=(0,C.R)({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),A=async()=>{if(!o.trim()||q)return;let a=o.trim();if(z.some(b=>b.id===a))return void alert("Model already exists for this provider.");r(!0);try{await j(a),p("")}catch(a){console.log("Error adding model:",a)}finally{r(!1)}},B=async()=>{if(s)return;let a=m.find(a=>!1!==a.isActive);if(a){t(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||"Failed to import models");let d=c.models||[];if(0===d.length)return void alert("No models returned from /models.");let e=0;for(let a of d){let b=a.id||a.name||a.model;b&&(z.some(a=>a.id===b)||(await j(b),e+=1))}0===e&&alert("No new models were added.")}catch(a){console.log("Error importing models:",a)}finally{t(!1)}}},D=m.some(a=>!1!==a.isActive);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>"Enter"===a.key&&A(),placeholder:n?"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,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:A,disabled:!o.trim()||q,children:q?"Adding...":"Add"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"download",onClick:B,disabled:!D||s,children:s?"Importing...":"Import from /models"})]}),!D&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),z.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:z.map(({id:c,alias:e,source:f})=>(0,d.jsx)(G,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?l(c):i(e),onTest:m.length>0?()=>y(c):void 0,testStatus:w[c],isTesting:u===c},`${f}-${a}/${c}`))})]})}F.propTypes={model:E().shape({id:E().string.isRequired}).isRequired,fullModel:E().string.isRequired,alias:E().string,copied:E().string,onCopy:E().func.isRequired,testStatus:E().oneOf(["ok","error"]),isCustom:E().bool,isFree:E().bool,onDeleteAlias:E().func,onTest:E().func,isTesting:E().bool,onDisable:E().func,caps:E().object,thinkingSuffix:E().string},E().string.isRequired,E().string.isRequired,E().string,E().func.isRequired,E().func.isRequired,E().func,E().oneOf(["ok","error"]),E().bool,E().string.isRequired,E().object.isRequired,E().arrayOf(E().object),E().string,E().func.isRequired,E().func.isRequired,E().func.isRequired,E().func.isRequired,H.propTypes={providerStorageAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,modelAliases:E().object.isRequired,customModels:E().arrayOf(E().object),copied:E().string,onCopy:E().func.isRequired,onDeleteAlias:E().func.isRequired,onAddCustomModel:E().func.isRequired,onDeleteCustomModel:E().func.isRequired,connections:E().arrayOf(E().shape({id:E().string,isActive:E().bool})).isRequired,isAnthropic:E().bool};var I=c(74429),J=c(74875);function K({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}function L({connection:a,proxyPools:b,isOAuth:c,isFirst:f,isLast:g,onMoveUp:h,onMoveDown:i,onToggleActive:j,onUpdateProxy:l,onEdit:m,onDelete:n,oneByOneStatus:o=null,autoPing:p=null}){let[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=(0,e.useRef)(null),[w,x]=(0,e.useState)(null),y=new Map((b||[]).map(a=>[a.id,a])),z=a.providerSpecificData?.proxyPoolId||null,A=z?y.get(z):null,B=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,C=!!z||B,D=A?`Pool: ${A.name}`:z?`Pool: ${z} (inactive/missing)`:B?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",E=(()=>{if(!p)return"";let a=[];return(p.reactiveOn&&a.push("On reset"),p.scheduleOn&&a.push(`Scheduled (${p.scheduleSummary||"active"})`),a.length>0)?`Auto-ping active: ${a.join(" + ")}. Click to configure.`:"codex"===p.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),F="";if(A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=A?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);F=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{F=b}}let G=A?.noProxy||a.providerSpecificData?.connectionNoProxy||"",H="default";A?.isActive===!0?H="success":(z||B)&&(H="error");let M=async a=>{t(!0);try{await l("__none__"===a?null:a)}finally{t(!1),r(!1)}},N=a.authType||(c?"oauth":"apikey"),O="oauth"===N,P="cookie"===N,Q="mcode-lease"===N,R=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(Q?"Desktop Lease":O?"OAuth Account":P?"Cookie Account":"API Key"),S=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,[T,U]=(0,e.useState)(!1),V=Object.entries(a).filter(([a])=>a.startsWith("modelLock_")).map(([,a])=>a).filter(a=>!!a).sort()[0]||null,W="unavailable"!==a.testStatus||T?a.testStatus:"active",X=()=>o?"queued"===o.state?"queued":"testing"===o.state?"testing":"success"===o.state?"success":"failed"===o.state?o.error?`failed: ${o.error}`:"failed":null:null;return(0,d.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===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:h,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:Q?"desktop_windows":P?"cookie":O?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:R}),S&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:S}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(k.Ex,{variant:(0,J.g)(a.isActive,W),size:"sm",dot:!0,children:!1===a.isActive?"disabled":W||"Unknown"}),(0,d.jsx)(k.Ex,{variant:"default",size:"sm",children:Q?"Desktop Lease":O?"OAuth":P?"Cookie":"API Key"}),C&&(0,d.jsx)(k.Ex,{variant:H,size:"sm",children:"Proxy"}),T&&!1!==a.isActive&&(0,d.jsx)(K,{until:V}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastError}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),X()&&(0,d.jsx)(k.Ex,{variant:o?"success"===o.state?"success":"failed"===o.state?"error":"testing"===o.state?"primary":"default":"default",size:"sm",children:X()})]}),C&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:D,children:D}),F&&(0,d.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:F}),G&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:G,children:["no_proxy: ",G]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(b||[]).length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{ref:v,onClick:()=>{if(q)return void r(!1);let a=v.current?.getBoundingClientRect();if(!a)return void r(!0);let c=((b?.length||0)+1)*34+8,d=window.innerHeight-a.bottom,e=d<c&&a.top>d;x({position:"fixed",right:window.innerWidth-a.right,...e?{bottom:window.innerHeight-a.top+4,maxHeight:Math.max(a.top-8,120)}:{top:a.bottom+4,maxHeight:Math.max(d-8,120)}}),r(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:s,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:s?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),q&&(0,I.createPortal)((0,d.jsxs)("div",{ref:u,style:w,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>M("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!z?"text-primary font-medium":"text-text-main"}`,children:"None"}),(b||[]).map(a=>(0,d.jsx)("button",{onClick:()=>M(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${z===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]}),document.body)]}),p&&(0,d.jsx)(k.m_,{text:E,children:(0,d.jsxs)("button",{onClick:p.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${p.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,d.jsxs)("button",{onClick:m,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,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(k.lM,{size:"sm",checked:a.isActive??!0,onChange:j,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}K.propTypes={until:E().string.isRequired},L.propTypes={connection:E().shape({id:E().string,name:E().string,email:E().string,displayName:E().string,modelLockUntil:E().string,testStatus:E().string,isActive:E().bool,lastError:E().string,priority:E().number,globalPriority:E().number}).isRequired,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string,proxyUrl:E().string,noProxy:E().string,isActive:E().bool})),isOAuth:E().bool.isRequired,isFirst:E().bool.isRequired,isLast:E().bool.isRequired,onMoveUp:E().func.isRequired,onMoveDown:E().func.isRequired,onToggleActive:E().func.isRequired,onUpdateProxy:E().func,onEdit:E().func.isRequired,onDelete:E().func.isRequired,oneByOneStatus:E().shape({state:E().string,error:E().string}),autoPing:E().shape({isActive:E().bool,provider:E().string,reactiveOn:E().bool,scheduleOn:E().bool,scheduleSummary:E().string,onConfigure:E().func})};let M=`name1|sk-key1
2
2
  name2|sk-key2
3
- sk-key-only-auto-named`;function N({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:j,proxyPools:m,error:n,existingNames:o,onSave:p,onBulkDone:q,onClose:r}){let s="__none__",t="ollama-local"===b,u="cookie"===h,v="xai"===b&&!u,w=u?"Cookie Value":"qoder"===b||"qoder-cn"===b?"Personal Access Token (PAT)":"API Key",x="azure"===b,y="cloudflare-ai"===b,z=l.Q2?.[b]?.credentialForm==="aws",A=l.Q2?.[b]?.apiKeyOptionalWith||null,B=l.Q2?.[b]?.regions||null,C=l.Q2?.[b]?.defaultRegion||B?.[0]?.id||"",[D,E]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:s,ollamaHostUrl:""}),[F,G]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[H,I]=(0,e.useState)({accountId:""}),[J,K]=(0,e.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[L,O]=(0,e.useState)(C),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(null),[T,U]=(0,e.useState)(!1),V=y?`name1|sk-key1|acc123456
3
+ sk-key-only-auto-named`;function N({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,authType:h,authHint:i,website:j,proxyPools:m,error:n,existingNames:o,onSave:p,onBulkDone:q,onClose:r}){let s="__none__",t="ollama-local"===b,u="cookie"===h,v="xai"===b&&!u,w=u?"Cookie Value":"qoder"===b||"qoder-cn"===b?"Personal Access Token (PAT)":"API Key",x="azure"===b,y="cloudflare-ai"===b,z=l.Q2?.[b]?.credentialForm==="aws",A=l.Q2?.[b]?.apiKeyOptionalWith||null,B=l.Q2?.[b]?.regions||null,C=l.Q2?.[b]?.defaultRegion||B?.[0]?.id||"",[D,E]=(0,e.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:s,ollamaHostUrl:""}),[F,G]=(0,e.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[H,I]=(0,e.useState)({accountId:""}),[J,K]=(0,e.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[L,O]=(0,e.useState)(C),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(null),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(null),Z=async()=>{W(!0),Y(null);try{let a=await fetch("/api/oauth/commandcode/auto-import"),b=await a.json();b.found&&b.apiKey?E(a=>({...a,name:a.name||b.userName||b.keyName||"CommandCode CLI",apiKey:b.apiKey})):Y(b.error||"Could not find Command Code credentials")}catch{Y("Failed to auto-import from Command Code CLI")}finally{W(!1)}},$=y?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
5
5
  sk-key-only-auto-named`:"qoder"===b||"qoder-cn"===b?`name1|pt-xxxxx
6
6
  name2|pt-yyyyy
7
- pt-only-auto-named`:M,[W,X]=(0,e.useState)("single"),[Y,Z]=(0,e.useState)(""),[$,_]=(0,e.useState)(null),aa=()=>{if(t&&D.ollamaHostUrl.trim())return{baseUrl:D.ollamaHostUrl.trim()};if(x)return{azureEndpoint:F.azureEndpoint,apiVersion:F.apiVersion,deployment:F.deployment,organization:F.organization};if(y)return{accountId:H.accountId};if(z){let a={};return J.profile.trim()&&(a.profile=J.profile.trim()),J.region.trim()&&(a.region=J.region.trim()),J.accessKeyId.trim()&&(a.accessKeyId=J.accessKeyId.trim()),J.sessionToken.trim()&&(a.sessionToken=J.sessionToken.trim()),Object.keys(a).length?a:void 0}if(B&&L)return{region:L}},ab=()=>{let a=aa();return!!(A&&a?.[A])||(z?!!D.apiKey&&!!a?.accessKeyId:!!D.apiKey)},ac=async()=>{Q(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:aa()})}),c=await a.json();S(c.valid?"success":"failed")}catch{S("failed")}finally{Q(!1)}},ad=async()=>{if(b&&(t||ab())&&(t||D.name)&&(!f||D.defaultModel.trim())){U(!0);try{let a=!1;try{Q(!0),S(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:aa()})});a=!!(await c.json()).valid,S(a?"success":"failed")}catch{S("failed")}finally{Q(!1)}await p({name:D.name||(t?"Ollama Local":""),apiKey:D.apiKey,defaultModel:f?D.defaultModel.trim():void 0,priority:D.priority,proxyPoolId:D.proxyPoolId===s?null:D.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:aa()})}finally{U(!1)}}},ae=async()=>{let a=Y.split("\n");if(!a.length)return;let c=function(a,b,c={}){let{isCloudflareAi:d=!1}=c,e=new Set((Array.isArray(b)?b:[]).map(a=>"string"==typeof a?a.toLowerCase():"")),f=[];for(let b of a){let a,c="string"==typeof b?b.trim():"";if(!c)continue;let g=function(a,b={}){let{isCloudflareAi:c=!1}=b;if(!c&&/^LLM\|/i.test(a.trim()))return{baseName:"LLM",apiKey:a.trim()};let d=a.split("|");if(c&&d.length>=3){let a=d[0].trim();return{baseName:a||"Key",apiKey:d.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:d[d.length-1].trim()}}}return d.length>=2?{baseName:d[0].trim()||"Key",apiKey:d.slice(1).join("|").trim()}:{baseName:"Key",apiKey:d[0].trim()}}(c,{isCloudflareAi:d});if(!g||!g.apiKey)continue;let h=g.baseName,i=1;for(;a=`${h} ${i}`,e.has(a.toLowerCase());)i+=1;e.add(a.toLowerCase());let j={name:a,apiKey:g.apiKey,skipped:!1};g.providerSpecificData&&(j.providerSpecificData=g.providerSpecificData),f.push(j)}return f}(a,o,{isCloudflareAi:y});if(!c.length)return;U(!0),_(null);let d=0,e=0;for(let a of c)try{let c=!1;try{let d=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey})});c=!!(await d.json().catch(()=>({}))).valid}catch{c=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey,name:a.name,priority:1,testStatus:c?"active":"unknown",...a.providerSpecificData?{providerSpecificData:a.providerSpecificData}:{}})})).ok?d++:e++}catch{e++}U(!1),_({success:d,failed:e}),d>0&&q&&q()};return b?(0,d.jsx)(k.aF,{isOpen:a,title:`Add ${c||b} ${w}`,onClose:r,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!z&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{size:"sm",variant:"single"===W?"primary":"ghost",onClick:()=>{X("single"),_(null)},children:"Single"}),(0,d.jsx)(k.$n,{size:"sm",variant:"bulk"===W?"primary":"ghost",onClick:()=>{X("bulk"),_(null)},children:"Bulk Add"})]}),"bulk"===W&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y?(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===b||"qoder-cn"===b?(0,d.jsxs)(d.Fragment,{children:["One PAT per line. Format: ",(0,d.jsx)("code",{children:"name|pt-..."})," or just ",(0,d.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,d.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:a=>Z(a.target.value)}),$&&(0,d.jsxs)("div",{className:`text-sm font-medium ${$.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",$.success," added",$.failed>0?`, ✗ ${$.failed} failed`:""]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:ae,fullWidth:!0,disabled:T||!Y.trim(),children:T?"Adding...":"Add All Keys"}),(0,d.jsx)(k.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===W&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.pd,{label:"Name",value:D.name,onChange:a=>E({...D,name:a.target.value}),placeholder:t?"Ollama Local":"Production Key"}),t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:"Ollama Host URL",value:D.ollamaHostUrl,onChange:a=>E({...D,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:ac,disabled:P||T,variant:"secondary",children:P?"Checking...":"Check"})})]}),!t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:w,type:u?"text":"password",value:D.apiKey,onChange:a=>E({...D,apiKey:a.target.value}),placeholder:u?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"qoder"===b||"qoder-cn"===b?"pt-...":"",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:ac,disabled:!ab()||P||T,variant:"secondary",children:P?"Checking...":"Check"})})]}),v&&(0,d.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."}),u&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,j&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",j.replace(/^https?:\/\//,"")]})]})]}),B&&(0,d.jsx)(k.l6,{label:"Region",value:L,onChange:a=>O(a.target.value),options:B.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(k.pd,{label:"Default Model",value:D.defaultModel,onChange:a=>E({...D,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),t&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),R&&(0,d.jsx)(k.Ex,{variant:"success"===R?"success":"error",children:"success"===R?"Valid":"Invalid"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.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."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(k.pd,{label:"Account ID",value:H.accountId,onChange:a=>I({...H,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),z&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(k.pd,{label:"AWS Profile (SSO — recommended)",value:J.profile,onChange:a=>K({...J,profile:a.target.value}),placeholder:"my-sso-profile"}),(0,d.jsx)(k.pd,{label:"Region",value:J.region,onChange:a=>K({...J,region:a.target.value}),placeholder:"us-east-1"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Set a profile from ",(0,d.jsx)("code",{children:"~/.aws/config"})," and leave the API key empty, then run"," ",(0,d.jsxs)("code",{children:["aws sso login --profile ",J.profile||"my-sso-profile"]}),". Credentials refresh automatically."]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,d.jsx)(k.pd,{label:"Access Key ID (only for static keys)",value:J.accessKeyId,onChange:a=>K({...J,accessKeyId:a.target.value}),placeholder:"AKIA..."}),(0,d.jsx)(k.pd,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:J.sessionToken,onChange:a=>K({...J,sessionToken:a.target.value}),placeholder:"FwoGZXIvYXdz..."})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["For static keys instead: put the AWS ",(0,d.jsx)("strong",{children:"secret"})," access key in the API Key field above and the access key id here. A profile, if set, takes precedence."]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(k.pd,{label:"Azure Endpoint",value:F.azureEndpoint,onChange:a=>G({...F,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(k.pd,{label:"Deployment Name",value:F.deployment,onChange:a=>G({...F,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(k.pd,{label:"API Version",value:F.apiVersion,onChange:a=>G({...F,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(k.pd,{label:"Organization",value:F.organization,onChange:a=>G({...F,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(k.pd,{label:"Priority",type:"number",value:D.priority,onChange:a=>E({...D,priority:Number.parseInt(a.target.value)||1})}),(0,d.jsx)(k.l6,{label:"Proxy Pool",value:D.proxyPoolId,onChange:a=>E({...D,proxyPoolId:a.target.value}),options:[{value:s,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:ad,fullWidth:!0,disabled:T||!t&&(!D.name||!ab())||f&&!D.defaultModel.trim()||x&&(!F.azureEndpoint||!F.deployment||!F.organization)||y&&!H.accountId,children:T?"Saving...":"Save"}),(0,d.jsx)(k.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function O({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[j,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(k.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(k.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(k.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(k.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(k.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(k.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(k.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||j,children:j?"Saving...":"Save"}),(0,d.jsx)(k.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}N.propTypes={isOpen:E().bool.isRequired,provider:E().string,providerName:E().string,isCompatible:E().bool,isAnthropic:E().bool,authType:E().string,authHint:E().string,website:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string})),error:E().string,existingNames:E().arrayOf(E().string),onSave:E().func.isRequired,onBulkDone:E().func,onClose:E().func.isRequired},O.propTypes={isOpen:E().bool.isRequired,node:E().shape({id:E().string,name:E().string,prefix:E().string,apiType:E().string,baseUrl:E().string}),onSave:E().func.isRequired,onClose:E().func.isRequired,isAnthropic:E().bool};let P=()=>Object.fromEntries(Object.keys(m.bs).map(a=>[a,!1]));function Q({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[j,l]=(0,e.useState)(P),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(""),v=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},w=async()=>{let a=v(h.trim());if(a){o("testing"),q("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`})}),d=await c.json();o(d.ok?"ok":"error"),q(d.error||"")}catch(a){o("error"),q(a.message)}}},x=async()=>{let a=v(h.trim());if(a&&!r){s(!0);try{await f(a,j,j.stt?t:null)}finally{s(!1)}}};return(0,d.jsx)(k.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),o(null),q("")},onKeyDown:a=>{"Enter"===a.key&&w()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,d.jsx)(k.$n,{variant:"secondary",icon:"science",loading:"testing"===n,onClick:w,disabled:!h.trim()||"testing"===n,children:"testing"===n?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:v(h.trim())||"model-id"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(m.bs).map(([a,b])=>(0,d.jsx)(k.lM,{checked:!!j[a],onChange:b=>l(c=>({...c,[a]:b})),label:b.label,description:b.desc,size:"sm"},a))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)(k.lM,{checked:!!j.stt,onChange:a=>{l(b=>({...b,stt:a})),a||u("")},label:"Speech to text",description:"Transcribes audio via /v1/audio/transcriptions",size:"sm"}),j.stt&&(0,d.jsx)("div",{className:"mt-3",children:(0,d.jsx)(k.l6,{label:"Transport",value:t,onChange:a=>u(a.target.value),placeholder:"Provider default (REST)",options:m.vp.map(a=>({value:a,label:m.qw[a].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."})})]}),"ok"===n&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===n&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:p||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(k.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(k.$n,{onClick:x,fullWidth:!0,size:"sm",disabled:!h.trim()||r,children:r?"Adding...":"Add Model"})]})]})})}Q.propTypes={isOpen:E().bool.isRequired,providerAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,onSave:E().func.isRequired,onClose:E().func.isRequired};let R=`[
7
+ pt-only-auto-named`:M,[_,aa]=(0,e.useState)("single"),[ab,ac]=(0,e.useState)(""),[ad,ae]=(0,e.useState)(null),af=()=>{if(t&&D.ollamaHostUrl.trim())return{baseUrl:D.ollamaHostUrl.trim()};if(x)return{azureEndpoint:F.azureEndpoint,apiVersion:F.apiVersion,deployment:F.deployment,organization:F.organization};if(y)return{accountId:H.accountId};if(z){let a={};return J.profile.trim()&&(a.profile=J.profile.trim()),J.region.trim()&&(a.region=J.region.trim()),J.accessKeyId.trim()&&(a.accessKeyId=J.accessKeyId.trim()),J.sessionToken.trim()&&(a.sessionToken=J.sessionToken.trim()),Object.keys(a).length?a:void 0}if(B&&L)return{region:L}},ag=()=>{let a=af();return!!(A&&a?.[A])||(z?!!D.apiKey&&!!a?.accessKeyId:!!D.apiKey)},ah=async()=>{Q(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:af()})}),c=await a.json();S(c.valid?"success":"failed")}catch{S("failed")}finally{Q(!1)}},ai=async()=>{if(b&&(t||ag())&&(t||D.name)&&(!f||D.defaultModel.trim())){U(!0);try{let a=!1;try{Q(!0),S(null);let c=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:D.apiKey,providerSpecificData:af()})});a=!!(await c.json()).valid,S(a?"success":"failed")}catch{S("failed")}finally{Q(!1)}await p({name:D.name||(t?"Ollama Local":""),apiKey:D.apiKey,defaultModel:f?D.defaultModel.trim():void 0,priority:D.priority,proxyPoolId:D.proxyPoolId===s?null:D.proxyPoolId,testStatus:a?"active":"unknown",providerSpecificData:af()})}finally{U(!1)}}},aj=async()=>{let a=ab.split("\n");if(!a.length)return;let c=function(a,b,c={}){let{isCloudflareAi:d=!1}=c,e=new Set((Array.isArray(b)?b:[]).map(a=>"string"==typeof a?a.toLowerCase():"")),f=[];for(let b of a){let a,c="string"==typeof b?b.trim():"";if(!c)continue;let g=function(a,b={}){let{isCloudflareAi:c=!1}=b;if(!c&&/^LLM\|/i.test(a.trim()))return{baseName:"LLM",apiKey:a.trim()};let d=a.split("|");if(c&&d.length>=3){let a=d[0].trim();return{baseName:a||"Key",apiKey:d.slice(1,-1).join("|").trim(),providerSpecificData:{accountId:d[d.length-1].trim()}}}return d.length>=2?{baseName:d[0].trim()||"Key",apiKey:d.slice(1).join("|").trim()}:{baseName:"Key",apiKey:d[0].trim()}}(c,{isCloudflareAi:d});if(!g||!g.apiKey)continue;let h=g.baseName,i=1;for(;a=`${h} ${i}`,e.has(a.toLowerCase());)i+=1;e.add(a.toLowerCase());let j={name:a,apiKey:g.apiKey,skipped:!1};g.providerSpecificData&&(j.providerSpecificData=g.providerSpecificData),f.push(j)}return f}(a,o,{isCloudflareAi:y});if(!c.length)return;U(!0),ae(null);let d=0,e=0;for(let a of c)try{let c=!1;try{let d=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey})});c=!!(await d.json().catch(()=>({}))).valid}catch{c=!1}(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,apiKey:a.apiKey,name:a.name,priority:1,testStatus:c?"active":"unknown",...a.providerSpecificData?{providerSpecificData:a.providerSpecificData}:{}})})).ok?d++:e++}catch{e++}U(!1),ae({success:d,failed:e}),d>0&&q&&q()};return b?(0,d.jsx)(k.aF,{isOpen:a,title:`Add ${c||b} ${w}`,onClose:r,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!z&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{size:"sm",variant:"single"===_?"primary":"ghost",onClick:()=>{aa("single"),ae(null)},children:"Single"}),(0,d.jsx)(k.$n,{size:"sm",variant:"bulk"===_?"primary":"ghost",onClick:()=>{aa("bulk"),ae(null)},children:"Bulk Add"})]}),"bulk"===_&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y?(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey|accountId"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}):"qoder"===b||"qoder-cn"===b?(0,d.jsxs)(d.Fragment,{children:["One PAT per line. Format: ",(0,d.jsx)("code",{children:"name|pt-..."})," or just ",(0,d.jsx)("code",{children:"pt-..."})," (auto-named by index)."]}):(0,d.jsxs)(d.Fragment,{children:["One key per line. Format: ",(0,d.jsx)("code",{children:"name|apiKey"})," or just ",(0,d.jsx)("code",{children:"apiKey"})," (auto-named by index)."]})}),(0,d.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:$,value:ab,onChange:a=>ac(a.target.value)}),ad&&(0,d.jsxs)("div",{className:`text-sm font-medium ${ad.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",ad.success," added",ad.failed>0?`, ✗ ${ad.failed} failed`:""]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:aj,fullWidth:!0,disabled:T||!ab.trim(),children:T?"Adding...":"Add All Keys"}),(0,d.jsx)(k.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===_&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.pd,{label:"Name",value:D.name,onChange:a=>E({...D,name:a.target.value}),placeholder:t?"Ollama Local":"Production Key"}),t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:"Ollama Host URL",value:D.ollamaHostUrl,onChange:a=>E({...D,ollamaHostUrl:a.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:ah,disabled:P||T,variant:"secondary",children:P?"Checking...":"Check"})})]}),"commandcode"===b&&(0,d.jsxs)("div",{className:"flex items-center justify-between p-3 rounded bg-accent/10 border border-accent/20",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-medium text-text",children:"Command Code CLI detected?"}),(0,d.jsx)("div",{className:"text-xs text-text-muted",children:"Import API key directly from ~/.commandcode/auth.json"}),X&&(0,d.jsx)("div",{className:"text-xs text-red-400 mt-1",children:X})]}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",onClick:Z,disabled:V||T,children:V?"Importing...":"Import from CLI"})]}),!t&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:w,type:u?"text":"password",value:D.apiKey,onChange:a=>E({...D,apiKey:a.target.value}),placeholder:u?"grok-web"===b?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"qoder"===b||"qoder-cn"===b?"pt-...":"",className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:ah,disabled:!ag()||P||T,variant:"secondary",children:P?"Checking...":"Check"})})]}),v&&(0,d.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."}),u&&i&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[i,j&&(0,d.jsxs)(d.Fragment,{children:[" ",(0,d.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",j.replace(/^https?:\/\//,"")]})]})]}),B&&(0,d.jsx)(k.l6,{label:"Region",value:L,onChange:a=>O(a.target.value),options:B.map(a=>({value:a.id,label:a.label}))}),f&&(0,d.jsx)(k.pd,{label:"Default Model",value:D.defaultModel,onChange:a=>E({...D,defaultModel:a.target.value}),placeholder:g?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),t&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,d.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,d.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),R&&(0,d.jsx)(k.Ex,{variant:"success"===R?"success":"error",children:"success"===R?"Valid":"Invalid"}),n&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:n}),f&&(0,d.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."}),y&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,d.jsx)(k.pd,{label:"Account ID",value:H.accountId,onChange:a=>I({...H,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,d.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),z&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(k.pd,{label:"AWS Profile (SSO — recommended)",value:J.profile,onChange:a=>K({...J,profile:a.target.value}),placeholder:"my-sso-profile"}),(0,d.jsx)(k.pd,{label:"Region",value:J.region,onChange:a=>K({...J,region:a.target.value}),placeholder:"us-east-1"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Set a profile from ",(0,d.jsx)("code",{children:"~/.aws/config"})," and leave the API key empty, then run"," ",(0,d.jsxs)("code",{children:["aws sso login --profile ",J.profile||"my-sso-profile"]}),". Credentials refresh automatically."]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 mt-4",children:[(0,d.jsx)(k.pd,{label:"Access Key ID (only for static keys)",value:J.accessKeyId,onChange:a=>K({...J,accessKeyId:a.target.value}),placeholder:"AKIA..."}),(0,d.jsx)(k.pd,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:J.sessionToken,onChange:a=>K({...J,sessionToken:a.target.value}),placeholder:"FwoGZXIvYXdz..."})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["For static keys instead: put the AWS ",(0,d.jsx)("strong",{children:"secret"})," access key in the API Key field above and the access key id here. A profile, if set, takes precedence."]})]}),x&&(0,d.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,d.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(k.pd,{label:"Azure Endpoint",value:F.azureEndpoint,onChange:a=>G({...F,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,d.jsx)(k.pd,{label:"Deployment Name",value:F.deployment,onChange:a=>G({...F,deployment:a.target.value}),placeholder:"gpt-4"}),(0,d.jsx)(k.pd,{label:"API Version",value:F.apiVersion,onChange:a=>G({...F,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,d.jsx)(k.pd,{label:"Organization",value:F.organization,onChange:a=>G({...F,organization:a.target.value}),placeholder:"Organization ID"})]})]}),(0,d.jsx)(k.pd,{label:"Priority",type:"number",value:D.priority,onChange:a=>E({...D,priority:Number.parseInt(a.target.value)||1})}),(0,d.jsx)(k.l6,{label:"Proxy Pool",value:D.proxyPoolId,onChange:a=>E({...D,proxyPoolId:a.target.value}),options:[{value:s,label:"None"},...(m||[]).map(a=>({value:a.id,label:a.name}))],placeholder:"None"}),0===(m||[]).length&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:ai,fullWidth:!0,disabled:T||!t&&(!D.name||!ag())||f&&!D.defaultModel.trim()||x&&(!F.azureEndpoint||!F.deployment||!F.organization)||y&&!H.accountId,children:T?"Saving...":"Save"}),(0,d.jsx)(k.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function O({isOpen:a,node:b,onSave:c,onClose:f,isAnthropic:g}){let[h,i]=(0,e.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[j,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null),u=async()=>{if(h.name.trim()&&h.prefix.trim()&&h.baseUrl.trim()){l(!0);try{let a={name:h.name,prefix:h.prefix,baseUrl:h.baseUrl};g||(a.apiType=h.apiType),await c(a)}finally{l(!1)}}},v=async()=>{r(!0);try{let a=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:h.baseUrl,apiKey:m,type:g?"anthropic-compatible":"openai-compatible",modelId:o.trim()||void 0})}),b=await a.json();t(b.valid?"success":"failed")}catch{t("failed")}finally{r(!1)}};return b?(0,d.jsx)(k.aF,{isOpen:a,title:`Edit ${g?"Anthropic":"OpenAI"} Compatible`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(k.pd,{label:"Name",value:h.name,onChange:a=>i({...h,name:a.target.value}),placeholder:`${g?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,d.jsx)(k.pd,{label:"Prefix",value:h.prefix,onChange:a=>i({...h,prefix:a.target.value}),placeholder:g?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!g&&(0,d.jsx)(k.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:h.apiType,onChange:a=>i({...h,apiType:a.target.value})}),(0,d.jsx)(k.pd,{label:"Base URL",value:h.baseUrl,onChange:a=>i({...h,baseUrl:a.target.value}),placeholder:g?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${g?"Anthropic":"OpenAI"}-compatible API.`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:a=>n(a.target.value),className:"flex-1"}),(0,d.jsx)("div",{className:"pt-6",children:(0,d.jsx)(k.$n,{onClick:v,disabled:!m||q||!h.baseUrl.trim(),variant:"secondary",children:q?"Checking...":"Check"})})]}),(0,d.jsx)(k.pd,{label:"Model ID (optional)",value:o,onChange:a=>p(a.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),s&&(0,d.jsx)(k.Ex,{variant:"success"===s?"success":"error",children:"success"===s?"Valid":"Invalid"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:u,fullWidth:!0,disabled:!h.name.trim()||!h.prefix.trim()||!h.baseUrl.trim()||j,children:j?"Saving...":"Save"}),(0,d.jsx)(k.$n,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}N.propTypes={isOpen:E().bool.isRequired,provider:E().string,providerName:E().string,isCompatible:E().bool,isAnthropic:E().bool,authType:E().string,authHint:E().string,website:E().string,proxyPools:E().arrayOf(E().shape({id:E().string,name:E().string})),error:E().string,existingNames:E().arrayOf(E().string),onSave:E().func.isRequired,onBulkDone:E().func,onClose:E().func.isRequired},O.propTypes={isOpen:E().bool.isRequired,node:E().shape({id:E().string,name:E().string,prefix:E().string,apiType:E().string,baseUrl:E().string}),onSave:E().func.isRequired,onClose:E().func.isRequired,isAnthropic:E().bool};let P=()=>Object.fromEntries(Object.keys(m.bs).map(a=>[a,!1]));function Q({isOpen:a,providerAlias:b,providerDisplayAlias:c,onSave:f,onClose:g}){let[h,i]=(0,e.useState)(""),[j,l]=(0,e.useState)(P),[n,o]=(0,e.useState)("llm"),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(""),x=a=>{let c=`${b}/`;return a.startsWith(c)?a.slice(c.length):a},y=async()=>{let a=x(h.trim());if(a){q("testing"),s("");try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${b}/${a}`,kind:n})}),d=await c.json();q(d.ok?"ok":"error"),s(d.error||"")}catch(a){q("error"),s(a.message)}}},z=async()=>{let a=x(h.trim());if(a&&!t){u(!0);try{await f(a,n,"llm"===n?j:void 0,"stt"===n?v:null)}finally{u(!1)}}};return(0,d.jsx)(k.aF,{isOpen:a,onClose:g,title:"Add Custom Model",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(k.l6,{label:"Model type",value:n,options:[{value:"llm",label:"Chat / LLM"},{value:"stt",label:"Speech to text (STT)"}],onChange:a=>{o(a.target.value),l(P()),w(""),q(null),s("")},disabled:t||"testing"===p,hint:"llm"===n?"Chat models appear in this provider's Available Models.":"Audio transcription models use /v1/audio/transcriptions."}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{type:"text",value:h,onChange:a=>{i(a.target.value),q(null),s("")},onKeyDown:a=>{"Enter"===a.key&&y()},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,d.jsx)(k.$n,{variant:"secondary",icon:"science",loading:"testing"===p,onClick:y,disabled:!h.trim()||"testing"===p,children:"testing"===p?"Testing...":"Test"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,d.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:x(h.trim())||"model-id"})]})]}),"llm"===n&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Capabilities"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-4",children:Object.entries(m.bs).map(([a,b])=>(0,d.jsx)(k.lM,{checked:!!j[a],onChange:b=>l(c=>({...c,[a]:b})),label:b.label,description:b.desc,size:"sm"},a))})]}),"stt"===n&&(0,d.jsx)(k.l6,{label:"Transport",value:v,onChange:a=>w(a.target.value),placeholder:"Provider default (REST)",options:m.vp.map(a=>({value:a,label:m.qw[a].label})),hint:"Realtime transport marker for the STT dispatcher. Empty keeps the provider's REST format."}),"ok"===p&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===p&&(0,d.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,d.jsx)("span",{children:r||"Model not reachable"})]}),(0,d.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,d.jsx)(k.$n,{onClick:g,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(k.$n,{onClick:z,fullWidth:!0,size:"sm",disabled:!h.trim()||t,children:t?"Adding...":"Add Model"})]})]})})}Q.propTypes={isOpen:E().bool.isRequired,providerAlias:E().string.isRequired,providerDisplayAlias:E().string.isRequired,onSave:E().func.isRequired,onClose:E().func.isRequired};let R=`[
8
8
  {
9
9
  "accessToken": "eyJhbGc...",
10
10
  "refreshToken": "rt_...",
@@ -24,4 +24,4 @@ pt-only-auto-named`:M,[W,X]=(0,e.useState)("single"),[Y,Z]=(0,e.useState)(""),[$
24
24
  "id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
25
25
  "email": "account2@example.com"
26
26
  }
27
- ]`;function U(a){let b,c=a.trim();if(!c)return[];try{b=JSON.parse(c)}catch(a){try{let a=c;a.startsWith("[")||((a=a.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(a=a.slice(0,-1)),a=`[${a}]`),b=JSON.parse(a)}catch{throw a}}if(Array.isArray(b))return b;if(b&&"object"==typeof b)return Array.isArray(b.accounts)?b.accounts:[b];throw Error("Input must be a JSON object or array of objects")}function V({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[j,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=()=>{h||(g(""),l(""),n(null),r(null),p(!1),b())},u=async a=>{if(!a||0===a.length)return;l("");let b=Array.from(a).filter(a=>a.name.endsWith(".json")||"application/json"===a.type||""===a.type);if(0===b.length)return void l((0,B.Tl)("Please select valid .json files"));try{let a=[];for(let c of b){let b=await c.text(),d=U(b);Array.isArray(d)?a.push(...d):d&&a.push(d)}if(0===a.length)return void l((0,B.Tl)("No accounts found in selected files"));g(JSON.stringify(a,null,2)),r({filesCount:b.length,accountsCount:a.length})}catch(a){l(`${(0,B.Tl)("Error reading files")}: ${a.message}`)}},v=async()=>{let a;l(""),n(null);try{a=U(f)}catch(a){l(`${(0,B.Tl)("Invalid JSON")}: ${a.message}`);return}if(!a||0===a.length)return void l((0,B.Tl)("No accounts found in input"));i(!0);try{let b=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),d=await b.json();if(!b.ok)return void l(d?.error||`Request failed: ${b.status}`);n(d),d.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,B.Tl)("Request failed"))}finally{i(!1)}},w=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(k.aF,{isOpen:a,title:(0,B.Tl)("Bulk Add Grok CLI Accounts"),onClose:t,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,B.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,d.jsx)("input",{ref:s,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:a=>{u(a.target.files),a.target&&(a.target.value="")}}),(0,d.jsx)(k.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>s.current?.click(),disabled:h,children:(0,B.Tl)("Upload JSON Files")})]}),(0,d.jsxs)("div",{onDragOver:a=>{a.preventDefault(),p(!0)},onDragLeave:a=>{a.preventDefault(),p(!1)},onDrop:a=>{a.preventDefault(),p(!1),a.dataTransfer?.files?.length>0&&u(a.dataTransfer.files)},className:`relative rounded border transition-colors ${o?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,d.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:T,value:f,onChange:a=>{g(a.target.value),r(null)},disabled:h}),o&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,d.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,B.Tl)("Drop .json files here")})]})]}),q&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,d.jsxs)("span",{children:[(0,B.Tl)("Loaded")," ",q.accountsCount," ",(0,B.Tl)("account(s) from")," ",q.filesCount," ",(0,B.Tl)("file(s)")]})]}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),m&&m.failed>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",m.failed," ",(0,B.Tl)("failed")]}),w.length>0&&(0,d.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(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:v,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,B.Tl)("Importing..."):(0,B.Tl)("Import All")}),(0,d.jsx)(k.$n,{onClick:t,variant:"ghost",fullWidth:!0,disabled:h,children:(0,B.Tl)("Close")})]})]})})}var W=c(41371);let X=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],Y=/^[A-Za-z0-9-]+$/;function Z({providerId:a}){let b=(0,W.i)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([{name:"",value:""}]),[i,j]=(0,e.useState)({}),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),p=(a,b,c)=>{h(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},q=(0,e.useCallback)(async()=>{let c={};for(let a of g.filter(a=>a.name.trim())){let d=a.name.trim();if(!Y.test(d))return void b.error(`Invalid header name: ${d}`);if(X.includes(d.toLowerCase()))return void b.error(`Header ${d} cannot be overridden`);if(d in c)return void b.error(`Duplicate header name: ${d}`);a.value!==i[d]&&(c[d]=a.value)}o(!0);try{let d=await fetch(`/api/providers/${a}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:c})});if(!d.ok){let a=await d.json().catch(()=>({}));b.error(a.error||"Failed to save");return}m(Object.keys(c).length>0),b.success("Custom headers saved")}finally{o(!1)}},[g,i,a,b]);return 0!==Object.keys(i).length||l?(0,d.jsxs)(k.Zp,{padding:"xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"flex w-full items-center justify-between text-left",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),l&&(0,d.jsx)(k.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:g.map((a,b)=>{let c=a.name.trim()in i&&a.value!==i[a.name.trim()];return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:a.name,onChange:a=>p(b,"name",a.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,d.jsx)("input",{value:a.value,onChange:a=>p(b,"value",a.target.value),placeholder:"Value",spellCheck:!1,title:c?"Overridden":a.name.trim()in i?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${c?"border-amber-400/60":"border-border"}`}),(0,d.jsx)("button",{type:"button",title:"Remove header",onClick:()=>h(a=>a.length>1?a.filter((a,c)=>c!==b):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},b)})}),(0,d.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>h(a=>[...a,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",disabled:n,onClick:()=>{h(Object.entries(i).map(([a,b])=>({name:a,value:b})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,d.jsx)("button",{type:"button",disabled:n,onClick:q,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:n?"Saving...":"Save"})]})]})]})]}):null}Z.propTypes={providerId:E().string.isRequired};var $=c(56020),_=c(41365);function aa({providerId:a,onConnected:b,size:c="sm"}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),j=async()=>{g(!0),i("");try{let c=await fetch(`/api/oauth/${a}/lease-connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),d=await c.json().catch(()=>({}));if(!c.ok)return void i(d.error||"Could not reach the MiniMax Code desktop app");"function"==typeof b&&b()}catch(a){i(a?.message||"Could not reach the MiniMax Code desktop app")}finally{g(!1)}};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:c,icon:"desktop_windows",variant:"secondary",disabled:f,onClick:j,title:(0,B.Tl)("Borrow the signed-in MiniMax Code desktop app's login — no second sign-in, refresh stays with the desktop app"),children:f?(0,B.Tl)("Connecting..."):(0,B.Tl)("Use Desktop App")}),h&&(0,d.jsx)("p",{className:"w-full text-xs text-red-500 break-words",children:h})]})}aa.propTypes={providerId:E().string.isRequired,onConnected:E().func,size:E().oneOf(["sm","md","lg"])};var ab=c(54589);let ac=new Set(["minimax-code","minimax-code-global"]),ad={claude:"claudeAutoPing",codex:"codexAutoPing"};function ae(){let a,b,c,g,n,o=(0,f.useParams)(),p=(0,f.useRouter)(),q=o.id,{getCaps:r}=(0,A.y)(),[s,t]=(0,e.useState)([]),[u,v]=(0,e.useState)(!0),[w,x]=(0,e.useState)(null),[D,E]=(0,e.useState)([]),[G,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[M,P]=(0,e.useState)(!1),[R,T]=(0,e.useState)(!1),[U,W]=(0,e.useState)(""),[X,Y]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)(null),[ao,ap]=(0,e.useState)({}),[aq,ar]=(0,e.useState)([]),[as,at]=(0,e.useState)(!1),[au,av]=(0,e.useState)({}),[aw,ax]=(0,e.useState)(""),[ay,az]=(0,e.useState)(()=>new Set),[aA,aB]=(0,e.useState)(!1),[aC,aD]=(0,e.useState)([]),[aE,aF]=(0,e.useState)("__none__"),[aG,aH]=(0,e.useState)(!1),[aI,aJ]=(0,e.useState)(null),[aK,aL]=(0,e.useState)(""),[aM,aN]=(0,e.useState)("auto"),[aO,aP]=(0,e.useState)({enabled:!1,connections:{},schedules:{}}),[aQ,aR]=(0,e.useState)(null),[aS,aT]=(0,e.useState)([]),[aU,aV]=(0,e.useState)([]),[aW,aX]=(0,e.useState)(null),[aY,aZ]=(0,e.useState)([]),[a$,a_]=(0,e.useState)([]),[a0,a1]=(0,e.useState)(null),[a2,a3]=(0,e.useState)(!1),[a4,a5]=(0,e.useState)(!1),[a6,a7]=(0,e.useState)(!1),[a8,a9]=(0,e.useState)(null),[ba,bb]=(0,e.useState)({}),[bc,bd]=(0,e.useState)(null),be=(0,e.useRef)(!1),[bf,bg]=(0,e.useState)(!1),[bh,bi]=(0,e.useState)(!1),{copied:bj,copy:bk}=(0,z.C)(),bl=()=>{I(!0)},bm=()=>{"xiaomi-mimo"===q?K(!0):br?bl():(W(""),T(!0))},bn=()=>{W(""),T(!0)},bo=()=>{br?bm():bn()},bp=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}:l.zN[q]||l.fg[q]||l.IS[q]||l.nJ[q]||l.br[q],bq=bp?.authModes||[],br=!!l.zN[q]||!!l.IS[q]||bq.includes("oauth"),bs=!!l.fg[q]||bq.includes("apikey"),bt=!!l.IS[q]?.noAuth,bu=(0,m.KC)(q),bv=("cursor"===q||"zed"===q)&&aU.length>0?aU:bu,bw=(0,l.wG)(q),bx=(0,l.mq)(q),by=(0,l.gb)(q),bz=bx||by,bA=!bz&&br&&bs,bB="xai"===q?"Grok Build OAuth":"grok-cli"===q?"Grok CLI Device Login":"kimi"===q?"Kimi Coding OAuth":"OAuth",bC="xai"===q?"xAI API Key":"kimi"===q?"Kimi API Key":"qoder"===q||"qoder-cn"===q?"PAT":"API Key",bD=a=>{if(!aM||"auto"===aM)return null;let b=y(q,a);return b&&b.includes(aM)?aM:null},bE=bz?q:bw,bF=(()=>{let a=new Set,b=new Set,c=c=>{if(!c||b.has(c))return;b.add(c);let d=y(q,c);d&&d.forEach(b=>{"none"!==b&&a.add(b)})};for(let a of bv)c(a.id);for(let a of aY)c(a.id);for(let a of aq)a.providerAlias===bE&&"llm"===(a.kind||a.type||"llm")&&c(a.id);return a.size?["auto",...a]:null})(),bG=bz?w?.prefix||q:bw,bH=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}`,{cache:"no-store"}),b=await a.json();a.ok&&a_(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bE]),bI=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bE,ids:[a]})})).ok&&await bH()}catch(a){console.log("Error disabling model:",a)}},bJ=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bH()}catch(a){console.log("Error enabling model:",a)}},bK=async a=>{a.length&&a1({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{a1(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bE,ids:a})})).ok&&await bH()}catch(a){console.log("Error disabling all models:",a)}}})},bL=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bE)}`,{method:"DELETE"})).ok&&await bH()}catch(a){console.log("Error enabling all models:",a)}},bM=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&ap(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bN=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&ar(b.models||[])}catch(a){console.log("Error fetching custom models:",a)}},[]),bO=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),e=await a.json(),f=await b.json(),g=await c.json(),h=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===q);t(a)}c.ok&&E(g.proxyPools||[]);let i=(h.providerStrategies||{})[q]||{};aJ(i.fallbackStrategy||null),aL(null!=i.stickyRoundRobinLimit?String(i.stickyRoundRobinLimit):"1");let j=(h.providerThinking||{})[q]||{};aN(j.mode||"auto");let k=ad[q],l=k&&h[k]||{};if(aP({enabled:!0===l.enabled,connections:l.connections||{},schedules:l.schedules||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===q)||null;if(!a&&bz)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===q)||null))break}x(a)}}catch(a){console.log("Error fetching connections:",a)}finally{v(!1)}},[q,bz]),bP=async a=>{try{let b=await fetch(`/api/provider-nodes/${q}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(x(c.node),await bO(),aj(!1))}catch(a){console.log("Error updating provider node:",a)}},bQ=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[q]:f[q]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},bR=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[q]={mode:a}:delete c[q],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},bS=async a=>{let b=ad[q];if(b){aP(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){console.log("Error saving auto-ping config:",a)}}},bT=async(a,b,c=bw)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await bM();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bU=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bM()}catch(a){console.log("Error deleting alias:",a)}},bV=async(a,b="llm",c=bE,d,e)=>{try{let f=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b,...d?{caps:d}:{},...e?{transport:e}:{}})});if(f.ok)await bN();else{let a=await f.json();alert(a.error||"Failed to add custom model")}}catch(a){console.log("Error adding custom model:",a)}},bW=async(a,b="llm",c=bE)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});(await fetch(`/api/models/custom?${d}`,{method:"DELETE"})).ok&&await bN()}catch(a){console.log("Error deleting custom model:",a)}},bX=async()=>{if(bf)return;let a=s.find(a=>!1!==a.isActive);if(!a)return void alert((0,B.Tl)("Please add an active Qoder connection first"));bg(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,B.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,B.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^(qoder-cn|qoder)\//,"");aq.some(a=>a.providerAlias===bE&&a.id===c&&"llm"===(a.kind||a.type||"llm"))||Object.values(ao).includes(`${bE}/${c}`)||(await bV(c,"llm",bE),e+=1)}0===e?alert((0,B.Tl)("All models already exist, no new models added")):alert((0,B.Tl)("Successfully added")+` ${e} `+(0,B.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,B.Tl)("Error fetching models")+": "+a.message)}finally{bg(!1)}},bY=async()=>{if(bh)return;let a=s.find(a=>!1!==a.isActive);if(!a)return void alert((0,B.Tl)("Please add an active Cline connection first"));bi(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,B.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,B.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;b&&(aq.some(a=>a.providerAlias===bE&&a.id===b&&"llm"===(a.kind||a.type||"llm"))||Object.values(ao).includes(`${bE}/${b}`)||(await bV(b,"llm",bE),e+=1))}0===e?alert((0,B.Tl)("All models already exist, no new models added")):alert((0,B.Tl)("Successfully added")+` ${e} `+(0,B.Tl)("models"))}catch(a){console.log("Error importing Cline models:",a),alert((0,B.Tl)("Error fetching models")+": "+a.message)}finally{bi(!1)}},bZ=async()=>{if(a4||0===s.length)return;let a=Object.fromEntries(s.map(a=>[a.id,{state:"queued",error:null}]));be.current=!1,a5(!0),a7(!1),a9(null),bb(a),bd({total:s.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<s.length;a+=1){if(be.current){bd({total:s.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=s[a];a9(d.id),bb(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,bb(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,bb(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}bd({total:s.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<s.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{a9(null),a5(!1),a7(!1),be.current=!1}},b$=async a=>{a1({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{a1(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&t(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},b_=()=>{bO(),I(!1)},b0=async a=>{W("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:q,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await bO(),T(!1);return}W(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),W("Failed to save connection")}},b1=async a=>{try{(await fetch(`/api/providers/${am.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bO(),ah(!1))}catch(a){console.log("Error updating connection:",a)}},b2=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&t(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},b3=async(a,b)=>{let c=[...s];[c[a],c[b]]=[c[b],c[a]],t(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await bO()}},b4=s.filter(a=>aC.includes(a.id)),b5=s.length>0&&aC.length===s.length;(()=>{if(0===b4.length)return;let a=new Set(b4.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=D.find(a=>a.id===b);return c?.name}})();let b6=()=>{aG||al(!1)},b7=async a=>{aH(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await bO(),al(!1)}finally{aH(!1)}},b8=a=>b7(s.map(b=>({connectionId:b.id,proxyPoolId:a}))),b9=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:s.map((a,b)=>{let c;return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,aC.includes(c)),onChange:()=>{var b;return b=a.id,void aD(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(L,{connection:a,proxyPools:D,isOAuth:br,isFirst:0===b,isLast:b===s.length-1,onMoveUp:()=>b3(b,b-1),onMoveDown:()=>b3(b,b+1),onToggleActive:b=>b2(a.id,b),autoPing:ad[q]&&"oauth"===a.authType?{isActive:!0===aO.connections[a.id]||aO.schedules?.[a.id]?.enabled===!0,reactiveOn:!0===aO.connections[a.id],provider:q,scheduleOn:aO.schedules?.[a.id]?.enabled===!0,scheduleSummary:(0,ab.JW)(aO.schedules?.[a.id]).join(" / "),onConfigure:()=>aR(a)}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&t(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{an(a),ah(!0)},onDelete:()=>b$(a.id),oneByOneStatus:ba[a.id]||null})})]},a.id)})}),ca=D.filter(a=>!0===a.isActive),cb=(0,d.jsx)(k.aF,{isOpen:ak,onClose:b6,title:`Apply Proxy (${s.length} connections)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=D.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):b7(s.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aG||0===ca.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>b8(null),disabled:aG,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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),D.map(a=>(0,d.jsxs)("button",{onClick:()=>b8(a.id),disabled:aG||!0!==a.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aG&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(k.$n,{onClick:b6,variant:"ghost",fullWidth:!0,disabled:aG,children:"Cancel"})]})}),cc=async a=>{if(!ay.has(a)){az(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bE}/${a}`})}),c=await b.json();av(b=>({...b,[a]:c.ok?"ok":"error"})),ax(c.ok?"":c.error||"Model not reachable")}catch{av(b=>({...b,[a]:"error"})),ax("Network error")}finally{az(b=>{let c=new Set(b);return c.delete(a),c})}}};if(u)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(k.Qv,{}),(0,d.jsx)(k.Qv,{})]});if(!bp)return(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let cd=()=>bx&&bp.apiType?"responses"===bp.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":by?"/providers/anthropic-m.png":(0,j.HY)(bp.id);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bp.color}15`},children:as||!cd()?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bp.color},children:bp.textIcon||bp.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.A,{src:cd(),alt:bp.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,j.Kw)(bp.id),at(!0)},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bp.name}),(bp.notice?.apiKeyUrl||bp.notice?.signupUrl||bp.website)&&(0,d.jsxs)("a",{href:bp.notice?.apiKeyUrl||bp.notice?.signupUrl||bp.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bp.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[s.length," connection",1===s.length?"":"s"]})]})]})]}),bp.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bp.deprecationNotice})]}),bp.notice?.text&&!bp.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bp.notice.text}),bp.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bp.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 →"})]}),bz&&w&&(0,d.jsx)(k.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:by?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[by?"Messages API":"responses"===w.apiType?"Responses API":"Chat Completions"," \xb7 ",(w.baseUrl||"").replace(/\/$/,""),"/",by?"messages":"responses"===w.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:()=>{W(""),T(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>aj(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{a1({title:"Delete Compatible Node",message:`Delete this ${by?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{a1(null);try{(await fetch(`/api/provider-nodes/${q}`,{method:"DELETE"})).ok&&p.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bt?(0,d.jsx)(k.gw,{providerId:q}):(0,d.jsxs)(k.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[s.length>0&&D.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>al(!0),children:"Apply Proxy"}),s.length>0&&(0,d.jsxs)(d.Fragment,{children:[aC.length>0&&(0,d.jsxs)(k.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=aC.length;0!==a&&a1({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{a1(null);let a=0,b=[...aC];for(let c of b)try{(await fetch(`/api/providers/${c}`,{method:"DELETE"})).ok||(a+=1)}catch(b){console.log("Error deleting connection:",b),a+=1}t(a=>a.filter(a=>!b.includes(a.id))),aD([]),a>0&&alert(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",aC.length,")"]}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:bZ,disabled:a4,children:a4?"Testing Connection One-by-One...":"Test Connection One-by-One"}),a4&&(0,d.jsx)(k.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{a4&&(be.current=!0,a7(!0))},disabled:a6,children:a6?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(k.lM,{checked:"round-robin"===aI,onChange:a=>{let b=a?"round-robin":null,c=a?aK||"1":aK;a&&!aK&&aL("1"),aJ(b),bQ(b,c)}}),"round-robin"===aI&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aK,onChange:a=>{var b;aL(b=a.target.value),bQ("round-robin",b)},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===s.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:br?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bA&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bB," or ",bC,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bA?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bm,children:bB}),(0,d.jsx)(k.$n,{size:"sm",icon:"key",onClick:bn,children:bC})]}):(0,d.jsxs)(d.Fragment,{children:[!bz&&_.w.has(q)&&(0,d.jsx)(_.A,{providerId:q,onConnected:bO}),!bz&&ac.has(q)&&(0,d.jsx)(aa,{providerId:q,onConnected:bO}),!bz&&"iflow"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>P(!0),children:"Cookie"}),"codex"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),children:(0,B.Tl)("Bulk Add")}),"grok-cli"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>af(!0),children:(0,B.Tl)("Bulk Add")}),(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:bo,children:bz?"Add API Key":"iflow"===q?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[bc&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",bc.total]}),(0,d.jsxs)("span",{children:["Completed: ",bc.completed]}),(0,d.jsxs)("span",{children:["Passed: ",bc.passed]}),(0,d.jsxs)("span",{children:["Failed: ",bc.failed]}),bc.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),a4&&a8&&(0,d.jsxs)("span",{children:["Running: ",s.find(a=>a.id===a8)?.name||a8]})]})}),s.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:b5,onChange:()=>{b5?aD([]):aD(s.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),b9,!bz&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:[_.w.has(q)&&(0,d.jsx)(_.A,{providerId:q,onConnected:bO}),ac.has(q)&&(0,d.jsx)(aa,{providerId:q,onConnected:bO}),"iflow"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>P(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),title:(0,B.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,B.Tl)("Bulk Add")}),"grok-cli"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>af(!0),title:(0,B.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,B.Tl)("Bulk Add")}),bA?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bm,className:"w-full sm:w-auto",children:bB}),(0,d.jsx)(k.$n,{size:"sm",icon:"key",onClick:bn,className:"w-full sm:w-auto",children:bC})]}):(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:bo,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsx)(Z,{providerId:q}),(0,d.jsxs)(k.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),bF&&(0,d.jsx)("select",{value:aM,onChange:a=>{var b;aN(b=a.target.value),bR(b)},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:bF.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))})]}),!bz&&(a=[...bv,...aY.filter(a=>!bv.some(b=>b.id===a.id))].filter(a=>{let b=(0,m.CP)(a);return!b||"llm"===b}).map(a=>a.id).filter(a=>!a$.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[a$.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bL,children:"Active All"}),a.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bK(a),children:"Disable All"})]}))]}),!!aw&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:aw}),/RegionError|hosted in China|regionNotAllowed/i.test(aw)&&(c=(b="string"==typeof aw?aw:JSON.stringify(aw)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),g=b.match(/wrk_[0-9A-Za-z]+/),n=c?c[0].endsWith("/go")?c[0]:`${c[0]}/go`:g?`https://opencode.ai/workspace/${g[0]}/go`:"https://opencode.ai",(0,d.jsx)("div",{className:"mt-1.5",children:(0,d.jsxs)("a",{href:n,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,d.jsx)("span",{children:"Allow China-hosted models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===q&&!!aW&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:aW}),(()=>{let a,b,c;if(bz)return(0,d.jsx)(H,{providerStorageAlias:bE,providerDisplayAlias:bG,modelAliases:ao,customModels:aq,copied:bj,onCopy:bk,onSetAlias:bT,onDeleteAlias:bU,onAddCustomModel:a=>bV(a,"llm",bE),onDeleteCustomModel:a=>bW(a,"llm",bE),connections:s,isAnthropic:by});let e=[...bv,...aY.filter(a=>!bv.some(b=>b.id===a.id))].filter(a=>{let b=(0,m.CP)(a);return!b||"llm"===b}),f=new Set(a$),g=e.filter(a=>!f.has(a.id)),h=e.filter(a=>f.has(a.id)),i=C({customModels:aq,modelAliases:ao,providerAlias:bE,builtInModels:bv,type:"llm"});return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[i.map(a=>(0,d.jsx)(F,{model:{id:a.id,name:a.name},fullModel:`${bG}/${a.id}`,alias:a.alias,copied:bj,onCopy:bk,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?bW(a.id,"llm",bE):bU(a.alias)},testStatus:au[a.id],onTest:s.length>0||bt?()=>cc(a.id):void 0,isTesting:ay.has(a.id),isCustom:!0,isFree:!1,caps:r(`${q}/${a.id}`),thinkingSuffix:bD(a.id)},`${a.source}-${a.fullModel}`)),g.map(a=>{let b=`${bE}/${a.id}`,c=`${q}/${a.id}`,e=Object.entries(ao).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(F,{model:a,fullModel:`${bG}/${a.id}`,alias:e,copied:bj,onCopy:bk,onSetAlias:b=>bT(a.id,b,bE),onDeleteAlias:()=>bU(e),testStatus:au[a.id],onTest:s.length>0||bt?()=>cc(a.id):void 0,isTesting:ay.has(a.id),isFree:a.isFree,onDisable:()=>bI(a.id),caps:r(`${q}/${a.id}`),thinkingSuffix:bD(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>aB(!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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),("qoder"===q||"qoder-cn"===q)&&s.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bX,disabled:bf,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bf?{animation:"spin 1s linear infinite"}:void 0,children:bf?"progress_activity":"download"}),bf?(0,B.Tl)("Fetching..."):(0,B.Tl)("Fetch Qoder Models")]}),("cline"===q||"clinepass"===q)&&s.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bY,disabled:bh,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bh?{animation:"spin 1s linear infinite"}:void 0,children:bh?"progress_activity":"download"}),bh?(0,B.Tl)("Fetching..."):(0,B.Tl)("Import from /models")]}),aS.length>0&&(a=new Set([...Object.values(ao),...i.map(a=>a.fullModel)]),b=new Set(bv.map(a=>a.id)),0===(c=aS.filter(c=>!a.has(`${bE}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await bV(a.id,"llm",bE)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),h.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",h.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:h.map(a=>(0,d.jsxs)("button",{onClick:()=>bJ(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),cb,"kiro"===q?(0,d.jsx)(k.Mh,{isOpen:G,providerInfo:bp,onSuccess:b_,onClose:()=>I(!1)}):"cursor"===q?(0,d.jsx)(k.G9,{isOpen:G,onSuccess:b_,onClose:()=>I(!1)}):"zed"===q?(0,d.jsx)(k.TE,{isOpen:G,providerInfo:bp,onSuccess:b_,onClose:()=>I(!1)}):"gitlab"===q?(0,d.jsx)(k.vj,{isOpen:G,providerInfo:bp,onSuccess:b_,onClose:()=>I(!1)}):(0,d.jsx)(k.LF,{isOpen:G,provider:q,providerInfo:bp,onSuccess:b_,onClose:()=>I(!1)}),(0,d.jsx)(k.LH,{isOpen:J,onSuccess:b_,onClose:()=>K(!1)}),"iflow"===q&&(0,d.jsx)(k.vE,{isOpen:M,onSuccess:()=>{bO(),P(!1)},onClose:()=>P(!1)}),(0,d.jsx)(N,{isOpen:R,provider:q,providerName:bp.name,isCompatible:bz,isAnthropic:by,authType:bp?.authType,authHint:bp?.authHint,website:bp?.website,proxyPools:D,error:U,existingNames:s.map(a=>a.name).filter(Boolean),onSave:b0,onBulkDone:bO,onClose:()=>{W(""),T(!1)}}),(0,d.jsx)(k.wI,{isOpen:ag,connection:am,proxyPools:D,onSave:b1,onClose:()=>ah(!1)}),bz&&(0,d.jsx)(O,{isOpen:ai,node:w,onSave:bP,onClose:()=>aj(!1),isAnthropic:by}),!bz&&(0,d.jsx)(Q,{isOpen:aA,providerAlias:bE,providerDisplayAlias:bG,onSave:async(a,b,c)=>{await bV(a,b?.stt?"stt":"llm",bE,b,c),aB(!1)},onClose:()=>aB(!1)}),"codex"===q&&(0,d.jsx)(S,{isOpen:X,onClose:()=>Y(!1),onSuccess:bO}),"grok-cli"===q&&(0,d.jsx)(V,{isOpen:ae,onClose:()=>af(!1),onSuccess:bO}),aQ&&(0,d.jsx)($.A,{isOpen:!!aQ,onClose:()=>aR(null),connection:aQ,reactive:!0===aO.connections[aQ.id],schedule:aO.schedules?.[aQ.id]||null,onSave:a=>((a,{reactive:b,schedule:c})=>{bS({...aO,connections:{...aO.connections,[a]:b},schedules:{...aO.schedules,[a]:c}})})(aQ.id,a)}),(0,d.jsx)(k.uo,{isOpen:a2,onClose:()=>a3(!1),onConfirm:()=>{(a3(!1),br)?bl():bn()},title:"Risk Notice",message:bp?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(k.uo,{isOpen:!!a0,onClose:()=>a1(null),onConfirm:a0?.onConfirm,title:a0?.title||"Confirm",message:a0?.message,variant:"danger"})]})}},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41365:(a,b,c)=>{"use strict";c.d(b,{A:()=>m,w:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(99258);let j=new Set(["grok-web","chatgpt-web","gemini-web","muse-web","deepseek-web","uc-web"]),k={default:"person",grok:"bolt",work:"work",personal:"home"},l=[{key:"opening",label:"Opening browser window",icon:"open_in_new"},{key:"waiting",label:"Waiting for you to log in",icon:"hourglass_top"},{key:"saving",label:"Saving connection",icon:"save"}];function m({providerId:a,onConnected:b,size:c="sm"}){let[f,g]=(0,e.useState)(!1),[j,n]=(0,e.useState)("idle"),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(["default"]),[s,t]=(0,e.useState)("default"),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w=(0,e.useCallback)(()=>{u.current&&(clearInterval(u.current),u.current=null)},[]),x=(0,e.useCallback)(a=>{t(a)},[a]),y="opening"===j||"waiting"===j,z=(0,e.useCallback)(()=>{y||(w(),g(!1),"error"===j&&(n("idle"),p("")))},[y,j,w]),A=(0,e.useCallback)(()=>{w(),u.current=setInterval(async()=>{try{let c=await fetch(`/api/providers/web-login?provider=${encodeURIComponent(a)}`,{cache:"no-store"}),d=await c.json();"success"===d.status?(w(),n("success"),p(d.email?`${(0,i.Tl)("Signed in as")} ${d.email}`:"Connection saved"),"function"==typeof b&&b(),v.current=setTimeout(()=>{g(!1),p("")},1500)):"error"===d.status||"timeout"===d.status||"cancelled"===d.status?(w(),n("error"),p(d.error||(0,i.Tl)("Login failed"))):n(a=>"opening"===a?"waiting":a)}catch{}},2e3)},[a,b,w]),B=(0,e.useCallback)(async()=>{n("opening"),p("");try{let b=await fetch("/api/providers/web-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a,profile:s})}),c=await b.json();if(!b.ok){n("error"),p(c.error||(0,i.Tl)("Failed to start login"));return}n("waiting"),p((0,i.Tl)("A browser window has opened — log in there, this page updates itself.")),A()}catch(a){n("error"),p(a?.message||(0,i.Tl)("Failed to start login"))}},[a,s,A]),C=(0,e.useCallback)(()=>{fetch(`/api/providers/web-login?provider=${encodeURIComponent(a)}`,{method:"DELETE"}).catch(()=>{}),w(),n("idle"),p("")},[a,w]),D=(0,e.useCallback)(()=>{let a=window.prompt((0,i.Tl)("New browser profile name (e.g. work, personal):"),"");if(!a)return;let b=a.trim().replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,40);b&&(r(a=>a.includes(b)?a:[...a,b]),x(b))},[x]),E="opening"===j?0:"waiting"===j?1:"success"===j?2:-1;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{size:c,icon:"success"===j?"check_circle":"language",variant:"secondary",onClick:()=>{n("idle"),p(""),g(!0)},title:(0,i.Tl)("Open a browser window, log in by hand — the cookie is captured automatically"),children:"success"===j?(0,i.Tl)("Connected"):(0,i.Tl)("Login via Browser")}),(0,d.jsx)(h.aF,{isOpen:f,onClose:z,title:(0,i.Tl)("Login via Browser"),size:"sm",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,i.Tl)("A Chrome window opens on a shared browser profile. Log in there — the session is captured automatically. One Google login in a profile makes every other provider a single “Continue with Google” click.")}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:(0,i.Tl)("Browser profile")}),(0,d.jsxs)("button",{type:"button",onClick:D,disabled:y,className:"flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),(0,i.Tl)("New profile")]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2",children:q.map(a=>{let b=a===s;return(0,d.jsxs)("button",{type:"button",disabled:y,onClick:()=>x(a),className:`flex items-center gap-2 rounded border border-accent/30 bg-sidebar p-2 text-left text-sm transition-colors focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 ${b?"border-primary ring-1 ring-primary":"hover:border-accent/60"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:function(a){let b=String(a).toLowerCase();for(let[a,c]of Object.entries(k))if(b.includes(a))return c;return"folder_shared"}(a)}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a}),b&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"})]},a)})})]}),"idle"!==j&&(0,d.jsx)("div",{className:"rounded border border-accent/20 bg-sidebar/50 p-3",children:"success"===j?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"check_circle"}),"✓ ",o||(0,i.Tl)("Connection saved")]}):"error"===j?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,i.Tl)("Login failed")]}),o&&(0,d.jsx)("p",{className:"pl-6 text-xs text-red-500 break-words",children:o})]}):(0,d.jsxs)("ol",{className:"flex flex-col gap-2",children:[l.map((a,b)=>{let c=b<E,e=b===E;return(0,d.jsxs)("li",{className:`flex items-center gap-2 text-sm ${c?"text-green-400":e?"text-primary":"text-text-muted opacity-50"}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] ${e?"animate-pulse":""}`,children:c?"check_circle":a.icon}),(0,i.Tl)(a.label)]},a.key)}),o&&(0,d.jsx)("li",{className:"pl-6 text-xs text-text-muted",children:o})]})}),(0,d.jsx)("div",{className:"flex gap-2",children:"success"===j?(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,children:(0,i.Tl)("Done")}):y?(0,d.jsx)(h.$n,{onClick:C,variant:"ghost",fullWidth:!0,children:(0,i.Tl)("Cancel")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{onClick:B,fullWidth:!0,disabled:"error"===j&&!o,children:(0,i.Tl)("Open Browser & Login")}),(0,d.jsx)(h.$n,{onClick:z,variant:"ghost",fullWidth:!0,disabled:y,children:(0,i.Tl)("Close")})]})})]})})]})}m.propTypes={providerId:g().string.isRequired,onConnected:g().func,size:g().oneOf(["sm","md","lg"])}},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48102:(a,b,c)=>{Promise.resolve().then(c.bind(c,12138))},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},56965:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,57529))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/Users/Working/router4/9router/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/Users/Working/router4/9router/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},72271:a=>{"use strict";a.exports=require("@aws-sdk/credential-providers")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79646:a=>{"use strict";a.exports=require("child_process")},80099:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1260,2430,3459,2760,1220,9100,8499,6070,869,915,6457,4123,2598,6777,412,4096],()=>b(b.s=56965));module.exports=c})();
27
+ ]`;function U(a){let b,c=a.trim();if(!c)return[];try{b=JSON.parse(c)}catch(a){try{let a=c;a.startsWith("[")||((a=a.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(a=a.slice(0,-1)),a=`[${a}]`),b=JSON.parse(a)}catch{throw a}}if(Array.isArray(b))return b;if(b&&"object"==typeof b)return Array.isArray(b.accounts)?b.accounts:[b];throw Error("Input must be a JSON object or array of objects")}function V({isOpen:a,onClose:b,onSuccess:c}){let[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(!1),[j,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=()=>{h||(g(""),l(""),n(null),r(null),p(!1),b())},u=async a=>{if(!a||0===a.length)return;l("");let b=Array.from(a).filter(a=>a.name.endsWith(".json")||"application/json"===a.type||""===a.type);if(0===b.length)return void l((0,B.Tl)("Please select valid .json files"));try{let a=[];for(let c of b){let b=await c.text(),d=U(b);Array.isArray(d)?a.push(...d):d&&a.push(d)}if(0===a.length)return void l((0,B.Tl)("No accounts found in selected files"));g(JSON.stringify(a,null,2)),r({filesCount:b.length,accountsCount:a.length})}catch(a){l(`${(0,B.Tl)("Error reading files")}: ${a.message}`)}},v=async()=>{let a;l(""),n(null);try{a=U(f)}catch(a){l(`${(0,B.Tl)("Invalid JSON")}: ${a.message}`);return}if(!a||0===a.length)return void l((0,B.Tl)("No accounts found in input"));i(!0);try{let b=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:a})}),d=await b.json();if(!b.ok)return void l(d?.error||`Request failed: ${b.status}`);n(d),d.success>0&&"function"==typeof c&&c()}catch(a){l(a.message||(0,B.Tl)("Request failed"))}finally{i(!1)}},w=m?.results?.filter(a=>!a.ok)||[];return(0,d.jsx)(k.aF,{isOpen:a,title:(0,B.Tl)("Bulk Add Grok CLI Accounts"),onClose:t,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,B.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,d.jsx)("input",{ref:s,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:a=>{u(a.target.files),a.target&&(a.target.value="")}}),(0,d.jsx)(k.$n,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>s.current?.click(),disabled:h,children:(0,B.Tl)("Upload JSON Files")})]}),(0,d.jsxs)("div",{onDragOver:a=>{a.preventDefault(),p(!0)},onDragLeave:a=>{a.preventDefault(),p(!1)},onDrop:a=>{a.preventDefault(),p(!1),a.dataTransfer?.files?.length>0&&u(a.dataTransfer.files)},className:`relative rounded border transition-colors ${o?"border-primary bg-primary/10 ring-2 ring-primary/30":"border-accent/30 bg-sidebar"}`,children:[(0,d.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:T,value:f,onChange:a=>{g(a.target.value),r(null)},disabled:h}),o&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary mb-1",children:"upload_file"}),(0,d.jsx)("span",{className:"text-sm font-medium text-primary",children:(0,B.Tl)("Drop .json files here")})]})]}),q&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),(0,d.jsxs)("span",{children:[(0,B.Tl)("Loaded")," ",q.accountsCount," ",(0,B.Tl)("account(s) from")," ",q.filesCount," ",(0,B.Tl)("file(s)")]})]}),j&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:j}),m&&m.failed>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"text-sm font-medium text-yellow-400",children:["✗ ",m.failed," ",(0,B.Tl)("failed")]}),w.length>0&&(0,d.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(a=>(0,d.jsxs)("li",{className:"text-red-400",children:["[",a.index,"] ",a.error]},a.index))})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:v,fullWidth:!0,disabled:h||!f.trim(),children:h?(0,B.Tl)("Importing..."):(0,B.Tl)("Import All")}),(0,d.jsx)(k.$n,{onClick:t,variant:"ghost",fullWidth:!0,disabled:h,children:(0,B.Tl)("Close")})]})]})})}var W=c(41371);let X=["host","content-length","content-type","connection","transfer-encoding","authorization","cookie"],Y=/^[A-Za-z0-9-]+$/;function Z({providerId:a}){let b=(0,W.i)(),[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([{name:"",value:""}]),[i,j]=(0,e.useState)({}),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),p=(a,b,c)=>{h(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},q=(0,e.useCallback)(async()=>{let c={};for(let a of g.filter(a=>a.name.trim())){let d=a.name.trim();if(!Y.test(d))return void b.error(`Invalid header name: ${d}`);if(X.includes(d.toLowerCase()))return void b.error(`Header ${d} cannot be overridden`);if(d in c)return void b.error(`Duplicate header name: ${d}`);a.value!==i[d]&&(c[d]=a.value)}o(!0);try{let d=await fetch(`/api/providers/${a}/overrides`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:c})});if(!d.ok){let a=await d.json().catch(()=>({}));b.error(a.error||"Failed to save");return}m(Object.keys(c).length>0),b.success("Custom headers saved")}finally{o(!1)}},[g,i,a,b]);return 0!==Object.keys(i).length||l?(0,d.jsxs)(k.Zp,{padding:"xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"flex w-full items-center justify-between text-left",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"tune"}),(0,d.jsx)("span",{className:"text-sm font-semibold",children:"Custom Headers"}),l&&(0,d.jsx)(k.Ex,{variant:"success",size:"sm",children:"Active"})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted",children:c?"expand_less":"expand_more"})]}),c&&(0,d.jsxs)("div",{className:"mt-3 border-t border-border pt-3",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:g.map((a,b)=>{let c=a.name.trim()in i&&a.value!==i[a.name.trim()];return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:a.name,onChange:a=>p(b,"name",a.target.value),placeholder:"Header-Name",spellCheck:!1,className:"w-44 rounded-md border border-border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none"}),(0,d.jsx)("input",{value:a.value,onChange:a=>p(b,"value",a.target.value),placeholder:"Value",spellCheck:!1,title:c?"Overridden":a.name.trim()in i?"Registry default":"",className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm focus:border-primary focus:outline-none ${c?"border-amber-400/60":"border-border"}`}),(0,d.jsx)("button",{type:"button",title:"Remove header",onClick:()=>h(a=>a.length>1?a.filter((a,c)=>c!==b):[{name:"",value:""}]),className:"shrink-0 text-text-muted hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]},b)})}),(0,d.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>h(a=>[...a,{name:"",value:""}]),className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add header"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",disabled:n,onClick:()=>{h(Object.entries(i).map(([a,b])=>({name:a,value:b})))},className:"rounded-md border border-border px-3 py-1.5 text-xs hover:bg-black/[0.03] dark:hover:bg-white/[0.03] disabled:opacity-50",children:"Reset"}),(0,d.jsx)("button",{type:"button",disabled:n,onClick:q,className:"rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-white hover:opacity-90 disabled:opacity-50",children:n?"Saving...":"Save"})]})]})]})]}):null}Z.propTypes={providerId:E().string.isRequired};var $=c(56020),_=c(41365);function aa({providerId:a,onConnected:b,size:c="sm"}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),j=async()=>{g(!0),i("");try{let c=await fetch(`/api/oauth/${a}/lease-connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),d=await c.json().catch(()=>({}));if(!c.ok)return void i(d.error||"Could not reach the MiniMax Code desktop app");"function"==typeof b&&b()}catch(a){i(a?.message||"Could not reach the MiniMax Code desktop app")}finally{g(!1)}};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:c,icon:"desktop_windows",variant:"secondary",disabled:f,onClick:j,title:(0,B.Tl)("Borrow the signed-in MiniMax Code desktop app's login — no second sign-in, refresh stays with the desktop app"),children:f?(0,B.Tl)("Connecting..."):(0,B.Tl)("Use Desktop App")}),h&&(0,d.jsx)("p",{className:"w-full text-xs text-red-500 break-words",children:h})]})}aa.propTypes={providerId:E().string.isRequired,onConnected:E().func,size:E().oneOf(["sm","md","lg"])};var ab=c(54589);let ac=new Set(["minimax-code","minimax-code-global"]),ad=new Set(["cursor","zed","claude","commandcode"]),ae={claude:"claudeAutoPing",codex:"codexAutoPing"};function af(){let a,b,c,g,n,o=(0,f.useParams)(),p=(0,f.useRouter)(),q=o.id,{getCaps:r}=(0,A.y)(),[s,t]=(0,e.useState)([]),[u,v]=(0,e.useState)(!0),[w,x]=(0,e.useState)(null),[D,E]=(0,e.useState)([]),[G,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[M,P]=(0,e.useState)(!1),[R,T]=(0,e.useState)(!1),[U,W]=(0,e.useState)(""),[X,Y]=(0,e.useState)(!1),[af,ag]=(0,e.useState)(!1),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(!1),[al,am]=(0,e.useState)(!1),[an,ao]=(0,e.useState)(null),[ap,aq]=(0,e.useState)({}),[ar,as]=(0,e.useState)([]),[at,au]=(0,e.useState)(!1),[av,aw]=(0,e.useState)({}),[ax,ay]=(0,e.useState)(""),[az,aA]=(0,e.useState)(()=>new Set),[aB,aC]=(0,e.useState)(!1),[aD,aE]=(0,e.useState)([]),[aF,aG]=(0,e.useState)("__none__"),[aH,aI]=(0,e.useState)(!1),[aJ,aK]=(0,e.useState)(null),[aL,aM]=(0,e.useState)(""),[aN,aO]=(0,e.useState)("auto"),[aP,aQ]=(0,e.useState)({enabled:!1,connections:{},schedules:{}}),[aR,aS]=(0,e.useState)(null),[aT,aU]=(0,e.useState)([]),[aV,aW]=(0,e.useState)([]),[aX,aY]=(0,e.useState)(null),[aZ,a$]=(0,e.useState)([]),[a_,a0]=(0,e.useState)([]),[a1,a2]=(0,e.useState)(null),[a3,a4]=(0,e.useState)(!1),[a5,a6]=(0,e.useState)(!1),[a7,a8]=(0,e.useState)(!1),[a9,ba]=(0,e.useState)(null),[bb,bc]=(0,e.useState)({}),[bd,be]=(0,e.useState)(null),bf=(0,e.useRef)(!1),[bg,bh]=(0,e.useState)(!1),[bi,bj]=(0,e.useState)(!1),{copied:bk,copy:bl}=(0,z.C)(),bm=()=>{I(!0)},bn=()=>{"xiaomi-mimo"===q?K(!0):bs?bm():(W(""),T(!0))},bo=()=>{W(""),T(!0)},bp=()=>{bs?bn():bo()},bq=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}:l.zN[q]||l.fg[q]||l.IS[q]||l.nJ[q]||l.br[q],br=bq?.authModes||[],bs=!!l.zN[q]||!!l.IS[q]||br.includes("oauth"),bt=!!l.fg[q]||br.includes("apikey"),bu=!!l.IS[q]?.noAuth,bv=(0,m.KC)(q),bw=ad.has(q)&&aV.length>0?aV:(0,C.N)(bv,ar,(0,l.wG)(q)),bx=(0,l.wG)(q),by=(0,l.mq)(q),bz=(0,l.gb)(q),bA=by||bz,bB=!bA&&bs&&bt,bC="xai"===q?"Grok Build OAuth":"grok-cli"===q?"Grok CLI Device Login":"kimi"===q?"Kimi Coding OAuth":"OAuth",bD="xai"===q?"xAI API Key":"kimi"===q?"Kimi API Key":"qoder"===q||"qoder-cn"===q?"PAT":"API Key",bE=a=>{if(!aN||"auto"===aN)return null;let b=y(q,a);return b&&b.includes(aN)?aN:null},bF=bA?q:bx,bG=(()=>{let a=new Set,b=new Set,c=c=>{if(!c||b.has(c))return;b.add(c);let d=y(q,c);d&&d.forEach(b=>{"none"!==b&&a.add(b)})};for(let a of bw)c(a.id);for(let a of aZ)c(a.id);for(let a of ar)a.providerAlias===bF&&"llm"===(a.kind||a.type||"llm")&&c(a.id);return a.size?["auto",...a]:null})(),bH=bA?w?.prefix||q:bx,bI=(0,e.useCallback)(async()=>{try{let a=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bF)}`,{cache:"no-store"}),b=await a.json();a.ok&&a0(b.ids||[])}catch(a){console.log("Error fetching disabled models:",a)}},[bF]),bJ=async a=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bF,ids:[a]})})).ok&&await bI()}catch(a){console.log("Error disabling model:",a)}},bK=async a=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bF)}&id=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bI()}catch(a){console.log("Error enabling model:",a)}},bL=async a=>{a.length&&a2({title:"Disable All Models",message:`Disable all ${a.length} model(s)?`,onConfirm:async()=>{a2(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bF,ids:a})})).ok&&await bI()}catch(a){console.log("Error disabling all models:",a)}}})},bM=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(bF)}`,{method:"DELETE"})).ok&&await bI()}catch(a){console.log("Error enabling all models:",a)}},bN=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&aq(b.aliases||{})}catch(a){console.log("Error fetching aliases:",a)}},[]),bO=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/custom",{cache:"no-store"}),b=await a.json();a.ok&&as(b.models||[])}catch(a){console.log("Error fetching custom models:",a)}},[]),bP=(0,e.useCallback)(async()=>{try{let[a,b,c,d]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),e=await a.json(),f=await b.json(),g=await c.json(),h=d.ok?await d.json():{};if(a.ok){let a=(e.connections||[]).filter(a=>a.provider===q);t(a)}c.ok&&E(g.proxyPools||[]);let i=(h.providerStrategies||{})[q]||{};aK(i.fallbackStrategy||null),aM(null!=i.stickyRoundRobinLimit?String(i.stickyRoundRobinLimit):"1");let j=(h.providerThinking||{})[q]||{};aO(j.mode||"auto");let k=ae[q],l=k&&h[k]||{};if(aQ({enabled:!0===l.enabled,connections:l.connections||{},schedules:l.schedules||{}}),b.ok){let a=(f.nodes||[]).find(a=>a.id===q)||null;if(!a&&bA)for(let b=0;b<3;b+=1){await new Promise(a=>setTimeout(a,150));let b=await fetch("/api/provider-nodes",{cache:"no-store"});if(b.ok&&(a=((await b.json()).nodes||[]).find(a=>a.id===q)||null))break}x(a)}}catch(a){console.log("Error fetching connections:",a)}finally{v(!1)}},[q,bA]),bQ=async a=>{try{let b=await fetch(`/api/provider-nodes/${q}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();b.ok&&(x(c.node),await bP(),ak(!1))}catch(a){console.log("Error updating provider node:",a)}},bR=async(a,b)=>{try{let c=await fetch("/api/settings",{cache:"no-store"}),d=(c.ok?await c.json():{}).providerStrategies||{},e={};a&&(e.fallbackStrategy=a),"round-robin"===a&&""!==b&&(e.stickyRoundRobinLimit=Number(b)||3);let f={...d};0===Object.keys(e).length?delete f[q]:f[q]=e,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:f})})}catch(a){console.log("Error saving provider strategy:",a)}},bS=async a=>{try{let b=await fetch("/api/settings",{cache:"no-store"}),c={...(b.ok?await b.json():{}).providerThinking||{}};a&&"auto"!==a?c[q]={mode:a}:delete c[q],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerThinking:c})})}catch(a){console.log("Error saving thinking config:",a)}},bT=async a=>{let b=ae[q];if(b){aQ(a);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:a})})}catch(a){console.log("Error saving auto-ping config:",a)}}},bU=async(a,b,c=bx)=>{let d=`${c}/${a}`;try{let a=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d,alias:b})});if(a.ok)await bN();else{let b=await a.json();alert(b.error||"Failed to set alias")}}catch(a){console.log("Error setting alias:",a)}},bV=async a=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(a)}`,{method:"DELETE"})).ok&&await bN()}catch(a){console.log("Error deleting alias:",a)}},bW=async(a,b="llm",c=bF,d,e)=>{try{let f=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:c,id:a,type:b,...d?{caps:d}:{},...e?{transport:e}:{}})});if(f.ok)await bO();else{let a=await f.json();alert(a.error||"Failed to add custom model")}}catch(a){console.log("Error adding custom model:",a)}},bX=async(a,b="llm",c=bF)=>{try{let d=new URLSearchParams({providerAlias:c,id:a,type:b});(await fetch(`/api/models/custom?${d}`,{method:"DELETE"})).ok&&await bO()}catch(a){console.log("Error deleting custom model:",a)}},bY=async()=>{if(bg)return;let a=s.find(a=>!1!==a.isActive);if(!a)return void alert((0,B.Tl)("Please add an active Qoder connection first"));bh(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,B.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,B.Tl)("No models returned"));if("qoder"===q||"qoder-cn"===q){for(let a of d){let b=a.id?.replace(/^(qoder-cn|qoder)\//,"");if(!b)continue;let c=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:bF,id:b,type:"llm",name:a.name||b})});if(!c.ok){let a=await c.json();throw Error(a.error||"Failed to save model")}}await bO(),window.dispatchEvent(new CustomEvent("customModelChanged")),alert((0,B.Tl)("Successfully updated")+` ${d.length} `+(0,B.Tl)("models"));return}let e=0;for(let a of d){let b=a.id||a.name;if(!b)continue;let c=b.replace(/^(qoder-cn|qoder)\//,"");ar.some(a=>a.providerAlias===bF&&a.id===c&&"llm"===(a.kind||a.type||"llm"))||Object.values(ap).includes(`${bF}/${c}`)||(await bW(c,"llm",bF),e+=1)}0===e?alert((0,B.Tl)("All models already exist, no new models added")):alert((0,B.Tl)("Successfully added")+` ${e} `+(0,B.Tl)("models"))}catch(a){console.log("Error importing Qoder models:",a),alert((0,B.Tl)("Error fetching models")+": "+a.message)}finally{bh(!1)}},bZ=async()=>{if(bi)return;let a=s.find(a=>!1!==a.isActive);if(!a)return void alert((0,B.Tl)("Please add an active Cline connection first"));bj(!0);try{let b=await fetch(`/api/providers/${a.id}/models`),c=await b.json();if(!b.ok)return void alert(c.error||(0,B.Tl)("Failed to fetch models"));let d=c.models||[];if(0===d.length)return void alert((0,B.Tl)("No models returned"));let e=0;for(let a of d){let b=a.id||a.name;b&&(ar.some(a=>a.providerAlias===bF&&a.id===b&&"llm"===(a.kind||a.type||"llm"))||Object.values(ap).includes(`${bF}/${b}`)||(await bW(b,"llm",bF),e+=1))}0===e?alert((0,B.Tl)("All models already exist, no new models added")):alert((0,B.Tl)("Successfully added")+` ${e} `+(0,B.Tl)("models"))}catch(a){console.log("Error importing Cline models:",a),alert((0,B.Tl)("Error fetching models")+": "+a.message)}finally{bj(!1)}},b$=async()=>{if(a5||0===s.length)return;let a=Object.fromEntries(s.map(a=>[a.id,{state:"queued",error:null}]));bf.current=!1,a6(!0),a8(!1),ba(null),bc(a),be({total:s.length,completed:0,passed:0,failed:0,stopped:!1});let b=0,c=0;try{for(let a=0;a<s.length;a+=1){if(bf.current){be({total:s.length,completed:a,passed:b,failed:c,stopped:!0});break}let d=s[a];ba(d.id),bc(a=>({...a,[d.id]:{state:"testing",error:null}}));try{let a=await fetch(`/api/providers/${d.id}/test`,{method:"POST"}),e=await a.json(),f=!!e.valid;f?b+=1:c+=1,bc(a=>({...a,[d.id]:{state:f?"success":"failed",error:f?null:e.error||null}}))}catch(a){c+=1,bc(b=>({...b,[d.id]:{state:"failed",error:a.message||"Test failed"}}))}be({total:s.length,completed:a+1,passed:b,failed:c,stopped:!1}),a<s.length-1&&await new Promise(a=>setTimeout(a,1e3))}}finally{ba(null),a6(!1),a8(!1),bf.current=!1}},b_=async a=>{a2({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{a2(null);try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok&&t(b=>b.filter(b=>b.id!==a))}catch(a){console.log("Error deleting connection:",a)}}})},b0=()=>{bP(),I(!1)},b1=async a=>{W("");try{let b=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:q,...a})}),c=null;try{c=await b.json()}catch{c=null}if(b.ok){await bP(),T(!1);return}W(c?.error||"Failed to save connection")}catch(a){console.log("Error saving connection:",a),W("Failed to save connection")}},b2=async a=>{try{(await fetch(`/api/providers/${an.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(await bP(),ai(!1))}catch(a){console.log("Error updating connection:",a)}},b3=async(a,b)=>{try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&t(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error updating connection status:",a)}},b4=async(a,b)=>{let c=[...s];[c[a],c[b]]=[c[b],c[a]],t(c);try{await Promise.all([fetch(`/api/providers/${c[a].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:a})}),fetch(`/api/providers/${c[b].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:b})})])}catch(a){console.log("Error swapping priority:",a),await bP()}},b5=s.filter(a=>aD.includes(a.id)),b6=s.length>0&&aD.length===s.length;(()=>{if(0===b5.length)return;let a=new Set(b5.map(a=>a.providerSpecificData?.proxyPoolId||"__none__"));if(1===a.size){let b=[...a][0];if("__none__"===b)return;let c=D.find(a=>a.id===b);return c?.name}})();let b7=()=>{aH||am(!1)},b8=async a=>{aI(!0);try{let b=0;for(let{connectionId:c,proxyPoolId:d}of a)try{(await fetch(`/api/providers/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:d})})).ok||(b+=1)}catch(a){console.log("Error applying proxy for",c,a),b+=1}b>0&&alert(`Updated with ${b} failed request(s).`),await bP(),am(!1)}finally{aI(!1)}},b9=a=>b8(s.map(b=>({connectionId:b.id,proxyPoolId:a}))),ca=(0,d.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:s.map((a,b)=>{let c;return(0,d.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,d.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,d.jsx)("input",{type:"checkbox",checked:(c=a.id,aD.includes(c)),onChange:()=>{var b;return b=a.id,void aE(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(L,{connection:a,proxyPools:D,isOAuth:bs,isFirst:0===b,isLast:b===s.length-1,onMoveUp:()=>b4(b,b-1),onMoveDown:()=>b4(b,b+1),onToggleActive:b=>b3(a.id,b),autoPing:ae[q]&&"oauth"===a.authType?{isActive:!0===aP.connections[a.id]||aP.schedules?.[a.id]?.enabled===!0,reactiveOn:!0===aP.connections[a.id],provider:q,scheduleOn:aP.schedules?.[a.id]?.enabled===!0,scheduleSummary:(0,ab.JW)(aP.schedules?.[a.id]).join(" / "),onConfigure:()=>aS(a)}:null,onUpdateProxy:async b=>{try{(await fetch(`/api/providers/${a.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:b||null})})).ok&&t(c=>c.map(c=>c.id===a.id?{...c,providerSpecificData:{...c.providerSpecificData,proxyPoolId:b||null}}:c))}catch(a){console.log("Error updating proxy:",a)}},onEdit:()=>{ao(a),ai(!0)},onDelete:()=>b_(a.id),oneByOneStatus:bb[a.id]||null})})]},a.id)})}),cb=D.filter(a=>!0===a.isActive),cc=(0,d.jsx)(k.aF,{isOpen:al,onClose:b7,title:`Apply Proxy (${s.length} connections)`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{onClick:()=>{let a=D.filter(a=>!0===a.isActive);return 0===a.length?void alert("No active proxy pools available."):b8(s.map((b,c)=>({connectionId:b.id,proxyPoolId:a[c%a.length].id})))},disabled:aH||0===cb.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,d.jsxs)("button",{onClick:()=>b9(null),disabled:aH,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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,d.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),D.map(a=>(0,d.jsxs)("button",{onClick:()=>b9(a.id),disabled:aH||!0!==a.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,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,d.jsx)("span",{className:"truncate text-sm text-text-main",children:a.name}),!0!==a.isActive&&(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},a.id))]}),aH&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,d.jsx)(k.$n,{onClick:b7,variant:"ghost",fullWidth:!0,disabled:aH,children:"Cancel"})]})}),cd=async a=>{if(!az.has(a)){aA(b=>new Set(b).add(a));try{let b=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${bF}/${a}`})}),c=await b.json();aw(b=>({...b,[a]:c.ok?"ok":"error"})),ay(c.ok?"":c.error||"Model not reachable")}catch{aw(b=>({...b,[a]:"error"})),ay("Network error")}finally{aA(b=>{let c=new Set(b);return c.delete(a),c})}}};if(u)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(k.Qv,{}),(0,d.jsx)(k.Qv,{})]});if(!bq)return(0,d.jsxs)("div",{className:"text-center py-20",children:[(0,d.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,d.jsx)(h(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]});let ce=()=>by&&bq.apiType?"responses"===bq.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":bz?"/providers/anthropic-m.png":(0,j.HY)(bq.id);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)(h(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,d.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${bq.color}15`},children:at||!ce()?(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:bq.color},children:bq.textIcon||bq.id.slice(0,2).toUpperCase()}):(0,d.jsx)(i.A,{src:ce(),alt:bq.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>{(0,j.Kw)(bq.id),au(!0)},loading:"lazy",decoding:"async"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:bq.name}),(bq.notice?.apiKeyUrl||bq.notice?.signupUrl||bq.website)&&(0,d.jsxs)("a",{href:bq.notice?.apiKeyUrl||bq.notice?.signupUrl||bq.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),bq.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:[s.length," connection",1===s.length?"":"s"]})]})]})]}),bq.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:bq.deprecationNotice})]}),bq.notice?.text&&!bq.deprecated&&(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,d.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:bq.notice.text}),bq.notice.apiKeyUrl&&(0,d.jsx)("a",{href:bq.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 →"})]}),bA&&w&&(0,d.jsx)(k.Zp,{children:(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:bz?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,d.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[bz?"Messages API":"responses"===w.apiType?"Responses API":"Chat Completions"," \xb7 ",(w.baseUrl||"").replace(/\/$/,""),"/",bz?"messages":"responses"===w.apiType?"responses":"chat/completions"]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:()=>{W(""),T(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>ak(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{a2({title:"Delete Compatible Node",message:`Delete this ${bz?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{a2(null);try{(await fetch(`/api/provider-nodes/${q}`,{method:"DELETE"})).ok&&p.push("/dashboard/providers")}catch(a){console.log("Error deleting provider node:",a)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),bu?(0,d.jsx)(k.gw,{providerId:q}):(0,d.jsxs)(k.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[s.length>0&&D.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>am(!0),children:"Apply Proxy"}),s.length>0&&(0,d.jsxs)(d.Fragment,{children:[aD.length>0&&(0,d.jsxs)(k.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let a=aD.length;0!==a&&a2({title:`Delete ${a} Connection${a>1?"s":""}`,message:`Delete ${a} connection${a>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{a2(null);let a=0,b=[...aD];for(let c of b)try{(await fetch(`/api/providers/${c}`,{method:"DELETE"})).ok||(a+=1)}catch(b){console.log("Error deleting connection:",b),a+=1}t(a=>a.filter(a=>!b.includes(a.id))),aE([]),a>0&&alert(`Deleted ${b.length-a} connection(s), ${a} failed.`)}})},children:["Delete Selected (",aD.length,")"]}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:b$,disabled:a5,children:a5?"Testing Connection One-by-One...":"Test Connection One-by-One"}),a5&&(0,d.jsx)(k.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{a5&&(bf.current=!0,a8(!0))},disabled:a7,children:a7?"Stopping...":"Stop"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,d.jsx)(k.lM,{checked:"round-robin"===aJ,onChange:a=>{let b=a?"round-robin":null,c=a?aL||"1":aL;a&&!aL&&aM("1"),aK(b),bR(b,c)}}),"round-robin"===aJ&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,d.jsx)("input",{type:"number",min:1,value:aL,onChange:a=>{var b;aM(b=a.target.value),bR("round-robin",b)},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===s.length?(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:bs?"lock":"key"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),bB&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",bC," or ",bD,"."]})]})]}),(0,d.jsx)("div",{className:"flex gap-2",children:bB?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bn,children:bC}),(0,d.jsx)(k.$n,{size:"sm",icon:"key",onClick:bo,children:bD})]}):(0,d.jsxs)(d.Fragment,{children:[!bA&&_.w.has(q)&&(0,d.jsx)(_.A,{providerId:q,onConnected:bP}),!bA&&ac.has(q)&&(0,d.jsx)(aa,{providerId:q,onConnected:bP}),!bA&&"iflow"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>P(!0),children:"Cookie"}),"codex"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),children:(0,B.Tl)("Bulk Add")}),"grok-cli"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ag(!0),children:(0,B.Tl)("Bulk Add")}),(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:bp,children:bA?"Add API Key":"iflow"===q?"OAuth":"Add Connection"})]})})]}):(0,d.jsxs)(d.Fragment,{children:[bd&&(0,d.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,d.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("span",{children:["Total: ",bd.total]}),(0,d.jsxs)("span",{children:["Completed: ",bd.completed]}),(0,d.jsxs)("span",{children:["Passed: ",bd.passed]}),(0,d.jsxs)("span",{children:["Failed: ",bd.failed]}),bd.stopped&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),a5&&a9&&(0,d.jsxs)("span",{children:["Running: ",s.find(a=>a.id===a9)?.name||a9]})]})}),s.length>0&&(0,d.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,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:b6,onChange:()=>{b6?aE([]):aE(s.map(a=>a.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),ca,!bA&&(0,d.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:[_.w.has(q)&&(0,d.jsx)(_.A,{providerId:q,onConnected:bP}),ac.has(q)&&(0,d.jsx)(aa,{providerId:q,onConnected:bP}),"iflow"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>P(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>Y(!0),title:(0,B.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,B.Tl)("Bulk Add")}),"grok-cli"===q&&(0,d.jsx)(k.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>ag(!0),title:(0,B.Tl)("Bulk import Grok CLI accounts from JSON"),className:"w-full sm:w-auto",children:(0,B.Tl)("Bulk Add")}),bB?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:bn,className:"w-full sm:w-auto",children:bC}),(0,d.jsx)(k.$n,{size:"sm",icon:"key",onClick:bo,className:"w-full sm:w-auto",children:bD})]}):(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:bp,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,d.jsx)(Z,{providerId:q}),(0,d.jsxs)(k.Zp,{children:[(0,d.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),bG&&(0,d.jsx)("select",{value:aN,onChange:a=>{var b;aO(b=a.target.value),bS(b)},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:bG.map(a=>(0,d.jsx)("option",{value:a,children:`Thinking: ${a.charAt(0).toUpperCase()+a.slice(1)}`},a))})]}),!bA&&(a=[...bw,...aZ.filter(a=>!bw.some(b=>b.id===a.id))].filter(a=>{let b=(0,m.CP)(a);return!b||"llm"===b}).map(a=>a.id).filter(a=>!a_.includes(a)),(0,d.jsxs)("div",{className:"flex gap-2",children:[a_.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:bM,children:"Active All"}),a.length>0&&(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>bL(a),children:"Disable All"})]}))]}),!!ax&&(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:ax}),/RegionError|hosted in China|regionNotAllowed/i.test(ax)&&(c=(b="string"==typeof ax?ax:JSON.stringify(ax)).match(/https:\/\/opencode\.ai\/workspace\/[^\s"')]+/),g=b.match(/wrk_[0-9A-Za-z]+/),n=c?c[0].endsWith("/go")?c[0]:`${c[0]}/go`:g?`https://opencode.ai/workspace/${g[0]}/go`:"https://opencode.ai",(0,d.jsx)("div",{className:"mt-1.5",children:(0,d.jsxs)("a",{href:n,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-600 hover:bg-amber-500/20 dark:text-amber-400 transition-colors",children:[(0,d.jsx)("span",{children:"Allow China-hosted models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"open_in_new"})]})}))]}),"zed"===q&&!!aX&&(0,d.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:aX}),(()=>{let a,b,c;if(bA)return(0,d.jsx)(H,{providerStorageAlias:bF,providerDisplayAlias:bH,modelAliases:ap,customModels:ar,copied:bk,onCopy:bl,onSetAlias:bU,onDeleteAlias:bV,onAddCustomModel:a=>bW(a,"llm",bF),onDeleteCustomModel:a=>bX(a,"llm",bF),connections:s,isAnthropic:bz});let e=[...bw,...aZ.filter(a=>!bw.some(b=>b.id===a.id))].filter(a=>{let b=(0,m.CP)(a);return!b||"llm"===b}),f=new Set(a_),g=e.filter(a=>!f.has(a.id)),h=e.filter(a=>f.has(a.id)),i=(0,C.R)({customModels:ar,modelAliases:ap,providerAlias:bF,builtInModels:bw,type:"llm"});return(0,d.jsxs)("div",{className:"flex flex-wrap gap-3",children:[i.map(a=>(0,d.jsx)(F,{model:{id:a.id,name:a.name},fullModel:`${bH}/${a.id}`,alias:a.alias,copied:bk,onCopy:bl,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===a.source?bX(a.id,"llm",bF):bV(a.alias)},testStatus:av[a.id],onTest:s.length>0||bu?()=>cd(a.id):void 0,isTesting:az.has(a.id),isCustom:!0,isFree:!1,caps:r(`${q}/${a.id}`),thinkingSuffix:bE(a.id)},`${a.source}-${a.fullModel}`)),g.map(a=>{let b=`${bF}/${a.id}`,c=`${q}/${a.id}`,e=Object.entries(ap).find(([,a])=>a===b||a===c)?.[0];return(0,d.jsx)(F,{model:a,fullModel:`${bH}/${a.id}`,alias:e,copied:bk,onCopy:bl,onSetAlias:b=>bU(a.id,b,bF),onDeleteAlias:()=>bV(e),testStatus:av[a.id],onTest:s.length>0||bu?()=>cd(a.id):void 0,isTesting:az.has(a.id),isFree:a.isFree,onDisable:()=>bJ(a.id),caps:r(`${q}/${a.id}`),thinkingSuffix:bE(a.id)},a.id)}),(0,d.jsxs)("button",{onClick:()=>aC(!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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),("qoder"===q||"qoder-cn"===q)&&s.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bY,disabled:bg,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bg?{animation:"spin 1s linear infinite"}:void 0,children:bg?"progress_activity":"download"}),bg?(0,B.Tl)("Fetching..."):(0,B.Tl)("Fetch Qoder Models")]}),("cline"===q||"clinepass"===q)&&s.some(a=>!1!==a.isActive)&&(0,d.jsxs)("button",{onClick:bZ,disabled:bi,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,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:bi?{animation:"spin 1s linear infinite"}:void 0,children:bi?"progress_activity":"download"}),bi?(0,B.Tl)("Fetching..."):(0,B.Tl)("Import from /models")]}),aT.length>0&&(a=new Set([...Object.values(ap),...i.map(a=>a.fullModel)]),b=new Set(bw.map(a=>a.id)),0===(c=aT.filter(c=>!a.has(`${bF}/${c.id}`)&&!b.has(c.id))).length?null:(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map(a=>(0,d.jsxs)("button",{onClick:async()=>{await bW(a.id,"llm",bF)},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:`${a.name} \xb7 ${(a.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id.split("/").pop()]},a.id))})]})),h.length>0&&(0,d.jsxs)("div",{className:"w-full mt-2",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",h.length,"):"]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:h.map(a=>(0,d.jsxs)("button",{onClick:()=>bK(a.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,d.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),a.id]},a.id))})]})]})})()]}),cc,"kiro"===q?(0,d.jsx)(k.Mh,{isOpen:G,providerInfo:bq,onSuccess:b0,onClose:()=>I(!1)}):"cursor"===q?(0,d.jsx)(k.G9,{isOpen:G,onSuccess:b0,onClose:()=>I(!1)}):"zed"===q?(0,d.jsx)(k.TE,{isOpen:G,providerInfo:bq,onSuccess:b0,onClose:()=>I(!1)}):"gitlab"===q?(0,d.jsx)(k.vj,{isOpen:G,providerInfo:bq,onSuccess:b0,onClose:()=>I(!1)}):(0,d.jsx)(k.LF,{isOpen:G,provider:q,providerInfo:bq,onSuccess:b0,onClose:()=>I(!1)}),(0,d.jsx)(k.LH,{isOpen:J,onSuccess:b0,onClose:()=>K(!1)}),"iflow"===q&&(0,d.jsx)(k.vE,{isOpen:M,onSuccess:()=>{bP(),P(!1)},onClose:()=>P(!1)}),(0,d.jsx)(N,{isOpen:R,provider:q,providerName:bq.name,isCompatible:bA,isAnthropic:bz,authType:bq?.authType,authHint:bq?.authHint,website:bq?.website,proxyPools:D,error:U,existingNames:s.map(a=>a.name).filter(Boolean),onSave:b1,onBulkDone:bP,onClose:()=>{W(""),T(!1)}}),(0,d.jsx)(k.wI,{isOpen:ah,connection:an,proxyPools:D,onSave:b2,onClose:()=>ai(!1)}),bA&&(0,d.jsx)(O,{isOpen:aj,node:w,onSave:bQ,onClose:()=>ak(!1),isAnthropic:bz}),!bA&&(0,d.jsx)(Q,{isOpen:aB,providerAlias:bF,providerDisplayAlias:bH,onSave:async(a,b,c,d)=>{await bW(a,b,bF,c,d),aC(!1)},onClose:()=>aC(!1)}),"codex"===q&&(0,d.jsx)(S,{isOpen:X,onClose:()=>Y(!1),onSuccess:bP}),"grok-cli"===q&&(0,d.jsx)(V,{isOpen:af,onClose:()=>ag(!1),onSuccess:bP}),aR&&(0,d.jsx)($.A,{isOpen:!!aR,onClose:()=>aS(null),connection:aR,reactive:!0===aP.connections[aR.id],schedule:aP.schedules?.[aR.id]||null,onSave:a=>((a,{reactive:b,schedule:c})=>{bT({...aP,connections:{...aP.connections,[a]:b},schedules:{...aP.schedules,[a]:c}})})(aR.id,a)}),(0,d.jsx)(k.uo,{isOpen:a3,onClose:()=>a4(!1),onConfirm:()=>{(a4(!1),bs)?bm():bo()},title:"Risk Notice",message:bq?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,d.jsx)(k.uo,{isOpen:!!a1,onClose:()=>a2(null),onConfirm:a1?.onConfirm,title:a1?.title||"Confirm",message:a1?.message,variant:"danger"})]})}},14985:a=>{"use strict";a.exports=require("dns")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},31421:a=>{"use strict";a.exports=require("node:child_process")},33189:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>x,handler:()=>z,routeModule:()=>y});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,57529))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),v={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,93110))),"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[u,"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/Users/Working/router4/9router/src/app/(dashboard)/layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/Users/Working/router4/9router/src/app/layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,w=(0,e.H)({tree:v,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),x=w.__next_app__,y=w.routeModule,z=w.handler},33873:a=>{"use strict";a.exports=require("path")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41365:(a,b,c)=>{"use strict";c.d(b,{A:()=>m,w:()=>j});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(99258);let j=new Set(["grok-web","chatgpt-web","gemini-web","muse-web","deepseek-web","uc-web"]),k={default:"person",grok:"bolt",work:"work",personal:"home"},l=[{key:"opening",label:"Opening browser window",icon:"open_in_new"},{key:"waiting",label:"Waiting for you to log in",icon:"hourglass_top"},{key:"saving",label:"Saving connection",icon:"save"}];function m({providerId:a,onConnected:b,size:c="sm"}){let[f,g]=(0,e.useState)(!1),[j,n]=(0,e.useState)("idle"),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(["default"]),[s,t]=(0,e.useState)("default"),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w=(0,e.useCallback)(()=>{u.current&&(clearInterval(u.current),u.current=null)},[]),x=(0,e.useCallback)(a=>{t(a)},[a]),y="opening"===j||"waiting"===j,z=(0,e.useCallback)(()=>{y||(w(),g(!1),"error"===j&&(n("idle"),p("")))},[y,j,w]),A=(0,e.useCallback)(()=>{w(),u.current=setInterval(async()=>{try{let c=await fetch(`/api/providers/web-login?provider=${encodeURIComponent(a)}`,{cache:"no-store"}),d=await c.json();"success"===d.status?(w(),n("success"),p(d.email?`${(0,i.Tl)("Signed in as")} ${d.email}`:"Connection saved"),"function"==typeof b&&b(),v.current=setTimeout(()=>{g(!1),p("")},1500)):"error"===d.status||"timeout"===d.status||"cancelled"===d.status?(w(),n("error"),p(d.error||(0,i.Tl)("Login failed"))):n(a=>"opening"===a?"waiting":a)}catch{}},2e3)},[a,b,w]),B=(0,e.useCallback)(async()=>{n("opening"),p("");try{let b=await fetch("/api/providers/web-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a,profile:s})}),c=await b.json();if(!b.ok){n("error"),p(c.error||(0,i.Tl)("Failed to start login"));return}n("waiting"),p((0,i.Tl)("A browser window has opened — log in there, this page updates itself.")),A()}catch(a){n("error"),p(a?.message||(0,i.Tl)("Failed to start login"))}},[a,s,A]),C=(0,e.useCallback)(()=>{fetch(`/api/providers/web-login?provider=${encodeURIComponent(a)}`,{method:"DELETE"}).catch(()=>{}),w(),n("idle"),p("")},[a,w]),D=(0,e.useCallback)(()=>{let a=window.prompt((0,i.Tl)("New browser profile name (e.g. work, personal):"),"");if(!a)return;let b=a.trim().replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,40);b&&(r(a=>a.includes(b)?a:[...a,b]),x(b))},[x]),E="opening"===j?0:"waiting"===j?1:"success"===j?2:-1;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{size:c,icon:"success"===j?"check_circle":"language",variant:"secondary",onClick:()=>{n("idle"),p(""),g(!0)},title:(0,i.Tl)("Open a browser window, log in by hand — the cookie is captured automatically"),children:"success"===j?(0,i.Tl)("Connected"):(0,i.Tl)("Login via Browser")}),(0,d.jsx)(h.aF,{isOpen:f,onClose:z,title:(0,i.Tl)("Login via Browser"),size:"sm",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:(0,i.Tl)("A Chrome window opens on a shared browser profile. Log in there — the session is captured automatically. One Google login in a profile makes every other provider a single “Continue with Google” click.")}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:(0,i.Tl)("Browser profile")}),(0,d.jsxs)("button",{type:"button",onClick:D,disabled:y,className:"flex items-center gap-1 text-xs text-primary hover:underline disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"}),(0,i.Tl)("New profile")]})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-2",children:q.map(a=>{let b=a===s;return(0,d.jsxs)("button",{type:"button",disabled:y,onClick:()=>x(a),className:`flex items-center gap-2 rounded border border-accent/30 bg-sidebar p-2 text-left text-sm transition-colors focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 ${b?"border-primary ring-1 ring-primary":"hover:border-accent/60"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:function(a){let b=String(a).toLowerCase();for(let[a,c]of Object.entries(k))if(b.includes(a))return c;return"folder_shared"}(a)}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a}),b&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"})]},a)})})]}),"idle"!==j&&(0,d.jsx)("div",{className:"rounded border border-accent/20 bg-sidebar/50 p-3",children:"success"===j?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"check_circle"}),"✓ ",o||(0,i.Tl)("Connection saved")]}):"error"===j?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,i.Tl)("Login failed")]}),o&&(0,d.jsx)("p",{className:"pl-6 text-xs text-red-500 break-words",children:o})]}):(0,d.jsxs)("ol",{className:"flex flex-col gap-2",children:[l.map((a,b)=>{let c=b<E,e=b===E;return(0,d.jsxs)("li",{className:`flex items-center gap-2 text-sm ${c?"text-green-400":e?"text-primary":"text-text-muted opacity-50"}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] ${e?"animate-pulse":""}`,children:c?"check_circle":a.icon}),(0,i.Tl)(a.label)]},a.key)}),o&&(0,d.jsx)("li",{className:"pl-6 text-xs text-text-muted",children:o})]})}),(0,d.jsx)("div",{className:"flex gap-2",children:"success"===j?(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,children:(0,i.Tl)("Done")}):y?(0,d.jsx)(h.$n,{onClick:C,variant:"ghost",fullWidth:!0,children:(0,i.Tl)("Cancel")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{onClick:B,fullWidth:!0,disabled:"error"===j&&!o,children:(0,i.Tl)("Open Browser & Login")}),(0,d.jsx)(h.$n,{onClick:z,variant:"ghost",fullWidth:!0,disabled:y,children:(0,i.Tl)("Close")})]})})]})})]})}m.propTypes={providerId:g().string.isRequired,onConnected:g().func,size:g().oneOf(["sm","md","lg"])}},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},48102:(a,b,c)=>{Promise.resolve().then(c.bind(c,11883))},48161:a=>{"use strict";a.exports=require("node:os")},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},57975:a=>{"use strict";a.exports=require("node:util")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},72271:a=>{"use strict";a.exports=require("@aws-sdk/credential-providers")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},79646:a=>{"use strict";a.exports=require("child_process")},80099:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},91645:a=>{"use strict";a.exports=require("net")},93110:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/9router/src/app/(dashboard)/dashboard/providers/[id]/page.js","default")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[2970,1260,2430,3459,2760,1220,9100,866,6070,869,915,6457,4123,2598,6777,412,4096],()=>b(b.s=33189));module.exports=c})();