@jheavenknows/bluerouter 2.0.36 → 2.0.38

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 (431) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +1 -1
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  41. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  42. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  43. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  44. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  45. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  47. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  48. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  49. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  50. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  51. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  52. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  53. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  54. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  92. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  172. package/app/.next-cli-build/server/app/callback.html +1 -1
  173. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  174. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  175. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  176. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  177. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  178. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  180. package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
  181. package/app/.next-cli-build/server/app/dashboard/analytics.rsc +4 -4
  182. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +1 -1
  183. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
  184. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  186. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +4 -4
  187. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
  188. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +3 -3
  189. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  191. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +5 -5
  192. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
  193. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
  194. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +5 -5
  197. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
  198. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +3 -3
  199. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
  200. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  201. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  202. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  203. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  204. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  207. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  208. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  209. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  210. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  211. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  212. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  213. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  214. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  216. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  217. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  218. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  219. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  220. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  222. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  223. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  224. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  225. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  226. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  227. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  228. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  229. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  230. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  232. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  233. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  234. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  235. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  236. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  237. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  238. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  239. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  240. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  242. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  243. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  244. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  248. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  249. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  250. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  253. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  254. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  257. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  258. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  259. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  260. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/profile.rsc +4 -4
  263. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  264. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  267. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
  268. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  269. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  270. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +4 -4
  273. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  277. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +4 -4
  278. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +3 -3
  280. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +4 -4
  283. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
  285. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  287. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +4 -4
  288. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
  289. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +3 -3
  290. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  293. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  294. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  298. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  299. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  301. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  304. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  305. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  308. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  309. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  311. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  314. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  315. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  318. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  319. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  321. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  324. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  325. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  328. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  329. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  331. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  333. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  335. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  336. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  338. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  345. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  346. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  349. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  350. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  352. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  355. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  356. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  359. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  360. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  362. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  364. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  365. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  366. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  369. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  370. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  372. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  373. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  374. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  375. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  376. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  378. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  379. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  381. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  382. package/app/.next-cli-build/server/app/index.html +1 -1
  383. package/app/.next-cli-build/server/app/index.rsc +3 -3
  384. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  386. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  388. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  389. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  390. package/app/.next-cli-build/server/app/landing.html +1 -1
  391. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  392. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  393. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  394. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  395. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  397. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  399. package/app/.next-cli-build/server/app/login.html +1 -1
  400. package/app/.next-cli-build/server/app/login.rsc +3 -3
  401. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  402. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  403. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  404. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  406. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  408. package/app/.next-cli-build/server/app-paths-manifest.json +1 -1
  409. package/app/.next-cli-build/server/chunks/3110.js +1 -1
  410. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  411. package/app/.next-cli-build/server/chunks/5681.js +1 -1
  412. package/app/.next-cli-build/server/chunks/7130.js +1 -1
  413. package/app/.next-cli-build/server/chunks/7153.js +1 -1
  414. package/app/.next-cli-build/server/chunks/7795.js +1 -1
  415. package/app/.next-cli-build/server/chunks/9489.js +1 -1
  416. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  417. package/app/.next-cli-build/server/pages/404.html +1 -1
  418. package/app/.next-cli-build/server/pages/500.html +1 -1
  419. package/app/.next-cli-build/static/chunks/{1321-dd77c9408c6e8818.js → 1321-148391da6a78aad3.js} +1 -1
  420. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-8ed4da481e060547.js +1 -0
  421. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-9ae277b4cec2c31d.js → page-430091744aba8721.js} +1 -1
  422. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-9e80977106840c3e.js → page-a714b4089e843f15.js} +1 -1
  423. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
  424. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
  425. package/app/package.json +1 -1
  426. package/package.json +1 -1
  427. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-541350d30a713a9e.js +0 -1
  428. /package/app/.next-cli-build/static/{7iUvy3V5r7ZH09Ps9Ypl5 → -OolRKRxYl7pEyrio44CU}/_buildManifest.js +0 -0
  429. /package/app/.next-cli-build/static/{7iUvy3V5r7ZH09Ps9Ypl5 → -OolRKRxYl7pEyrio44CU}/_ssgManifest.js +0 -0
  430. /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-2.0.16-to-2.0.17-2.0.17-20260611-205800 → upgrade-2.0.36-to-2.0.37-2.0.37-20260612-195131}/data.sqlite +0 -0
  431. /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-2.0.17-to-2.0.18-2.0.18-20260611-213830 → upgrade-2.0.37-to-2.0.38-2.0.38-20260612-201930}/data.sqlite +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{52154:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),d=s(90620),c=s(52679),p=s(98500),m=s.n(p),x=s(65921),u=s(38003);let h={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function f(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,x.i)(),u=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await u()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let g=e?.models||[],b=0===(e?.unavailableCount||g.filter(e=>"available"!==e.status).length),v={};return g.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:p,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:b?"#22c55e":"#f59e0b"},children:b?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:b?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=h[e.status]||h.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}function g(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function b(){let e,t,[s,l]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[p,m]=(0,a.useState)(!0),[h,g]=(0,a.useState)(!1),[b,C]=(0,a.useState)(!1),[k,T]=(0,a.useState)(!1),[A,I]=(0,a.useState)(null),[R,S]=(0,a.useState)(null),E=(0,x.i)(),$=(0,u.C)(e=>e.query),O=(0,u.C)(e=>e.register),U=(0,u.C)(e=>e.unregister);(0,a.useEffect)(()=>(O("Search providers..."),()=>U()),[O,U]);let P=e=>!$.trim()||e.toLowerCase().includes($.trim().toLowerCase());(0,a.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),s=await e.json(),r=await t.json();e.ok&&l(s.connections||[]),t.ok&&o(r.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}})()},[]);let _=(e,t)=>{let r=s.filter(s=>s.provider===e&&s.authType===t),a=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=a(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=a(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=r.length,d=o>0&&r.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},q=async(e,t,r)=>{let a=s.filter(s=>s.provider===e&&s.authType===t);l(s=>s.map(s=>s.provider===e&&s.authType===t?{...s,isActive:r}:s)),await Promise.allSettled(a.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:r})})))},z=async(e,t=null)=>{if(!A){I("provider"===e?t:e),S(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(S(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?E.success(`All ${s} tests passed`):E.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){S({error:"Test request failed"}),E.error("Provider test failed")}finally{I(null)}}},D=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>P(e.name)),F=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>P(e.name)),M=Object.entries(d.zN).filter(([,e])=>!e.hidden&&P(e.name)),K=Object.entries(c.IS).filter(([,e])=>!e.hidden&&P(e.name)),L=Object.entries(c.nJ).filter(([,e])=>!e.hidden&&P(e.name)),J=(e=Object.entries(d.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&P(e.name)),t="apikey",[...e].sort(([e,s],[r,a])=>{let l=_(e,t),i=_(r,t),n=+(l.connected>0),o=+(i.connected>0);return n!==o?o-n:(s.name||"").localeCompare(a.name||"")})),W=!!$.trim(),H=W||h?J:J.slice(0,20),B=J.length-20;if(p)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let Q=M.length>0||K.length>0||L.length>0||J.length>0||D.length>0||F.length>0;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!Q&&(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>T(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>C(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===D.length&&0===F.length?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,r.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...D,...F].map(e=>(0,r.jsx)(y,{providerId:e.id,provider:e,stats:_(e.id,"apikey"),authType:"compatible",onToggle:t=>q(e.id,"apikey",t)},e.id))})]}),M.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(f,{}),(0,r.jsxs)("button",{onClick:()=>z("oauth"),disabled:!!A,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===A?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===A?" animate-spin":""}`,children:"play_arrow"}),"oauth"===A?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:M.map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:_(e,"oauth"),authType:"oauth",onToggle:t=>q(e,"oauth",t)},e))})]}),(K.length>0||L.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>z("free"),disabled:!!A,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===A?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===A?" animate-spin":""}`,children:"play_arrow"}),"free"===A?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[K.map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:_(e,"oauth"),authType:"free",onToggle:t=>q(e,"oauth",t)},e)),L.map(([e,t])=>(0,r.jsx)(y,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))]})]}),J.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,r.jsxs)("button",{onClick:()=>z("apikey"),disabled:!!A,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===A?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===A?" animate-spin":""}`,children:"play_arrow"}),"apikey"===A?"Testing...":"Test All"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:H.map(([e,t])=>(0,r.jsx)(y,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))}),!W&&!h&&B>0&&(0,r.jsxs)("button",{onClick:()=>g(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",J.length," providers"]})]}),(0,r.jsx)(j,{isOpen:b,onClose:()=>C(!1),onCreated:e=>{o(t=>[...t,e]),C(!1)}}),(0,r.jsx)(N,{isOpen:k,onClose:()=>T(!1),onCreated:e=>{o(t=>[...t,e]),T(!1)}}),R&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>S(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>S(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(w,{results:R})})]})]})]})}function v({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:x}=s,u=!!t.noAuth;return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[g(i,d,c),p&&(0,r.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function y({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:p,errorTime:x,allDisabled:u}=s,h=e.startsWith(c.JH),f=e.startsWith(c.DI);return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[g(i,d,p),h&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,r.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function j({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",apiType:"chat",openAICompatibleRuntime:c.hb,baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,a.useState)(!1),[p,m]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let v=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,openAICompatibleRuntime:l.openAICompatibleRuntime,baseUrl:l.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",apiType:"chat",openAICompatibleRuntime:c.hb,baseUrl:"https://api.openai.com/v1"}),m(""),b(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},y=async()=>{f(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:p,type:"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t)}catch{b({valid:!1,error:"Network error"})}finally{f(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,r.jsx)(n.l6,{label:"Server Type",options:c._8.map(e=>({value:e.value,label:e.label})),value:l.openAICompatibleRuntime,onChange:e=>i({...l,openAICompatibleRuntime:e.target.value}),hint:c._8.find(e=>e.value===l.openAICompatibleRuntime)?.description||"Choose how BlueRouter maps combo thinking/reasoning params for this endpoint."}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>m(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:x,onChange:e=>u(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:y,disabled:!p||h||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:h?"Checking...":"Check"}),(()=>{if(!g)return null;let{valid:e,error:t,method:s}=g;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:v,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function N({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(g(null),p(""),x(""))},[e]);let b=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),g(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:m.trim()||void 0})}),t=await e.json();g(t)}catch{g({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:b,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function w({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}v.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},y.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},j.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},N.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},w.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},53928:(e,t,s)=>{Promise.resolve().then(s.bind(s,52154))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=53928)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{52154:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(95155),a=s(12115),l=s(14051),i=s.n(l),n=s(35497),o=s(57250),d=s(90620),c=s(52679),p=s(98500),m=s.n(p),x=s(65921),u=s(38003);let h={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function f(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,x.i)(),u=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await u()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let g=e?.models||[],b=0===(e?.unavailableCount||g.filter(e=>"available"!==e.status).length),v={};return g.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:p,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:b?"#22c55e":"#f59e0b"},children:b?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:u,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:b?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=h[e.status]||h.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}function g(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function b(){let e,t,[s,l]=(0,a.useState)([]),[i,o]=(0,a.useState)([]),[p,m]=(0,a.useState)(!0),[h,g]=(0,a.useState)(!1),[b,C]=(0,a.useState)(!1),[k,T]=(0,a.useState)(!1),[A,I]=(0,a.useState)(null),[R,S]=(0,a.useState)(null),E=(0,x.i)(),$=(0,u.C)(e=>e.query),O=(0,u.C)(e=>e.register),U=(0,u.C)(e=>e.unregister);(0,a.useEffect)(()=>(O("Search providers..."),()=>U()),[O,U]);let P=e=>!$.trim()||e.toLowerCase().includes($.trim().toLowerCase());(0,a.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),s=await e.json(),r=await t.json();e.ok&&l(s.connections||[]),t.ok&&o(r.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}})()},[]);let _=(e,t)=>{let r=s.filter(s=>s.provider===e&&s.authType===t),a=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=a(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=a(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=r.length,d=o>0&&r.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},q=async(e,t,r)=>{let a=s.filter(s=>s.provider===e&&s.authType===t);l(s=>s.map(s=>s.provider===e&&s.authType===t?{...s,isActive:r}:s)),await Promise.allSettled(a.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:r})})))},z=async(e,t=null)=>{if(!A){I("provider"===e?t:e),S(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(S(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?E.success(`All ${s} tests passed`):E.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){S({error:"Test request failed"}),E.error("Provider test failed")}finally{I(null)}}},D=i.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})).filter(e=>P(e.name)),F=i.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"})).filter(e=>P(e.name)),M=Object.entries(d.zN).filter(([,e])=>!e.hidden&&P(e.name)),K=Object.entries(c.IS).filter(([,e])=>!e.hidden&&P(e.name)),L=Object.entries(c.nJ).filter(([,e])=>!e.hidden&&P(e.name)),J=(e=Object.entries(d.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")&&P(e.name)),t="apikey",[...e].sort(([e,s],[r,a])=>{let l=_(e,t),i=_(r,t),n=+(l.connected>0),o=+(i.connected>0);return n!==o?o-n:(s.name||"").localeCompare(a.name||"")})),W=!!$.trim(),H=W||h?J:J.slice(0,20),B=J.length-20;if(p)return(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]});let Q=M.length>0||K.length>0||L.length>0||J.length>0||D.length>0||F.length>0;return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[!Q&&(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No providers match your search"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["Custom Providers (OpenAI/Anthropic Compatible)"," "]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:w-auto",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>T(!0),className:"w-full sm:w-auto",children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>C(!0),className:"w-full !bg-white !text-black hover:!bg-gray-100 sm:w-auto",children:"Add OpenAI Compatible"})]})]}),0===D.length&&0===F.length?(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2 border border-dashed border-border rounded-xl text-text-muted text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"extension"}),(0,r.jsx)("span",{children:"No custom providers — use buttons above to add OpenAI/Anthropic compatible endpoints"})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[...D,...F].map(e=>(0,r.jsx)(y,{providerId:e.id,provider:e,stats:_(e.id,"apikey"),authType:"compatible",onToggle:t=>q(e.id,"apikey",t)},e.id))})]}),M.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,r.jsx)(f,{}),(0,r.jsxs)("button",{onClick:()=>z("oauth"),disabled:!!A,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"oauth"===A?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===A?" animate-spin":""}`,children:"play_arrow"}),"oauth"===A?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:M.map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:_(e,"oauth"),authType:"oauth",onToggle:t=>q(e,"oauth",t)},e))})]}),(K.length>0||L.length>0)&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:"Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>z("free"),disabled:!!A,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"free"===A?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===A?" animate-spin":""}`,children:"play_arrow"}),"free"===A?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:[K.map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:_(e,"oauth"),authType:"free",onToggle:t=>q(e,"oauth",t)},e)),L.map(([e,t])=>(0,r.jsx)(y,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))]})]}),J.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h2",{className:"text-lg sm:text-xl font-semibold flex items-center gap-2 leading-tight",children:["API Key Providers"," "]}),(0,r.jsxs)("button",{onClick:()=>z("apikey"),disabled:!!A,className:`flex w-full items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors sm:w-auto sm:py-1.5 ${"apikey"===A?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===A?" animate-spin":""}`,children:"play_arrow"}),"apikey"===A?"Testing...":"Test All"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3 xl:grid-cols-4",children:H.map(([e,t])=>(0,r.jsx)(y,{providerId:e,provider:t,stats:_(e,"apikey"),authType:"apikey",onToggle:t=>q(e,"apikey",t)},e))}),!W&&!h&&B>0&&(0,r.jsxs)("button",{onClick:()=>g(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2.5 text-sm font-medium text-primary transition-colors hover:border-primary hover:bg-primary/5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"expand_more"}),"Show all ",J.length," providers"]})]}),(0,r.jsx)(j,{isOpen:b,onClose:()=>C(!1),onCreated:e=>{o(t=>[...t,e]),C(!1)}}),(0,r.jsx)(N,{isOpen:k,onClose:()=>T(!1),onCreated:e=>{o(t=>[...t,e]),T(!1)}}),R&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center px-3 pt-[6vh] sm:pt-[10vh]",onClick:()=>S(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[86vh] sm:max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>S(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(w,{results:R})})]})]})]})}function v({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:x}=s,u=!!t.noAuth;return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:x?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):u?(0,r.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"Ready"}):(0,r.jsxs)(r.Fragment,{children:[g(i,d,c),p&&(0,r.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function y({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:p,errorTime:x,allDisabled:u}=s,h=e.startsWith(c.JH),f=e.startsWith(c.DI);return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group min-w-0",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":f?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"truncate font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs flex-wrap",children:u?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[g(i,d,p),h&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),f&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,r.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,r.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function j({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1",openAICompatibleRuntime:c.hb}),[o,d]=(0,a.useState)(!1),[p,m]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[h,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let v=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,baseUrl:l.baseUrl,openAICompatibleRuntime:l.openAICompatibleRuntime,type:"openai-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1",openAICompatibleRuntime:c.hb}),m(""),b(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},y=async()=>{f(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:p,type:"openai-compatible",modelId:x.trim()||void 0})}),t=await e.json();b(t)}catch{b({valid:!1,error:"Network error"})}finally{f(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,r.jsx)(n.l6,{label:"Server Type",options:c._8,value:l.openAICompatibleRuntime,onChange:e=>i({...l,openAICompatibleRuntime:e.target.value}),hint:c._8.find(e=>e.value===l.openAICompatibleRuntime)?.description||"Controls how BlueRouter maps thinking/reasoning params for this endpoint."}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>m(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:x,onChange:e=>u(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:y,disabled:!p||h||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:h?"Checking...":"Check"}),(()=>{if(!g)return null;let{valid:e,error:t,method:s}=g;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:v,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function N({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(g(null),p(""),x(""))},[e]);let b=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),g(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:m.trim()||void 0})}),t=await e.json();g(t)}catch{g({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,r.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,r.jsx)(n.$n,{onClick:b,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function w({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs mb-1 sm:gap-3",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted sm:ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-lg bg-black/[0.03] px-3 py-2 text-xs dark:bg-white/[0.03] sm:flex-nowrap",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,r.jsx)("span",{className:"block truncate font-medium sm:inline",children:e.connectionName}),(0,r.jsxs)("span",{className:"block truncate text-text-muted sm:ml-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"shrink-0 text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`shrink-0 text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}v.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},y.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},j.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},N.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},w.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}},53928:(e,t,s)=>{Promise.resolve().then(s.bind(s,52154))}},e=>{e.O(0,[2574,3862,1051,1321,5497,8441,3794,7358],()=>e(e.s=53928)),_N_E=e.O()}]);
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluerouter-app",
3
- "version": "2.0.36",
3
+ "version": "2.0.38",
4
4
  "description": "Router web dashboard",
5
5
  "private": false,
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jheavenknows/bluerouter",
3
- "version": "2.0.36",
3
+ "version": "2.0.38",
4
4
  "description": "Bluerouter CLI - Start and manage Bluerouter server",
5
5
  "bin": {
6
6
  "bluerouter": "./cli.js"
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{20061:(e,t,n)=>{Promise.resolve().then(n.bind(n,47295))},47295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>F});var a=n(95155),r=n(12115),l=n(44923),s=n(87256),o=n(39768),i=n(82639),d=n(35497),c=n(11059),m=n(28777),u=n(52679);let x=/^[a-zA-Z0-9_.\-]+$/,b=[{value:"global",label:"To\xe0n cục / h\xe0nh vi hiện tại",description:"Giữ h\xe0nh vi hiện tại: mọi request d\xf9ng chung v\xf2ng xoay combo to\xe0n cục."},{value:"client_ip",label:"IP client",description:"Giữ c\xf9ng model khởi đầu cho c\xf9ng IP client cho đến khi hết TTL."},{value:"client_session",label:"IP client + phi\xean chat",description:"Ph\xf9 hợp nhất cho c\xf4ng cụ chat. Giữ c\xf9ng model cho c\xf9ng m\xe1y v\xe0 c\xf9ng phi\xean chat."}],p=[{value:"fallback",label:"Ưu ti\xean fallback",description:"Thử model trong combo theo đ\xfang thứ tự hiển thị, lỗi th\xec fallback."},{value:"round-robin",label:"Round Robin",description:"Lu\xe2n phi\xean model đang bật được thử đầu ti\xean. C\xe1c t\xf9y chọn giữ d\xednh b\xean dưới vẫn được \xe1p dụng."},{value:"least-latency",label:"Độ trễ thấp nhất",description:"Ưu ti\xean target c\xf3 điểm health/độ trễ tốt nhất. Hữu \xedch cho LAN Ollama."},{value:"p2c",label:"P2C",description:"Power of Two Choices: lấy mẫu hai target khỏe rồi chọn target \xedt bận hơn."}],h=Object.freeze({temperature:.3,top_p:.95,max_tokens:4096,reasoning_budget:0,thinkingMode:"off"}),g=[{value:"inherit",label:"Theo request gốc",description:"Kh\xf4ng inject tham số thinking."},{value:"off",label:"Tắt thinking",description:"Gửi chat_template_kwargs.enable_thinking = false."},{value:"on",label:"Bật thinking",description:"Gửi chat_template_kwargs.enable_thinking = true."}];function f(e,t){return Object.prototype.hasOwnProperty.call(e||{},t)}function y(e,{min:t,max:n,precision:a=3}={}){if(null==e||""===e)return;let r=Number(e);if(Number.isFinite(r))return Number(Math.min(n,Math.max(t,r)).toFixed(a))}function v(e,{min:t,max:n}={}){let a=y(e,{min:t,max:n,precision:0});return void 0===a?void 0:Math.trunc(a)}function j(e={}){let t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},n={};if(f(t,"temperature")){let e=y(t.temperature,{min:0,max:2});void 0!==e&&(n.temperature=e)}if(f(t,"top_p")){let e=y(t.top_p,{min:0,max:1});void 0!==e&&(n.top_p=e)}let a=t.max_tokens??t.maxTokens??t.max_token;if(f(t,"max_tokens")||f(t,"maxTokens")||f(t,"max_token")){let e=v(a,{min:1,max:262144});void 0!==e&&(n.max_tokens=e)}let r=t.reasoning_budget??t.reasoningBudget??t["reasoning-budget"];if(f(t,"reasoning_budget")||f(t,"reasoningBudget")||f(t,"reasoning-budget")){let e=v(r,{min:0,max:262144});void 0!==e&&(n.reasoning_budget=e)}let l=function(e){if(!0===e)return"on";if(!1===e)return"off";let t=k(e).toLowerCase();return["on","true","1","enable","enabled"].includes(t)?"on":["off","false","0","disable","disabled"].includes(t)?"off":void 0}(t.thinkingMode??t.thinking);return l&&(n.thinkingMode=l),n}function k(e){return String(e||"").trim()}function N(e={}){return Array.isArray(e.disabledModels)?[...new Set(e.disabledModels.map(e=>k(e)).filter(Boolean))]:[]}function w(e={}){let t=e.fallbackStrategy||"fallback";return{...e,fallbackStrategy:t,stickyScope:e.stickyScope||"global",stickyTtlMinutes:Number(e.stickyTtlMinutes||120),stickyFallbackToClientIp:!1!==e.stickyFallbackToClientIp,lanHealthEnabled:!1!==e.lanHealthEnabled,healthCheckPath:e.healthCheckPath||"/api/tags",healthCheckIntervalMs:Number(e.healthCheckIntervalMs||15e3),requiredTags:Array.isArray(e.requiredTags)?e.requiredTags:[],modelTagRules:e.modelTagRules||e.modelTags||e.tagRules||{},disabledModels:N(e),requestOverrides:j(e.requestOverrides||{})}}function C(e={}){let t={...e};t.disabledModels=N(e),"fallback"===(t.fallbackStrategy||"fallback")&&delete t.fallbackStrategy,t.disabledModels.length||delete t.disabledModels,t.requiredTags?.length||delete t.requiredTags;let n=j(t.requestOverrides||{});return Object.keys(n).length?t.requestOverrides=n:delete t.requestOverrides,t.modelTagRules&&0!==Object.keys(t.modelTagRules).length||delete t.modelTagRules,"/api/tags"===t.healthCheckPath&&delete t.healthCheckPath,15e3===Number(t.healthCheckIntervalMs)&&delete t.healthCheckIntervalMs,!0===t.lanHealthEnabled&&delete t.lanHealthEnabled,Object.keys(t).length?t:null}function _(e=[]){return Array.isArray(e)?e.join(", "):String(e||"")}function T(e=""){return String(e||"").split(/[\n,;]+/).map(e=>e.trim()).filter(Boolean)}function S(e={}){return e&&"object"==typeof e?Object.entries(e).map(([e,t])=>`${e}: ${Array.isArray(t)?t.join(", "):String(t||"")}`).join("\n"):""}function $(e){return"string"==typeof e?e:e&&"object"==typeof e&&(e.value||e.model||e.id)||""}function M(e={}){let t=k(e.provider);return k(e.providerSpecificData?.prefix)||k(e.prefix)||k((0,u.wG)(t))||t}function O(e={}){return k(e.email)||k(e.accountName)||k(e.displayName)||k(e.name)||k(e.providerSpecificData?.nodeName)||k(e.id)}function E(e){return e&&"object"==typeof e?k(e.connectionId||e.connection_id):""}function q(e){let t=$(e),n=E(e);return t?n?`${t}@@${n}`:t:""}function I(e){return"string"==typeof e?e:e&&"object"==typeof e?k(e.label)||k(e.displayName)||k(e.name)||$(e):""}function P(e){if(!e||"object"!=typeof e)return $(e);let t=$(e);return t?Object.fromEntries(Object.entries({model:t,connectionId:E(e)||void 0,label:I(e)||void 0,provider:k(e.provider)||void 0,accountName:k(e.accountName||e.account_name)||void 0,weight:Number(e.weight||0)>0?Number(e.weight):void 0}).filter(([,e])=>void 0!==e&&""!==e)):""}function R(e,t=!0){let n=P(e),a=q(n);return{value:a,enabled:t,target:n,label:I(n)||a,subtitle:function(e){if(!e||"object"!=typeof e)return"";let t=E(e),n=$(e);return t?`T\xe0i khoản cố định • ${t}${n?` • ${n}`:""}`:""}(n)}}function A(e={}){return k(e.defaultModel)||k(e.providerSpecificData?.defaultModel)||k(e.model)||""}function B(e,t,n,a=""){let r=k(n);!r||t.has(r)||(t.add(r),e.push({value:r,label:k(a)||r}))}function D(e={},t={}){let n=[],a=new Set,r=k(e.provider),l=[...new Set([M(e),k((0,u.wG)(r)),r].filter(Boolean))];for(let e of(0,m.KC)(r)||[])e?.type&&"llm"!==e.type||B(n,a,e.id,e.name||e.id);for(let[e,r]of Object.entries(t||{})){let t=k(r),s=l.find(e=>e&&t.startsWith(`${e}/`));if(!s)continue;let o=t.slice(s.length+1);B(n,a,o,e||o)}return B(n,a,A(e),"Model mặc định"),n}function L(e={},{disabledModels:t=[],requestOverrides:n}={}){let a={...e},r=[...new Set((t||[]).map(e=>k(e)).filter(Boolean))];if(r.length>0?a.disabledModels=r:delete a.disabledModels,void 0!==n){let e=j(n||{});Object.keys(e).length?a.requestOverrides=e:delete a.requestOverrides}return C(a)}function F(){let[e,t]=(0,r.useState)([]),[n,l]=(0,r.useState)(!0),[s,o]=(0,r.useState)(!1),[i,m]=(0,r.useState)(null),[u,x]=(0,r.useState)([]),[b,p]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1),[f,y]=(0,r.useState)({}),[v,j]=(0,r.useState)(null),{copied:k,copy:N}=(0,c.C)();(0,r.useEffect)(()=>{_()},[]);let _=async()=>{try{let e=await fetch("/api/dashboard/combos",{cache:"no-store"}),n=await e.json();e.ok&&(t(n.combos||[]),y(n.comboStrategies||{}))}catch(e){console.log("Error fetching combo data:",e)}finally{l(!1)}},T=async()=>{if(!b&&!h){g(!0);try{let e=await fetch("/api/providers",{cache:"no-store"}),t=await e.json();e.ok&&(x(t.connections||[]),p(!0))}catch(e){console.log("Error loading provider accounts:",e)}finally{g(!1)}}},S=async()=>{o(!0),T()},$=async e=>{m(e),T()},M=async e=>{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:e})}),y(e)},O=async e=>{let{disabledModels:t=[],requestOverrides:n,...a}=e;try{let e=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(e.ok){let e=L({},{disabledModels:t,requestOverrides:n});e&&await M({...f,[a.name]:e}),await _(),o(!1)}else{let t=await e.json();alert(t.error||"Tạo combo thất bại")}}catch(e){console.log("Error creating combo:",e)}},E=async(e,t)=>{let{disabledModels:n=[],requestOverrides:a,...r}=t,l=i?.name;try{let t=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(t.ok){let e={...f};l&&l!==r.name&&e[l]&&(e[r.name]=e[l],delete e[l]);let t=L(e[r.name]||{},{disabledModels:n,requestOverrides:a});t?e[r.name]=t:delete e[r.name],await M(e),await _(),m(null)}else{let e=await t.json();alert(e.error||"Cập nhật combo thất bại")}}catch(e){console.log("Error updating combo:",e)}},q=async n=>{let a=e.find(e=>e.id===n);j({title:"X\xf3a combo",message:"Bạn c\xf3 chắc muốn x\xf3a combo n\xe0y?",onConfirm:async()=>{j(null);try{if((await fetch(`/api/combos/${n}`,{method:"DELETE"})).ok){if(a?.name&&f[a.name]){let e={...f};delete e[a.name],await M(e)}t(e=>e.filter(e=>e.id!==n))}}catch(e){console.log("Error deleting combo:",e)}}})},I=async(e,t)=>{try{let n={...f};if(t)n[e]=w(n[e]);else{let t=function(e={}){return C({...e,fallbackStrategy:"fallback"})}(n[e]||{});t?n[e]=t:delete n[e]}await M(n)}catch(e){console.log("Error updating combo strategy:",e)}},P=async(e,t)=>{try{let n={...f},a=C({...w(n[e]),...t});a?n[e]=a:delete n[e],await M(n)}catch(e){console.log("Error updating combo routing settings:",e)}};return n?(0,a.jsx)("div",{className:"grid gap-4",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-36 animate-pulse rounded-2xl border border-border bg-surface"},e))}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Combo model"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tạo combo model với fallback, round-robin, độ trễ thấp nhất, P2C v\xe0 routing theo trạng th\xe1i health của LAN Ollama."})]}),(0,a.jsxs)("button",{type:"button",onClick:S,className:"inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Tạo combo"]})]}),0===e.length?(0,a.jsxs)("div",{className:"rounded-2xl border border-dashed border-border bg-surface p-12 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-4xl text-text-muted",children:"layers"}),(0,a.jsx)("h2",{className:"mt-3 text-lg font-semibold text-text-main",children:"Chưa c\xf3 combo n\xe0o"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tạo combo model c\xf3 hỗ trợ fallback."}),(0,a.jsx)("button",{type:"button",onClick:S,className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:"Tạo combo"})]}):(0,a.jsx)("div",{className:"grid gap-4",children:e.map(e=>(0,a.jsx)(G,{combo:e,copied:k,onCopy:N,onEdit:()=>$(e),onDelete:()=>q(e.id),comboStrategy:f[e.name]||{},onToggleRoundRobin:t=>I(e.name,t),onUpdateComboStrategy:t=>P(e.name,t)},e.id))}),(0,a.jsx)(J,{isOpen:s,comboStrategy:{},onClose:()=>o(!1),onSave:O,activeProviders:u,providersLoading:h}),(0,a.jsx)(J,{isOpen:!!i,combo:i,comboStrategy:f[i?.name]||{},onClose:()=>m(null),onSave:e=>E(i.id,e),activeProviders:u,providersLoading:h}),(0,a.jsx)(d.uo,{isOpen:!!v,onClose:()=>j(null),onConfirm:v?.onConfirm,title:v?.title||"X\xe1c nhận",message:v?.message,variant:"danger"})]})}function G({combo:e,copied:t,onCopy:n,onEdit:l,onDelete:s,comboStrategy:o={},onToggleRoundRobin:i,onUpdateComboStrategy:d}){let c=w(o||{}),m=c.fallbackStrategy||"fallback",u=p.find(e=>e.value===m)||p[0],x=c.stickyScope||"global",h=b.find(e=>e.value===x)||b[0],g=N(o),[f,y]=(0,r.useState)(_(c.requiredTags)),[v,k]=(0,r.useState)(S(c.modelTagRules));return(0,r.useEffect)(()=>{y(_(c.requiredTags)),k(S(c.modelTagRules))},[e.name,JSON.stringify(c.requiredTags||[]),JSON.stringify(c.modelTagRules||{})]),(0,a.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-5",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"layers"}),(0,a.jsx)("h3",{className:"truncate text-lg font-semibold text-text-main",children:e.name})]}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:[(e.models||[]).length," model đang bật",g.length>0?` • ${g.length} đ\xe3 tắt`:""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(H,{icon:t===`combo-${e.id}`?"check":"content_copy",title:"Copy t\xean combo",onClick:()=>n(e.name,`combo-${e.id}`)}),(0,a.jsx)(H,{icon:"edit",title:"Chỉnh sửa",onClick:l}),(0,a.jsx)(H,{icon:"delete",title:"X\xf3a",onClick:s,danger:!0})]})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[0===(e.models||[]).length?(0,a.jsx)("span",{className:"rounded-lg bg-background px-2 py-1 text-xs text-text-muted",children:"Chưa c\xf3 model đang bật"}):(e.models||[]).slice(0,5).map((e,t)=>(0,a.jsx)("span",{className:"rounded-lg bg-background px-2 py-1 font-mono text-xs text-text-main",children:I(e)},`${q(e)}-${t}`)),(e.models||[]).length>5&&(0,a.jsxs)("span",{className:"rounded-lg bg-background px-2 py-1 text-xs text-text-muted",children:["+",e.models.length-5," model nữa"]}),g.length>0&&(0,a.jsxs)("span",{className:"rounded-lg bg-red-500/10 px-2 py-1 text-xs text-red-500",children:[g.length," đ\xe3 tắt"]}),(function(e={}){let t=j(e),n=[];return void 0!==t.temperature&&n.push(`temp ${t.temperature}`),void 0!==t.top_p&&n.push(`top_p ${t.top_p}`),void 0!==t.max_tokens&&n.push(`max ${t.max_tokens}`),void 0!==t.reasoning_budget&&n.push(`reasoning ${t.reasoning_budget}`),"off"===t.thinkingMode&&n.push("thinking off"),"on"===t.thinkingMode&&n.push("thinking on"),n})(c.requestOverrides).map(e=>(0,a.jsx)("span",{className:"rounded-lg bg-primary/10 px-2 py-1 text-xs font-medium text-primary",children:e},e))]}),(0,a.jsxs)("div",{className:"mt-5 rounded-xl border border-border bg-background p-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-text-main",children:"Chiến lược routing"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:u.description})]}),(0,a.jsx)("select",{value:m,onChange:e=>d({fallbackStrategy:e.target.value}),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:p.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsx)(K,{value:c.requestOverrides||{},onChange:e=>d({requestOverrides:e}),compact:!0}),("least-latency"===m||"p2c"===m)&&(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/15 bg-surface p-3",children:[(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==c.lanHealthEnabled,onChange:e=>d({lanHealthEnabled:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Routing theo trạng th\xe1i health LAN"}),(0,a.jsx)("span",{className:"mt-1 block text-xs",children:"D\xf9ng dữ liệu health v\xe0 circuit breaker khi xếp hạng target trong combo."})]})]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Đường dẫn health"}),(0,a.jsx)("input",{value:c.healthCheckPath||"/api/tags",onChange:e=>d({healthCheckPath:e.target.value||"/api/tags"}),placeholder:"/api/tags",className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Chu kỳ kiểm tra (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",value:c.healthCheckIntervalMs||15e3,onChange:e=>d({healthCheckIntervalMs:Number(e.target.value)||15e3}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary"})]})]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Tag endpoint bắt buộc"}),(0,a.jsx)("input",{value:f,onChange:e=>y(e.target.value),onBlur:()=>d({requiredTags:T(f)}),onKeyDown:e=>"Enter"===e.key&&e.currentTarget.blur(),placeholder:"gpu, vram:8gb",className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"Mọi endpoint được route đều phải c\xf3 c\xe1c tag n\xe0y."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Quy tắc tag theo model"}),(0,a.jsx)("textarea",{value:v,onChange:e=>k(e.target.value),onBlur:()=>d({modelTagRules:function(e=""){let t={};for(let n of String(e||"").split(/\n+/)){let e=n.trim();if(!e)continue;let a=e.indexOf(":");if(-1===a)continue;let r=e.slice(0,a).trim(),l=T(e.slice(a+1));r&&l.length&&(t[r]=l)}return t}(v)}),placeholder:"qwen3:32b: gpu, vram:16gb\nqwen3:8b: model_support:qwen3:8b",rows:3,className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"})]})]})]}),"round-robin"===m&&(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/15 bg-surface p-3",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"sticky_note_2"}),"Round Robin giữ d\xednh"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:"round-robin"===m,onChange:e=>i(e.target.checked),className:"h-3.5 w-3.5 accent-primary"}),"Bật"]})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Chế độ giữ d\xednh"}),(0,a.jsx)("select",{value:x,onChange:e=>d({stickyScope:e.target.value}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary",children:b.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:h.description})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"TTL giữ d\xednh (ph\xfat)"}),(0,a.jsx)("input",{type:"number",min:"1",value:c.stickyTtlMinutes||120,onChange:e=>d({stickyTtlMinutes:Number(e.target.value)||120}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary"})]})]}),(0,a.jsxs)("label",{className:"mt-3 flex items-start gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==c.stickyFallbackToClientIp,onChange:e=>d({stickyFallbackToClientIp:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),"Nếu thiếu chat session id, fallback về IP client thay v\xec xoay to\xe0n cục."]})]})]})]})}function H({icon:e,title:t,onClick:n,danger:r=!1}){return(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),n?.()},className:`rounded-lg p-2 transition ${r?"text-red-500 hover:bg-red-500/10":"text-text-muted hover:bg-background hover:text-primary"}`,title:t,"aria-label":t,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:e})})}function z({id:e,index:t,model:n,subtitle:l="",enabled:i,isFirst:d,isLast:c,onEdit:m,onMoveUp:u,onMoveDown:x,onRemove:b,onToggleEnabled:p}){let{attributes:h,listeners:g,setNodeRef:f,transform:y,isDragging:v}=(0,s.gl)({id:e}),j={transform:o.Ks.Transform.toString(y),opacity:v?.4:1,zIndex:v?999:void 0},[k,N]=(0,r.useState)(!1),[w,C]=(0,r.useState)(n);(0,r.useEffect)(()=>{C(n)},[n]);let _=()=>{let e=w.trim();e&&e!==n?m(e):C(n),N(!1)};return(0,a.jsxs)("div",{ref:f,style:j,className:`flex items-center gap-3 rounded-xl border p-3 transition ${i?"border-border bg-background":"border-red-200 bg-red-50/70 opacity-75 dark:border-red-500/30 dark:bg-red-500/10"}`,children:[(0,a.jsx)("button",{type:"button",className:"cursor-grab text-text-muted active:cursor-grabbing",...h,...g,title:"K\xe9o để sắp xếp lại",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"drag_indicator"})}),(0,a.jsx)("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${i?"bg-primary/10 text-primary":"bg-red-100 text-red-600 dark:bg-red-500/20 dark:text-red-300"}`,children:t+1}),k?(0,a.jsx)("input",{autoFocus:!0,value:w,onChange:e=>C(e.target.value),onBlur:_,onKeyDown:e=>{"Enter"===e.key&&_(),"Escape"===e.key&&(C(n),N(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-background px-2 py-1 font-mono text-xs text-text-main outline-none"}):(0,a.jsxs)("button",{type:"button",onClick:()=>N(!0),className:"min-w-0 flex-1 text-left",title:"Bấm để sửa model",children:[(0,a.jsx)("span",{className:`block truncate font-mono text-xs ${i?"text-text-main":"text-text-muted line-through"}`,children:n}),l?(0,a.jsx)("span",{className:"mt-0.5 block truncate text-[11px] text-text-muted",children:l}):null]}),(0,a.jsx)("button",{type:"button",onClick:p,className:`rounded-lg p-1.5 transition ${i?"text-green-600 hover:bg-green-500/10":"text-red-500 hover:bg-red-500/10"}`,title:i?"Tắt model trong combo":"Bật model trong combo",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i?"toggle_on":"toggle_off"})}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:d,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface disabled:opacity-30",title:"Di chuyển l\xean",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_upward"})}),(0,a.jsx)("button",{type:"button",onClick:x,disabled:c,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface disabled:opacity-30",title:"Di chuyển xuống",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_downward"})}),(0,a.jsx)("button",{type:"button",onClick:b,className:"rounded-lg p-1.5 text-red-500 transition hover:bg-red-500/10",title:"X\xf3a",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]})}function K({value:e={},onChange:t,compact:n=!1}){let r=j(e),l=void 0!==r.temperature,s=void 0!==r.top_p,o=void 0!==r.max_tokens,i=void 0!==r.reasoning_budget,d=r.thinkingMode||"inherit",c=e=>{t?.(j({...r,...e}))},m=(e,n,a)=>{if(!n){let n={...r};delete n[e],t?.(j(n));return}c({[e]:a})};return(0,a.jsxs)("div",{className:n?"mt-4 rounded-xl border border-sky-500/15 bg-surface p-3":"rounded-xl border border-sky-500/15 bg-sky-500/5 p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-text-main",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-sky-500",children:"tune"}),"Tham số request OpenAI-compatible"]}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Chỉ inject khi target route tới provider ",(0,a.jsx)("span",{className:"font-mono",children:"openai-compatible-*"}),". Server Type của custom provider quyết định mapping: llama.cpp d\xf9ng ",(0,a.jsx)("span",{className:"font-mono",children:"reasoning_budget"}),", vLLM d\xf9ng ",(0,a.jsx)("span",{className:"font-mono",children:"thinking_token_budget"}),", generic kh\xf4ng nhận thinking/budget."]})]}),!function(e={}){return Object.keys(j(e)).length>0}(r)?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full bg-background px-2 py-1 text-[11px] font-semibold text-text-muted",children:"Kh\xf4ng inject"}):(0,a.jsx)("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-1 text-[11px] font-semibold text-primary",children:"Đang override"})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${l?"border-primary/30 bg-background":"border-border bg-background/60"}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-text-main",children:["Temperature",(0,a.jsx)("input",{type:"checkbox",checked:l,onChange:e=>m("temperature",e.target.checked,h.temperature),className:"h-3.5 w-3.5 accent-primary"})]}),(0,a.jsx)("input",{type:"number",min:"0",max:"2",step:"0.05",disabled:!l,value:l?r.temperature:h.temperature,onChange:e=>c({temperature:e.target.value}),className:"w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"0 = ổn định, 2 = s\xe1ng tạo."})]}),(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${s?"border-primary/30 bg-background":"border-border bg-background/60"}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-text-main",children:["top_p",(0,a.jsx)("input",{type:"checkbox",checked:s,onChange:e=>m("top_p",e.target.checked,h.top_p),className:"h-3.5 w-3.5 accent-primary"})]}),(0,a.jsx)("input",{type:"number",min:"0",max:"1",step:"0.01",disabled:!s,value:s?r.top_p:h.top_p,onChange:e=>c({top_p:e.target.value}),className:"w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"0.9–0.95 thường hợp coder/chat."})]}),(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${o?"border-primary/30 bg-background":"border-border bg-background/60"}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-text-main",children:["max_tokens",(0,a.jsx)("input",{type:"checkbox",checked:o,onChange:e=>m("max_tokens",e.target.checked,h.max_tokens),className:"h-3.5 w-3.5 accent-primary"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:"262144",step:"1",disabled:!o,value:o?r.max_tokens:h.max_tokens,onChange:e=>c({max_tokens:e.target.value}),className:"w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"Giới hạn output cho request."})]}),(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${i?"border-primary/30 bg-background":"border-border bg-background/60"}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-text-main",children:["reasoning_budget",(0,a.jsx)("input",{type:"checkbox",checked:i,onChange:e=>m("reasoning_budget",e.target.checked,h.reasoning_budget),className:"h-3.5 w-3.5 accent-primary"})]}),(0,a.jsx)("input",{type:"number",min:"0",max:"262144",step:"1",disabled:!i,value:i?r.reasoning_budget:h.reasoning_budget,onChange:e=>c({reasoning_budget:e.target.value}),className:"w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"Gi\xe1 trị trừu tượng; runtime sẽ map đ\xfang field theo Server Type."})]}),(0,a.jsxs)("label",{className:"rounded-lg border border-border bg-background p-3",children:[(0,a.jsx)("span",{className:"mb-2 block text-xs font-medium text-text-main",children:"Thinking"}),(0,a.jsx)("select",{value:d,onChange:e=>c({thinkingMode:"inherit"===e.target.value?void 0:e.target.value}),className:"w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary",children:g.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:g.find(e=>e.value===d)?.description||g[0].description})]})]})]})}function J({isOpen:e,combo:t,comboStrategy:n={},onClose:o,onSave:c,activeProviders:m,providersLoading:b=!1,kindFilter:p=null}){let[g,f]=(0,r.useState)(t?.name||""),[y,v]=(0,r.useState)([]),[w,C]=(0,r.useState)(!1),[_,T]=(0,r.useState)(!1),[S,$]=(0,r.useState)(""),[E,I]=(0,r.useState)({}),[B,L]=(0,r.useState)(""),[F,G]=(0,r.useState)(""),[H,X]=(0,r.useState)(()=>t?j(n?.requestOverrides||{}):j(h)),U=n||{},W=(0,l.FR)((0,l.MS)(l.AN,{activationConstraint:{distance:5}}),(0,l.MS)(l.uN,{coordinateGetter:s.JR}));(0,r.useEffect)(()=>{e&&(f(t?.name||""),v(function(e,t={}){let n=(e?.models||[]).map(e=>R(e,!0)).filter(e=>e.value),a=new Set(n.map(e=>e.value));return[...n,...N(t).filter(e=>!a.has(e)).map(e=>R(e,!1)).filter(e=>e.value)]}(t,U)),$(""),L(""),G(""),X(t?j(U.requestOverrides||{}):j(h)))},[e,t?.id,t?.name]),(0,r.useEffect)(()=>{e&&Q()},[e]);let Q=async()=>{try{let e=await fetch("/api/models/alias",{cache:"no-store"});if(!e.ok)return;let t=await e.json();I(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}},V=y.map((e,t)=>({uid:`item-${t}-${e.value}`,row:e})),Z=y.map(e=>e.value),Y=y.filter(e=>e.enabled).length,ee=y.filter(e=>!e.enabled).length,et=(m||[]).filter(e=>e?.isActive!==!1),en=et.find(e=>e.id===B)||null,ea=en?D(en,E):[],er=ea[0]?.value||(en?A(en):""),el=e=>e.trim()?x.test(e)?($(""),!0):($("Chỉ cho ph\xe9p chữ, số, dấu -, _ v\xe0 ."),!1):($("Bắt buộc nhập t\xean"),!1),es=async()=>{if(!el(g))return;let{models:e,disabledModels:t}=function(e=[]){let t=[],n=new Set;for(let a of e){let e=k(a?.value||q(a?.target));!e||n.has(e)||(n.add(e),t.push({...a,value:e,enabled:a?.enabled!==!1,target:P(a?.target||a?.value)}))}return{models:t.filter(e=>e.enabled).map(e=>e.target).filter(Boolean),disabledModels:t.filter(e=>!e.enabled).map(e=>e.value)}}(y);T(!0),await c({name:g.trim(),models:e,disabledModels:t,requestOverrides:j(H)}),T(!1)};if(!e)return null;let eo=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/45 p-4 backdrop-blur-[1px]",children:(0,a.jsxs)("div",{className:"flex max-h-[88vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-white shadow-2xl dark:bg-zinc-950",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between border-b border-border px-5 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:eo?"Chỉnh sửa combo":"Tạo combo"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Chọn model, tắt tạm thời khi cần v\xe0 sắp xếp thứ tự ưu ti\xean fallback đang bật."})]}),(0,a.jsx)("button",{type:"button",onClick:o,className:"rounded-lg p-1 text-text-muted transition hover:bg-surface hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),(0,a.jsxs)("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto bg-white px-5 py-4 dark:bg-zinc-950",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-2 block text-sm font-semibold text-text-main",children:"T\xean"}),(0,a.jsx)("input",{value:g,onChange:e=>{let t=e.target.value;f(t),t?el(t):$("")},placeholder:"premium-coding",className:`w-full rounded-xl border bg-white px-4 py-2.5 text-text-main outline-none transition focus:border-primary dark:bg-zinc-900 ${S?"border-red-400":"border-border"}`}),(0,a.jsx)("span",{className:`mt-1 block text-xs ${S?"text-red-500":"text-text-muted"}`,children:S||"Chỉ cho ph\xe9p chữ, số, dấu -, _ v\xe0 ."})]}),(0,a.jsx)(K,{value:H,onChange:X,defaultEnabled:!eo}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Danh s\xe1ch model"}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:[Y," đang bật",ee>0?`, ${ee} đ\xe3 tắt`:"",". Model đ\xe3 tắt vẫn nằm trong combo nhưng kh\xf4ng được route."]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>C(!0),className:"inline-flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-primary hover:border-primary/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Th\xeam model"]})]}),(0,a.jsxs)("div",{className:"mb-4 rounded-xl border border-primary/15 bg-primary/5 p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"account_tree"}),"Th\xeam target theo provider account"]}),(0,a.jsx)("p",{className:"mb-3 text-xs text-text-muted",children:"Cố định bước combo n\xe0y v\xe0o một provider account cụ thể. Danh s\xe1ch account chỉ được load khi mở modal để trang combo nhẹ hơn."}),(0,a.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_auto]",children:[(0,a.jsxs)("select",{value:B,onChange:e=>{let t=e.target.value,n=et.find(e=>e.id===t),a=n?D(n,E):[];L(t),G(a[0]?.value||A(n||{})||"")},className:"min-w-0 rounded-lg border border-border bg-background px-3 py-2 text-xs text-text-main outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"",children:b?"Đang tải provider account...":"Chọn provider account"}),et.map(e=>{let t=M(e),n=O(e),r=n&&n!==t?`${t} / ${n}`:t;return(0,a.jsx)("option",{value:e.id,children:r},e.id)})]}),(0,a.jsxs)("select",{value:F,onChange:e=>G(e.target.value),disabled:!B||0===ea.length,className:"min-w-0 rounded-lg border border-border bg-background px-3 py-2 font-mono text-xs text-text-main outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-60",children:[(0,a.jsx)("option",{value:"",children:B?ea.length>0?"Chọn model":"Kh\xf4ng t\xecm thấy model của provider":"Chọn account trước"}),ea.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},`${e.value}-${e.label}`))]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{if(!en)return;let e=function(e,t){let n=M(e),a=function(e={}){let t=k(e.provider),n=M(e);return(0,u.mq)(t)||(0,u.gb)(t)?n||t:t||n}(e),r=O(e),l=k(t||A(e));if(!n||!e?.id||!l)return null;let s=l.includes("/"),o=s?l:`${n}/${l}`,i=s&&l.startsWith(`${n}/`)?l.slice(n.length+1):l,d=r&&r!==a?`${a}/${r}/${i}`:`${a}/${i}`;return{model:o,connectionId:e.id,provider:a||n,accountName:r||void 0,label:d}}(en,F||er);if(!e)return void alert("H\xe3y chọn provider account v\xe0 model cho target cố định n\xe0y.");let t=R(e,!0);v(e=>{let n=e.findIndex(e=>e.value===t.value);if(-1!==n){let a=[...e];return a[n]={...a[n],...t,enabled:!0},a}return[...e,t]}),G("")},disabled:!B||!F,className:"inline-flex items-center justify-center gap-1 rounded-lg bg-primary px-3 py-2 text-xs font-semibold text-white disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_link"}),"Th\xeam account"]})]})]}),0===y.length?(0,a.jsxs)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"layers"}),(0,a.jsx)("p",{className:"mt-2 text-sm",children:"Chưa th\xeam model n\xe0o"})]}):(0,a.jsx)(l.Mp,{sensors:W,collisionDetection:l.fp,modifiers:[i.FN,i.gj],onDragEnd:e=>{let{active:t,over:n}=e;if(n&&t.id!==n.id){let e=V.findIndex(e=>e.uid===t.id),a=V.findIndex(e=>e.uid===n.id);-1!==e&&-1!==a&&v(t=>(0,s.be)(t,e,a))}},children:(0,a.jsx)(s.gB,{items:V.map(e=>e.uid),strategy:s._G,children:(0,a.jsx)("div",{className:"space-y-3",children:V.map(({uid:e,row:t},n)=>(0,a.jsx)(z,{id:e,index:n,model:t.label||t.value,subtitle:t.subtitle,enabled:t.enabled,isFirst:0===n,isLast:n===y.length-1,onEdit:e=>{let t=e.trim();if(!t)return;let a=[...y],r=a[n];if(r?.target&&"object"==typeof r.target){let e=P({...r.target,model:t});a[n]=R(e,!1!==r.enabled)}else a[n]=R(t,r?.enabled!==!1);v(a)},onMoveUp:()=>{if(0===n)return;let e=[...y];[e[n-1],e[n]]=[e[n],e[n-1]],v(e)},onMoveDown:()=>{if(n===y.length-1)return;let e=[...y];[e[n],e[n+1]]=[e[n+1],e[n]],v(e)},onToggleEnabled:()=>{let e=[...y];e[n]={...e[n],enabled:!e[n].enabled},v(e)},onRemove:()=>v(y.filter((e,t)=>t!==n))},e))})})})]})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-3 border-t border-border bg-white px-5 py-4 dark:bg-zinc-950",children:[(0,a.jsx)("button",{type:"button",onClick:o,className:"rounded-xl border border-border px-4 py-2 text-sm font-medium text-text-main hover:bg-surface",children:"Hủy"}),(0,a.jsx)("button",{type:"button",onClick:es,disabled:_,className:"rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 disabled:opacity-50",children:_?"Đang lưu...":eo?"Lưu":"Tạo"})]})]})}),(0,a.jsx)(d.rq,{isOpen:w,onClose:()=>C(!1),onSelect:e=>{let t=e.value;v(e=>{let n=e.findIndex(e=>e.value===t);if(-1!==n){let t=[...e];return t[n]={...t[n],enabled:!0},t}return[...e,R(t,!0)]})},onDeselect:e=>{v(t=>t.filter(t=>t.value!==e.value))},activeProviders:m,modelAliases:E,title:"Th\xeam model v\xe0o combo",kindFilter:p,addedModelValues:Z,closeOnSelect:!1})]})}}},e=>{e.O(0,[2574,3862,1051,7055,1321,5497,8441,3794,7358],()=>e(e.s=20061)),_N_E=e.O()}]);