omniroute 0.2.0 → 0.4.0

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 (899) hide show
  1. package/README.md +36 -1139
  2. package/app/.next/BUILD_ID +1 -1
  3. package/app/.next/app-path-routes-manifest.json +42 -25
  4. package/app/.next/build-manifest.json +3 -3
  5. package/app/.next/prerender-manifest.json +75 -3
  6. package/app/.next/routes-manifest.json +104 -0
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  14. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -0
  17. package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -0
  18. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -0
  19. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
  20. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  23. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  26. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  29. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  32. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  35. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
  38. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
  41. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  44. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  47. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  49. package/app/.next/server/app/_global-error/page.js +3 -3
  50. package/app/.next/server/app/_global-error/page.js.nft.json +1 -1
  51. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/_global-error.html +2 -2
  53. package/app/.next/server/app/_global-error.rsc +10 -9
  54. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +10 -9
  55. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  56. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  57. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  58. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +2 -1
  59. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  60. package/app/.next/server/app/_not-found/page.js +2 -2
  61. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  62. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/_not-found.html +1 -1
  64. package/app/.next/server/app/_not-found.rsc +16 -12
  65. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +16 -12
  66. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  67. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -3
  68. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +8 -4
  69. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  70. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  71. package/app/.next/server/app/api/auth/login/route.js +1 -1
  72. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  73. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/cache/route.js +2 -0
  76. package/app/.next/server/app/api/cache/route.js.nft.json +1 -0
  77. package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -0
  78. package/app/.next/server/app/api/cache/stats/route.js +1 -0
  79. package/app/.next/server/app/api/cache/stats/route.js.nft.json +1 -0
  80. package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -0
  81. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -157
  82. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  83. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  85. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
  87. package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  89. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  90. package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
  91. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  92. package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
  93. package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
  95. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  96. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
  97. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  100. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  102. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +1 -1
  104. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/cloud/auth/route.js +1 -156
  106. package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
  107. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -156
  109. package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
  110. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  111. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -156
  112. package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
  113. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  115. package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
  116. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  117. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  118. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  119. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/combos/route.js +1 -1
  122. package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
  123. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/api/combos/test/route.js +1 -156
  125. package/app/.next/server/app/api/combos/test/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/compliance/audit-log/route.js +1 -0
  128. package/app/.next/server/app/api/compliance/audit-log/route.js.nft.json +1 -0
  129. package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -0
  130. package/app/.next/server/app/api/db-backups/route.js +1 -156
  131. package/app/.next/server/app/api/db-backups/route.js.nft.json +1 -1
  132. package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -0
  134. package/app/.next/server/app/api/evals/[suiteId]/route.js.nft.json +1 -0
  135. package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -0
  136. package/app/.next/server/app/api/evals/route.js +1 -0
  137. package/app/.next/server/app/api/evals/route.js.nft.json +1 -0
  138. package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -0
  139. package/app/.next/server/app/api/fallback/chains/route.js +3 -0
  140. package/app/.next/server/app/api/fallback/chains/route.js.nft.json +1 -0
  141. package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -0
  142. package/app/.next/server/app/api/init/route.js +1 -1
  143. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  144. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  146. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  148. package/app/.next/server/app/api/keys/route.js +1 -1
  149. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  150. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/models/alias/route.js +1 -1
  152. package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
  153. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  154. package/app/.next/server/app/api/models/availability/route.js +1 -0
  155. package/app/.next/server/app/api/models/availability/route.js.nft.json +1 -0
  156. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -0
  157. package/app/.next/server/app/api/models/catalog/route.js +2 -1
  158. package/app/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
  160. package/app/.next/server/app/api/models/route.js +2 -156
  161. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/api/monitoring/health/route.js +2 -0
  164. package/app/.next/server/app/api/monitoring/health/route.js.nft.json +1 -0
  165. package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -0
  166. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  167. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  170. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  171. package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  173. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  174. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  175. package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  179. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  180. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  181. package/app/.next/server/app/api/policies/route.js +3 -0
  182. package/app/.next/server/app/api/policies/route.js.nft.json +1 -0
  183. package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -0
  184. package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
  185. package/app/.next/server/app/api/pricing/models/route.js +1 -156
  186. package/app/.next/server/app/api/pricing/models/route.js.nft.json +1 -1
  187. package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
  188. package/app/.next/server/app/api/pricing/route.js +1 -156
  189. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
  190. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  191. package/app/.next/server/app/api/provider-models/route.js +1 -156
  192. package/app/.next/server/app/api/provider-models/route.js.nft.json +1 -1
  193. package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
  194. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -156
  195. package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  196. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  197. package/app/.next/server/app/api/provider-nodes/route.js +2 -156
  198. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  199. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  200. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/providers/[id]/models/route.js +2 -156
  202. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  203. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  204. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  205. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  208. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  209. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  210. package/app/.next/server/app/api/providers/client/route.js +1 -156
  211. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  212. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  213. package/app/.next/server/app/api/providers/route.js +2 -1
  214. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  215. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  216. package/app/.next/server/app/api/providers/test-batch/route.js +2 -156
  217. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  218. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  219. package/app/.next/server/app/api/providers/validate/route.js +1 -156
  220. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  221. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  222. package/app/.next/server/app/api/rate-limit/route.js +1 -156
  223. package/app/.next/server/app/api/rate-limit/route.js.nft.json +1 -1
  224. package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
  225. package/app/.next/server/app/api/rate-limits/route.js +1 -1
  226. package/app/.next/server/app/api/rate-limits/route.js.nft.json +1 -1
  227. package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
  228. package/app/.next/server/app/api/resilience/reset/route.js +1 -0
  229. package/app/.next/server/app/api/resilience/reset/route.js.nft.json +1 -0
  230. package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -0
  231. package/app/.next/server/app/api/resilience/route.js +1 -0
  232. package/app/.next/server/app/api/resilience/route.js.nft.json +1 -0
  233. package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -0
  234. package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  235. package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  236. package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -156
  237. package/app/.next/server/app/api/settings/combo-defaults/route.js.nft.json +1 -1
  238. package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
  239. package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
  240. package/app/.next/server/app/api/settings/proxy/route.js +1 -156
  241. package/app/.next/server/app/api/settings/proxy/route.js.nft.json +1 -1
  242. package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
  243. package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
  244. package/app/.next/server/app/api/settings/require-login/route.js +1 -156
  245. package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
  246. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  247. package/app/.next/server/app/api/settings/route.js +1 -1
  248. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  249. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  250. package/app/.next/server/app/api/settings/system-prompt/route.js +1 -156
  251. package/app/.next/server/app/api/settings/system-prompt/route.js.nft.json +1 -1
  252. package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
  253. package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -156
  254. package/app/.next/server/app/api/settings/thinking-budget/route.js.nft.json +1 -1
  255. package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
  256. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  257. package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
  258. package/app/.next/server/app/api/sync/cloud/route.js +1 -1
  259. package/app/.next/server/app/api/sync/cloud/route.js.nft.json +1 -1
  260. package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
  261. package/app/.next/server/app/api/sync/initialize/route.js +1 -1
  262. package/app/.next/server/app/api/sync/initialize/route.js.nft.json +1 -1
  263. package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
  264. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  265. package/app/.next/server/app/api/telemetry/summary/route.js +1 -0
  266. package/app/.next/server/app/api/telemetry/summary/route.js.nft.json +1 -0
  267. package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -0
  268. package/app/.next/server/app/api/token-health/route.js +1 -0
  269. package/app/.next/server/app/api/token-health/route.js.nft.json +1 -0
  270. package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -0
  271. package/app/.next/server/app/api/translator/detect/route.js +1 -1
  272. package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
  273. package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
  274. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  275. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  276. package/app/.next/server/app/api/translator/send/route.js +1 -156
  277. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  278. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  279. package/app/.next/server/app/api/translator/translate/route.js +1 -156
  280. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  281. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  282. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  283. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  284. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  285. package/app/.next/server/app/api/usage/analytics/route.js +1 -156
  286. package/app/.next/server/app/api/usage/analytics/route.js.nft.json +1 -1
  287. package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
  288. package/app/.next/server/app/api/usage/budget/route.js +3 -0
  289. package/app/.next/server/app/api/usage/budget/route.js.nft.json +1 -0
  290. package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -0
  291. package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -156
  292. package/app/.next/server/app/api/usage/call-logs/[id]/route.js.nft.json +1 -1
  293. package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
  294. package/app/.next/server/app/api/usage/call-logs/route.js +1 -156
  295. package/app/.next/server/app/api/usage/call-logs/route.js.nft.json +1 -1
  296. package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
  297. package/app/.next/server/app/api/usage/history/route.js +1 -156
  298. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  299. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  300. package/app/.next/server/app/api/usage/logs/route.js +1 -156
  301. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  302. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  303. package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
  304. package/app/.next/server/app/api/usage/request-logs/route.js +1 -156
  305. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  306. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  307. package/app/.next/server/app/api/v1/api/chat/route.js +1 -156
  308. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  309. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  310. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -156
  311. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  312. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  313. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -156
  314. package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  315. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  316. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  317. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  318. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  319. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  320. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  321. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  322. package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
  323. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  324. package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  325. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  326. package/app/.next/server/app/api/v1/messages/route.js +1 -156
  327. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  328. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  329. package/app/.next/server/app/api/v1/models/route.js +2 -1
  330. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  331. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  332. package/app/.next/server/app/api/v1/moderations/route.js +1 -156
  333. package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
  334. package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
  335. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -156
  336. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
  337. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
  338. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
  339. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
  340. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
  341. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
  342. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
  343. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
  344. package/app/.next/server/app/api/v1/rerank/route.js +1 -156
  345. package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
  346. package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
  347. package/app/.next/server/app/api/v1/responses/route.js +1 -156
  348. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  349. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  350. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  351. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -156
  352. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  353. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  354. package/app/.next/server/app/api/v1beta/models/route.js +2 -1
  355. package/app/.next/server/app/api/v1beta/models/route.js.nft.json +1 -1
  356. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  357. package/app/.next/server/app/callback/page.js +2 -2
  358. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  359. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  360. package/app/.next/server/app/callback.html +1 -1
  361. package/app/.next/server/app/callback.rsc +17 -16
  362. package/app/.next/server/app/callback.segments/_full.segment.rsc +17 -16
  363. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  364. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -3
  365. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  366. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  367. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  368. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  369. package/app/.next/server/app/dashboard/cli-tools.rsc +16 -15
  370. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  371. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  372. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  373. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  374. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +16 -15
  375. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  376. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -3
  377. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  378. package/app/.next/server/app/dashboard/combos.html +1 -1
  379. package/app/.next/server/app/dashboard/combos.rsc +18 -17
  380. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  381. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  382. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  383. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  384. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +18 -17
  385. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  386. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -3
  387. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  388. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  389. package/app/.next/server/app/dashboard/endpoint.rsc +16 -15
  390. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  391. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  392. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  393. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  394. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +16 -15
  395. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  396. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -3
  397. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  398. package/app/.next/server/app/dashboard/health.html +1 -0
  399. package/app/.next/server/app/dashboard/health.meta +17 -0
  400. package/app/.next/server/app/dashboard/health.rsc +24 -0
  401. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +9 -0
  402. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +4 -0
  403. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +4 -0
  404. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +5 -0
  405. package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +24 -0
  406. package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +6 -0
  407. package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +9 -0
  408. package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +5 -0
  409. package/app/.next/server/app/dashboard/onboarding.html +1 -1
  410. package/app/.next/server/app/dashboard/onboarding.rsc +18 -17
  411. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding/__PAGE__.segment.rsc +1 -1
  412. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding.segment.rsc +1 -1
  413. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  414. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  415. package/app/.next/server/app/dashboard/onboarding.segments/_full.segment.rsc +18 -17
  416. package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +1 -1
  417. package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +4 -3
  418. package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +2 -2
  419. package/app/.next/server/app/dashboard/profile.html +1 -1
  420. package/app/.next/server/app/dashboard/profile.rsc +15 -14
  421. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  422. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  423. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  424. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  425. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +15 -14
  426. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  427. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -3
  428. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  429. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  430. package/app/.next/server/app/dashboard/providers/new.rsc +18 -17
  431. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  432. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  433. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  434. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  435. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  436. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +18 -17
  437. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  438. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -3
  439. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  440. package/app/.next/server/app/dashboard/providers.html +1 -1
  441. package/app/.next/server/app/dashboard/providers.rsc +18 -17
  442. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  443. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  444. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  445. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  446. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +18 -17
  447. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  448. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -3
  449. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  450. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  451. package/app/.next/server/app/dashboard/settings/pricing.rsc +18 -17
  452. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  453. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  454. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  455. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  456. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  457. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +18 -17
  458. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  459. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -3
  460. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  461. package/app/.next/server/app/dashboard/settings.html +1 -1
  462. package/app/.next/server/app/dashboard/settings.rsc +18 -17
  463. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +2 -2
  464. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  465. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  466. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  467. package/app/.next/server/app/dashboard/settings.segments/_full.segment.rsc +18 -17
  468. package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +1 -1
  469. package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +4 -3
  470. package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +2 -2
  471. package/app/.next/server/app/dashboard/translator.html +2 -2
  472. package/app/.next/server/app/dashboard/translator.rsc +15 -14
  473. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  474. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  475. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  476. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  477. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +15 -14
  478. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  479. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -3
  480. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  481. package/app/.next/server/app/dashboard/usage.html +2 -1
  482. package/app/.next/server/app/dashboard/usage.rsc +18 -17
  483. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  484. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  485. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  486. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  487. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +18 -17
  488. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  489. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -3
  490. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  491. package/app/.next/server/app/docs/page.js +3 -2
  492. package/app/.next/server/app/docs/page.js.nft.json +1 -1
  493. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  494. package/app/.next/server/app/docs.html +1 -1
  495. package/app/.next/server/app/docs.rsc +22 -24
  496. package/app/.next/server/app/docs.segments/_full.segment.rsc +22 -24
  497. package/app/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  498. package/app/.next/server/app/docs.segments/_index.segment.rsc +4 -3
  499. package/app/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  500. package/app/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  501. package/app/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  502. package/app/.next/server/app/forbidden/page.js +2 -0
  503. package/app/.next/server/app/forbidden/page.js.nft.json +1 -0
  504. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -0
  505. package/app/.next/server/app/forbidden.html +1 -0
  506. package/app/.next/server/app/forbidden.meta +15 -0
  507. package/app/.next/server/app/forbidden.rsc +23 -0
  508. package/app/.next/server/app/forbidden.segments/_full.segment.rsc +23 -0
  509. package/app/.next/server/app/forbidden.segments/_head.segment.rsc +6 -0
  510. package/app/.next/server/app/forbidden.segments/_index.segment.rsc +9 -0
  511. package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +5 -0
  512. package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +9 -0
  513. package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +4 -0
  514. package/app/.next/server/app/forgot-password/page.js +2 -0
  515. package/app/.next/server/app/forgot-password/page.js.nft.json +1 -0
  516. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -0
  517. package/app/.next/server/app/forgot-password.html +1 -0
  518. package/app/.next/server/app/forgot-password.meta +15 -0
  519. package/app/.next/server/app/forgot-password.rsc +23 -0
  520. package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +23 -0
  521. package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +6 -0
  522. package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +9 -0
  523. package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +5 -0
  524. package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +9 -0
  525. package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +4 -0
  526. package/app/.next/server/app/index.html +1 -1
  527. package/app/.next/server/app/index.rsc +14 -13
  528. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  529. package/app/.next/server/app/index.segments/_full.segment.rsc +14 -13
  530. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  531. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -3
  532. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  533. package/app/.next/server/app/landing/page.js +2 -2
  534. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  535. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  536. package/app/.next/server/app/landing.html +1 -1
  537. package/app/.next/server/app/landing.rsc +17 -16
  538. package/app/.next/server/app/landing.segments/_full.segment.rsc +17 -16
  539. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  540. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -3
  541. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  542. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  543. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  544. package/app/.next/server/app/login/page.js +2 -2
  545. package/app/.next/server/app/login/page.js.nft.json +1 -1
  546. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  547. package/app/.next/server/app/login.html +1 -1
  548. package/app/.next/server/app/login.rsc +17 -16
  549. package/app/.next/server/app/login.segments/_full.segment.rsc +17 -16
  550. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  551. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -3
  552. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  553. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  554. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  555. package/app/.next/server/app/page.js +2 -2
  556. package/app/.next/server/app/page.js.nft.json +1 -1
  557. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  558. package/app/.next/server/app/privacy/page.js +2 -2
  559. package/app/.next/server/app/privacy/page.js.nft.json +1 -1
  560. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  561. package/app/.next/server/app/privacy.html +1 -1
  562. package/app/.next/server/app/privacy.rsc +21 -23
  563. package/app/.next/server/app/privacy.segments/_full.segment.rsc +21 -23
  564. package/app/.next/server/app/privacy.segments/_head.segment.rsc +1 -1
  565. package/app/.next/server/app/privacy.segments/_index.segment.rsc +4 -3
  566. package/app/.next/server/app/privacy.segments/_tree.segment.rsc +2 -2
  567. package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +2 -2
  568. package/app/.next/server/app/privacy.segments/privacy.segment.rsc +1 -1
  569. package/app/.next/server/app/terms/page.js +2 -2
  570. package/app/.next/server/app/terms/page.js.nft.json +1 -1
  571. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  572. package/app/.next/server/app/terms.html +1 -1
  573. package/app/.next/server/app/terms.rsc +22 -20
  574. package/app/.next/server/app/terms.segments/_full.segment.rsc +22 -20
  575. package/app/.next/server/app/terms.segments/_head.segment.rsc +1 -1
  576. package/app/.next/server/app/terms.segments/_index.segment.rsc +4 -3
  577. package/app/.next/server/app/terms.segments/_tree.segment.rsc +2 -2
  578. package/app/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +1 -1
  579. package/app/.next/server/app/terms.segments/terms.segment.rsc +1 -1
  580. package/app/.next/server/app-paths-manifest.json +42 -25
  581. package/app/.next/server/chunks/1228.js +3 -0
  582. package/app/.next/server/chunks/1362.js +1 -1
  583. package/app/.next/server/chunks/152.js +1 -0
  584. package/app/.next/server/chunks/1746.js +1 -0
  585. package/app/.next/server/chunks/216.js +37 -0
  586. package/app/.next/server/chunks/2399.js +1 -1
  587. package/app/.next/server/chunks/3676.js +2 -0
  588. package/app/.next/server/chunks/4004.js +1 -0
  589. package/app/.next/server/chunks/4352.js +46 -0
  590. package/app/.next/server/chunks/4436.js +1 -1
  591. package/app/.next/server/chunks/4443.js +1 -1
  592. package/app/.next/server/chunks/{8259.js → 4469.js} +52 -2
  593. package/app/.next/server/chunks/4755.js +16 -2
  594. package/app/.next/server/chunks/{7132.js → 4832.js} +3 -3
  595. package/app/.next/server/chunks/5040.js +1 -0
  596. package/app/.next/server/chunks/5727.js +1 -0
  597. package/app/.next/server/chunks/7093.js +2 -0
  598. package/app/.next/server/chunks/7271.js +1 -0
  599. package/app/.next/server/chunks/7615.js +9 -2
  600. package/app/.next/server/chunks/7763.js +1 -0
  601. package/app/.next/server/chunks/7802.js +1 -0
  602. package/app/.next/server/chunks/7968.js +3 -1
  603. package/app/.next/server/chunks/8020.js +13 -0
  604. package/app/.next/server/chunks/8108.js +1 -1
  605. package/app/.next/server/chunks/8392.js +1 -0
  606. package/app/.next/server/chunks/8400.js +1 -1
  607. package/app/.next/server/chunks/8847.js +3 -0
  608. package/app/.next/server/chunks/9263.js +1 -0
  609. package/app/.next/server/middleware-build-manifest.js +1 -1
  610. package/app/.next/server/middleware.js +207 -2
  611. package/app/.next/server/pages/404.html +1 -1
  612. package/app/.next/server/pages/500.html +2 -2
  613. package/app/.next/server/server-reference-manifest.js +1 -1
  614. package/app/.next/server/server-reference-manifest.json +1 -1
  615. package/app/.next/static/H6LKncewEoggilnvYL9Ff/_buildManifest.js +1 -0
  616. package/app/.next/static/chunks/1525-ec661e96acc6574e.js +21 -0
  617. package/app/.next/static/chunks/3191-0bbb8ebd1bd32d1d.js +1 -0
  618. package/app/.next/static/chunks/{6941-0643e7aebf5ed645.js → 6941-77ce2b3be7709b94.js} +1 -1
  619. package/app/.next/static/chunks/7896-6e5648294ec51150.js +2 -0
  620. package/app/.next/static/chunks/9751-3a35163d337d54ea.js +37 -0
  621. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-148b0ad18f6bec86.js → page-4cec40aa933b932e.js} +1 -1
  622. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-962f1e2bfe0d0b8d.js +1 -0
  623. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-5caaa75c0ab78bc1.js +1 -0
  624. package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-81352b2272952085.js +1 -0
  625. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-3d3dabe4363d421d.js +1 -0
  626. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-c02303813bcb9777.js +1 -0
  627. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-57279ed20b5399be.js +1 -0
  628. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-4bd8ea64f2e8008b.js → page-9667287d75830fd5.js} +1 -1
  629. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-d08547fcb1031577.js +1 -0
  630. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-26179a630baa2686.js +1 -0
  631. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-c891465a1a2938d2.js → page-6190920e7526556c.js} +1 -1
  632. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-d1066b6c4c28fe46.js +1 -0
  633. package/app/.next/static/chunks/app/(dashboard)/layout-b6fc79d0628b97e3.js +1 -0
  634. package/app/.next/static/chunks/app/_global-error/page-c02303813bcb9777.js +1 -0
  635. package/app/.next/static/chunks/app/_not-found/page-c02303813bcb9777.js +1 -0
  636. package/app/.next/static/chunks/app/api/auth/login/route-c02303813bcb9777.js +1 -0
  637. package/app/.next/static/chunks/app/api/auth/logout/route-c02303813bcb9777.js +1 -0
  638. package/app/.next/static/chunks/app/api/cache/route-c02303813bcb9777.js +1 -0
  639. package/app/.next/static/chunks/app/api/cache/stats/route-c02303813bcb9777.js +1 -0
  640. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-c02303813bcb9777.js +1 -0
  641. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-c02303813bcb9777.js +1 -0
  642. package/app/.next/static/chunks/app/api/cli-tools/backups/route-c02303813bcb9777.js +1 -0
  643. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-c02303813bcb9777.js +1 -0
  644. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-c02303813bcb9777.js +1 -0
  645. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-c02303813bcb9777.js +1 -0
  646. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-c02303813bcb9777.js +1 -0
  647. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-c02303813bcb9777.js +1 -0
  648. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-c02303813bcb9777.js +1 -0
  649. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-c02303813bcb9777.js +1 -0
  650. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-c02303813bcb9777.js +1 -0
  651. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-c02303813bcb9777.js +1 -0
  652. package/app/.next/static/chunks/app/api/cloud/auth/route-c02303813bcb9777.js +1 -0
  653. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-c02303813bcb9777.js +1 -0
  654. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-c02303813bcb9777.js +1 -0
  655. package/app/.next/static/chunks/app/api/cloud/models/alias/route-c02303813bcb9777.js +1 -0
  656. package/app/.next/static/chunks/app/api/combos/[id]/route-c02303813bcb9777.js +1 -0
  657. package/app/.next/static/chunks/app/api/combos/metrics/route-c02303813bcb9777.js +1 -0
  658. package/app/.next/static/chunks/app/api/combos/route-c02303813bcb9777.js +1 -0
  659. package/app/.next/static/chunks/app/api/combos/test/route-c02303813bcb9777.js +1 -0
  660. package/app/.next/static/chunks/app/api/compliance/audit-log/route-c02303813bcb9777.js +1 -0
  661. package/app/.next/static/chunks/app/api/db-backups/route-c02303813bcb9777.js +1 -0
  662. package/app/.next/static/chunks/app/api/evals/[suiteId]/route-c02303813bcb9777.js +1 -0
  663. package/app/.next/static/chunks/app/api/evals/route-c02303813bcb9777.js +1 -0
  664. package/app/.next/static/chunks/app/api/fallback/chains/route-c02303813bcb9777.js +1 -0
  665. package/app/.next/static/chunks/app/api/init/route-c02303813bcb9777.js +1 -0
  666. package/app/.next/static/chunks/app/api/keys/[id]/route-c02303813bcb9777.js +1 -0
  667. package/app/.next/static/chunks/app/api/keys/route-c02303813bcb9777.js +1 -0
  668. package/app/.next/static/chunks/app/api/models/alias/route-c02303813bcb9777.js +1 -0
  669. package/app/.next/static/chunks/app/api/models/availability/route-c02303813bcb9777.js +1 -0
  670. package/app/.next/static/chunks/app/api/models/catalog/route-c02303813bcb9777.js +1 -0
  671. package/app/.next/static/chunks/app/api/models/route-c02303813bcb9777.js +1 -0
  672. package/app/.next/static/chunks/app/api/monitoring/health/route-c02303813bcb9777.js +1 -0
  673. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-c02303813bcb9777.js +1 -0
  674. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-c02303813bcb9777.js +1 -0
  675. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-c02303813bcb9777.js +1 -0
  676. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-c02303813bcb9777.js +1 -0
  677. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-c02303813bcb9777.js +1 -0
  678. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-c02303813bcb9777.js +1 -0
  679. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-c02303813bcb9777.js +1 -0
  680. package/app/.next/static/chunks/app/api/policies/route-c02303813bcb9777.js +1 -0
  681. package/app/.next/static/chunks/app/api/pricing/defaults/route-c02303813bcb9777.js +1 -0
  682. package/app/.next/static/chunks/app/api/pricing/models/route-c02303813bcb9777.js +1 -0
  683. package/app/.next/static/chunks/app/api/pricing/route-c02303813bcb9777.js +1 -0
  684. package/app/.next/static/chunks/app/api/provider-models/route-c02303813bcb9777.js +1 -0
  685. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-c02303813bcb9777.js +1 -0
  686. package/app/.next/static/chunks/app/api/provider-nodes/route-c02303813bcb9777.js +1 -0
  687. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-c02303813bcb9777.js +1 -0
  688. package/app/.next/static/chunks/app/api/providers/[id]/models/route-c02303813bcb9777.js +1 -0
  689. package/app/.next/static/chunks/app/api/providers/[id]/route-c02303813bcb9777.js +1 -0
  690. package/app/.next/static/chunks/app/api/providers/[id]/test/route-c02303813bcb9777.js +1 -0
  691. package/app/.next/static/chunks/app/api/providers/client/route-c02303813bcb9777.js +1 -0
  692. package/app/.next/static/chunks/app/api/providers/route-c02303813bcb9777.js +1 -0
  693. package/app/.next/static/chunks/app/api/providers/test-batch/route-c02303813bcb9777.js +1 -0
  694. package/app/.next/static/chunks/app/api/providers/validate/route-c02303813bcb9777.js +1 -0
  695. package/app/.next/static/chunks/app/api/rate-limit/route-c02303813bcb9777.js +1 -0
  696. package/app/.next/static/chunks/app/api/rate-limits/route-c02303813bcb9777.js +1 -0
  697. package/app/.next/static/chunks/app/api/resilience/reset/route-c02303813bcb9777.js +1 -0
  698. package/app/.next/static/chunks/app/api/resilience/route-c02303813bcb9777.js +1 -0
  699. package/app/.next/static/chunks/app/api/restart/route-c02303813bcb9777.js +1 -0
  700. package/app/.next/static/chunks/app/api/sessions/route-c02303813bcb9777.js +1 -0
  701. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-c02303813bcb9777.js +1 -0
  702. package/app/.next/static/chunks/app/api/settings/ip-filter/route-c02303813bcb9777.js +1 -0
  703. package/app/.next/static/chunks/app/api/settings/proxy/route-c02303813bcb9777.js +1 -0
  704. package/app/.next/static/chunks/app/api/settings/proxy/test/route-c02303813bcb9777.js +1 -0
  705. package/app/.next/static/chunks/app/api/settings/require-login/route-c02303813bcb9777.js +1 -0
  706. package/app/.next/static/chunks/app/api/settings/route-c02303813bcb9777.js +1 -0
  707. package/app/.next/static/chunks/app/api/settings/system-prompt/route-c02303813bcb9777.js +1 -0
  708. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-c02303813bcb9777.js +1 -0
  709. package/app/.next/static/chunks/app/api/shutdown/route-c02303813bcb9777.js +1 -0
  710. package/app/.next/static/chunks/app/api/storage/health/route-c02303813bcb9777.js +1 -0
  711. package/app/.next/static/chunks/app/api/sync/cloud/route-c02303813bcb9777.js +1 -0
  712. package/app/.next/static/chunks/app/api/sync/initialize/route-c02303813bcb9777.js +1 -0
  713. package/app/.next/static/chunks/app/api/tags/route-c02303813bcb9777.js +1 -0
  714. package/app/.next/static/chunks/app/api/telemetry/summary/route-c02303813bcb9777.js +1 -0
  715. package/app/.next/static/chunks/app/api/token-health/route-c02303813bcb9777.js +1 -0
  716. package/app/.next/static/chunks/app/api/translator/detect/route-c02303813bcb9777.js +1 -0
  717. package/app/.next/static/chunks/app/api/translator/history/route-c02303813bcb9777.js +1 -0
  718. package/app/.next/static/chunks/app/api/translator/load/route-c02303813bcb9777.js +1 -0
  719. package/app/.next/static/chunks/app/api/translator/save/route-c02303813bcb9777.js +1 -0
  720. package/app/.next/static/chunks/app/api/translator/send/route-c02303813bcb9777.js +1 -0
  721. package/app/.next/static/chunks/app/api/translator/translate/route-c02303813bcb9777.js +1 -0
  722. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-c02303813bcb9777.js +1 -0
  723. package/app/.next/static/chunks/app/api/usage/analytics/route-c02303813bcb9777.js +1 -0
  724. package/app/.next/static/chunks/app/api/usage/budget/route-c02303813bcb9777.js +1 -0
  725. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-c02303813bcb9777.js +1 -0
  726. package/app/.next/static/chunks/app/api/usage/call-logs/route-c02303813bcb9777.js +1 -0
  727. package/app/.next/static/chunks/app/api/usage/history/route-c02303813bcb9777.js +1 -0
  728. package/app/.next/static/chunks/app/api/usage/logs/route-c02303813bcb9777.js +1 -0
  729. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-c02303813bcb9777.js +1 -0
  730. package/app/.next/static/chunks/app/api/usage/request-logs/route-c02303813bcb9777.js +1 -0
  731. package/app/.next/static/chunks/app/api/v1/api/chat/route-c02303813bcb9777.js +1 -0
  732. package/app/.next/static/chunks/app/api/v1/audio/speech/route-c02303813bcb9777.js +1 -0
  733. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-c02303813bcb9777.js +1 -0
  734. package/app/.next/static/chunks/app/api/v1/chat/completions/route-c02303813bcb9777.js +1 -0
  735. package/app/.next/static/chunks/app/api/v1/embeddings/route-c02303813bcb9777.js +1 -0
  736. package/app/.next/static/chunks/app/api/v1/images/generations/route-c02303813bcb9777.js +1 -0
  737. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-c02303813bcb9777.js +1 -0
  738. package/app/.next/static/chunks/app/api/v1/messages/route-c02303813bcb9777.js +1 -0
  739. package/app/.next/static/chunks/app/api/v1/models/route-c02303813bcb9777.js +1 -0
  740. package/app/.next/static/chunks/app/api/v1/moderations/route-c02303813bcb9777.js +1 -0
  741. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-c02303813bcb9777.js +1 -0
  742. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-c02303813bcb9777.js +1 -0
  743. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-c02303813bcb9777.js +1 -0
  744. package/app/.next/static/chunks/app/api/v1/rerank/route-c02303813bcb9777.js +1 -0
  745. package/app/.next/static/chunks/app/api/v1/responses/route-c02303813bcb9777.js +1 -0
  746. package/app/.next/static/chunks/app/api/v1/route-c02303813bcb9777.js +1 -0
  747. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-c02303813bcb9777.js +1 -0
  748. package/app/.next/static/chunks/app/api/v1beta/models/route-c02303813bcb9777.js +1 -0
  749. package/app/.next/static/chunks/app/forbidden/page-6806872971c364f0.js +1 -0
  750. package/app/.next/static/chunks/app/forgot-password/page-9c116a597f3df4d1.js +1 -0
  751. package/app/.next/static/chunks/app/global-error-6abc2976016d7bd1.js +1 -0
  752. package/app/.next/static/chunks/app/layout-6504ce60623b0a41.js +1 -0
  753. package/app/.next/static/chunks/app/login/{page-e99ed6a85e91ae7c.js → page-93ac51059ef434b7.js} +1 -1
  754. package/app/.next/static/chunks/app/not-found-e1af8b9c5785b71b.js +1 -0
  755. package/app/.next/static/chunks/app/page-c02303813bcb9777.js +1 -0
  756. package/app/.next/static/chunks/main-app-c9da11a8061df107.js +1 -0
  757. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-c02303813bcb9777.js +1 -0
  758. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-c02303813bcb9777.js +1 -0
  759. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c02303813bcb9777.js +1 -0
  760. package/app/.next/static/css/2ecfad7c4409b17e.css +1 -0
  761. package/app/package.json +9 -5
  762. package/app/src/shared/utils/apiKey.js +5 -1
  763. package/bin/reset-password.mjs +116 -0
  764. package/package.json +9 -5
  765. package/app/.next/server/chunks/1483.js +0 -156
  766. package/app/.next/server/chunks/21.js +0 -46
  767. package/app/.next/server/chunks/2116.js +0 -1
  768. package/app/.next/server/chunks/2250.js +0 -1
  769. package/app/.next/server/chunks/3919.js +0 -1
  770. package/app/.next/server/chunks/481.js +0 -156
  771. package/app/.next/server/chunks/5640.js +0 -1
  772. package/app/.next/server/chunks/6194.js +0 -1
  773. package/app/.next/server/chunks/6937.js +0 -156
  774. package/app/.next/server/chunks/7471.js +0 -13
  775. package/app/.next/server/chunks/9188.js +0 -1
  776. package/app/.next/static/XnNWFvV2IXZ4xuX0F1Skg/_buildManifest.js +0 -1
  777. package/app/.next/static/chunks/1525-8aaae9ffdaa67144.js +0 -7
  778. package/app/.next/static/chunks/7896-4e519429f67f381e.js +0 -1
  779. package/app/.next/static/chunks/8013-04b90e92e614b5d9.js +0 -1
  780. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-49caa7328acff82d.js +0 -1
  781. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-ab8b870377087bc7.js +0 -1
  782. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-bc5764734a448526.js +0 -1
  783. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-c452284fb77ecee0.js +0 -1
  784. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-fb1fa9ae8a3af8c8.js +0 -1
  785. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-4140db5a52fc7323.js +0 -1
  786. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-70619a1bafdc9c4c.js +0 -1
  787. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-9ee5997edb778414.js +0 -1
  788. package/app/.next/static/chunks/app/(dashboard)/layout-0ee92d902ee7a39c.js +0 -1
  789. package/app/.next/static/chunks/app/_global-error/page-c452284fb77ecee0.js +0 -1
  790. package/app/.next/static/chunks/app/_not-found/page-a99a85b5268f1c54.js +0 -1
  791. package/app/.next/static/chunks/app/api/auth/login/route-c452284fb77ecee0.js +0 -1
  792. package/app/.next/static/chunks/app/api/auth/logout/route-c452284fb77ecee0.js +0 -1
  793. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-c452284fb77ecee0.js +0 -1
  794. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-c452284fb77ecee0.js +0 -1
  795. package/app/.next/static/chunks/app/api/cli-tools/backups/route-c452284fb77ecee0.js +0 -1
  796. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-c452284fb77ecee0.js +0 -1
  797. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-c452284fb77ecee0.js +0 -1
  798. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-c452284fb77ecee0.js +0 -1
  799. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-c452284fb77ecee0.js +0 -1
  800. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-c452284fb77ecee0.js +0 -1
  801. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-c452284fb77ecee0.js +0 -1
  802. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-c452284fb77ecee0.js +0 -1
  803. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-c452284fb77ecee0.js +0 -1
  804. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-c452284fb77ecee0.js +0 -1
  805. package/app/.next/static/chunks/app/api/cloud/auth/route-c452284fb77ecee0.js +0 -1
  806. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-c452284fb77ecee0.js +0 -1
  807. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-c452284fb77ecee0.js +0 -1
  808. package/app/.next/static/chunks/app/api/cloud/models/alias/route-c452284fb77ecee0.js +0 -1
  809. package/app/.next/static/chunks/app/api/combos/[id]/route-c452284fb77ecee0.js +0 -1
  810. package/app/.next/static/chunks/app/api/combos/metrics/route-c452284fb77ecee0.js +0 -1
  811. package/app/.next/static/chunks/app/api/combos/route-c452284fb77ecee0.js +0 -1
  812. package/app/.next/static/chunks/app/api/combos/test/route-c452284fb77ecee0.js +0 -1
  813. package/app/.next/static/chunks/app/api/db-backups/route-c452284fb77ecee0.js +0 -1
  814. package/app/.next/static/chunks/app/api/init/route-c452284fb77ecee0.js +0 -1
  815. package/app/.next/static/chunks/app/api/keys/[id]/route-c452284fb77ecee0.js +0 -1
  816. package/app/.next/static/chunks/app/api/keys/route-c452284fb77ecee0.js +0 -1
  817. package/app/.next/static/chunks/app/api/models/alias/route-c452284fb77ecee0.js +0 -1
  818. package/app/.next/static/chunks/app/api/models/catalog/route-c452284fb77ecee0.js +0 -1
  819. package/app/.next/static/chunks/app/api/models/route-c452284fb77ecee0.js +0 -1
  820. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-c452284fb77ecee0.js +0 -1
  821. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-c452284fb77ecee0.js +0 -1
  822. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-c452284fb77ecee0.js +0 -1
  823. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-c452284fb77ecee0.js +0 -1
  824. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-c452284fb77ecee0.js +0 -1
  825. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-c452284fb77ecee0.js +0 -1
  826. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-c452284fb77ecee0.js +0 -1
  827. package/app/.next/static/chunks/app/api/pricing/defaults/route-c452284fb77ecee0.js +0 -1
  828. package/app/.next/static/chunks/app/api/pricing/models/route-c452284fb77ecee0.js +0 -1
  829. package/app/.next/static/chunks/app/api/pricing/route-c452284fb77ecee0.js +0 -1
  830. package/app/.next/static/chunks/app/api/provider-models/route-c452284fb77ecee0.js +0 -1
  831. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-c452284fb77ecee0.js +0 -1
  832. package/app/.next/static/chunks/app/api/provider-nodes/route-c452284fb77ecee0.js +0 -1
  833. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-c452284fb77ecee0.js +0 -1
  834. package/app/.next/static/chunks/app/api/providers/[id]/models/route-c452284fb77ecee0.js +0 -1
  835. package/app/.next/static/chunks/app/api/providers/[id]/route-c452284fb77ecee0.js +0 -1
  836. package/app/.next/static/chunks/app/api/providers/[id]/test/route-c452284fb77ecee0.js +0 -1
  837. package/app/.next/static/chunks/app/api/providers/client/route-c452284fb77ecee0.js +0 -1
  838. package/app/.next/static/chunks/app/api/providers/route-c452284fb77ecee0.js +0 -1
  839. package/app/.next/static/chunks/app/api/providers/test-batch/route-c452284fb77ecee0.js +0 -1
  840. package/app/.next/static/chunks/app/api/providers/validate/route-c452284fb77ecee0.js +0 -1
  841. package/app/.next/static/chunks/app/api/rate-limit/route-c452284fb77ecee0.js +0 -1
  842. package/app/.next/static/chunks/app/api/rate-limits/route-c452284fb77ecee0.js +0 -1
  843. package/app/.next/static/chunks/app/api/restart/route-c452284fb77ecee0.js +0 -1
  844. package/app/.next/static/chunks/app/api/sessions/route-c452284fb77ecee0.js +0 -1
  845. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-c452284fb77ecee0.js +0 -1
  846. package/app/.next/static/chunks/app/api/settings/ip-filter/route-c452284fb77ecee0.js +0 -1
  847. package/app/.next/static/chunks/app/api/settings/proxy/route-c452284fb77ecee0.js +0 -1
  848. package/app/.next/static/chunks/app/api/settings/proxy/test/route-c452284fb77ecee0.js +0 -1
  849. package/app/.next/static/chunks/app/api/settings/require-login/route-c452284fb77ecee0.js +0 -1
  850. package/app/.next/static/chunks/app/api/settings/route-c452284fb77ecee0.js +0 -1
  851. package/app/.next/static/chunks/app/api/settings/system-prompt/route-c452284fb77ecee0.js +0 -1
  852. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-c452284fb77ecee0.js +0 -1
  853. package/app/.next/static/chunks/app/api/shutdown/route-c452284fb77ecee0.js +0 -1
  854. package/app/.next/static/chunks/app/api/storage/health/route-c452284fb77ecee0.js +0 -1
  855. package/app/.next/static/chunks/app/api/sync/cloud/route-c452284fb77ecee0.js +0 -1
  856. package/app/.next/static/chunks/app/api/sync/initialize/route-c452284fb77ecee0.js +0 -1
  857. package/app/.next/static/chunks/app/api/tags/route-c452284fb77ecee0.js +0 -1
  858. package/app/.next/static/chunks/app/api/translator/detect/route-c452284fb77ecee0.js +0 -1
  859. package/app/.next/static/chunks/app/api/translator/history/route-c452284fb77ecee0.js +0 -1
  860. package/app/.next/static/chunks/app/api/translator/load/route-c452284fb77ecee0.js +0 -1
  861. package/app/.next/static/chunks/app/api/translator/save/route-c452284fb77ecee0.js +0 -1
  862. package/app/.next/static/chunks/app/api/translator/send/route-c452284fb77ecee0.js +0 -1
  863. package/app/.next/static/chunks/app/api/translator/translate/route-c452284fb77ecee0.js +0 -1
  864. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-c452284fb77ecee0.js +0 -1
  865. package/app/.next/static/chunks/app/api/usage/analytics/route-c452284fb77ecee0.js +0 -1
  866. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-c452284fb77ecee0.js +0 -1
  867. package/app/.next/static/chunks/app/api/usage/call-logs/route-c452284fb77ecee0.js +0 -1
  868. package/app/.next/static/chunks/app/api/usage/history/route-c452284fb77ecee0.js +0 -1
  869. package/app/.next/static/chunks/app/api/usage/logs/route-c452284fb77ecee0.js +0 -1
  870. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-c452284fb77ecee0.js +0 -1
  871. package/app/.next/static/chunks/app/api/usage/request-logs/route-c452284fb77ecee0.js +0 -1
  872. package/app/.next/static/chunks/app/api/v1/api/chat/route-c452284fb77ecee0.js +0 -1
  873. package/app/.next/static/chunks/app/api/v1/audio/speech/route-c452284fb77ecee0.js +0 -1
  874. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-c452284fb77ecee0.js +0 -1
  875. package/app/.next/static/chunks/app/api/v1/chat/completions/route-c452284fb77ecee0.js +0 -1
  876. package/app/.next/static/chunks/app/api/v1/embeddings/route-c452284fb77ecee0.js +0 -1
  877. package/app/.next/static/chunks/app/api/v1/images/generations/route-c452284fb77ecee0.js +0 -1
  878. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-c452284fb77ecee0.js +0 -1
  879. package/app/.next/static/chunks/app/api/v1/messages/route-c452284fb77ecee0.js +0 -1
  880. package/app/.next/static/chunks/app/api/v1/models/route-c452284fb77ecee0.js +0 -1
  881. package/app/.next/static/chunks/app/api/v1/moderations/route-c452284fb77ecee0.js +0 -1
  882. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-c452284fb77ecee0.js +0 -1
  883. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-c452284fb77ecee0.js +0 -1
  884. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-c452284fb77ecee0.js +0 -1
  885. package/app/.next/static/chunks/app/api/v1/rerank/route-c452284fb77ecee0.js +0 -1
  886. package/app/.next/static/chunks/app/api/v1/responses/route-c452284fb77ecee0.js +0 -1
  887. package/app/.next/static/chunks/app/api/v1/route-c452284fb77ecee0.js +0 -1
  888. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-c452284fb77ecee0.js +0 -1
  889. package/app/.next/static/chunks/app/api/v1beta/models/route-c452284fb77ecee0.js +0 -1
  890. package/app/.next/static/chunks/app/layout-485b011f69e6ed37.js +0 -1
  891. package/app/.next/static/chunks/app/page-c452284fb77ecee0.js +0 -1
  892. package/app/.next/static/chunks/main-app-fbc16f70c595b197.js +0 -1
  893. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-c452284fb77ecee0.js +0 -1
  894. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-c452284fb77ecee0.js +0 -1
  895. package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-d91548a7b6ba5970.js +0 -1
  896. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-c452284fb77ecee0.js +0 -1
  897. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c452284fb77ecee0.js +0 -1
  898. package/app/.next/static/css/5309860f6e486620.css +0 -1
  899. /package/app/.next/static/{XnNWFvV2IXZ4xuX0F1Skg → H6LKncewEoggilnvYL9Ff}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{11313:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),l=s(71525),i=s(26853);let n=/^[a-zA-Z0-9_/.-]+$/;function o(e){return"string"==typeof e?{model:e,weight:0}:{model:e.model,weight:e.weight||0}}function d(){let[e,t]=(0,r.useState)([]),[s,n]=(0,r.useState)(!0),[o,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(null),[h,b]=(0,r.useState)([]),[g,f]=(0,r.useState)({}),[y,j]=(0,r.useState)(null),[v,N]=(0,r.useState)(null),{copied:k,copy:w}=(0,i.C)(),[C,S]=(0,r.useState)(null),[$,M]=(0,r.useState)(null);(0,r.useEffect)(()=>{T(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>M(e)).catch(()=>{})},[]);let T=async()=>{try{let[e,s,a]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics")]),r=await e.json(),l=await s.json(),i=await a.json();if(e.ok&&t(r.combos||[]),s.ok){let e=(l.connections||[]).filter(e=>"active"===e.testStatus||"success"===e.testStatus);b(e)}a.ok&&f(i.metrics||{})}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}},_=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await T(),d(!1);else{let e=await t.json();alert(e.error?.message||e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},E=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await T(),p(null);else{let e=await s.json();alert(e.error?.message||e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},P=async s=>{if(confirm("Delete this combo?"))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}},D=async t=>{let s=t.name.replace(/-copy(-\d+)?$/,""),a=e.map(e=>e.name),r=`${s}-copy`,l=1;for(;a.includes(r);)l++,r=`${s}-copy-${l}`;let i={name:r,models:t.models,strategy:t.strategy||"priority",config:t.config||{}};await _(i)},O=async e=>{N(e.name),j(null);try{let t=await fetch("/api/combos/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:e.name})}),s=await t.json();j(s)}catch(e){j({error:"Test request failed"})}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.Qv,{}),(0,a.jsx)(l.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold",children:"Combos"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with weighted routing and fallback support"})]}),(0,a.jsx)(l.$n,{icon:"add",onClick:()=>d(!0),children:"Create Combo"})]}),0===e.length?(0,a.jsx)(l.Zp,{children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with weighted routing and fallback support"}),(0,a.jsx)(l.$n,{icon:"add",onClick:()=>d(!0),children:"Create Combo"})]})}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,a.jsx)(c,{combo:e,metrics:g[e.name],copied:k,onCopy:w,onEdit:()=>p(e),onDelete:()=>P(e.id),onDuplicate:()=>D(e),onTest:()=>O(e),testing:v===e.name,onProxy:()=>S(e),hasProxy:!!$?.combos?.[e.id]},e.id))}),y&&(0,a.jsx)(l.aF,{isOpen:!!y,onClose:()=>{j(null),N(null)},title:`Test Results — ${v}`,children:(0,a.jsx)(m,{results:y})}),(0,a.jsx)(x,{isOpen:o,onClose:()=>d(!1),onSave:_,activeProviders:h},"create"),(0,a.jsx)(x,{isOpen:!!u,combo:u,onClose:()=>p(null),onSave:e=>E(u.id,e),activeProviders:h},u?.id||"new"),C&&(0,a.jsx)(l.KN,{isOpen:!!C,onClose:()=>S(null),level:"combo",levelId:C.id,levelLabel:C.name})]})}function c({combo:e,metrics:t,copied:s,onCopy:r,onEdit:i,onDelete:n,onDuplicate:d,onTest:c,testing:m,onProxy:x,hasProxy:u}){let p=e.strategy||"priority",h=e.models||[];return(0,a.jsx)(l.Zp,{padding:"sm",className:"group",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(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)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,a.jsx)("span",{className:`text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full ${"weighted"===p?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"round-robin"===p?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-blue-500/15 text-blue-600 dark:text-blue-400"}`,children:p}),u&&(0,a.jsxs)("span",{className:"text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full bg-primary/15 text-primary flex items-center gap-0.5",title:"Proxy configured",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"vpn_lock"}),"proxy"]}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:"Copy combo name",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s===`combo-${e.id}`?"check":"content_copy"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===h.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):h.slice(0,3).map((e,t)=>{let{model:s,weight:r}=o(e);return(0,a.jsxs)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:[s,"weighted"===p&&r>0?` (${r}%)`:""]},t)}),h.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",h.length-3," more"]})]}),t&&(0,a.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,a.jsx)("span",{className:"text-emerald-500",children:t.totalSuccesses}),"/",t.totalRequests," reqs"]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:[t.successRate,"% success"]}),(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",t.avgLatencyMs,"ms"]}),t.fallbackRate>0&&(0,a.jsxs)("span",{className:"text-[10px] text-amber-500",children:[t.fallbackRate,"% fallback"]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-emerald-500 transition-colors",title:"Test combo",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${m?"animate-spin":""}`,children:m?"progress_activity":"play_arrow"})}),(0,a.jsx)("button",{onClick:d,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Duplicate",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,a.jsx)("button",{onClick:x,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Proxy configuration",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_lock"})}),(0,a.jsx)("button",{onClick:i,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Edit",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,a.jsx)("button",{onClick:n,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:"Delete",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})})}function m({results:e}){return e.error?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),"string"==typeof e.error?e.error:JSON.stringify(e.error)]}):(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.resolvedBy&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-[18px]",children:"check_circle"}),(0,a.jsxs)("span",{children:["Resolved by:"," ",(0,a.jsx)("code",{className:"text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:e.resolvedBy})]})]}),e.results?.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs px-2 py-1.5 rounded bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:"ok"===e.status?"check_circle":"skipped"===e.status?"skip_next":"error"}),(0,a.jsx)("code",{className:"font-mono flex-1",children:e.model}),void 0!==e.latencyMs&&(0,a.jsxs)("span",{className:"text-text-muted",children:[e.latencyMs,"ms"]}),(0,a.jsx)("span",{className:`text-[10px] uppercase font-medium ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:e.status})]},t))]})}function x({isOpen:e,combo:t,onClose:s,onSave:i,activeProviders:d}){let[c,m]=(0,r.useState)(t?.name||""),[x,p]=(0,r.useState)(()=>(t?.models||[]).map(e=>o(e))),[h,b]=(0,r.useState)(t?.strategy||"priority"),[g,f]=(0,r.useState)(!1),[y,j]=(0,r.useState)(!1),[v,N]=(0,r.useState)(""),[k,w]=(0,r.useState)({}),[C,S]=(0,r.useState)([]),[$,M]=(0,r.useState)(!1),[T,_]=(0,r.useState)(t?.config||{}),[E,P]=(0,r.useState)(null),[D,O]=(0,r.useState)(null),R=async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/provider-nodes")]);if(!e.ok||!t.ok)throw Error(`Failed to fetch data: aliases=${e.status}, nodes=${t.status}`);let[s,a]=await Promise.all([e.json(),t.json()]);w(s.aliases||{}),S(a.nodes||[])}catch(e){console.error("Error fetching modal data:",e)}};(0,r.useEffect)(()=>{e&&R()},[e]);let q=e=>e.trim()?n.test(e)?(N(""),!0):(N("Only letters, numbers, -, _, / and . allowed"),!1):(N("Name is required"),!1),A=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return e;let[s,a]=t,r=C.find(e=>e.id===s);return r?`${r.name}/${a}`:e},[C]),F=e=>{e.target&&(e.target.style.opacity="1"),P(null),O(null)},L=async()=>{if(!q(c))return;j(!0);let e={name:c.trim(),models:"weighted"===h?x:x.map(e=>e.model),strategy:h},t={...T};"round-robin"===h&&(void 0!==T.concurrencyPerModel&&(t.concurrencyPerModel=T.concurrencyPerModel),void 0!==T.queueTimeoutMs&&(t.queueTimeoutMs=T.queueTimeoutMs)),Object.keys(t).length>0&&(e.config=t),await i(e),j(!1)},z=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.aF,{isOpen:e,onClose:s,title:z?"Edit Combo":"Create Combo",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(l.pd,{label:"Combo Name",value:c,onChange:e=>{let t=e.target.value;m(t),t?q(t):N("")},placeholder:"my-combo",error:v}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Letters, numbers, -, _, / and . allowed"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Routing Strategy"}),(0,a.jsxs)("div",{className:"flex gap-1 p-0.5 bg-black/5 dark:bg-white/5 rounded-lg",children:[(0,a.jsxs)("button",{onClick:()=>b("priority"),className:`flex-1 py-1.5 px-3 rounded-md text-xs font-medium transition-all ${"priority"===h?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-1",children:"sort"}),"Priority"]}),(0,a.jsxs)("button",{onClick:()=>b("weighted"),className:`flex-1 py-1.5 px-3 rounded-md text-xs font-medium transition-all ${"weighted"===h?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-1",children:"percent"}),"Weighted"]}),(0,a.jsxs)("button",{onClick:()=>b("round-robin"),className:`flex-1 py-1.5 px-3 rounded-md text-xs font-medium transition-all ${"round-robin"===h?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-1",children:"autorenew"}),"Round-Robin"]})]}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"priority"===h?"Sequential fallback: tries model 1 first, then 2, etc.":"weighted"===h?"Distributes traffic by weight percentage with fallback":"Circular distribution: each request goes to the next model in rotation"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Models"}),"weighted"===h&&x.length>1&&(0,a.jsx)("button",{onClick:()=>{let e=x.length;if(0===e)return;let t=Math.floor(100/e),s=100-t*e;p(x.map((e,a)=>({...e,weight:t+(0===a?s:0)})))},className:"text-[10px] text-primary hover:text-primary/80 transition-colors",children:"Auto-balance"})]}),0===x.length?(0,a.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-1 max-h-[240px] overflow-y-auto",children:x.map((e,t)=>(0,a.jsxs)("div",{draggable:!0,onDragStart:e=>{P(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.toString()),e.target&&setTimeout(()=>e.target.style.opacity="0.5",0)},onDragEnd:F,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",O(t)},onDrop:e=>((e,t)=>{if(e.preventDefault(),null===E||E===t)return;let s=[...x],[a]=s.splice(E,1);s.splice(t,0,a),p(s),P(null),O(null)})(e,t),className:`group/item flex items-center gap-1.5 px-2 py-1.5 rounded-md transition-all cursor-grab active:cursor-grabbing ${D===t&&E!==t?"bg-primary/10 border border-primary/30":"bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] border border-transparent"} ${E===t?"opacity-50":""}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted/40 cursor-grab shrink-0",children:"drag_indicator"}),(0,a.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),(0,a.jsx)("div",{className:"flex-1 min-w-0 px-1 text-xs text-text-main truncate",children:A(e.model)}),"weighted"===h&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,a.jsx)("input",{type:"number",min:"0",max:"100",value:e.weight,onChange:e=>{var s;let a;return s=e.target.value,void((a=[...x])[t]={...a[t],weight:Math.max(0,Math.min(100,Number(s)||0))},p(a))},className:"w-10 text-[11px] text-center py-0.5 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]}),"priority"===h&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:()=>(e=>{if(0===e)return;let t=[...x];[t[e-1],t[e]]=[t[e],t[e-1]],p(t)})(t),disabled:0===t,className:`p-0.5 rounded ${0===t?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:()=>(e=>{if(e===x.length-1)return;let t=[...x];[t[e],t[e+1]]=[t[e+1],t[e]],p(t)})(t),disabled:t===x.length-1,className:`p-0.5 rounded ${t===x.length-1?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,a.jsx)("button",{onClick:()=>{p(x.filter((e,s)=>s!==t))},className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e.model}-${t}`))}),"weighted"===h&&x.length>0&&(0,a.jsx)(u,{models:x}),(0,a.jsxs)("button",{onClick:()=>f(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,a.jsxs)("button",{onClick:()=>M(!$),className:"flex items-center gap-1 text-xs text-text-muted hover:text-text-main transition-colors self-start",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:$?"expand_less":"expand_more"}),"Advanced Settings"]}),$&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-3 bg-black/[0.02] dark:bg-white/[0.02] rounded-lg border border-black/5 dark:border-white/5",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Max Retries"}),(0,a.jsx)("input",{type:"number",min:"0",max:"10",value:T.maxRetries??"",placeholder:"1",onChange:e=>_({...T,maxRetries:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Retry Delay (ms)"}),(0,a.jsx)("input",{type:"number",min:"0",max:"60000",step:"500",value:T.retryDelayMs??"",placeholder:"2000",onChange:e=>_({...T,retryDelayMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Timeout (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",max:"600000",step:"1000",value:T.timeoutMs??"",placeholder:"120000",onChange:e=>_({...T,timeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted",children:"Healthcheck"}),(0,a.jsx)("input",{type:"checkbox",checked:!1!==T.healthCheckEnabled,onChange:e=>_({...T,healthCheckEnabled:e.target.checked}),className:"accent-primary"})]})]}),"round-robin"===h&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-black/5 dark:border-white/5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Concurrency / Model"}),(0,a.jsx)("input",{type:"number",min:"1",max:"20",value:T.concurrencyPerModel??"",placeholder:"3",onChange:e=>_({...T,concurrencyPerModel:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[10px] text-text-muted mb-0.5 block",children:"Queue Timeout (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",max:"120000",step:"1000",value:T.queueTimeoutMs??"",placeholder:"30000",onChange:e=>_({...T,queueTimeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]})]}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted",children:"Leave empty to use global defaults. These override per-provider settings."})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(l.$n,{onClick:L,fullWidth:!0,size:"sm",disabled:!c.trim()||!!v||y,children:y?"Saving...":z?"Save":"Create"})]})]})}),(0,a.jsx)(l.rq,{isOpen:g,onClose:()=>f(!1),onSelect:e=>{x.find(t=>t.model===e.value)||p([...x,{model:e.value,weight:0}])},activeProviders:d,modelAliases:k,title:"Add Model to Combo"})]})}function u({models:e}){let t=e.reduce((e,t)=>e+(t.weight||0),0),s=100===t,r=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"];return(0,a.jsxs)("div",{className:"mt-1.5",children:[(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-black/5 dark:bg-white/5 overflow-hidden flex",children:e.map((e,t)=>e.weight?(0,a.jsx)("div",{className:`${r[t%r.length]} transition-all duration-300`,style:{width:`${Math.min(e.weight,100)}%`}},t):null)}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,a.jsx)("div",{className:"flex gap-1",children:e.map((e,t)=>e.weight>0&&(0,a.jsxs)("span",{className:"flex items-center gap-0.5 text-[9px] text-text-muted",children:[(0,a.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${r[t%r.length]}`}),e.weight,"%"]},t))}),(0,a.jsxs)("span",{className:`text-[10px] font-medium ${s?"text-emerald-500":t>100?"text-red-500":"text-amber-500"}`,children:[t,"%",!s&&t>0&&" ≠ 100%"]})]})]})}},66618:(e,t,s)=>{Promise.resolve().then(s.bind(s,11313))}},e=>{e.O(0,[8500,600,8013,7896,1525,8441,3794,7358],()=>e(e.s=66618)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{},_=>{_.O(0,[8500,600,8013,7896,1525,6941,8441,3794,7358],()=>_(_.s=86941)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{},_=>{_.O(0,[8500,600,8013,7896,1525,6941,8441,3794,7358],()=>_(_.s=86941)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{29556:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>u});var s=i(95155),a=i(12115),r=i(14051),l=i(73321),n=i(98500),o=i(5772),d=i(71525),c=i(64745),p=i(18595),m=i(26853);function u(){let e=(0,l.useParams)(),t=(0,l.useRouter)(),i=e.id,[r,u]=(0,a.useState)([]),[f,v]=(0,a.useState)(!0),[g,w]=(0,a.useState)(null),[A,S]=(0,a.useState)(!1),[T,$]=(0,a.useState)(!1),[R,E]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[_,P]=(0,a.useState)(null),[q,U]=(0,a.useState)(null),[D,K]=(0,a.useState)({}),[L,M]=(0,a.useState)(!1),{copied:F,copy:z}=(0,m.C)(),V=(0,a.useRef)(!1),J=(0,a.useRef)(!1),[B,W]=(0,a.useState)(null),[Z,G]=(0,a.useState)(null),[Q,H]=(0,a.useState)(!1),X=g?{id:g.id,name:g.name||("anthropic-compatible"===g.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===g.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===g.type?"AC":"OC",apiType:g.apiType,baseUrl:g.baseUrl,type:g.type}:c.IS[i]||c.zN[i]||c.fg[i],Y=!!c.IS[i]||!!c.zN[i],ee=(0,p.KC)(i),et=(0,c.wG)(i),ei=(0,c.mq)(i),es=(0,c.gb)(i),ea=ei||es,er=ea?i:et,el=ea?g?.prefix||i:et,en=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&K(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),eo=(0,a.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"})]),s=await e.json(),a=await t.json();if(e.ok){let e=(s.connections||[]).filter(e=>e.provider===i);u(e)}if(t.ok){let e=(a.nodes||[]).find(e=>e.id===i)||null;if(!e&&ea)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===i)||null))break}w(e)}}catch(e){console.log("Error fetching connections:",e)}finally{v(!1)}},[i,ea]),ed=async e=>{try{let t=await fetch(`/api/provider-nodes/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(w(s.node),await eo(),O(!1))}catch(e){console.log("Error updating provider node:",e)}};(0,a.useEffect)(()=>{eo(),en(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>G(e)).catch(()=>{})},[eo,en]),(0,a.useEffect)(()=>{f||0!==r.length||!X||ea||V.current||J.current||(V.current=!0,Y?S(!0):$(!0))},[f]);let ec=async(e,t,i=et)=>{let s=`${i}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await en();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},ep=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await en()}catch(e){console.log("Error deleting alias:",e)}},em=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&u(r.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},eu=(0,a.useCallback)(()=>{eo(),S(!1)},[eo]),ex=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,...e})})).ok&&(await eo(),$(!1))}catch(e){console.log("Error saving connection:",e)}},eh=async e=>{try{(await fetch(`/api/providers/${_.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eo(),E(!1))}catch(e){console.log("Error updating connection:",e)}},ef=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&u(i=>i.map(i=>i.id===e?{...i,isActive:t}:i))}catch(e){console.log("Error updating connection status:",e)}},ey=async(e,t)=>{try{(await fetch("/api/rate-limit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,enabled:t})})).ok&&u(i=>i.map(i=>i.id===e?{...i,rateLimitProtection:t}:i))}catch(e){console.error("Error toggling rate limit:",e)}},eb=async e=>{if(e&&!q){U(e);try{let t=await fetch(`/api/providers/${e}/test`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>({}));alert(e.error||"Failed to retest connection");return}await eo()}catch(e){console.error("Error retesting connection:",e)}finally{U(null)}}},ev=async(e,t)=>{if(e&&t)try{let i=t.priority,s=e.priority;i===s&&(i=r.indexOf(e)>r.indexOf(t)?t.priority-.5:t.priority+.5),await Promise.all([fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:i})}),fetch(`/api/providers/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:s})})]),await eo()}catch(e){console.log("Error swapping priority:",e)}},eg=async()=>{if(Q)return;let e=r.find(e=>!1!==e.isActive);if(e){H(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),i=await t.json();if(!t.ok)return void alert(i.error||"Failed to import models");let s=i.models||[];if(0===s.length)return void alert("No models returned from /models.");let a=0;for(let e of s){let t=e.id||e.name||e.model;if(!t)continue;let i=t.split("/"),s=i[i.length-1];D[s]||(await ec(t,s,er),a+=1)}0===a&&alert("No new models were added (all already exist)."),await en()}catch(e){console.log("Error importing models:",e)}finally{H(!1)}}},ej=r.some(e=>!1!==e.isActive);return f?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(d.Qv,{}),(0,s.jsx)(d.Qv,{})]}):X?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(n,{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"rounded-lg flex items-center justify-center",style:{backgroundColor:`${X.color}15`},children:L?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:X.color},children:X.textIcon||X.id.slice(0,2).toUpperCase()}):(0,s.jsx)(o.default,{src:ei&&X.apiType?"responses"===X.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":es?"/providers/anthropic-m.png":`/providers/${X.id}.png`,alt:X.name,width:48,height:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",sizes:"48px",onError:()=>M(!0)})}),(0,s.jsxs)("div",{children:[X.website?(0,s.jsxs)("a",{href:X.website,target:"_blank",rel:"noopener noreferrer",className:"text-3xl font-semibold tracking-tight hover:underline inline-flex items-center gap-2",style:{color:X.color},children:[X.name,(0,s.jsx)("span",{className:"material-symbols-outlined text-lg opacity-60",children:"open_in_new"})]}):(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:X.name}),(0,s.jsxs)("p",{className:"text-text-muted",children:[r.length," connection",1===r.length?"":"s"]})]})]})]}),ea&&g&&(0,s.jsxs)(d.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:es?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:[es?"Messages API":"responses"===g.apiType?"Responses API":"Chat Completions"," ","\xb7 ",(g.baseUrl||"").replace(/\/$/,""),"/",es?"messages":"responses"===g.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>$(!0),disabled:r.length>0,children:"Add"}),(0,s.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>O(!0),children:"Edit"}),(0,s.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${es?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${i}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},children:"Delete"})]})]}),r.length>0&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Only one connection is allowed per compatible node. Add another node if you need more connections."})]}),(0,s.jsxs)(d.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),!ea&&(0,s.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>Y?S(!0):$(!0),children:"Add"})]}),0===r.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:Y?"lock":"key"})}),(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No connections yet"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Add your first connection to get started"}),!ea&&(0,s.jsx)(d.$n,{icon:"add",onClick:()=>Y?S(!0):$(!0),children:"Add Connection"})]}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:r.sort((e,t)=>(e.priority||0)-(t.priority||0)).map((e,t)=>(0,s.jsx)(j,{connection:e,isOAuth:Y,isFirst:0===t,isLast:t===r.length-1,onMoveUp:()=>ev(e,r[t-1]),onMoveDown:()=>ev(e,r[t+1]),onToggleActive:t=>ef(e.id,t),onToggleRateLimit:t=>ey(e.id,t),onRetest:()=>eb(e.id),isRetesting:q===e.id,onEdit:()=>{P(e),E(!0)},onDelete:()=>em(e.id),onReauth:Y?()=>S(!0):void 0,onProxy:()=>W({level:"key",id:e.id,label:e.name||e.email||e.id}),hasProxy:!!Z?.keys?.[e.id]},e.id))})]}),(0,s.jsxs)(d.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:X.passthroughModels?"Model Aliases":"Available Models"}),(()=>{if(ea)return(0,s.jsx)(b,{providerStorageAlias:er,providerDisplayAlias:el,modelAliases:D,copied:F,onCopy:z,onSetAlias:ec,onDeleteAlias:ep,connections:r,isAnthropic:es});if(X.passthroughModels)return(0,s.jsx)(h,{providerAlias:et,modelAliases:D,copied:F,onCopy:z,onSetAlias:ec,onDeleteAlias:ep});let e=(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eg,disabled:!ej||Q,children:Q?"Importing...":"Import from /models"}),!ej&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Add a connection to enable importing."})]});return 0===ee.length?(0,s.jsxs)("div",{children:[e,(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No models configured"})]}):(0,s.jsxs)("div",{children:[e,(0,s.jsx)("div",{className:"flex flex-wrap gap-3",children:ee.map(e=>{let t=`${er}/${e.id}`,a=`${i}/${e.id}`,r=Object.entries(D).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(x,{model:e,fullModel:`${el}/${e.id}`,alias:r,copied:F,onCopy:z,onSetAlias:t=>ec(e.id,t,er),onDeleteAlias:()=>ep(r)},e.id)})})]})})(),!ea&&(0,s.jsx)(y,{providerId:i,providerAlias:el,copied:F,onCopy:z})]}),"kiro"===i?(0,s.jsx)(d.Mh,{isOpen:A,providerInfo:X,onSuccess:eu,onClose:()=>{J.current=!0,S(!1)}}):"cursor"===i?(0,s.jsx)(d.G9,{isOpen:A,onSuccess:eu,onClose:()=>{J.current=!0,S(!1)}}):(0,s.jsx)(d.LF,{isOpen:A,provider:i,providerInfo:X,onSuccess:eu,onClose:()=>{J.current=!0,S(!1)}}),(0,s.jsx)(N,{isOpen:T,provider:i,providerName:X.name,isCompatible:ea,isAnthropic:es,onSave:ex,onClose:()=>$(!1)}),(0,s.jsx)(k,{isOpen:R,connection:_,onSave:eh,onClose:()=>E(!1)}),ea&&(0,s.jsx)(C,{isOpen:I,node:g,onSave:ed,onClose:()=>O(!1),isAnthropic:es}),B&&(0,s.jsx)(d.KN,{isOpen:!!B,onClose:()=>W(null),level:B.level,levelId:B.id,levelLabel:B.label})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(n,{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}function x({model:e,fullModel:t,alias:i,copied:a,onCopy:r}){return(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"smart_toy"}),(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})})]})}function h({providerAlias:e,modelAliases:t,copied:i,onCopy:r,onSetAlias:l,onDeleteAlias:n}){let[o,c]=(0,a.useState)(""),[p,m]=(0,a.useState)(!1),u=Object.entries(t).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,i])=>({modelId:i.replace(`${e}/`,""),fullModel:i,alias:t})),x=async()=>{let e;if(!o.trim()||p)return;let i=o.trim(),s=(e=i.split("/"))[e.length-1];if(t[s])return void alert(`Alias "${s}" already exists. Please use a different model or edit existing alias.`);m(!0);try{await l(i,s),c("")}catch(e){console.log("Error adding model:",e)}finally{m(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"OpenRouter supports any model. Add models and create aliases for quick access."}),(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{htmlFor:"new-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID (from OpenRouter)"}),(0,s.jsx)("input",{id:"new-model-input",type:"text",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&x(),placeholder:"anthropic/claude-3-opus",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(d.$n,{size:"sm",icon:"add",onClick:x,disabled:!o.trim()||p,children:p?"Adding...":"Add"})]}),u.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:u.map(({modelId:e,fullModel:t,alias:a})=>(0,s.jsx)(f,{modelId:e,fullModel:t,copied:i,onCopy:r,onDeleteAlias:()=>n(a)},t))})]})}function f({modelId:e,fullModel:t,copied:i,onCopy:a,onDeleteAlias:r}){return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"smart_toy"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e}`?"check":"content_copy"})})]})]}),(0,s.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function y({providerId:e,providerAlias:t,copied:i,onCopy:r}){let[l,n]=(0,a.useState)([]),[o,c]=(0,a.useState)(""),[p,m]=(0,a.useState)(""),[u,x]=(0,a.useState)(!1),[h,f]=(0,a.useState)(!0),y=(0,a.useCallback)(async()=>{try{let t=await fetch(`/api/provider-models?provider=${e}`);if(t.ok){let e=await t.json();n(e.models||[])}}catch(e){console.error("Failed to fetch custom models:",e)}finally{f(!1)}},[e]);(0,a.useEffect)(()=>{y()},[y]);let b=async()=>{if(o.trim()&&!u){x(!0);try{(await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:o.trim(),modelName:p.trim()||void 0})})).ok&&(c(""),m(""),await y())}catch(e){console.error("Failed to add custom model:",e)}finally{x(!1)}}},v=async t=>{try{await fetch(`/api/provider-models?provider=${e}&model=${encodeURIComponent(t)}`,{method:"DELETE"}),await y()}catch(e){console.error("Failed to remove custom model:",e)}};return(0,s.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[(0,s.jsxs)("h3",{className:"text-sm font-semibold mb-3 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary",children:"tune"}),"Custom Models"]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Add model IDs not in the default list. These will be available for routing."}),(0,s.jsxs)("div",{className:"flex items-end gap-2 mb-3",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{htmlFor:"custom-model-id",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"custom-model-id",type:"text",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&b(),placeholder:"e.g. gpt-4.5-turbo",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsxs)("div",{className:"w-40",children:[(0,s.jsx)("label",{htmlFor:"custom-model-name",className:"text-xs text-text-muted mb-1 block",children:"Display Name"}),(0,s.jsx)("input",{id:"custom-model-name",type:"text",value:p,onChange:e=>m(e.target.value),onKeyDown:e=>"Enter"===e.key&&b(),placeholder:"Optional",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(d.$n,{size:"sm",icon:"add",onClick:b,disabled:!o.trim()||u,children:u?"Adding...":"Add"})]}),h?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Loading..."}):l.length>0?(0,s.jsx)("div",{className:"flex flex-col gap-2",children:l.map(e=>{let a=`${t}/${e.id}`,l=`custom-${e.id}`;return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary",children:"tune"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e.name||e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:a}),(0,s.jsx)("button",{onClick:()=>r(a,l),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===l?"check":"content_copy"})})]})]}),(0,s.jsx)("button",{onClick:()=>v(e.id),className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]},e.id)})}):(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No custom models added yet."})]})}function b({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:i,copied:r,onCopy:l,onSetAlias:n,onDeleteAlias:o,connections:c,isAnthropic:p}){let[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),v=Object.entries(i).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,i])=>({modelId:i.replace(`${e}/`,""),fullModel:i,alias:t})),g=e=>{let s,a=(s=e.split("/"))[s.length-1];if(!i[a])return a;let r=`${t}-${a}`;return i[r]?null:r},j=async()=>{if(!m.trim()||x)return;let t=m.trim(),i=g(t);if(!i)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await n(t,i,e),u("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},N=async()=>{if(y)return;let t=c.find(e=>!1!==e.isActive);if(t){b(!0);try{let i=await fetch(`/api/providers/${t.id}/models`),s=await i.json();if(!i.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let r=0;for(let t of a){let i=t.id||t.name||t.model;if(!i)continue;let s=g(i);s&&(await n(i,s,e),r+=1)}0===r&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},k=c.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",p?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:m,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&j(),placeholder:p?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(d.$n,{size:"sm",icon:"add",onClick:j,disabled:!m.trim()||x,children:x?"Adding...":"Add"}),(0,s.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:N,disabled:!k||y,children:y?"Importing...":"Import from /models"})]}),!k&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),v.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:v.map(({modelId:e,fullModel:i,alias:a})=>(0,s.jsx)(f,{modelId:e,fullModel:`${t}/${e}`,copied:r,onCopy:l,onDeleteAlias:()=>o(a)},i))})]})}function v({until:e}){let[t,i]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void i("");let s=Math.floor(t/1e3);if(s<60)i(`${s}s`);else if(s<3600)i(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);i(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}x.propTypes={model:r.shape({id:r.string.isRequired}).isRequired,fullModel:r.string.isRequired,alias:r.string,copied:r.string,onCopy:r.func.isRequired},h.propTypes={providerAlias:r.string.isRequired,modelAliases:r.object.isRequired,copied:r.string,onCopy:r.func.isRequired,onSetAlias:r.func.isRequired,onDeleteAlias:r.func.isRequired},f.propTypes={modelId:r.string.isRequired,fullModel:r.string.isRequired,copied:r.string,onCopy:r.func.isRequired,onDeleteAlias:r.func.isRequired},y.propTypes={providerId:r.string.isRequired,providerAlias:r.string.isRequired,copied:r.string,onCopy:r.func.isRequired},b.propTypes={providerStorageAlias:r.string.isRequired,providerDisplayAlias:r.string.isRequired,modelAliases:r.object.isRequired,copied:r.string,onCopy:r.func.isRequired,onSetAlias:r.func.isRequired,onDeleteAlias:r.func.isRequired,connections:r.arrayOf(r.shape({id:r.string,isActive:r.bool})).isRequired,isAnthropic:r.bool},v.propTypes={until:r.string.isRequired};let g={runtime_error:{label:"Local runtime",variant:"warning"},upstream_auth_error:{label:"Upstream auth",variant:"error"},auth_missing:{label:"Missing credential",variant:"warning"},token_refresh_failed:{label:"Refresh failed",variant:"warning"},token_expired:{label:"Token expired",variant:"warning"},upstream_rate_limited:{label:"Rate limited",variant:"warning"},upstream_unavailable:{label:"Upstream unavailable",variant:"error"},network_error:{label:"Network error",variant:"warning"},unsupported:{label:"Test unsupported",variant:"default"},upstream_error:{label:"Upstream error",variant:"error"}};function j({connection:e,isOAuth:t,isFirst:i,isLast:r,onMoveUp:l,onMoveDown:n,onToggleActive:o,onToggleRateLimit:c,onRetest:p,isRetesting:m,onEdit:u,onDelete:x,onReauth:h,onProxy:f,hasProxy:y}){let b=t?e.name||e.email||e.displayName||"OAuth Account":e.name,[j,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=()=>{N(e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now())};t();let i=e.rateLimitedUntil?setInterval(t,1e3):null;return()=>{i&&clearInterval(i)}},[e.rateLimitedUntil]);let k="unavailable"!==e.testStatus||j?e.testStatus:"active",C=function(e,t,i){if(!1===e.isActive)return{statusVariant:"default",statusLabel:"disabled",errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};if("active"===t||"success"===t)return{statusVariant:"success",statusLabel:"connected",errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};let s=function(e,t){if(t)return"upstream_rate_limited";if(e.lastErrorType)return e.lastErrorType;let i=Number(e.errorCode);if(401===i||403===i)return"upstream_auth_error";if(429===i)return"upstream_rate_limited";if(i>=500)return"upstream_unavailable";let s=(e.lastError||"").toLowerCase();return s?s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")||s.includes("healthcheck")?"runtime_error":s.includes("refresh failed")?"token_refresh_failed":s.includes("token expired")||s.includes("expired")?"token_expired":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.includes("access denied")||s.includes("unauthorized")?"upstream_auth_error":s.includes("rate limit")||s.includes("quota")||s.includes("too many requests")||s.includes("429")?"upstream_rate_limited":s.includes("fetch failed")||s.includes("network")||s.includes("timeout")||s.includes("econn")||s.includes("enotfound")?"network_error":s.includes("not supported")?"unsupported":"upstream_error":null}(e,i),a=s&&g[s]||null;return"runtime_error"===s?{statusVariant:"warning",statusLabel:"runtime issue",errorType:s,errorBadge:a,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"upstream_auth_error"===s||"auth_missing"===s||"token_refresh_failed"===s||"token_expired"===s?{statusVariant:"error",statusLabel:"auth failed",errorType:s,errorBadge:a,errorTextClass:"text-red-500"}:"upstream_rate_limited"===s?{statusVariant:"warning",statusLabel:"rate limited",errorType:s,errorBadge:a,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"network_error"===s?{statusVariant:"warning",statusLabel:"network issue",errorType:s,errorBadge:a,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"unsupported"===s?{statusVariant:"default",statusLabel:"test unsupported",errorType:s,errorBadge:a,errorTextClass:"text-text-muted"}:{statusVariant:"error",statusLabel:t||"error",errorType:s,errorBadge:a,errorTextClass:"text-red-500"}}(e,k,j),w=!!e.rateLimitProtection;return(0,s.jsxs)("div",{className:`group flex items-center justify-between p-3 rounded-lg hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:n,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:t?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:b}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[(0,s.jsx)(d.Ex,{variant:C.statusVariant,size:"sm",dot:!0,children:C.statusLabel}),j&&!1!==e.isActive&&(0,s.jsx)(v,{until:e.rateLimitedUntil}),C.errorBadge&&!1!==e.isActive&&(0,s.jsx)(d.Ex,{variant:C.errorBadge.variant,size:"sm",children:C.errorBadge.label}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:`text-xs truncate max-w-[300px] ${C.errorTextClass}`,title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),(0,s.jsx)("span",{className:"text-text-muted/30 select-none",children:"|"}),(0,s.jsxs)("button",{onClick:()=>c(!w),className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium transition-all cursor-pointer ${w?"bg-emerald-500/15 text-emerald-500 hover:bg-emerald-500/25":"bg-black/[0.03] dark:bg-white/[0.03] text-text-muted/50 hover:text-text-muted hover:bg-black/[0.06] dark:hover:bg-white/[0.06]"}`,title:w?"Click to disable rate limit protection":"Click to enable rate limit protection",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"shield"}),w?"Protected":"Unprotected"]}),y&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-text-muted/30 select-none",children:"|"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-xs font-medium bg-primary/15 text-primary",title:"Proxy configured",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"vpn_lock"}),"Proxy"]})]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"refresh",loading:m,disabled:!1===e.isActive,onClick:p,className:"!h-7 !px-2 text-xs",title:"Retest authentication",children:"Retest"}),(0,s.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:o,title:e.isActive??!0?"Disable connection":"Enable connection"}),(0,s.jsxs)("div",{className:"flex gap-1 ml-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h&&(0,s.jsx)("button",{onClick:h,className:"p-2 hover:bg-amber-500/10 rounded text-amber-600 hover:text-amber-500",title:"Re-authenticate this connection",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"passkey"})}),(0,s.jsx)("button",{onClick:u,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,s.jsx)("button",{onClick:f,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",title:"Proxy config",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:x,className:"p-2 hover:bg-red-500/10 rounded text-red-500",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]})]})}function N({isOpen:e,provider:t,providerName:i,isCompatible:r,isAnthropic:l,onSave:n,onClose:o}){let[c,p]=(0,a.useState)({name:"",apiKey:"",priority:1}),[m,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),b=async()=>{u(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),i=await e.json();h(i.valid?"success":"failed")}catch{h("failed")}finally{u(!1)}},v=async()=>{if(t&&c.apiKey){y(!0);try{let e=!1;try{u(!0),h(null);let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await i.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{u(!1)}await n({name:c.name,apiKey:c.apiKey,priority:c.priority,testStatus:e?"active":"unknown"})}finally{y(!1)}}};return t?(0,s.jsx)(d.aF,{isOpen:e,title:`Add ${i||t} API Key`,onClose:o,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.pd,{label:"Name",value:c.name,onChange:e=>p({...c,name:e.target.value}),placeholder:"Production Key"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.pd,{label:"API Key",type:"password",value:c.apiKey,onChange:e=>p({...c,apiKey:e.target.value}),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.$n,{onClick:b,disabled:!c.apiKey||m||f,variant:"secondary",children:m?"Checking...":"Check"})})]}),x&&(0,s.jsx)(d.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),r&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:l?`Validation checks ${i||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${i||"OpenAI Compatible"} via /models on your base URL.`}),(0,s.jsx)(d.pd,{label:"Priority",type:"number",value:c.priority,onChange:e=>p({...c,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!c.name||!c.apiKey||f,children:f?"Saving...":"Save"}),(0,s.jsx)(d.$n,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function k({isOpen:e,connection:t,onSave:i,onClose:r}){let[l,n]=(0,a.useState)({name:"",priority:1,apiKey:"",healthCheckInterval:60}),[o,p]=(0,a.useState)(!1),[m,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(n({name:t.name||"",priority:t.priority||1,apiKey:"",healthCheckInterval:t.healthCheckInterval??60}),u(null),y(null))},[t]);let j=async()=>{if(t?.provider){p(!0),u(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),i=await e.json();u({valid:!!i.valid,diagnosis:i.diagnosis||null,message:i.error||null})}catch{u({valid:!1,diagnosis:{type:"network_error"},message:"Failed to test connection"})}finally{p(!1)}}},N=async()=>{if(t?.provider&&l.apiKey){h(!0),y(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:l.apiKey})}),i=await e.json();y(i.valid?"success":"failed")}catch{y("failed")}finally{h(!1)}}},k=async()=>{v(!0);try{let e={name:l.name,priority:l.priority,healthCheckInterval:l.healthCheckInterval};if(!C&&l.apiKey){e.apiKey=l.apiKey;let i="success"===f;if(!i)try{h(!0),y(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:l.apiKey})});i=!!(await e.json()).valid,y(i?"success":"failed")}catch{y("failed")}finally{h(!1)}i&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null,e.lastErrorType=null,e.lastErrorSource=null,e.errorCode=null,e.rateLimitedUntil=null)}await i(e)}finally{v(!1)}};if(!t)return null;let C="oauth"===t.authType,w=(0,c.mq)(t.provider)||(0,c.gb)(t.provider),A=!m?.valid&&m?.diagnosis?.type&&g[m.diagnosis.type]||null;return(0,s.jsx)(d.aF,{isOpen:e,title:"Edit Connection",onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.pd,{label:"Name",value:l.name,onChange:e=>n({...l,name:e.target.value}),placeholder:C?"Account name":"Production Key"}),C&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),C&&(0,s.jsx)(d.pd,{label:"Health Check (min)",type:"number",value:l.healthCheckInterval,onChange:e=>n({...l,healthCheckInterval:Math.max(0,Number.parseInt(e.target.value)||0)}),hint:"Proactive token refresh interval. 0 = disabled."}),(0,s.jsx)(d.pd,{label:"Priority",type:"number",value:l.priority,onChange:e=>n({...l,priority:Number.parseInt(e.target.value)||1})}),!C&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.pd,{label:"API Key",type:"password",value:l.apiKey,onChange:e=>n({...l,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.$n,{onClick:N,disabled:!l.apiKey||x||b,variant:"secondary",children:x?"Checking...":"Check"})})]}),f&&(0,s.jsx)(d.Ex,{variant:"success"===f?"success":"error",children:"success"===f?"Valid":"Invalid"})]}),!w&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(d.$n,{onClick:j,variant:"secondary",disabled:o,children:o?"Testing...":"Test Connection"}),m&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Ex,{variant:m.valid?"success":"error",children:m.valid?"Valid":"Failed"}),A&&(0,s.jsx)(d.Ex,{variant:A.variant,children:A.label})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.$n,{onClick:k,fullWidth:!0,disabled:b,children:b?"Saving...":"Save"}),(0,s.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function C({isOpen:e,node:t,onSave:i,onClose:r,isAnthropic:l}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,p]=(0,a.useState)(!1),[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let b=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){p(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};l||(e.apiType=n.apiType),await i(e)}finally{p(!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:n.baseUrl,apiKey:m,type:l?"anthropic-compatible":"openai-compatible"})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{h(!1)}};return t?(0,s.jsx)(d.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,s.jsx)(d.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,s.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,s.jsx)(d.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>u(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.$n,{onClick:v,disabled:!m||x||!n.baseUrl.trim(),variant:"secondary",children:x?"Checking...":"Check"})})]}),f&&(0,s.jsx)(d.Ex,{variant:"success"===f?"success":"error",children:"success"===f?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.$n,{onClick:b,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,s.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}j.propTypes={connection:r.shape({id:r.string,name:r.string,email:r.string,displayName:r.string,rateLimitedUntil:r.string,rateLimitProtection:r.bool,testStatus:r.string,isActive:r.bool,priority:r.number,lastError:r.string,lastErrorType:r.string,lastErrorSource:r.string,errorCode:r.oneOfType([r.string,r.number]),globalPriority:r.number}).isRequired,isOAuth:r.bool.isRequired,isFirst:r.bool.isRequired,isLast:r.bool.isRequired,onMoveUp:r.func.isRequired,onMoveDown:r.func.isRequired,onToggleActive:r.func.isRequired,onToggleRateLimit:r.func.isRequired,onRetest:r.func.isRequired,isRetesting:r.bool,onEdit:r.func.isRequired,onDelete:r.func.isRequired,onReauth:r.func},N.propTypes={isOpen:r.bool.isRequired,provider:r.string,providerName:r.string,isCompatible:r.bool,isAnthropic:r.bool,onSave:r.func.isRequired,onClose:r.func.isRequired},k.propTypes={isOpen:r.bool.isRequired,connection:r.shape({id:r.string,name:r.string,email:r.string,priority:r.number,authType:r.string,provider:r.string}),onSave:r.func.isRequired,onClose:r.func.isRequired},C.propTypes={isOpen:r.bool.isRequired,node:r.shape({id:r.string,name:r.string,prefix:r.string,apiType:r.string,baseUrl:r.string}),onSave:r.func.isRequired,onClose:r.func.isRequired,isAnthropic:r.bool}},80209:(e,t,i)=>{Promise.resolve().then(i.bind(i,29556))}},e=>{e.O(0,[8500,600,8013,7896,1525,8441,3794,7358],()=>e(e.s=80209)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{11200:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var s=r(95155),a=r(12115),i=r(5772),l=r(14051),n=r(71525),o=r(81172),d=r(64745),c=r(98500);function p(e,t,r){let a=[];if(e>0&&a.push((0,s.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=r?`${t} Error (${r})`:`${t} Error`;a.push((0,s.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function m(){let[e,t]=(0,a.useState)([]),[r,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[p,m]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),[y,j]=(0,a.useState)(null),[N,C]=(0,a.useState)(null);(0,a.useEffect)(()=>{(async()=>{try{let[e,r]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),s=await e.json(),a=await r.json();e.ok&&t(s.connections||[]),r.ok&&i(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{c(!1)}})()},[]);let k=(t,r)=>{let s=e.filter(e=>e.provider===t&&e.authType===r),a=e=>{let t=e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now();return"unavailable"!==e.testStatus||t?e.testStatus:"active"},i=s.filter(e=>{let t=a(e);return"active"===t||"success"===t}).length,l=s.filter(e=>{let t=a(e);return"error"===t||"expired"===t||"unavailable"===t}),n=l.length,o=s.length,d=l.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:i,error:n,total:o,errorCode:d?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let r=Number(e.errorCode);if(Number.isFinite(r)&&r>=400)return String(r);let s=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===s||"403"===s)return"AUTH";if(s&&"ERR"!==s)return s;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"}(d):null,errorTime:d?.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 r=Math.floor(t/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(d.lastErrorAt):null}},T=async(e,t=null)=>{if(!y){j("provider"===e?t:e),C(null);try{let r=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),s=await r.json();C(s)}catch(e){C({error:"Test request failed"})}finally{j(null)}}},w=r.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})),A=r.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"}));return l?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"OAuth Providers"}),(0,s.jsxs)("button",{onClick:()=>T("oauth"),disabled:!!y,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"oauth"===y?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:"Test all OAuth connections",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"oauth"===y?"sync":"play_arrow"}),"oauth"===y?"Testing...":"Test All"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(o.zN).map(([e,t])=>(0,s.jsx)(x,{providerId:e,provider:t,stats:k(e,"oauth")},e))})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"Free Providers"}),(0,s.jsxs)("button",{onClick:()=>T("free"),disabled:!!y,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"free"===y?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:"Test all Free connections",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"free"===y?"sync":"play_arrow"}),"free"===y?"Testing...":"Test All"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(d.IS).map(([e,t])=>(0,s.jsx)(x,{providerId:e,provider:t,stats:k(e,"oauth")},e))})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"API Key Providers"}),(0,s.jsxs)("button",{onClick:()=>T("apikey"),disabled:!!y,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"apikey"===y?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:"Test all API Key connections",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"apikey"===y?"sync":"play_arrow"}),"apikey"===y?"Testing...":"Test All"]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(o.fg).map(([e,t])=>(0,s.jsx)(u,{providerId:e,provider:t,stats:k(e,"apikey")},e))})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"API Key Compatible Providers"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(w.length>0||A.length>0)&&(0,s.jsxs)("button",{onClick:()=>T("compatible"),disabled:!!y,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"compatible"===y?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:"Test all Compatible connections",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"compatible"===y?"sync":"play_arrow"}),"compatible"===y?"Testing...":"Test All"]}),(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>v(!0),children:"Add Anthropic Compatible"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>m(!0),className:"!bg-white !text-black hover:!bg-gray-100",children:"Add OpenAI Compatible"})]})]}),0===w.length&&0===A.length?(0,s.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"extension"}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:"No compatible providers added yet"}),(0,s.jsx)("p",{className:"text-text-muted text-xs mt-1",children:"Use the buttons above to add OpenAI or Anthropic compatible endpoints"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...w,...A].map(e=>(0,s.jsx)(u,{providerId:e.id,provider:e,stats:k(e.id,"apikey")},e.id))})]}),(0,s.jsx)(h,{isOpen:p,onClose:()=>m(!1),onCreated:e=>{i(t=>[...t,e]),m(!1)}}),(0,s.jsx)(b,{isOpen:g,onClose:()=>v(!1),onCreated:e=>{i(t=>[...t,e]),v(!1)}}),N&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[10vh]",onClick:()=>C(null),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"relative bg-bg-primary border border-border rounded-xl w-full max-w-[600px] max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-bg-primary/95 backdrop-blur-sm rounded-t-xl",children:[(0,s.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,s.jsx)("button",{onClick:()=>C(null),className:"p-1 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,s.jsx)("div",{className:"p-5",children:(0,s.jsx)(f,{results:N})})]})]})]})}function x({providerId:e,provider:t,stats:r}){let{connected:l,error:o,errorCode:d,errorTime:m}=r,[x,u]=(0,a.useState)(!1);return(0,s.jsx)(c,{href:`/dashboard/providers/${e}`,className:"group",children:(0,s.jsx)(n.Zp,{padding:"xs",className:"h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color}15`},children:x?(0,s.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,s.jsx)(i.default,{src:`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",sizes:"32px",onError:()=>u(!0)})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold",children:t.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:[p(l,o,d),m&&(0,s.jsxs)("span",{className:"text-text-muted",children:["• ",m]})]})]})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})})})}function u({providerId:e,provider:t,stats:r}){let{connected:l,error:o,errorCode:m,errorTime:x}=r,u=e.startsWith(d.JH),h=e.startsWith(d.DI),[b,f]=(0,a.useState)(!1);return(0,s.jsx)(c,{href:`/dashboard/providers/${e}`,className:"group",children:(0,s.jsx)(n.Zp,{padding:"xs",className:"h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color}15`},children:b?(0,s.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,s.jsx)(i.default,{src:u?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":h?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",sizes:"30px",onError:()=>f(!0)})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold",children:t.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:[p(l,o,m),u&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),h&&(0,s.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,s.jsxs)("span",{className:"text-text-muted",children:["• ",x]})]})]})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})})})}function h({isOpen:e,onClose:t,onCreated:r}){let[i,l]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(!1),[u,h]=(0,a.useState)(null);(0,a.useEffect)(()=>{l(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[i.apiType]);let b=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,apiType:i.apiType,baseUrl:i.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(r(t.node),l({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),p(""),h(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},f=async()=>{x(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:i.baseUrl,apiKey:c,type:"openai-compatible"})}),t=await e.json();h(t.valid?"success":"failed")}catch{h("failed")}finally{x(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:i.name,onChange:e=>l({...i,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:i.prefix,onChange:e=>l({...i,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,s.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:i.apiType,onChange:e=>l({...i,apiType:e.target.value})}),(0,s.jsx)(n.pd,{label:"Base URL",value:i.baseUrl,onChange:e=>l({...i,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(n.$n,{onClick:f,disabled:!c||m||!i.baseUrl.trim(),variant:"secondary",children:m?"Checking...":"Check"})})]}),u&&(0,s.jsx)(n.Ex,{variant:"success"===u?"success":"error",children:"success"===u?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:b,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function b({isOpen:e,onClose:t,onCreated:r}){let[i,l]=(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)(!1),[u,h]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(h(null),p(""))},[e]);let b=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,baseUrl:i.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(r(t.node),l({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),h(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},f=async()=>{x(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:i.baseUrl,apiKey:c,type:"anthropic-compatible"})}),t=await e.json();h(t.valid?"success":"failed")}catch{h("failed")}finally{x(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(n.pd,{label:"Name",value:i.name,onChange:e=>l({...i,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,s.jsx)(n.pd,{label:"Prefix",value:i.prefix,onChange:e=>l({...i,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,s.jsx)(n.pd,{label:"Base URL",value:i.baseUrl,onChange:e=>l({...i,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,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(n.$n,{onClick:f,disabled:!c||m||!i.baseUrl.trim(),variant:"secondary",children:m?"Checking...":"Check"})})]}),u&&(0,s.jsx)(n.Ex,{variant:"success"===u?"success":"error",children:"success"===u?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:b,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,s.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function f({results:e}){if(e.error&&!e.results)return(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,s.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:r}=e,a=e.results||[];return(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[t&&(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs mb-1",children:[(0,s.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[r]||r," Test"]}),(0,s.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,s.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,s.jsxs)("span",{className:"text-text-muted ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs px-3 py-2 rounded-lg bg-black/[0.03] dark:bg-white/[0.03]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("span",{className:"font-medium",children:e.connectionName}),(0,s.jsxs)("span",{className:"text-text-muted ml-1.5",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`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,s.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}x.propTypes={providerId:l.string.isRequired,provider:l.shape({id:l.string.isRequired,name:l.string.isRequired,color:l.string,textIcon:l.string}).isRequired,stats:l.shape({connected:l.number,error:l.number,errorCode:l.string,errorTime:l.string}).isRequired},u.propTypes={providerId:l.string.isRequired,provider:l.shape({id:l.string.isRequired,name:l.string.isRequired,color:l.string,textIcon:l.string,apiType:l.string}).isRequired,stats:l.shape({connected:l.number,error:l.number,errorCode:l.string,errorTime:l.string}).isRequired},h.propTypes={isOpen:l.bool.isRequired,onClose:l.func.isRequired,onCreated:l.func.isRequired},b.propTypes={isOpen:l.bool.isRequired,onClose:l.func.isRequired,onCreated:l.func.isRequired},f.propTypes={results:l.shape({mode:l.string,results:l.array,summary:l.shape({total:l.number,passed:l.number,failed:l.number}),error:l.string}).isRequired}},96105:(e,t,r)=>{Promise.resolve().then(r.bind(r,11200))}},e=>{e.O(0,[8500,600,8013,7896,1525,8441,3794,7358],()=>e(e.s=96105)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{17618:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>$});var a=s(95155),l=s(12115),r=s(61592),i=s(81172),n=s(71525);function d(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,d]=(0,l.useState)(!1),[c,o]=(0,l.useState)({type:"",message:""}),[m,x]=(0,l.useState)(null),[u,p]=(0,l.useState)(null),[h,b]=(0,l.useState)(!1),[g,j]=(0,l.useState)({type:"",message:""}),[f,v]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),y=async()=>{r(!0);try{let e=await fetch("/api/db-backups"),s=await e.json();t(s.backups||[])}catch(e){console.error("Failed to fetch backups:",e)}finally{r(!1)}},N=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();v(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},w=async()=>{b(!0),j({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?j({type:"success",message:`Backup created: ${t.filename}`}):j({type:"info",message:t.message||"No changes since last backup"}),await N(),i&&await y()):j({type:"error",message:t.error||"Backup failed"})}catch{j({type:"error",message:"An error occurred"})}finally{b(!1)}},k=async e=>{x(e),o({type:"",message:""});try{let t=await fetch("/api/db-backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupId:e})}),s=await t.json();t.ok?(o({type:"success",message:`Restored! ${s.connectionCount} connections, ${s.nodeCount} nodes, ${s.comboCount} combos, ${s.apiKeyCount} API keys.`}),await y(),await N()):o({type:"error",message:s.error||"Restore failed"})}catch{o({type:"error",message:"An error occurred during restore"})}finally{x(null),p(null)}};(0,l.useEffect)(()=>{N()},[]);let C=e=>e&&0!==e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"0 B";return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"System & Storage"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"All data stored locally on your machine"})]}),(0,a.jsx)(n.Ex,{variant:"success",size:"sm",children:f.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:"Database Path"}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:f.dbPath||"~/.omniroute/storage.sqlite"})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:"Database Size"}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:C(f.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"schedule"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Last Backup"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:f.lastBackupAt?`${new Date(f.lastBackupAt).toLocaleString("pt-BR")} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/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 a=Math.floor(s/24);return`${a}d ago`})(f.lastBackupAt)})`:"No backup yet"})]})]}),(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:w,loading:h,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),"Backup Now"]})]}),g.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===g.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===g.type?"bg-blue-500/10 text-blue-500 border border-blue-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===g.type?"check_circle":"info"===g.type?"info":"error"}),g.message]})}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500","aria-hidden":"true",children:"restore"}),(0,a.jsx)("p",{className:"font-medium",children:"Backup & Restore"})]}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:()=>{d(!i),i||0!==e.length||y()},children:i?"Hide":"View Backups"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Database snapshots are created automatically before restore and every 15 minutes when data changes. Retention: 24 hourly + 30 daily backups with smart rotation."}),c.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===c.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===c.type?"check_circle":"error"}),c.message]})}),i&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px] mr-2","aria-hidden":"true",children:"progress_activity"}),"Loading backups..."]}):0===e.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"folder_off"}),"No backups available yet. Backups will be created automatically when data changes."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.length," backup(s) available"]}),(0,a.jsxs)("button",{onClick:y,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"}),"Refresh"]})]}),e.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-border/50 hover:border-border transition-colors",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"description"}),(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:new Date(e.createdAt).toLocaleString("pt-BR")}),(0,a.jsx)(n.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:e.reason})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsxs)("span",{children:[e.connectionCount," connection(s)"]}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:C(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:u===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:"Confirm?"}),(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:()=>k(e.id),loading:m===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:"Yes"}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:()=>p(null),children:"No"})]}):(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:()=>p(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),"Restore"]})})]},e.id))]})})]})]})}let c=[{value:"disabled",label:"Disabled",icon:"block"},{value:"blacklist",label:"Blacklist",icon:"do_not_disturb"},{value:"whitelist",label:"Whitelist",icon:"verified_user"},{value:"whitelist-priority",label:"WL Priority",icon:"priority_high"}];function o(){let[e,t]=(0,l.useState)({enabled:!1,mode:"blacklist",blacklist:[],whitelist:[],tempBans:[]}),[s,r]=(0,l.useState)(!0),[i,d]=(0,l.useState)(""),[o,m]=(0,l.useState)("blacklist");(0,l.useEffect)(()=>{x()},[]);let x=async()=>{try{let e=await fetch("/api/settings/ip-filter");e.ok&&t(await e.json())}catch{}finally{r(!1)}},u=async e=>{try{let s=await fetch("/api/settings/ip-filter",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});s.ok&&t(await s.json())}catch{}},p=()=>{i.trim()&&(u({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),d(""))},h=(e,t)=>{u({["blacklist"===t?"removeBlacklist":"removeWhitelist"]:e})},b=e.enabled?e.mode:"disabled";return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-red-500/10 text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"security"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"IP Access Control"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Block or allow specific IP addresses"})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2 mb-5",children:c.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;"disabled"===(t=e.value)?u({enabled:!1}):u({enabled:!0,mode:t})},disabled:s,className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border text-center transition-all ${b===e.value?"border-red-500/50 bg-red-500/5 ring-1 ring-red-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] ${b===e.value?"text-red-400":"text-text-muted"}`,children:e.icon}),(0,a.jsx)("span",{className:`text-xs font-medium ${b===e.value?"text-red-400":"text-text-muted"}`,children:e.label})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Add IP Address",placeholder:"192.168.1.0/24 or 10.0.*.*",value:i,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&p()})}),(0,a.jsxs)("div",{className:"flex gap-1 pb-[2px]",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&p()},children:"+ Block"}),(0,a.jsx)(n.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&p()},children:"+ Allow"})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Blocked (",e.blacklist.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.blacklist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-red-500/10 text-red-400 border border-red-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>h(e,"blacklist"),className:"hover:text-red-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.whitelist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Allowed (",e.whitelist.length,")"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.whitelist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>h(e,"whitelist"),className:"hover:text-emerald-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.tempBans.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:["Temporary Bans (",e.tempBans.length,")"]}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.tempBans.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted tabular-nums",children:[Math.ceil(e.remainingMs/6e4),"m left"]}),(0,a.jsx)("button",{onClick:()=>u({removeBan:e.ip}),className:"text-text-muted hover:text-orange-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]},e.ip))})]})]})]})}function m(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,d]=(0,l.useState)({current:"",new:"",confirm:""}),[c,m]=(0,l.useState)({type:"",message:""}),[x,u]=(0,l.useState)(!1);(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let p=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&t(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},h=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:"Passwords do not match"});u(!0),m({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:i.current,newPassword:i.new})}),t=await e.json();e.ok?(m({type:"success",message:"Password updated successfully"}),d({current:"",new:"",confirm:""})):m({type:"error",message:t.error||"Failed to update password"})}catch{m({type:"error",message:"An error occurred"})}finally{u(!1)}};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(n.lM,{checked:!0===e.requireLogin,onChange:()=>p(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:h,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(n.pd,{label:"Current Password",type:"password",placeholder:"Enter current password",value:i.current,onChange:e=>d({...i,current:e.target.value}),required:!0}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)(n.pd,{label:"New Password",type:"password",placeholder:"Enter new password",value:i.new,onChange:e=>d({...i,new:e.target.value}),required:!0}),(0,a.jsx)(n.pd,{label:"Confirm New Password",type:"password",placeholder:"Confirm new password",value:i.confirm,onChange:e=>d({...i,confirm:e.target.value}),required:!0})]}),c.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===c.type?"text-red-500":"text-green-500"}`,children:c.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(n.$n,{type:"submit",variant:"primary",loading:x,children:e.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsx)(o,{})]})}let x=[{value:"fill-first",label:"Fill First",desc:"Use accounts in priority order",icon:"vertical_align_top"},{value:"round-robin",label:"Round Robin",desc:"Cycle through all accounts",icon:"loop"},{value:"p2c",label:"P2C",desc:"Pick 2 random, use the healthier one",icon:"balance"}];function u(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,d]=(0,l.useState)([]),[c,o]=(0,l.useState)(""),[m,u]=(0,l.useState)("");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),d(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let p=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&t(t=>({...t,...e}))}catch(e){console.error("Failed to update settings:",e)}},h=async()=>{if(!c.trim()||!m.trim())return;let e=[...i,{pattern:c.trim(),target:m.trim()}];await p({wildcardAliases:e}),d(e),o(""),u("")},b=async e=>{let t=i.filter((t,s)=>s!==e);await p({wildcardAliases:t}),d(t)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 mb-4",children:x.map(t=>(0,a.jsxs)("button",{onClick:()=>p({fallbackStrategy:t.value}),disabled:s,className:`flex flex-col items-center gap-2 p-4 rounded-lg border text-center transition-all ${e.fallbackStrategy===t.value?"border-blue-500/50 bg-blue-500/5 ring-1 ring-blue-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${e.fallbackStrategy===t.value?"text-blue-400":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.fallbackStrategy===t.value?"text-blue-400":""}`,children:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:t.desc})]})]},t.value))}),"round-robin"===e.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-border/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(n.pd,{type:"number",min:"1",max:"10",value:e.stickyRoundRobinLimit||3,onChange:e=>p({stickyRoundRobinLimit:parseInt(e.target.value)}),disabled:s,className:"w-20 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:["round-robin"===e.fallbackStrategy&&`Distributing requests across accounts with ${e.stickyRoundRobinLimit||3} calls per account.`,"fill-first"===e.fallbackStrategy&&"Using accounts in priority order (Fill First).","p2c"===e.fallbackStrategy&&"Power of Two Choices: picks 2 random accounts and routes to the healthier one."]})]}),(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"alt_route"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Model Aliases"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Wildcard patterns to remap model names • Use * and ?"})]})]}),i.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-1.5 mb-4",children:i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400",children:e.pattern}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("span",{className:"font-mono text-text-main",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>b(t),className:"text-text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,a.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Pattern",placeholder:"claude-sonnet-*",value:c,onChange:e=>o(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.pd,{label:"Target Model",placeholder:"claude-sonnet-4-20250514",value:m,onChange:e=>u(e.target.value)})}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:h,className:"mb-[2px]",children:"+ Add"})]})]})]})}function p(){let[e,t]=(0,l.useState)({strategy:"priority",maxRetries:1,retryDelayMs:2e3,timeoutMs:12e4,healthCheckEnabled:!0,healthCheckTimeoutMs:3e3,maxComboDepth:3,trackMetrics:!0}),[s,i]=(0,l.useState)({}),[d,c]=(0,l.useState)(""),[o,m]=(0,l.useState)(!1);(0,l.useEffect)(()=>{fetch("/api/settings/combo-defaults").then(e=>e.json()).then(e=>{e.comboDefaults&&t(e.comboDefaults),e.providerOverrides&&i(e.providerOverrides)}).catch(e=>console.error("Failed to fetch combo defaults:",e))},[]);let x=async()=>{m(!0);try{await fetch("/api/settings/combo-defaults",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboDefaults:e,providerOverrides:s})})}catch(e){console.error("Failed to save combo defaults:",e)}finally{m(!1)}},u=()=>{let e=d.trim().toLowerCase();e&&!s[e]&&(i(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),c(""))};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"tune"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Combo Defaults"}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:"Global combo configuration"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Default Strategy"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applied to new combos without explicit strategy"})]}),(0,a.jsx)("div",{role:"tablist","aria-label":"Combo strategy",className:"inline-flex p-0.5 rounded-md bg-black/5 dark:bg-white/5",children:["priority","weighted","round-robin"].map(s=>(0,a.jsx)("button",{role:"tab","aria-selected":e.strategy===s,onClick:()=>t(e=>({...e,strategy:s})),className:(0,r.cn)("px-3 py-1 rounded text-xs font-medium transition-all capitalize",e.strategy===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:"round-robin"===s?"Round-Robin":s},s))})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[{key:"maxRetries",label:"Max Retries",min:0,max:5},{key:"retryDelayMs",label:"Retry Delay (ms)",min:500,max:1e4,step:500},{key:"timeoutMs",label:"Timeout (ms)",min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:"Max Nesting Depth",min:1,max:10}].map(({key:s,label:l,min:r,max:i,step:d})=>(0,a.jsx)(n.pd,{label:l,type:"number",min:r,max:i,step:d||1,value:e[s]??"",onChange:e=>t(t=>({...t,[s]:parseInt(e.target.value)||0})),className:"text-sm"},s))}),"round-robin"===e.strategy&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[(0,a.jsx)(n.pd,{label:"Concurrency / Model",type:"number",min:1,max:20,value:e.concurrencyPerModel??"",placeholder:"3",onChange:e=>t(t=>({...t,concurrencyPerModel:parseInt(e.target.value)||0})),className:"text-sm"}),(0,a.jsx)(n.pd,{label:"Queue Timeout (ms)",type:"number",min:1e3,max:12e4,step:1e3,value:e.queueTimeoutMs??"",placeholder:"30000",onChange:e=>t(t=>({...t,queueTimeoutMs:parseInt(e.target.value)||0})),className:"text-sm"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Health Check"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Pre-check provider availability"})]}),(0,a.jsx)(n.lM,{checked:!1!==e.healthCheckEnabled,onChange:()=>t(e=>({...e,healthCheckEnabled:!e.healthCheckEnabled}))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Track Metrics"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Record per-combo request metrics"})]}),(0,a.jsx)(n.lM,{checked:!1!==e.trackMetrics,onChange:()=>t(e=>({...e,trackMetrics:!e.trackMetrics}))})]})]}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsx)("p",{className:"font-medium text-sm mb-2",children:"Provider Overrides"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Override timeout and retries per provider. Provider settings override global defaults."}),Object.entries(s).map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs font-mono font-medium min-w-[80px]",children:e}),(0,a.jsx)(n.pd,{type:"number",min:"0",max:"5",value:t.maxRetries??1,onChange:t=>i(s=>({...s,[e]:{...s[e],maxRetries:parseInt(t.target.value)||0}})),className:"text-xs w-16","aria-label":`${e} max retries`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"retries"}),(0,a.jsx)(n.pd,{type:"number",min:"5000",max:"300000",step:"5000",value:t.timeoutMs??12e4,onChange:t=>i(s=>({...s,[e]:{...s[e],timeoutMs:parseInt(t.target.value)||12e4}})),className:"text-xs w-24","aria-label":`${e} timeout ms`}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"ms"}),(0,a.jsx)("button",{onClick:()=>{i(t=>{let s={...t};return delete s[e],s})},className:"ml-auto text-red-400 hover:text-red-500 transition-colors","aria-label":`Remove ${e} override`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]},e)),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)(n.pd,{type:"text",placeholder:"e.g. google, openai...",value:d,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&u(),className:"text-xs flex-1","aria-label":"New provider name"}),(0,a.jsx)(n.$n,{variant:"outline",size:"sm",onClick:u,disabled:!d.trim(),children:"Add"})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:x,loading:o,children:"Save Combo Defaults"})})]})]})}function h(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=async()=>{try{let e=await fetch("/api/settings/proxy?level=global");if(e.ok){let t=await e.json();r(t.proxy||null)}}catch{}};return(0,l.useEffect)(()=>{i()},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"vpn_lock"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Global Proxy"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Configure a global outbound proxy for all API calls. Individual providers, combos, and keys can override this."}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded text-xs font-bold uppercase bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:[s.type,"://",s.host,":",s.port]})}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"No global proxy configured"}),(0,a.jsx)(n.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{i(),t(!0)},children:s?"Edit":"Configure"})]})]})}),(0,a.jsx)(n.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:"Global",onSaved:i})]})}var b=s(2946);function g(){let{theme:e,setTheme:t,isDark:s}=(0,b.D)();return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Appearance"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Dark Mode"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Switch between light and dark themes"})]}),(0,a.jsx)(n.lM,{checked:s,onChange:()=>t(s?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{role:"tablist","aria-label":"Theme selection",className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s,onClick:()=>t(s),className:(0,r.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize",children:s})]},s))})})]})]})}let j=[{value:"passthrough",label:"Passthrough",desc:"No changes — client controls thinking budget",icon:"arrow_forward"},{value:"auto",label:"Auto",desc:"Strip all thinking config — let provider decide",icon:"auto_awesome"},{value:"custom",label:"Custom",desc:"Set a fixed token budget for all requests",icon:"tune"},{value:"adaptive",label:"Adaptive",desc:"Scale budget based on request complexity",icon:"trending_up"}],f=[{value:"none",label:"None (0 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (10K tokens)"},{value:"high",label:"High (128K tokens)"}];function v(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,d]=(0,l.useState)(!1),[c,o]=(0,l.useState)("");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let m=async s=>{let a={...e,...s};t(a),d(!0),o("");try{(await fetch("/api/settings/thinking-budget",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok?(o("saved"),setTimeout(()=>o(""),2e3)):o("error")}catch{o("error")}finally{d(!1)}};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"psychology"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Thinking Budget"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Control AI reasoning token usage across all requests"})]}),"saved"===c&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," Saved"]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 mb-5",children:j.map(t=>(0,a.jsxs)("button",{onClick:()=>m({mode:t.value}),disabled:s||i,className:`flex items-start gap-3 p-3 rounded-lg border text-left transition-all ${e.mode===t.value?"border-violet-500/50 bg-violet-500/5 ring-1 ring-violet-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] mt-0.5 ${e.mode===t.value?"text-violet-500":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.mode===t.value?"text-violet-400":""}`,children:t.label}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:t.desc})]})]},t.value))}),"custom"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:"Token Budget"}),(0,a.jsxs)("span",{className:"text-sm font-mono tabular-nums text-violet-400",children:[e.customBudget.toLocaleString()," tokens"]})]}),(0,a.jsx)("input",{type:"range",min:"0",max:"131072",step:"1024",value:e.customBudget,onChange:e=>m({customBudget:parseInt(e.target.value)}),className:"w-full accent-violet-500"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-text-muted mt-1",children:[(0,a.jsx)("span",{children:"Off"}),(0,a.jsx)("span",{children:"1K"}),(0,a.jsx)("span",{children:"10K"}),(0,a.jsx)("span",{children:"64K"}),(0,a.jsx)("span",{children:"128K"})]})]}),"adaptive"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:"Base Effort Level"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Adaptive mode scales from this base level based on message count, tool usage, and prompt length."}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-2",children:f.map(t=>(0,a.jsx)("button",{onClick:()=>m({effortLevel:t.value}),disabled:s||i,className:`px-3 py-2 rounded-lg text-xs font-medium border transition-all ${e.effortLevel===t.value?"border-violet-500/50 bg-violet-500/10 text-violet-400":"border-border/50 text-text-muted hover:border-border"}`,children:t.value.charAt(0).toUpperCase()+t.value.slice(1)},t.value))})]})]})}function y(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,d]=(0,l.useState)(""),[c,o]=(0,l.useState)(null);(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let m=async s=>{let a={...e,...s};t(a),d("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(d("saved"),setTimeout(()=>d(""),2e3))}catch{d("error")}};return(0,a.jsxs)(n.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"edit_note"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Global System Prompt"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Injected into all requests at proxy level"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["saved"===i&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," Saved"]}),(0,a.jsx)(n.lM,{checked:e.enabled,onChange:()=>m({enabled:!e.enabled}),disabled:s})]})]}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("textarea",{value:e.prompt,onChange:e=>{var s;return s=e.target.value,void(t(e=>({...e,prompt:s})),c&&clearTimeout(c),o(setTimeout(()=>{m({prompt:s})},800)))},placeholder:"Enter system prompt to inject into all requests...",rows:5,className:"w-full px-4 py-3 rounded-lg border border-border/50 bg-surface/30 text-sm placeholder:text-text-muted/50 resize-y min-h-[120px] focus:outline-none focus:ring-1 focus:ring-amber-500/30 focus:border-amber-500/50 transition-colors",disabled:s}),(0,a.jsxs)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:[e.prompt.length," chars"]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted/70 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),"This prompt is prepended to the system message of every request. Use for global instructions, safety guidelines, or response formatting rules. Send ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-surface/50",children:"_skipSystemPrompt: true"})," in a request to bypass."]})]})]})}let N=["input","output","cached","reasoning","cache_creation"],w={input:"Input",output:"Output",cached:"Cached",reasoning:"Reasoning",cache_creation:"Cache Write"};function k(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)({}),[i,d]=(0,l.useState)(!0),[c,o]=(0,l.useState)(!1),[m,x]=(0,l.useState)(""),[u,p]=(0,l.useState)(null),[h,b]=(0,l.useState)(new Set),[g,j]=(0,l.useState)(""),[f,v]=(0,l.useState)(new Set);(0,l.useEffect)(()=>{y()},[]);let y=async()=>{d(!0);try{let[e,s]=await Promise.all([fetch("/api/pricing/models"),fetch("/api/pricing")]);e.ok&&t(await e.json()),s.ok&&r(await s.json())}catch(e){console.error("Failed to load pricing data:",e)}finally{d(!1)}},N=(0,l.useMemo)(()=>Object.entries(e).map(([e,t])=>({alias:e,...t,pricedModels:s[e]?Object.keys(s[e]).length:0})).sort((e,t)=>t.modelCount-e.modelCount),[e,s]),w=(0,l.useMemo)(()=>{if(!g.trim())return N;let e=g.toLowerCase();return N.filter(t=>t.alias.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.models.some(t=>t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)))},[N,g]),k=(0,l.useMemo)(()=>{let e=N.reduce((e,t)=>e+t.modelCount,0),t=Object.values(s).reduce((e,t)=>e+Object.keys(t).length,0);return{providers:N.length,totalModels:e,pricedCount:t}},[N,s]),S=(0,l.useCallback)(e=>{b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),P=(0,l.useCallback)((e,t,s,a)=>{let l=parseFloat(a);isNaN(l)||l<0||(r(a=>{let r={...a};return r[e]||(r[e]={}),r[e][t]||(r[e][t]={input:0,output:0,cached:0,reasoning:0,cache_creation:0}),r[e][t]={...r[e][t],[s]:l},r}),v(t=>new Set(t).add(e)))},[]),$=(0,l.useCallback)(async e=>{o(!0),x("");try{let t=s[e]||{},a=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})});if(a.ok)x(`✅ ${e.toUpperCase()} saved`),v(t=>{let s=new Set(t);return s.delete(e),s}),setTimeout(()=>x(""),3e3);else{let e=await a.json();x(`❌ Error: ${e.error}`)}}catch(e){x(`❌ Save failed: ${e.message}`)}finally{o(!1)}},[s]),M=(0,l.useCallback)(async e=>{if(confirm(`Reset all pricing for ${e.toUpperCase()} to defaults?`))try{let t=await fetch(`/api/pricing?provider=${e}`,{method:"DELETE"});if(t.ok){let s=await t.json();r(s),x(`🔄 ${e.toUpperCase()} reset to defaults`),v(t=>{let s=new Set(t);return s.delete(e),s}),setTimeout(()=>x(""),3e3)}}catch(e){x(`❌ Reset failed: ${e.message}`)}},[]),T=(0,l.useCallback)(e=>{p(t=>t===e?null:e)},[]),A=(0,l.useMemo)(()=>u?w.filter(e=>e.alias===u):w,[w,u]);return i?(0,a.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,a.jsx)("div",{className:"text-text-muted animate-pulse",children:"Loading pricing data..."})}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between flex-wrap gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-bold",children:"Model Pricing"}),(0,a.jsxs)("p",{className:"text-text-muted text-sm mt-1",children:["Configure cost rates per model • All rates in"," ",(0,a.jsx)("strong",{children:"$/1M tokens"})]})]}),(0,a.jsxs)("div",{className:"flex gap-3 text-sm",children:[(0,a.jsxs)("div",{className:"bg-bg-subtle rounded-lg px-3 py-2 text-center",children:[(0,a.jsx)("div",{className:"text-text-muted text-xs font-semibold",children:"Providers"}),(0,a.jsx)("div",{className:"text-lg font-bold",children:k.providers})]}),(0,a.jsxs)("div",{className:"bg-bg-subtle rounded-lg px-3 py-2 text-center",children:[(0,a.jsx)("div",{className:"text-text-muted text-xs font-semibold",children:"Registry"}),(0,a.jsx)("div",{className:"text-lg font-bold",children:k.totalModels})]}),(0,a.jsxs)("div",{className:"bg-bg-subtle rounded-lg px-3 py-2 text-center",children:[(0,a.jsx)("div",{className:"text-text-muted text-xs font-semibold",children:"Priced"}),(0,a.jsx)("div",{className:"text-lg font-bold text-success",children:k.pricedCount})]})]})]}),m&&(0,a.jsx)("div",{className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm",children:m}),(0,a.jsxs)("div",{className:"flex gap-3 items-center flex-wrap",children:[(0,a.jsxs)("div",{className:"relative flex-1 min-w-[200px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined absolute left-3 top-1/2 -translate-y-1/2 text-text-muted text-lg",children:"search"}),(0,a.jsx)("input",{type:"text",placeholder:"Search providers or models...",value:g,onChange:e=>j(e.target.value),className:"w-full pl-10 pr-3 py-2 bg-bg-base border border-border rounded-lg focus:outline-none focus:border-primary text-sm"})]}),u&&(0,a.jsxs)("button",{onClick:()=>p(null),className:"px-3 py-2 text-xs bg-primary/10 text-primary border border-primary/20 rounded-lg hover:bg-primary/20 transition-colors flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"}),u.toUpperCase()," — Show All"]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:N.map(e=>(0,a.jsxs)("button",{onClick:()=>T(e.alias),className:`px-2.5 py-1 rounded-md text-xs font-medium transition-all ${u===e.alias?"bg-primary text-white shadow-sm":f.has(e.alias)?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-bg-subtle text-text-muted hover:bg-bg-hover border border-transparent"}`,children:[e.alias.toUpperCase()," ",(0,a.jsxs)("span",{className:"opacity-60",children:["(",e.modelCount,")"]})]},e.alias))}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[A.map(e=>(0,a.jsx)(C,{provider:e,pricingData:s[e.alias]||{},isExpanded:h.has(e.alias),isEdited:f.has(e.alias),onToggle:()=>S(e.alias),onPricingChange:(t,s,a)=>P(e.alias,t,s,a),onSave:()=>$(e.alias),onReset:()=>M(e.alias),saving:c},e.alias)),0===A.length&&(0,a.jsx)("div",{className:"text-center py-12 text-text-muted",children:"No providers match your search."})]}),(0,a.jsxs)(n.Zp,{className:"p-4 mt-2",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm align-middle mr-1",children:"info"}),"How Pricing Works"]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted space-y-1",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Input"}),": tokens sent to the model •"," ",(0,a.jsx)("strong",{children:"Output"}),": tokens generated •"," ",(0,a.jsx)("strong",{children:"Cached"}),": reused input (~50% of input rate) •"," ",(0,a.jsx)("strong",{children:"Reasoning"}),": thinking tokens (falls back to Output) •"," ",(0,a.jsx)("strong",{children:"Cache Write"}),": creating cache entries (falls back to Input)"]}),(0,a.jsx)("p",{children:"Cost = (input \xd7 input_rate) + (output \xd7 output_rate) + (cached \xd7 cached_rate) per million tokens."})]})]})]})}function C({provider:e,pricingData:t,isExpanded:s,isEdited:l,onToggle:r,onPricingChange:i,onSave:n,onReset:d,saving:c}){let o=Object.keys(t).length,m="oauth"===e.authType?"OAuth":"apikey"===e.authType?"API Key":e.authType;return(0,a.jsxs)("div",{className:`border rounded-lg overflow-hidden transition-colors ${l?"border-yellow-500/40 bg-yellow-500/5":"border-border"}`,children:[(0,a.jsxs)("button",{onClick:r,className:"w-full flex items-center justify-between px-4 py-3 hover:bg-bg-hover/50 transition-colors text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg transition-transform ${s?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold text-sm",children:e.id.charAt(0).toUpperCase()+e.id.slice(1)}),(0,a.jsxs)("span",{className:"text-text-muted text-xs ml-2",children:["(",e.alias.toUpperCase(),")"]})]}),(0,a.jsx)("span",{className:"px-1.5 py-0.5 bg-bg-subtle text-text-muted text-[10px] rounded uppercase font-semibold",children:m}),(0,a.jsx)("span",{className:"px-1.5 py-0.5 bg-bg-subtle text-text-muted text-[10px] rounded uppercase font-semibold",children:e.format})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,a.jsx)("span",{className:"text-yellow-500 text-xs font-medium",children:"unsaved"}),(0,a.jsxs)("span",{className:"text-text-muted text-xs",children:[o,"/",e.modelCount," priced"]}),(0,a.jsx)("div",{className:"w-16 h-1.5 bg-bg-subtle rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${e.modelCount>0?Math.round(o/e.modelCount*100):0}%`}})})]})]}),s&&(0,a.jsxs)("div",{className:"border-t border-border",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 bg-bg-subtle/50",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.modelCount," models •"," ",o," with pricing configured"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),d()},className:"px-2.5 py-1 text-[11px] text-red-400 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",children:"Reset Defaults"}),(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},disabled:c||!l,className:"px-2.5 py-1 text-[11px] bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-40",children:c?"Saving...":"Save Provider"})]})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"text-[11px] text-text-muted uppercase bg-bg-subtle/30",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-2 text-left font-semibold",children:"Model"}),N.map(e=>(0,a.jsx)("th",{className:"px-2 py-2 text-right font-semibold w-24",children:w[e]},e))]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border/50",children:e.models.map(e=>(0,a.jsx)(S,{model:e,pricing:t[e.id],onPricingChange:(t,s)=>i(e.id,t,s)},e.id))})]})})]})]})}function S({model:e,pricing:t,onPricingChange:s}){let l=t&&Object.values(t).some(e=>e>0);return(0,a.jsxs)("tr",{className:"hover:bg-bg-hover/30 group",children:[(0,a.jsx)("td",{className:"px-4 py-1.5",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${l?"bg-success":"bg-text-muted/30"}`}),(0,a.jsx)("span",{className:"font-medium text-xs",children:e.name}),e.custom&&(0,a.jsx)("span",{className:"px-1 py-0.5 text-[8px] font-bold bg-blue-500/15 text-blue-400 border border-blue-500/20 rounded uppercase",children:"custom"}),(0,a.jsx)("span",{className:"text-text-muted text-[10px] opacity-0 group-hover:opacity-100 transition-opacity",children:e.id})]})}),N.map(e=>(0,a.jsx)("td",{className:"px-2 py-1.5",children:(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:t?.[e]||0,onChange:t=>s(e,t.target.value),className:"w-full px-2 py-1 text-right text-xs bg-transparent border border-transparent hover:border-border focus:border-primary focus:bg-bg-base rounded transition-colors outline-none tabular-nums"})},e))]})}let P=[{id:"general",label:"General",icon:"settings"},{id:"ai",label:"AI",icon:"smart_toy"},{id:"security",label:"Security",icon:"shield"},{id:"routing",label:"Routing",icon:"route"},{id:"pricing",label:"Pricing",icon:"payments"},{id:"advanced",label:"Advanced",icon:"tune"}];function $(){let[e,t]=(0,l.useState)("general");return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{role:"tablist","aria-label":"Settings sections",className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 self-start",children:P.map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s.id,tabIndex:e===s.id?0:-1,onClick:()=>t(s.id),className:(0,r.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",e===s.id?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:s.icon}),(0,a.jsx)("span",{className:"hidden sm:inline",children:s.label})]},s.id))}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":P.find(t=>t.id===e)?.label,children:["general"===e&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(d,{}),(0,a.jsx)(g,{})]})}),"ai"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(v,{}),(0,a.jsx)(y,{})]}),"security"===e&&(0,a.jsx)(m,{}),"routing"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(u,{}),(0,a.jsx)(p,{})]}),"pricing"===e&&(0,a.jsx)(k,{}),"advanced"===e&&(0,a.jsx)(h,{})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[i.vQ.name," v",i.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode — All data stored on your machine"})]})]})})}},21680:(e,t,s)=>{Promise.resolve().then(s.bind(s,17618))}},e=>{e.O(0,[8500,600,8013,7896,1525,8441,3794,7358],()=>e(e.s=21680)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{25852:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var a=s(95155),l=s(12115),r=s(71525),n=s(5772),i=s(80237);function c(e){let t="string"==typeof e?e.trim():"";if(!t)return{key:"unknown",label:"Unknown",variant:"default",rank:0,raw:null};let s=t.toUpperCase();return s.includes("ENTERPRISE")||s.includes("CORP")||s.includes("ORG")?{key:"enterprise",label:"Enterprise",variant:"info",rank:6,raw:t}:s.includes("BUSINESS")||s.includes("TEAM")||s.includes("STANDARD")?{key:"business",label:"Business",variant:"warning",rank:5,raw:t}:s.includes("ULTRA")?{key:"ultra",label:"Ultra",variant:"success",rank:4,raw:t}:s.includes("PRO")||s.includes("PLUS")||s.includes("PREMIUM")||s.includes("PAID")?{key:"pro",label:"Pro",variant:"primary",rank:3,raw:t}:s.includes("FREE")||s.includes("INDIVIDUAL")||s.includes("BASIC")||s.includes("TRIAL")||s.includes("LEGACY")?{key:"free",label:"Free",variant:"default",rank:1,raw:t}:{key:"unknown",label:t.toLowerCase().split(/[\s_-]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")||"Unknown",variant:"default",rank:0,raw:t}}var o=s(67578),d=s(23375),x=s(78076),u=s(64745);let m={antigravity:{label:"Antigravity",color:"#F59E0B"},github:{label:"GitHub Copilot",color:"#333"},kiro:{label:"Kiro AI",color:"#FF6B35"},codex:{label:"OpenAI Codex",color:"#10A37F"},claude:{label:"Claude Code",color:"#D97757"}},p=[{key:"all",label:"All"},{key:"enterprise",label:"Enterprise"},{key:"business",label:"Business"},{key:"ultra",label:"Ultra"},{key:"pro",label:"Pro"},{key:"free",label:"Free"},{key:"unknown",label:"Unknown"}];function h(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)({}),[h,f]=(0,l.useState)({}),[b,g]=(0,l.useState)({}),[j,v]=(0,l.useState)(!0),[y,N]=(0,l.useState)(null),[k,w]=(0,l.useState)(!1),[S,A]=(0,l.useState)(120),[C,I]=(0,l.useState)(!0),[E,q]=(0,l.useState)("all"),$=(0,l.useRef)(null),M=(0,l.useRef)(null),P=(0,l.useRef)({}),T=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/providers/client");if(!e.ok)throw Error("Failed");let s=(await e.json()).connections||[];return t(s),s}catch{return t([]),[]}},[]),L=(0,l.useCallback)(async(e,t)=>{let s=Date.now();if(!(s-(P.current[e]||0)<3e4)){P.current[e]=s,f(t=>({...t,[e]:!0})),g(t=>({...t,[e]:null}));try{let s=await fetch(`/api/usage/${e}`);if(!s.ok){let t=(await s.json().catch(()=>({}))).error||s.statusText;if(404===s.status)return;if(401===s.status)return void r(s=>({...s,[e]:{quotas:[],message:t}}));throw Error(`HTTP ${s.status}: ${t}`)}let a=await s.json(),l=function(e,t){if(!t||"object"!=typeof t)return[];let s=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"claude":t.message?s.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{s.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,i.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));s.sort((t,s)=>{let a=t.modelKey||t.name,l=s.modelKey||s.name;return(e.get(a)??999)-(e.get(l)??999)})}return s}(t,a);r(t=>({...t,[e]:{quotas:l,plan:a.plan||null,message:a.message||null,raw:a}}))}catch(t){g(s=>({...s,[e]:t.message||"Failed to fetch quota"}))}finally{f(t=>({...t,[e]:!1}))}}},[]),R=(0,l.useCallback)(async(e,t)=>{await L(e,t),N(new Date)},[L]),_=(0,l.useCallback)(async()=>{if(!k){w(!0),A(120);try{let e=(await T()).filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType);await Promise.all(e.map(e=>L(e.id,e.provider))),N(new Date)}catch(e){console.error("Error refreshing all:",e)}finally{w(!1)}}},[k,T,L]);(0,l.useEffect)(()=>{(async()=>{I(!0),await _(),I(!1)})()},[]),(0,l.useEffect)(()=>{if(!j){$.current&&clearInterval($.current),M.current&&clearInterval(M.current);return}return $.current=setInterval(_,12e4),M.current=setInterval(()=>{A(e=>e<=1?120:e-1)},1e3),()=>{$.current&&clearInterval($.current),M.current&&clearInterval(M.current)}},[j,_]),(0,l.useEffect)(()=>{let e=()=>{document.hidden?($.current&&clearInterval($.current),M.current&&clearInterval(M.current)):j&&($.current=setInterval(_,12e4),M.current=setInterval(()=>{A(e=>e<=1?120:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[j,_]);let O=(0,l.useMemo)(()=>e.filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType),[e]),F=(0,l.useMemo)(()=>{let e={antigravity:1,github:2,codex:3,claude:4,kiro:5};return[...O].sort((t,s)=>(e[t.provider]||9)-(e[s.provider]||9))},[O]),U=(0,l.useMemo)(()=>{let e={};for(let t of F)e[t.id]=c(s[t.id]?.plan);return e},[F,s]),D=(0,l.useMemo)(()=>{let e={all:F.length,enterprise:0,business:0,ultra:0,pro:0,free:0,unknown:0};for(let t of F){let s=U[t.id]?.key||"unknown";e[s]=(e[s]||0)+1}return e},[F,U]),B=(0,l.useMemo)(()=>"all"===E?F:F.filter(e=>(U[e.id]?.key||"unknown")===E),[F,U,E]);return C?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(x.CardSkeleton,{}),(0,a.jsx)(x.CardSkeleton,{})]}):0===F.length?(0,a.jsx)(o.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] opacity-15",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-main",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-[400px] mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main m-0",children:"Provider Limits"}),(0,a.jsxs)("span",{className:"text-[13px] text-text-muted",children:[B.length," account",1!==B.length?"s":"",B.length!==F.length?` (filtered from ${F.length})`:""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>v(e=>!e),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-white/[0.08] bg-transparent cursor-pointer text-text-main text-[13px]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",style:{color:j?"#22c55e":"var(--text-muted)"},children:j?"toggle_on":"toggle_off"}),"Auto-refresh",j&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["(",S,"s)"]})]}),(0,a.jsxs)("button",{onClick:_,disabled:k,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg bg-white/[0.06] border border-white/10 text-text-main text-[13px] disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${k?"animate-spin":""}`,children:"refresh"}),"Refresh All"]})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:p.map(e=>{if("all"!==e.key&&!D[e.key])return null;let t=E===e.key;return(0,a.jsxs)("button",{onClick:()=>q(e.key),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold cursor-pointer",style:{border:t?"1px solid var(--primary, #f97815)":"1px solid rgba(255,255,255,0.12)",background:t?"rgba(249,120,21,0.14)":"transparent",color:t?"var(--primary, #f97815)":"var(--text-muted)"},children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"opacity-85",children:D[e.key]||0})]},e.key)})}),(0,a.jsxs)("div",{className:"rounded-xl border border-white/[0.06] overflow-hidden bg-black/15",children:[(0,a.jsxs)("div",{className:"items-center px-4 py-2.5 border-b border-white/[0.06] text-[11px] font-semibold uppercase tracking-wider text-text-muted",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px"},children:[(0,a.jsx)("div",{children:"Account"}),(0,a.jsx)("div",{children:"Model Quotas"}),(0,a.jsx)("div",{className:"text-center",children:"Last Used"}),(0,a.jsx)("div",{className:"text-center",children:"Actions"})]}),B.map((e,t)=>{let l=s[e.id],r=h[e.id],i=b[e.id],o=m[e.provider]||{label:e.provider,color:"#666"},x=U[e.id]||c(null);return(0,a.jsxs)("div",{className:"items-center px-4 py-3.5 transition-[background] duration-150 hover:bg-white/[0.02]",style:{display:"grid",gridTemplateColumns:"280px 1fr 100px 48px",borderBottom:t<B.length-1?"1px solid rgba(255,255,255,0.04)":"none"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden shrink-0",children:(0,a.jsx)(n.default,{src:`/providers/${e.provider}.png`,alt:e.provider,width:32,height:32,className:"object-contain",sizes:"32px"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-[13px] font-semibold text-text-main truncate",children:e.name||o.label}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,a.jsx)("span",{title:l?.plan?`Raw plan: ${l.plan}`:"No plan from provider",children:(0,a.jsx)(d.default,{variant:x.variant,size:"sm",dot:!0,children:x.label})}),(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:o.label})]})]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 pr-3",children:r?(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[14px]",children:"progress_activity"}),"Loading..."]}):i?(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap max-w-[300px]",children:i})]}):l?.message&&(!l.quotas||0===l.quotas.length)?(0,a.jsx)("div",{className:"text-xs text-text-muted italic",children:l.message}):l?.quotas?.length>0?l.quotas.map((e,t)=>{var s,l,r;let n=void 0!==e.remainingPercentage?Math.round(e.remainingPercentage):(s=e.used,(l=e.total)&&0!==l?!s||s<0?100:s>=l?0:Math.round((l-s)/l*100):0),i=n>70?{bar:"#22c55e",text:"#22c55e",bg:"rgba(34,197,94,0.12)"}:n>=30?{bar:"#eab308",text:"#eab308",bg:"rgba(234,179,8,0.12)"}:{bar:"#ef4444",text:"#ef4444",bg:"rgba(239,68,68,0.12)"},c=function(e){if(!e)return null;try{let t=new Date(e)-new Date;if(t<=0)return null;let s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);if(s>=24){let e=Math.floor(s/24);return`${e}d ${s%24}h`}return`${s}h ${a}m`}catch{return null}}(e.resetAt),o={"gemini-3-pro-high":"G3 Pro","gemini-3-pro-low":"G3 Pro Low","gemini-3-flash":"G3 Flash","gemini-2.5-flash":"G2.5 Flash","claude-opus-4-6-thinking":"Opus 4.6 Tk","claude-opus-4-5-thinking":"Opus 4.5 Tk","claude-opus-4-5":"Opus 4.5","claude-sonnet-4-5-thinking":"Sonnet 4.5 Tk","claude-sonnet-4-5":"Sonnet 4.5",chat:"Chat",completions:"Completions",premium_interactions:"Premium",session:"Session",weekly:"Weekly",agentic_request:"Agentic",agentic_request_freetrial:"Agentic (Trial)"}[r=e.name]||r;return(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-[200px] shrink-0",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold py-0.5 px-2 rounded whitespace-nowrap min-w-[60px] text-center",style:{background:i.bg,color:i.text},children:o}),c&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:["⏱ ",c]}),(0,a.jsx)("div",{className:"flex-1 h-1.5 rounded-sm bg-white/[0.06] min-w-[60px] overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-sm transition-[width] duration-300 ease-out",style:{width:`${Math.min(n,100)}%`,background:i.bar}})}),(0,a.jsxs)("span",{className:"text-[11px] font-semibold min-w-[32px] text-right",style:{color:i.text},children:[n,"%"]})]},t)}):(0,a.jsx)("div",{className:"text-xs text-text-muted italic",children:"No quota data"})}),(0,a.jsx)("div",{className:"text-center text-[11px] text-text-muted",children:y?(0,a.jsx)("span",{children:y.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}):"-"}),(0,a.jsx)("div",{className:"flex justify-center gap-0.5",children:(0,a.jsx)("button",{onClick:()=>R(e.id,e.provider),disabled:r,title:"Refresh quota",className:"p-1 rounded-md border-none bg-transparent cursor-pointer disabled:cursor-not-allowed disabled:opacity-30 opacity-60 hover:opacity-100 flex items-center justify-center transition-opacity duration-150",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] text-text-muted ${r?"animate-spin":""}`,children:"refresh"})})})]},e.id)}),0===B.length&&(0,a.jsxs)("div",{className:"py-6 px-4 text-center text-text-muted text-[13px]",children:["No accounts found for tier filter"," ",(0,a.jsx)("strong",{children:p.find(e=>e.key===E)?.label||E}),"."]})]})]})}function f(){let[e,t]=(0,l.useState)({count:0,sessions:[]}),[s,n]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/sessions");e.ok&&t(await e.json())}catch{}finally{n(!1)}},[]);return(0,l.useEffect)(()=>{i();let e=setInterval(i,5e3);return()=>clearInterval(e)},[i]),(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"fingerprint"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Active Sessions"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tracked via request fingerprinting • Auto-refresh 5s"})]}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-cyan-500/10 border border-cyan-500/20",children:[(0,a.jsx)("span",{className:"w-2 h-2 rounded-full bg-cyan-500 animate-pulse"}),(0,a.jsx)("span",{className:"text-sm font-semibold tabular-nums text-cyan-400",children:e.count})]})})]}),0===e.sessions.length?(0,a.jsxs)("div",{className:"text-center py-8 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[40px] mb-2 block opacity-40",children:"fingerprint"}),(0,a.jsx)("p",{className:"text-sm",children:"No active sessions"}),(0,a.jsx)("p",{className:"text-xs mt-1",children:"Sessions appear as requests flow through the proxy"})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-border/30",children:[(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Session"}),(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Age"}),(0,a.jsx)("th",{className:"text-right py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Requests"}),(0,a.jsx)("th",{className:"text-left py-2 px-3 text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Connection"})]})}),(0,a.jsx)("tbody",{children:e.sessions.map(e=>{var t;return(0,a.jsxs)("tr",{className:"border-b border-border/10 hover:bg-surface/20 transition-colors",children:[(0,a.jsx)("td",{className:"py-2.5 px-3",children:(0,a.jsxs)("span",{className:"font-mono text-xs px-2 py-1 rounded bg-surface/40 text-text-muted",children:[e.sessionId.slice(0,12),"…"]})}),(0,a.jsx)("td",{className:"py-2.5 px-3 text-text-muted tabular-nums",children:(t=e.ageMs)<6e4?`${Math.floor(t/1e3)}s`:t<36e5?`${Math.floor(t/6e4)}m`:`${Math.floor(t/36e5)}h`}),(0,a.jsx)("td",{className:"py-2.5 px-3 text-right",children:(0,a.jsx)("span",{className:"font-semibold tabular-nums",children:e.requestCount})}),(0,a.jsx)("td",{className:"py-2.5 px-3",children:e.connectionId?(0,a.jsx)("span",{className:"text-xs font-mono text-cyan-400",children:e.connectionId.slice(0,10)}):(0,a.jsx)("span",{className:"text-text-muted/40",children:"—"})})]},e.sessionId)})})]})})]})}function b(){let[e,t]=(0,l.useState)({lockouts:[],cacheStats:null}),[s,n]=(0,l.useState)(!0),i=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/rate-limits");e.ok&&t(await e.json())}catch{}finally{n(!1)}},[]);return(0,l.useEffect)(()=>{i();let e=setInterval(i,1e4);return()=>clearInterval(e)},[i]),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"lock_clock"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Model Lockouts"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Per-model rate limit locks • Auto-refresh 10s"})]}),e.lockouts.length>0&&(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold bg-orange-500/10 text-orange-400 border border-orange-500/20",children:[e.lockouts.length," locked"]})]}),0===e.lockouts.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40",children:"lock_open"}),(0,a.jsx)("p",{className:"text-sm",children:"No models currently locked"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:e.lockouts.map((e,t)=>{var s;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-orange-500/5 border border-orange-500/15",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-orange-400",children:"lock"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.model}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Account: ",(0,a.jsx)("span",{className:"font-mono",children:e.accountId?.slice(0,12)||"N/A"}),e.reason&&(0,a.jsxs)(a.Fragment,{children:[" — ",e.reason]})]})]})]}),(0,a.jsxs)("span",{className:"text-xs font-mono tabular-nums text-orange-400",children:[(s=e.remainingMs)<1e3?`${s}ms`:s<6e4?`${Math.ceil(s/1e3)}s`:`${Math.ceil(s/6e4)}m`," left"]})]},t)})})]}),e.cacheStats&&(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-indigo-500/10 text-indigo-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Signature Cache"})]}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-3",children:[{label:"Defaults",value:e.cacheStats.defaultCount,color:"text-text-muted"},{label:"Tool",value:`${e.cacheStats.tool.entries}/${e.cacheStats.tool.patterns}`,color:"text-blue-400"},{label:"Family",value:`${e.cacheStats.family.entries}/${e.cacheStats.family.patterns}`,color:"text-purple-400"},{label:"Session",value:`${e.cacheStats.session.entries}/${e.cacheStats.session.patterns}`,color:"text-cyan-400"}].map(({label:e,value:t,color:s})=>(0,a.jsxs)("div",{className:"text-center p-3 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:`text-lg font-bold tabular-nums ${s}`,children:t}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e})]},e))})]})]})}function g(){let[e,t]=(0,l.useState)("overview");return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(r.Iz,{options:[{value:"overview",label:"Overview"},{value:"logs",label:"Logger"},{value:"proxy-logs",label:"Proxy"},{value:"limits",label:"Limits"},{value:"sessions",label:"Sessions"}],value:e,onChange:t}),"overview"===e&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(r.cn,{})}),"logs"===e&&(0,a.jsx)(r.y7,{}),"proxy-logs"===e&&(0,a.jsx)(r.Lo,{}),"limits"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.Qv,{}),children:(0,a.jsx)(h,{})}),(0,a.jsx)(b,{})]}),"sessions"===e&&(0,a.jsx)(f,{})]})}},49448:(e,t,s)=>{Promise.resolve().then(s.bind(s,25852))}},e=>{e.O(0,[8500,600,8013,7896,1525,8441,3794,7358],()=>e(e.s=49448)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{76443:(e,s,n)=>{Promise.resolve().then(n.bind(n,24229)),Promise.resolve().then(n.bind(n,23375)),Promise.resolve().then(n.bind(n,39680)),Promise.resolve().then(n.bind(n,67578)),Promise.resolve().then(n.bind(n,44817)),Promise.resolve().then(n.bind(n,15419)),Promise.resolve().then(n.bind(n,33205)),Promise.resolve().then(n.bind(n,5708)),Promise.resolve().then(n.bind(n,78966)),Promise.resolve().then(n.bind(n,25861)),Promise.resolve().then(n.bind(n,85764)),Promise.resolve().then(n.bind(n,5704)),Promise.resolve().then(n.bind(n,33730)),Promise.resolve().then(n.bind(n,78076)),Promise.resolve().then(n.bind(n,26693)),Promise.resolve().then(n.bind(n,34405)),Promise.resolve().then(n.bind(n,97418)),Promise.resolve().then(n.bind(n,18056)),Promise.resolve().then(n.bind(n,22447)),Promise.resolve().then(n.bind(n,6024)),Promise.resolve().then(n.bind(n,68661)),Promise.resolve().then(n.bind(n,34713)),Promise.resolve().then(n.bind(n,13720)),Promise.resolve().then(n.bind(n,16620)),Promise.resolve().then(n.bind(n,57896)),Promise.resolve().then(n.bind(n,66137)),Promise.resolve().then(n.bind(n,43144)),Promise.resolve().then(n.bind(n,31117)),Promise.resolve().then(n.bind(n,41566))}},e=>{e.O(0,[8500,600,8013,7896,1525,8441,3794,7358],()=>e(e.s=76443)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9492],{9541:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(95155),n=l(35949),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35949:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(95155),n=l(37356);function o({status:e,message:t}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:`${e}: ${t}`}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:e}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:t})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37356:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82051:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(9541)}])}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=82051)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[204,335,449,516,552,747,748,907,931,992,1070,1097,1110,1288,1451,1512,1566,1624,1625,1666,1860,1873,1910,1949,2121,2296,2310,2720,2797,3025,3038,3079,3102,3254,3394,3461,3471,3472,3549,3954,4286,4503,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5466,5693,5696,5745,5922,6162,6217,6268,6392,6442,6479,6529,6580,6740,6819,6853,6988,7176,7241,7295,7346,7429,7442,7457,7520,7545,7597,7758,7851,7855,8167,8207,8246,8406,8453,8489,8573,8648,8777,8809,8814,8870,8948,8974,8975,9027,9069,9088,9141,9214,9321,9461,9794],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);