omniroute 0.7.0 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (757) hide show
  1. package/README.md +74 -29
  2. package/app/.next/BUILD_ID +1 -1
  3. package/app/.next/app-path-routes-manifest.json +30 -30
  4. package/app/.next/build-manifest.json +3 -3
  5. package/app/.next/prerender-manifest.json +3 -3
  6. package/app/.next/react-loadable-manifest.json +2 -2
  7. package/app/.next/required-server-files.json +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
  9. package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +4 -4
  12. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  15. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  21. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -2
  24. package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
  27. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  30. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  33. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  36. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  42. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
  45. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
  48. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +3 -3
  51. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  54. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  55. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/_global-error/page.js +3 -3
  57. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/_global-error.html +2 -2
  59. package/app/.next/server/app/_global-error.rsc +3 -3
  60. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +3 -3
  61. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  62. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  63. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  64. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  65. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  66. package/app/.next/server/app/_not-found/page.js +2 -2
  67. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  68. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/_not-found.html +1 -1
  70. package/app/.next/server/app/_not-found.rsc +5 -5
  71. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  72. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  73. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  74. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  75. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  76. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  77. package/app/.next/server/app/api/auth/login/route.js +1 -1
  78. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  79. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  81. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/api/cache/route.js +2 -2
  83. package/app/.next/server/app/api/cache/route.js.nft.json +1 -1
  84. package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/api/cache/stats/route.js +1 -1
  86. package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
  87. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  88. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  89. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  90. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +4 -4
  91. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  92. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  93. package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
  94. package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
  95. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  96. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
  98. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
  100. package/app/.next/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  101. package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
  102. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  103. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  104. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  105. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route.js +1 -1
  107. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  109. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  111. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
  113. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/cli-tools/status/route.js +2 -2
  115. package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
  116. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  117. package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
  118. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  119. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  120. package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
  121. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  122. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  123. package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
  124. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  125. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  126. package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
  127. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  128. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  129. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  130. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  131. package/app/.next/server/app/api/combos/metrics/route.js +1 -1
  132. package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/combos/route.js +1 -1
  134. package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
  135. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  136. package/app/.next/server/app/api/combos/test/route.js +1 -1
  137. package/app/.next/server/app/api/combos/test/route.js.nft.json +1 -1
  138. package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
  139. package/app/.next/server/app/api/compliance/audit-log/route.js +1 -1
  140. package/app/.next/server/app/api/compliance/audit-log/route.js.nft.json +1 -1
  141. package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/api/db-backups/route.js +1 -1
  143. package/app/.next/server/app/api/db-backups/route.js.nft.json +1 -1
  144. package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -1
  146. package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
  147. package/app/.next/server/app/api/evals/route.js +1 -1
  148. package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app/api/fallback/chains/route.js +2 -2
  150. package/app/.next/server/app/api/fallback/chains/route.js.nft.json +1 -1
  151. package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
  152. package/app/.next/server/app/api/init/route.js +1 -1
  153. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  154. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  155. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  156. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  157. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  158. package/app/.next/server/app/api/keys/route.js +1 -1
  159. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  160. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  161. package/app/.next/server/app/api/models/alias/route.js +1 -1
  162. package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
  163. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  164. package/app/.next/server/app/api/models/availability/route.js +1 -1
  165. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  166. package/app/.next/server/app/api/models/catalog/route.js +2 -2
  167. package/app/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/models/route.js +2 -2
  170. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  171. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  172. package/app/.next/server/app/api/monitoring/health/route.js +2 -2
  173. package/app/.next/server/app/api/monitoring/health/route.js.nft.json +1 -1
  174. package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
  175. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  176. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  177. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  179. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  180. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  181. package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  182. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  183. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  184. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  185. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  186. package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  187. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  188. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  189. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  190. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  191. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  192. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  193. package/app/.next/server/app/api/policies/route.js +2 -2
  194. package/app/.next/server/app/api/policies/route.js.nft.json +1 -1
  195. package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
  196. package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
  197. package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
  198. package/app/.next/server/app/api/pricing/models/route.js +1 -1
  199. package/app/.next/server/app/api/pricing/models/route.js.nft.json +1 -1
  200. package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/pricing/route.js +1 -1
  202. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
  203. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  204. package/app/.next/server/app/api/provider-metrics/route.js +2 -2
  205. package/app/.next/server/app/api/provider-metrics/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/api/provider-models/route.js +1 -1
  208. package/app/.next/server/app/api/provider-models/route.js.nft.json +1 -1
  209. package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
  210. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  211. package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  212. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  213. package/app/.next/server/app/api/provider-nodes/route.js +2 -2
  214. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  215. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  216. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  217. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  218. package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
  219. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  220. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  221. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  222. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  223. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  224. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  225. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  226. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  227. package/app/.next/server/app/api/providers/client/route.js +1 -1
  228. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  229. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  230. package/app/.next/server/app/api/providers/route.js +2 -2
  231. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  232. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  233. package/app/.next/server/app/api/providers/test-batch/route.js +1 -2
  234. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  235. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  236. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  237. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  238. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  239. package/app/.next/server/app/api/rate-limit/route.js +1 -1
  240. package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
  241. package/app/.next/server/app/api/rate-limits/route.js +1 -1
  242. package/app/.next/server/app/api/rate-limits/route.js.nft.json +1 -1
  243. package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
  244. package/app/.next/server/app/api/resilience/reset/route.js +1 -1
  245. package/app/.next/server/app/api/resilience/reset/route.js.nft.json +1 -1
  246. package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
  247. package/app/.next/server/app/api/resilience/route.js +1 -1
  248. package/app/.next/server/app/api/resilience/route.js.nft.json +1 -1
  249. package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
  250. package/app/.next/server/app/api/restart/route.js +1 -1
  251. package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  252. package/app/.next/server/app/api/sessions/route.js +1 -1
  253. package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  254. package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -1
  255. package/app/.next/server/app/api/settings/combo-defaults/route.js.nft.json +1 -1
  256. package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
  257. package/app/.next/server/app/api/settings/ip-filter/route.js +1 -1
  258. package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
  259. package/app/.next/server/app/api/settings/proxy/route.js +1 -1
  260. package/app/.next/server/app/api/settings/proxy/route.js.nft.json +1 -1
  261. package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
  262. package/app/.next/server/app/api/settings/proxy/test/route.js +1 -1
  263. package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
  264. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  265. package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
  266. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  267. package/app/.next/server/app/api/settings/route.js +1 -1
  268. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  269. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  270. package/app/.next/server/app/api/settings/system-prompt/route.js +1 -1
  271. package/app/.next/server/app/api/settings/system-prompt/route.js.nft.json +1 -1
  272. package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
  273. package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -1
  274. package/app/.next/server/app/api/settings/thinking-budget/route.js.nft.json +1 -1
  275. package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
  276. package/app/.next/server/app/api/shutdown/route.js +1 -1
  277. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  278. package/app/.next/server/app/api/storage/health/route.js +1 -1
  279. package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
  280. package/app/.next/server/app/api/sync/cloud/route.js +1 -1
  281. package/app/.next/server/app/api/sync/cloud/route.js.nft.json +1 -1
  282. package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
  283. package/app/.next/server/app/api/sync/initialize/route.js +1 -1
  284. package/app/.next/server/app/api/sync/initialize/route.js.nft.json +1 -1
  285. package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
  286. package/app/.next/server/app/api/tags/route.js +1 -1
  287. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  288. package/app/.next/server/app/api/telemetry/summary/route.js +1 -1
  289. package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
  290. package/app/.next/server/app/api/token-health/route.js +1 -1
  291. package/app/.next/server/app/api/token-health/route.js.nft.json +1 -1
  292. package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
  293. package/app/.next/server/app/api/translator/detect/route.js +1 -1
  294. package/app/.next/server/app/api/translator/detect/route.js.nft.json +1 -1
  295. package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
  296. package/app/.next/server/app/api/translator/history/route.js +1 -1
  297. package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
  298. package/app/.next/server/app/api/translator/load/route.js +1 -1
  299. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  300. package/app/.next/server/app/api/translator/save/route.js +1 -1
  301. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  302. package/app/.next/server/app/api/translator/send/route.js +1 -1
  303. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  304. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  305. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  306. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  307. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  308. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  309. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  310. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  311. package/app/.next/server/app/api/usage/analytics/route.js +1 -1
  312. package/app/.next/server/app/api/usage/analytics/route.js.nft.json +1 -1
  313. package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
  314. package/app/.next/server/app/api/usage/budget/route.js +2 -2
  315. package/app/.next/server/app/api/usage/budget/route.js.nft.json +1 -1
  316. package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
  317. package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -1
  318. package/app/.next/server/app/api/usage/call-logs/[id]/route.js.nft.json +1 -1
  319. package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
  320. package/app/.next/server/app/api/usage/call-logs/route.js +1 -1
  321. package/app/.next/server/app/api/usage/call-logs/route.js.nft.json +1 -1
  322. package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
  323. package/app/.next/server/app/api/usage/history/route.js +1 -1
  324. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  325. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  326. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  327. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  328. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  329. package/app/.next/server/app/api/usage/proxy-logs/route.js +8 -1
  330. package/app/.next/server/app/api/usage/proxy-logs/route.js.nft.json +1 -1
  331. package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
  332. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  333. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  334. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  335. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  336. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  337. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  338. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  339. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  340. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  341. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  342. package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  343. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  344. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  345. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  346. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  347. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  348. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  349. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  350. package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
  351. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  352. package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  353. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  354. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  355. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  356. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  357. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  358. package/app/.next/server/app/api/v1/models/route.js +2 -2
  359. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  360. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  361. package/app/.next/server/app/api/v1/moderations/route.js +1 -1
  362. package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
  363. package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
  364. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
  365. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
  366. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
  367. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
  368. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
  369. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
  370. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
  371. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
  372. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
  373. package/app/.next/server/app/api/v1/rerank/route.js +1 -1
  374. package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
  375. package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
  376. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  377. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  378. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  379. package/app/.next/server/app/api/v1/route.js +1 -1
  380. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  381. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  382. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  383. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  384. package/app/.next/server/app/api/v1beta/models/route.js +2 -2
  385. package/app/.next/server/app/api/v1beta/models/route.js.nft.json +1 -1
  386. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  387. package/app/.next/server/app/callback/page.js +2 -2
  388. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  389. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  390. package/app/.next/server/app/callback.html +1 -1
  391. package/app/.next/server/app/callback.rsc +6 -6
  392. package/app/.next/server/app/callback.segments/_full.segment.rsc +6 -6
  393. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  394. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  395. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  396. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
  397. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  398. package/app/.next/server/app/dashboard/analytics.html +1 -1
  399. package/app/.next/server/app/dashboard/analytics.rsc +7 -7
  400. package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +2 -2
  401. package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
  402. package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  403. package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  404. package/app/.next/server/app/dashboard/analytics.segments/_full.segment.rsc +7 -7
  405. package/app/.next/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
  406. package/app/.next/server/app/dashboard/analytics.segments/_index.segment.rsc +4 -4
  407. package/app/.next/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
  408. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  409. package/app/.next/server/app/dashboard/cli-tools.rsc +7 -7
  410. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  411. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  412. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  413. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  414. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  415. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  416. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  417. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  418. package/app/.next/server/app/dashboard/combos.html +1 -1
  419. package/app/.next/server/app/dashboard/combos.rsc +7 -7
  420. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  421. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  422. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  423. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  424. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  425. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  426. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  427. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  428. package/app/.next/server/app/dashboard/costs.html +1 -1
  429. package/app/.next/server/app/dashboard/costs.rsc +7 -7
  430. package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs/__PAGE__.segment.rsc +2 -2
  431. package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs.segment.rsc +1 -1
  432. package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  433. package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  434. package/app/.next/server/app/dashboard/costs.segments/_full.segment.rsc +7 -7
  435. package/app/.next/server/app/dashboard/costs.segments/_head.segment.rsc +1 -1
  436. package/app/.next/server/app/dashboard/costs.segments/_index.segment.rsc +4 -4
  437. package/app/.next/server/app/dashboard/costs.segments/_tree.segment.rsc +2 -2
  438. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  439. package/app/.next/server/app/dashboard/endpoint.rsc +7 -7
  440. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  441. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  442. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  443. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  444. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  445. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  446. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  447. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  448. package/app/.next/server/app/dashboard/health.html +1 -1
  449. package/app/.next/server/app/dashboard/health.rsc +7 -7
  450. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +2 -2
  451. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +1 -1
  452. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  453. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  454. package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +7 -7
  455. package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +1 -1
  456. package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +4 -4
  457. package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +2 -2
  458. package/app/.next/server/app/dashboard/onboarding.html +1 -1
  459. package/app/.next/server/app/dashboard/onboarding.rsc +7 -7
  460. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding/__PAGE__.segment.rsc +2 -2
  461. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding.segment.rsc +1 -1
  462. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  463. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  464. package/app/.next/server/app/dashboard/onboarding.segments/_full.segment.rsc +7 -7
  465. package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +1 -1
  466. package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +4 -4
  467. package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +2 -2
  468. package/app/.next/server/app/dashboard/profile.html +1 -1
  469. package/app/.next/server/app/dashboard/profile.rsc +6 -6
  470. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  471. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  472. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  473. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  474. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  475. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  476. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  477. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  478. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  479. package/app/.next/server/app/dashboard/providers/new.rsc +7 -7
  480. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  481. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  482. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  483. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  484. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  485. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  486. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  487. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  488. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  489. package/app/.next/server/app/dashboard/providers.html +1 -1
  490. package/app/.next/server/app/dashboard/providers.rsc +7 -7
  491. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  492. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  493. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  494. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  495. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  496. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  497. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  498. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  499. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  500. package/app/.next/server/app/dashboard/settings/pricing.rsc +7 -7
  501. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  502. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  503. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  504. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  505. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  506. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +7 -7
  507. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  508. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  509. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  510. package/app/.next/server/app/dashboard/settings.html +1 -1
  511. package/app/.next/server/app/dashboard/settings.rsc +7 -7
  512. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +2 -2
  513. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  514. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  515. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  516. package/app/.next/server/app/dashboard/settings.segments/_full.segment.rsc +7 -7
  517. package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +1 -1
  518. package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +4 -4
  519. package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +2 -2
  520. package/app/.next/server/app/dashboard/translator.html +2 -2
  521. package/app/.next/server/app/dashboard/translator.rsc +7 -7
  522. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  523. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  524. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  525. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  526. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  527. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  528. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  529. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  530. package/app/.next/server/app/dashboard/usage.html +1 -1
  531. package/app/.next/server/app/dashboard/usage.rsc +7 -7
  532. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  533. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  534. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  535. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  536. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  537. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  538. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  539. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  540. package/app/.next/server/app/docs/page.js +3 -3
  541. package/app/.next/server/app/docs/page.js.nft.json +1 -1
  542. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  543. package/app/.next/server/app/docs.html +1 -1
  544. package/app/.next/server/app/docs.rsc +5 -5
  545. package/app/.next/server/app/docs.segments/_full.segment.rsc +5 -5
  546. package/app/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  547. package/app/.next/server/app/docs.segments/_index.segment.rsc +4 -4
  548. package/app/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  549. package/app/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  550. package/app/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  551. package/app/.next/server/app/forbidden/page.js +2 -2
  552. package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
  553. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  554. package/app/.next/server/app/forbidden.html +1 -1
  555. package/app/.next/server/app/forbidden.rsc +6 -6
  556. package/app/.next/server/app/forbidden.segments/_full.segment.rsc +6 -6
  557. package/app/.next/server/app/forbidden.segments/_head.segment.rsc +1 -1
  558. package/app/.next/server/app/forbidden.segments/_index.segment.rsc +4 -4
  559. package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +2 -2
  560. package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +2 -2
  561. package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +1 -1
  562. package/app/.next/server/app/forgot-password/page.js +2 -2
  563. package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
  564. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  565. package/app/.next/server/app/forgot-password.html +1 -1
  566. package/app/.next/server/app/forgot-password.rsc +6 -6
  567. package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +6 -6
  568. package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +1 -1
  569. package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +4 -4
  570. package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +2 -2
  571. package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +2 -2
  572. package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +1 -1
  573. package/app/.next/server/app/index.html +1 -1
  574. package/app/.next/server/app/index.rsc +5 -5
  575. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  576. package/app/.next/server/app/index.segments/_full.segment.rsc +5 -5
  577. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  578. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  579. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  580. package/app/.next/server/app/landing/page.js +2 -2
  581. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  582. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  583. package/app/.next/server/app/landing.html +1 -1
  584. package/app/.next/server/app/landing.rsc +6 -6
  585. package/app/.next/server/app/landing.segments/_full.segment.rsc +6 -6
  586. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  587. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  588. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  589. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  590. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  591. package/app/.next/server/app/login/page.js +2 -2
  592. package/app/.next/server/app/login/page.js.nft.json +1 -1
  593. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  594. package/app/.next/server/app/login.html +1 -1
  595. package/app/.next/server/app/login.rsc +6 -6
  596. package/app/.next/server/app/login.segments/_full.segment.rsc +6 -6
  597. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  598. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  599. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  600. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  601. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  602. package/app/.next/server/app/page.js +2 -2
  603. package/app/.next/server/app/page.js.nft.json +1 -1
  604. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  605. package/app/.next/server/app/privacy/page.js +2 -2
  606. package/app/.next/server/app/privacy/page.js.nft.json +1 -1
  607. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  608. package/app/.next/server/app/privacy.html +1 -1
  609. package/app/.next/server/app/privacy.rsc +5 -5
  610. package/app/.next/server/app/privacy.segments/_full.segment.rsc +5 -5
  611. package/app/.next/server/app/privacy.segments/_head.segment.rsc +1 -1
  612. package/app/.next/server/app/privacy.segments/_index.segment.rsc +4 -4
  613. package/app/.next/server/app/privacy.segments/_tree.segment.rsc +2 -2
  614. package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +1 -1
  615. package/app/.next/server/app/privacy.segments/privacy.segment.rsc +1 -1
  616. package/app/.next/server/app/terms/page.js +2 -2
  617. package/app/.next/server/app/terms/page.js.nft.json +1 -1
  618. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  619. package/app/.next/server/app/terms.html +1 -1
  620. package/app/.next/server/app/terms.rsc +5 -5
  621. package/app/.next/server/app/terms.segments/_full.segment.rsc +5 -5
  622. package/app/.next/server/app/terms.segments/_head.segment.rsc +1 -1
  623. package/app/.next/server/app/terms.segments/_index.segment.rsc +4 -4
  624. package/app/.next/server/app/terms.segments/_tree.segment.rsc +2 -2
  625. package/app/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +1 -1
  626. package/app/.next/server/app/terms.segments/terms.segment.rsc +1 -1
  627. package/app/.next/server/app-paths-manifest.json +30 -30
  628. package/app/.next/server/chunks/1020.js +1 -0
  629. package/app/.next/server/chunks/1079.js +1 -0
  630. package/app/.next/server/chunks/1308.js +1 -0
  631. package/app/.next/server/chunks/{4469.js → 1549.js} +26 -3
  632. package/app/.next/server/chunks/2286.js +1 -0
  633. package/app/.next/server/chunks/239.js +3 -0
  634. package/app/.next/server/chunks/2391.js +1 -1
  635. package/app/.next/server/chunks/2620.js +3 -0
  636. package/app/.next/server/chunks/2767.js +26 -0
  637. package/app/.next/server/chunks/{3542.js → 2817.js} +2 -2
  638. package/app/.next/server/chunks/2867.js +1 -0
  639. package/app/.next/server/chunks/{651.js → 287.js} +2 -2
  640. package/app/.next/server/chunks/293.js +1 -0
  641. package/app/.next/server/chunks/2951.js +1 -1
  642. package/app/.next/server/chunks/{8108.js → 3596.js} +1 -1
  643. package/app/.next/server/chunks/{1746.js → 3699.js} +1 -1
  644. package/app/.next/server/chunks/4163.js +1 -0
  645. package/app/.next/server/chunks/4568.js +1 -0
  646. package/app/.next/server/chunks/4755.js +1 -21
  647. package/app/.next/server/chunks/5248.js +1 -0
  648. package/app/.next/server/chunks/5583.js +2 -0
  649. package/app/.next/server/chunks/560.js +1 -0
  650. package/app/.next/server/chunks/595.js +1 -1
  651. package/app/.next/server/chunks/5994.js +1 -0
  652. package/app/.next/server/chunks/6120.js +1 -0
  653. package/app/.next/server/chunks/7109.js +8 -0
  654. package/app/.next/server/chunks/7230.js +36 -0
  655. package/app/.next/server/chunks/7544.js +143 -0
  656. package/app/.next/server/chunks/7669.js +3 -0
  657. package/app/.next/server/chunks/8369.js +2 -0
  658. package/app/.next/server/chunks/8429.js +1 -0
  659. package/app/.next/server/chunks/9342.js +1 -0
  660. package/app/.next/server/chunks/9343.js +5 -5
  661. package/app/.next/server/chunks/{1099.js → 9723.js} +2 -2
  662. package/app/.next/server/chunks/9824.js +21 -0
  663. package/app/.next/server/middleware-build-manifest.js +1 -1
  664. package/app/.next/server/middleware-react-loadable-manifest.js +1 -1
  665. package/app/.next/server/middleware.js +27 -4
  666. package/app/.next/server/pages/404.html +1 -1
  667. package/app/.next/server/pages/500.html +2 -2
  668. package/app/.next/server/server-reference-manifest.js +1 -1
  669. package/app/.next/server/server-reference-manifest.json +1 -1
  670. package/app/.next/server/webpack-runtime.js +1 -1
  671. package/app/.next/static/chunks/5846-2708fad522c4092b.js +2 -0
  672. package/app/.next/static/chunks/993-6be0cd05a02eb09b.js +21 -0
  673. package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-a7a7e3485f278504.js +1 -0
  674. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-1c6897612e762e03.js +15 -0
  675. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-2cf4a7b419667452.js +1 -0
  676. package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/page-6913ad5d715dcc3f.js +1 -0
  677. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-a446f6fd8dc64f29.js +1 -0
  678. package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-d3f501b59334c3d5.js +1 -0
  679. package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/page-207d4961e362eae5.js +1 -0
  680. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-7312e2dd8b5feff0.js +1 -0
  681. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a9c594cf56c3465e.js +1 -0
  682. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-521cffebf9da74b1.js +1 -0
  683. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-627628d3588d56d0.js +1 -0
  684. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-ae5e43ea2a576094.js +1 -0
  685. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-1b3f14c99d3edf09.js +1 -0
  686. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-c3cbea97c4f3a3b3.js +4 -0
  687. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-8e19076a0d9227ca.js +1 -0
  688. package/app/.next/static/chunks/app/(dashboard)/layout-c498dd9c790d0115.js +1 -0
  689. package/app/.next/static/chunks/app/callback/page-5c58a06902dd94ed.js +1 -0
  690. package/app/.next/static/chunks/app/forbidden/page-86b6392f80a3ff69.js +1 -0
  691. package/app/.next/static/chunks/app/forgot-password/page-3682163d66078655.js +1 -0
  692. package/app/.next/static/chunks/app/{global-error-6abc2976016d7bd1.js → global-error-ece0210f8bb4e441.js} +1 -1
  693. package/app/.next/static/chunks/app/landing/page-09741814aaca7548.js +1 -0
  694. package/app/.next/static/chunks/app/layout-3375493e8f9133db.js +1 -0
  695. package/app/.next/static/chunks/app/login/page-319adaa570f7cef2.js +1 -0
  696. package/app/.next/static/chunks/app/not-found-a1cabc3706cf5b84.js +1 -0
  697. package/app/.next/static/chunks/{webpack-a2b6b20e2db553f5.js → webpack-9837b0fbf7de0b62.js} +1 -1
  698. package/app/.next/static/css/c08bd521c418658c.css +1 -0
  699. package/app/package.json +7 -4
  700. package/app/server.js +1 -1
  701. package/app/src/mitm/cert/{install.js → install.ts} +3 -3
  702. package/app/src/mitm/dns/{dnsConfig.js → dnsConfig.ts} +1 -1
  703. package/app/src/mitm/{manager.js → manager.ts} +3 -3
  704. package/app/src/mitm/{server.js → server.ts} +1 -1
  705. package/package.json +7 -4
  706. package/app/.next/server/chunks/1228.js +0 -3
  707. package/app/.next/server/chunks/1362.js +0 -1
  708. package/app/.next/server/chunks/152.js +0 -1
  709. package/app/.next/server/chunks/2399.js +0 -1
  710. package/app/.next/server/chunks/4004.js +0 -1
  711. package/app/.next/server/chunks/4832.js +0 -36
  712. package/app/.next/server/chunks/5040.js +0 -1
  713. package/app/.next/server/chunks/5727.js +0 -1
  714. package/app/.next/server/chunks/6599.js +0 -1
  715. package/app/.next/server/chunks/7093.js +0 -2
  716. package/app/.next/server/chunks/7136.js +0 -1
  717. package/app/.next/server/chunks/7271.js +0 -1
  718. package/app/.next/server/chunks/7615.js +0 -19
  719. package/app/.next/server/chunks/7763.js +0 -1
  720. package/app/.next/server/chunks/7802.js +0 -1
  721. package/app/.next/server/chunks/7968.js +0 -3
  722. package/app/.next/server/chunks/8392.js +0 -1
  723. package/app/.next/server/chunks/8400.js +0 -143
  724. package/app/.next/server/chunks/8757.js +0 -2
  725. package/app/.next/server/chunks/8847.js +0 -3
  726. package/app/.next/server/chunks/9081.js +0 -1
  727. package/app/.next/server/chunks/9263.js +0 -1
  728. package/app/.next/static/chunks/1525-5a69ef0a1ac4f962.js +0 -21
  729. package/app/.next/static/chunks/7896-9a0909a92a983a09.js +0 -2
  730. package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-a04417ebc8cf8378.js +0 -1
  731. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-a0d59a10c0c8cf03.js +0 -15
  732. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-0ec8339a5e63e29b.js +0 -1
  733. package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/page-38d9a3dbd2b14ce0.js +0 -1
  734. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-9f316bbfedf248e3.js +0 -1
  735. package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-1c7f51c61cd1e699.js +0 -1
  736. package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/page-6f10b6cb468bdc21.js +0 -1
  737. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-b7f4f0bd54a35446.js +0 -1
  738. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-0a52b0b6a790afd5.js +0 -1
  739. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-8d7182afc4e86131.js +0 -1
  740. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-8ecd49c8dede42af.js +0 -1
  741. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-9460e0e29ba0ca7d.js +0 -1
  742. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-834e40170968cf11.js +0 -1
  743. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-2889507d608ace80.js +0 -4
  744. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-016d44203ff299ac.js +0 -1
  745. package/app/.next/static/chunks/app/(dashboard)/layout-5cca2595e89e770c.js +0 -1
  746. package/app/.next/static/chunks/app/callback/page-259c406ba4d2aeff.js +0 -1
  747. package/app/.next/static/chunks/app/forbidden/page-6806872971c364f0.js +0 -1
  748. package/app/.next/static/chunks/app/forgot-password/page-9cf548e06e388c72.js +0 -1
  749. package/app/.next/static/chunks/app/landing/page-24ee8d70cde143a9.js +0 -1
  750. package/app/.next/static/chunks/app/layout-6504ce60623b0a41.js +0 -1
  751. package/app/.next/static/chunks/app/login/page-1fe2fbac3d005b28.js +0 -1
  752. package/app/.next/static/chunks/app/not-found-e1af8b9c5785b71b.js +0 -1
  753. package/app/.next/static/css/bd676ecee93f7aaf.css +0 -1
  754. /package/app/.next/static/{-4iz0aT4gr0pcgbKDy3mR → 4zh9cgkOJsay7eUxfk-tb}/_buildManifest.js +0 -0
  755. /package/app/.next/static/{-4iz0aT4gr0pcgbKDy3mR → 4zh9cgkOJsay7eUxfk-tb}/_ssgManifest.js +0 -0
  756. /package/app/src/mitm/cert/{generate.js → generate.ts} +0 -0
  757. /package/app/src/shared/utils/{apiKey.js → apiKey.ts} +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{21680:(e,t,s)=>{Promise.resolve().then(s.bind(s,68425))},68425:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>M});var a=s(95155),l=s(12115),r=s(61592),i=s(81172),n=s(71525);function c(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)({type:"",message:""}),[m,x]=(0,l.useState)(null),[u,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(!1),[g,f]=(0,l.useState)({type:"",message:""}),[j,v]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),N=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)}},y=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)}},k=async()=>{b(!0),f({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?f({type:"success",message:`Backup created: ${t.filename}`}):f({type:"info",message:t.message||"No changes since last backup"}),await y(),i&&await N()):f({type:"error",message:t.error||"Backup failed"})}catch{f({type:"error",message:"An error occurred"})}finally{b(!1)}},w=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 N(),await y()):o({type:"error",message:s.error||"Restore failed"})}catch{o({type:"error",message:"An error occurred during restore"})}finally{x(null),h(null)}};(0,l.useEffect)(()=>{y()},[]);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:j.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:j.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(j.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:j.lastBackupAt?`${new Date(j.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`})(j.lastBackupAt)})`:"No backup yet"})]})]}),(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:k,loading:p,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:()=>{c(!i),i||0!==e.length||N()},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."}),d.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===d.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"===d.type?"check_circle":"error"}),d.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:N,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:()=>w(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:()=>h(null),children:"No"})]}):(0,a.jsxs)(n.$n,{variant:"outline",size:"sm",onClick:()=>h(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),"Restore"]})})]},e.id))]})})]})]})}let d=[{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,c]=(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{}},h=()=>{i.trim()&&(u({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),c(""))},p=(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:d.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=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&h()})}),(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()&&h()},children:"+ Block"}),(0,a.jsx)(n.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&h()},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:()=>p(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:()=>p(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))})]})]})]})}var m=s(45567);let x={closed:{icon:"check_circle",color:"#22c55e",label:"Closed"},"half-open":{icon:"pending",color:"#f59e0b",label:"Half-Open"},open:{icon:"error",color:"#ef4444",label:"Open"}};function u(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(null),d=(0,m.i)(),o=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/policies");if(e.ok){let s=await e.json();t(s)}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{o();let e=setInterval(o,15e3);return()=>clearInterval(e)},[o]);let u=async e=>{c(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(d.success(`Unlocked: ${e}`),await o()):d.error("Failed to unlock")}catch{d.error("Failed to unlock")}finally{c(null)}};if(s)return(0,a.jsx)(n.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"security"}),"Loading policies..."]})});let h=e?.circuitBreakers||[],p=e?.lockedIdentifiers||[];return h.some(e=>"closed"!==e.state)||p.length>0?(0,a.jsxs)(n.Zp,{className:"p-6 mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",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]",children:"gpp_maybe"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:"Policies & Circuit Breakers"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Active issues detected"})]})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:o,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),h.filter(e=>"closed"!==e.state).length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:"Circuit Breakers"}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:h.filter(e=>"closed"!==e.state).map((e,t)=>{let s=x[e.state]||x.open;return(0,a.jsx)("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-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:s.color},children:s.icon}),(0,a.jsx)("span",{className:"text-sm text-text-main font-medium",children:e.name||e.provider||"Unknown"}),(0,a.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${s.color}15`,color:s.color},children:s.label}),e.failures>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failures," failures"]})]})},e.name||t)})})]}),p.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:"Locked Identifiers"}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:p.map((e,t)=>{let s="string"==typeof e?e:e.identifier||e.id;return(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-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-400",children:"lock"}),(0,a.jsx)("span",{className:"font-mono text-sm text-text-main",children:s}),"object"==typeof e&&e.lockedAt&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["since ",new Date(e.lockedAt).toLocaleString()]})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>u(s),disabled:i===s,className:"text-xs",children:i===s?"Unlocking...":"Force Unlock"})]},s||t)})})]})]}):(0,a.jsx)(n.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"verified_user"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-text-main",children:"Policies & Circuit Breakers"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"All systems operational — no lockouts or tripped breakers"})]})]})})}function h(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)({current:"",new:"",confirm:""}),[d,m]=(0,l.useState)({type:"",message:""}),[x,h]=(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)}},b=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:"Passwords do not match"});h(!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"}),c({current:"",new:"",confirm:""})):m({type:"error",message:t.error||"Failed to update password"})}catch{m({type:"error",message:"An error occurred"})}finally{h(!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:b,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=>c({...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=>c({...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=>c({...i,confirm:e.target.value}),required:!0})]}),d.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===d.type?"text-red-500":"text-green-500"}`,children:d.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,{}),(0,a.jsx)(u,{})]})}let p=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function b(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,b]=(0,l.useState)(!1),g=(0,m.i)(),f=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/fallback/chains");if(e.ok){let s=await e.json();t(s.chains||s||{})}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{f()},[f]);let j=async()=>{if(!d.trim()||!x.trim())return void g.warning("Please fill model name and providers");let e=x.split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({provider:e,priority:t+1,enabled:!0}));if(0===e.length)return void g.warning("Add at least one provider");b(!0);try{(await fetch("/api/fallback/chains",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d.trim(),chain:e})})).ok?(g.success(`Chain created for ${d.trim()}`),o(""),u(""),c(!1),await f()):g.error("Failed to create chain")}catch{g.error("Failed to create chain")}finally{b(!1)}},v=async e=>{if(confirm(`Delete fallback chain for "${e}"?`))try{(await fetch("/api/fallback/chains",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})})).ok?(g.success(`Chain deleted for ${e}`),await f()):g.error("Failed to delete chain")}catch{g.error("Failed to delete chain")}};if(s)return(0,a.jsx)(n.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"}),"Loading fallback chains..."]})});let N=Object.entries(e);return(0,a.jsxs)(n.Zp,{className:"mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4 p-6 pb-0",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]",children:"timeline"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Fallback Chains"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Define provider fallback order per model"})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:()=>c(!i),children:i?"Cancel":"+ Add Chain"})]}),i&&(0,a.jsxs)("div",{className:"mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-3",children:[(0,a.jsx)(n.pd,{label:"Model Name",placeholder:"claude-sonnet-4-20250514",value:d,onChange:e=>o(e.target.value)}),(0,a.jsx)(n.pd,{label:"Providers (comma-separated, in priority order)",placeholder:"anthropic, openai, gemini",value:x,onChange:e=>u(e.target.value)})]}),(0,a.jsx)(n.$n,{variant:"primary",size:"sm",onClick:j,loading:h,children:"Create Chain"})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===N.length?(0,a.jsx)(n.pp,{icon:"timeline",title:"No Fallback Chains",description:"Create a chain to define provider fallback order for a model."}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:N.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 rounded-lg border border-border/20 bg-surface/20 hover:bg-surface/40 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-text-main truncate max-w-[200px]",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("div",{className:"flex gap-1.5 flex-wrap",children:(Array.isArray(t)?t:[]).map((e,t)=>(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:`${p[t%p.length]}20`,color:p[t%p.length],border:`1px solid ${p[t%p.length]}40`},children:[t+1,". ",e.provider]},`${e.provider}-${t}`))})]}),(0,a.jsx)("button",{onClick:()=>v(e),className:"text-text-muted hover:text-red-400 transition-colors ml-2",title:"Delete chain",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let g=[{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 f(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)([]),[d,o]=(0,l.useState)(""),[m,x]=(0,l.useState)("");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),c(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let u=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(!d.trim()||!m.trim())return;let e=[...i,{pattern:d.trim(),target:m.trim()}];await u({wildcardAliases:e}),c(e),o(""),x("")},p=async e=>{let t=i.filter((t,s)=>s!==e);await u({wildcardAliases:t}),c(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:g.map(t=>(0,a.jsxs)("button",{onClick:()=>u({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=>u({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:()=>p(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:d,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=>x(e.target.value)})}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:h,className:"mb-[2px]",children:"+ Add"})]})]}),(0,a.jsx)(b,{})]})}function j(){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)({}),[c,d]=(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=c.trim().toLowerCase();e&&!s[e]&&(i(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),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-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:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",children:[{value:"priority",label:"Priority",icon:"sort"},{value:"weighted",label:"Weighted",icon:"percent"},{value:"round-robin",label:"Round-Robin",icon:"autorenew"},{value:"random",label:"Random",icon:"shuffle"},{value:"least-used",label:"Least-Used",icon:"low_priority"},{value:"cost-optimized",label:"Cost-Opt",icon:"savings"}].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e.strategy===s.value,onClick:()=>t(e=>({...e,strategy:s.value})),className:(0,r.cn)("px-2 py-1 rounded text-xs font-medium transition-all flex items-center justify-center gap-0.5",e.strategy===s.value?"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-[14px]",children:s.icon}),s.label]},s.value))})]}),(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:c})=>(0,a.jsx)(n.pd,{label:l,type:"number",min:r,max:i,step:c||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:c,onChange:e=>d(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:!c.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 v(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),c=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.current=!0,async function(){try{let e=await fetch("/api/settings/proxy?level=global");if(!i.current)return;if(e.ok){let t=await e.json();i.current&&r(t.proxy||null)}}catch{}}(),()=>{i.current=!1}),[]),(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:()=>{c(),t(!0)},children:s?"Edit":"Configure"})]})]})}),(0,a.jsx)(n.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:"Global",onSaved:c})]})}var N=s(2946);function y(){let{theme:e,setTheme:t,isDark:s}=(0,N.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 k=[{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"}],w=[{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 C(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,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),c(!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{c(!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"===d&&(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:k.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:w.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 S(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[d,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),c("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(c("saved"),setTimeout(()=>c(""),2e3))}catch{c("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})),d&&clearTimeout(d),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 $=[{key:"timestamp",label:"Time"},{key:"action",label:"Action"},{key:"actor",label:"Actor"},{key:"details",label:"Details"}];function P(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[d,o]=(0,l.useState)({}),[x,u]=(0,l.useState)({timestamp:!0,action:!0,actor:!0,details:!0}),h=(0,m.i)();(0,l.useEffect)(()=>{fetch("/api/compliance/audit-log?limit=100").then(e=>e.json()).then(e=>{t(Array.isArray(e)?e:e.logs||[]),r(!1)}).catch(()=>{r(!1),h.error("Failed to load audit log")})},[]);let p=[...new Set(e.map(e=>e.action).filter(Boolean))],b=[...new Set(e.map(e=>e.actor).filter(Boolean))],g=e.filter(e=>{if(i){let t=i.toLowerCase();if(!(e.action?.toLowerCase().includes(t)||e.actor?.toLowerCase().includes(t)||e.details&&JSON.stringify(e.details).toLowerCase().includes(t)))return!1}return(!d.action||e.action===d.action)&&(!d.actor||e.actor===d.actor)}),f=$.filter(e=>x[e.key]),j=(0,l.useCallback)(e=>{u(t=>({...t,[e]:!t[e]}))},[]),v=(0,l.useCallback)((e,t)=>{switch(t.key){case"timestamp":return(0,a.jsx)("span",{className:"font-mono text-xs text-text-muted whitespace-nowrap",children:e.timestamp?new Date(e.timestamp).toLocaleString():"—"});case"action":return(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-accent/10 text-accent",children:e.action||"—"});case"actor":return(0,a.jsx)("span",{className:"text-text-main",children:e.actor||"system"});case"details":return(0,a.jsx)("span",{className:"text-text-muted text-xs max-w-xs truncate block",children:e.details?JSON.stringify(e.details):"—"});default:return e[t.key]||"—"}},[]);return(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),"Audit Log"]}),(0,a.jsx)(n.tD,{columns:$,visible:x,onToggle:j})]}),(0,a.jsx)(n.Qn,{searchValue:i,onSearchChange:c,placeholder:"Search audit logs...",filters:[{key:"action",label:"Action",options:p},{key:"actor",label:"Actor",options:b}],activeFilters:d,onFilterChange:(e,t)=>o(s=>({...s,[e]:t}))}),(0,a.jsx)(n.bQ,{columns:f,data:g,renderCell:v,loading:s,maxHeight:"400px",emptyIcon:"\uD83D\uDCCB",emptyMessage:"No audit events found"})]})}function A(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=()=>{fetch("/api/cache/stats").then(e=>e.json()).then(t).catch(()=>{})};(0,l.useEffect)(i,[]);let c=async()=>{r(!0);try{await fetch("/api/cache/stats",{method:"DELETE"}),i()}finally{r(!1)}};return(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"cached"}),"Prompt Cache"]}),(0,a.jsx)("button",{onClick:c,disabled:s,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:s?"Flushing…":"Flush Cache"})]}),e?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Size"}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.size,"/",e.maxSize]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Hit Rate"}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Hits"}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.hits??0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Evictions"}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.evictions??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Loading cache stats…"})]})}let B={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",label:"CLOSED",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",label:"OPEN",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",label:"HALF-OPEN",icon:"warning"}};function L({breakers:e,onReset:t,loading:s}){let l=e.filter(e=>"CLOSED"!==e.state),r=e.length;return(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 justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"electrical_services"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Circuit Breakers"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l.length>0?`${l.length} tripped`:`${r} healthy`}),l.length>0&&(0,a.jsx)(n.$n,{size:"sm",variant:"danger",icon:"restart_alt",onClick:t,disabled:s,children:"Reset All"})]})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No circuit breakers active yet. They are created automatically when requests flow through the combo pipeline."}):(0,a.jsx)("div",{className:"space-y-2",children:e.map(e=>{let t=B[e.state]||B.CLOSED;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-base ${t.text}`,"aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name.replace("combo:","")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.failureCount>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[e.failureCount," failure",1!==e.failureCount?"s":""]}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:t.label})]})]},e.name)})})]})})}function T({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[c,d]=(0,l.useState)(e);(0,l.useEffect)(()=>{d(e)},[e]);let o=[{key:"transientCooldown",label:"Transient Cooldown",suffix:"ms"},{key:"rateLimitCooldown",label:"Rate Limit Cooldown",suffix:"ms"},{key:"maxBackoffLevel",label:"Max Backoff Level",suffix:""},{key:"circuitBreakerThreshold",label:"CB Threshold",suffix:" fails"},{key:"circuitBreakerReset",label:"CB Reset Time",suffix:"ms"}];return(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 justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"tune"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Provider Profiles"})]}),r?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:"Cancel"}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(c),i(!1)},disabled:s,children:"Save"})]}):(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>i(!0),children:"Edit"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Separate resilience settings for OAuth (session-based) and API Key (metered) providers. OAuth providers have stricter thresholds due to lower rate limits."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["oauth","apikey"].map(t=>(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base","aria-hidden":"true",children:"oauth"===t?"lock":"key"}),"oauth"===t?"OAuth Providers":"API Key Providers"]}),(0,a.jsx)("div",{className:"space-y-2",children:o.map(({key:s,label:l,suffix:i})=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l}),r?(0,a.jsx)("input",{type:"number",min:"0",value:c?.[t]?.[s]??0,onChange:e=>d({...c,[t]:{...c[t],[s]:Number(e.target.value)}}),className:"w-24 px-2 py-1 text-xs rounded bg-white/10 border border-white/20 text-right"}):(0,a.jsxs)("span",{className:"text-sm font-mono",children:[e?.[t]?.[s]??"—",i&&e?.[t]?.[s]!=null?i:""]})]},s))})]},t))})]})})}function E({rateLimitStatus:e,defaults:t}){var s;return(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:"speed"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:"Rate Limiting"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"API Key providers are automatically rate-limited with safe defaults. Limits are learned from response headers and adapt over time."}),(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4 mb-4",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-text-muted",children:"Default Safety Net"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-lg font-bold",children:t?.requestsPerMinute??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:"RPM"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-lg font-bold",children:(s=t?.minTimeBetweenRequests)&&!(s<=0)?s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`:"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:"Min Gap"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-lg font-bold",children:t?.concurrentRequests??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:"Max Concurrent"})]})]})]}),e&&e.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:"Active Limiters"}),e.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.provider||e.key}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[null!=e.reservoir&&(0,a.jsxs)("span",{children:["Reservoir: ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:["Running: ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:["Queued: ",e.queued]})]})]},t))]}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active rate limiters yet."})]})})}function R(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(null),m=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(`Failed to load: ${e.status}`);let s=await e.json();t(s),o(null)}catch(e){o(e.message)}finally{r(!1)}},[]);(0,l.useEffect)(()=>{m();let e=setInterval(m,1e4);return()=>clearInterval(e)},[m]);let x=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error("Reset failed");await m()}catch(e){o(e.message)}finally{r(!1)}},u=async e=>{try{if(c(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})})).ok)throw Error("Save failed");await m()}catch(e){o(e.message)}finally{c(!1)}};return s&&!e?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"hourglass_empty"}),"Loading resilience status..."]}):d&&!e?(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"error"}),(0,a.jsx)("span",{className:"text-sm",children:d})]}),(0,a.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:m,className:"mt-3",children:"Retry"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(L,{breakers:e?.circuitBreakers||[],onReset:x,loading:s}),(0,a.jsx)(T,{profiles:e?.profiles||{},onSave:u,saving:i}),(0,a.jsx)(E,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{}})]})}let O=[{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:"resilience",label:"Resilience",icon:"electrical_services"},{id:"advanced",label:"Advanced",icon:"tune"},{id:"compliance",label:"Compliance",icon:"policy"}];function M(){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:O.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":O.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)(c,{}),(0,a.jsx)(y,{})]})}),"ai"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(C,{}),(0,a.jsx)(S,{})]}),"security"===e&&(0,a.jsx)(h,{}),"routing"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(f,{}),(0,a.jsx)(j,{})]}),"resilience"===e&&(0,a.jsx)(R,{}),"advanced"===e&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(v,{}),(0,a.jsx)(A,{})]}),"compliance"===e&&(0,a.jsx)(P,{})]}),(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"})]})]})})}}},e=>{e.O(0,[8500,9751,782,7013,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([[410],{25287:(e,t,a)=>{Promise.resolve().then(a.bind(a,45448))},45448:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>u});var c=a(95155),n=a(12115),i=a(73321),o=a(67578);let r={cc:{"claude-opus-4-5-20251101":{input:15,output:75,cached:7.5,reasoning:75,cache_creation:15},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4-5-20251001":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}},cx:{"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-codex-mini":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},gc:{"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},qw:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},if:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"deepseek-r1":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"deepseek-v3.2-chat":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"deepseek-v3.2-reasoner":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"minimax-m2":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},ag:{"gemini-3-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"claude-sonnet-4-5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4-5-thinking":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5}},gh:{"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"claude-4.5-sonnet":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-4.5-opus":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-4.5-haiku":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"gemini-3-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},openai:{"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},anthropic:{"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:75,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3}},gemini:{"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},openrouter:{auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},glm:{"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},kimi:{"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},minimax:{"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},groq:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b-versatile":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen/qwen3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},fireworks:{"accounts/fireworks/models/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/deepseek-v3p1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/llama-v3p3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/qwen3-235b-a22b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},cerebras:{"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-glm-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-4-scout-17b-16e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-235b-a22b-instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nvidia:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/kimi-k2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"z-ai/glm4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/deepseek-v3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"nvidia/llama-3.3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek/deepseek-r1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nebius:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},siliconflow:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-235B-A22B-Instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/Kimi-K2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-org/GLM-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"baidu/ERNIE-4.5-300B-A47B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},hyperbolic:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/QwQ-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.2-3B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-72B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-Coder-32B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"NousResearch/Hermes-3-Llama-3.1-70B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},kiro:{"claude-sonnet-4.5":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}}};function s({isOpen:e,onClose:t,onSave:a}){let[i,o]=(0,n.useState)({}),[s,u]=(0,n.useState)(!0),[d,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&l()},[e]);let l=async()=>{u(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();o(t)}else o(r)}catch(e){console.error("Failed to load pricing:",e),o(r)}finally{u(!1)}},h=async()=>{p(!0);try{let e=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.ok)a?.(),t();else{let t=await e.json();alert(`Failed to save pricing: ${t.error}`)}}catch(e){console.error("Failed to save pricing:",e),alert("Failed to save pricing")}finally{p(!1)}},g=async()=>{if(confirm("Reset all pricing to defaults? This cannot be undone."))try{(await fetch("/api/pricing",{method:"DELETE"})).ok&&o(r)}catch(e){console.error("Failed to reset pricing:",e),alert("Failed to reset pricing")}};if(!e)return null;let m=Object.keys(i).sort(),x=["input","output","cached","reasoning","cache_creation"];return(0,c.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,c.jsxs)("div",{className:"bg-bg-base border border-border rounded-lg shadow-xl max-w-6xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,c.jsx)("h2",{className:"text-xl font-semibold",children:"Pricing Configuration"}),(0,c.jsx)("button",{onClick:t,className:"text-text-muted hover:text-text text-2xl leading-none",children:"\xd7"})]}),(0,c.jsx)("div",{className:"flex-1 overflow-auto p-4",children:s?(0,c.jsx)("div",{className:"text-center py-8 text-text-muted",children:"Loading pricing data..."}):(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"bg-bg-subtle border border-border rounded-lg p-3 text-sm",children:[(0,c.jsx)("p",{className:"font-medium mb-1",children:"Pricing Rates Format"}),(0,c.jsxs)("p",{className:"text-text-muted",children:["All rates are in ",(0,c.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: Input rate of 2.50 means $2.50 per 1,000,000 input tokens."]})]}),m.map(e=>{let t=Object.keys(i[e]).sort();return(0,c.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,c.jsx)("div",{className:"bg-bg-subtle px-4 py-2 font-semibold text-sm",children:e.toUpperCase()}),(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)("table",{className:"w-full text-sm",children:[(0,c.jsx)("thead",{className:"bg-bg-hover text-text-muted uppercase text-xs",children:(0,c.jsxs)("tr",{children:[(0,c.jsx)("th",{className:"px-3 py-2 text-left",children:"Model"}),(0,c.jsx)("th",{className:"px-3 py-2 text-right",children:"Input"}),(0,c.jsx)("th",{className:"px-3 py-2 text-right",children:"Output"}),(0,c.jsx)("th",{className:"px-3 py-2 text-right",children:"Cached"}),(0,c.jsx)("th",{className:"px-3 py-2 text-right",children:"Reasoning"}),(0,c.jsx)("th",{className:"px-3 py-2 text-right",children:"Cache Creation"})]})}),(0,c.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>(0,c.jsxs)("tr",{className:"hover:bg-bg-subtle/50",children:[(0,c.jsx)("td",{className:"px-3 py-2 font-medium",children:t}),x.map(a=>(0,c.jsx)("td",{className:"px-3 py-2",children:(0,c.jsx)("input",{type:"number",step:"0.01",min:"0",value:i[e][t][a]||0,onChange:c=>{let n;!isNaN(n=parseFloat(c.target.value))&&!(n<0)&&o(c=>{let i={...c};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={}),i[e][t][a]=n,i})},className:"w-20 px-2 py-1 text-right bg-bg-base border border-border rounded focus:outline-none focus:border-primary"})},a))]},t))})]})})]},e)}),0===m.length&&(0,c.jsx)("div",{className:"text-center py-8 text-text-muted",children:"No pricing data available"})]})}),(0,c.jsxs)("div",{className:"p-4 border-t border-border flex items-center justify-between gap-2",children:[(0,c.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm text-red-500 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",disabled:d,children:"Reset to Defaults"}),(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm text-text-muted hover:text-text border border-border rounded transition-colors",disabled:d,children:"Cancel"}),(0,c.jsx)("button",{onClick:h,className:"px-4 py-2 text-sm bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:d,children:d?"Saving...":"Save Changes"})]})]})]})})}function u(){(0,i.useRouter)();let[e,t]=(0,n.useState)(!1),[a,r]=(0,n.useState)(null),[u,d]=(0,n.useState)(!0);(0,n.useEffect)(()=>{p()},[]);let p=async()=>{d(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();r(t)}}catch(e){console.error("Failed to load pricing:",e)}finally{d(!1)}};return(0,c.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h1",{className:"text-3xl font-bold",children:"Pricing Settings"}),(0,c.jsx)("p",{className:"text-text-muted mt-1",children:"Configure pricing rates for cost tracking and calculations"})]}),(0,c.jsx)("button",{onClick:()=>t(!0),className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary/90 transition-colors",children:"Edit Pricing"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,c.jsxs)(o.default,{className:"p-4",children:[(0,c.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Models"}),(0,c.jsx)("div",{className:"text-2xl font-bold mt-1",children:u?"...":(()=>{if(!a)return 0;let e=0;for(let t in a)e+=Object.keys(a[t]).length;return e})()})]}),(0,c.jsxs)(o.default,{className:"p-4",children:[(0,c.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Providers"}),(0,c.jsx)("div",{className:"text-2xl font-bold mt-1",children:u?"...":(!a?[]:Object.keys(a).sort()).length})]}),(0,c.jsxs)(o.default,{className:"p-4",children:[(0,c.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Status"}),(0,c.jsx)("div",{className:"text-2xl font-bold mt-1 text-success",children:u?"...":"Active"})]})]}),(0,c.jsxs)(o.default,{className:"p-6",children:[(0,c.jsx)("h2",{className:"text-xl font-semibold mb-4",children:"How Pricing Works"}),(0,c.jsxs)("div",{className:"space-y-3 text-sm text-text-muted",children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Cost Calculation:"})," Costs are calculated based on token usage and pricing rates. Each request's cost is determined by: (input_tokens \xd7 input_rate) + (output_tokens \xd7 output_rate) + (cached_tokens \xd7 cached_rate)"]}),(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Pricing Format:"})," All rates are in"," ",(0,c.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: An input rate of 2.50 means $2.50 per 1,000,000 input tokens."]}),(0,c.jsx)("p",{children:(0,c.jsx)("strong",{children:"Token Types:"})}),(0,c.jsxs)("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[(0,c.jsxs)("li",{children:[(0,c.jsx)("strong",{children:"Input:"})," Standard prompt tokens"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("strong",{children:"Output:"})," Completion/response tokens"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("strong",{children:"Cached:"})," Cached input tokens (typically 50% of input rate)"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("strong",{children:"Reasoning:"})," Special reasoning/thinking tokens (fallback to output rate)"]}),(0,c.jsxs)("li",{children:[(0,c.jsx)("strong",{children:"Cache Creation:"})," Tokens used to create cache entries (fallback to input rate)"]})]}),(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Custom Pricing:"})," You can override default pricing for specific models. Reset to defaults anytime to restore standard rates."]})]})]}),(0,c.jsxs)(o.default,{className:"p-6",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsx)("h2",{className:"text-xl font-semibold",children:"Current Pricing Overview"}),(0,c.jsx)("button",{onClick:()=>t(!0),className:"text-primary hover:underline text-sm",children:"View Full Details"})]}),u?(0,c.jsx)("div",{className:"text-center py-4 text-text-muted",children:"Loading pricing data..."}):a?(0,c.jsxs)("div",{className:"space-y-3",children:[Object.keys(a).slice(0,5).map(e=>(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsxs)("span",{className:"font-semibold",children:[e.toUpperCase(),":"]})," ",(0,c.jsxs)("span",{className:"text-text-muted",children:[Object.keys(a[e]).length," models"]})]},e)),Object.keys(a).length>5&&(0,c.jsxs)("div",{className:"text-sm text-text-muted",children:["+ ",Object.keys(a).length-5," more providers"]})]}):(0,c.jsx)("div",{className:"text-text-muted",children:"No pricing data available"})]}),e&&(0,c.jsx)(s,{isOpen:e,onClose:()=>t(!1),onSave:()=>{p()}})]})}},61592:(e,t,a)=>{"use strict";function c(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}a.d(t,{cn:()=>c})},67578:(e,t,a)=>{"use strict";a.d(t,{default:()=>i});var c=a(95155),n=a(61592);function i({children:e,title:t,subtitle:a,icon:i,action:o,padding:r="md",hover:s=!1,className:u,...d}){return(0,c.jsxs)("div",{className:(0,n.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",s&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[r],u),...d,children:[(t||o)&&(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,c.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i})}),(0,c.jsxs)("div",{children:[t&&(0,c.jsx)("h3",{className:"text-text-main font-semibold",children:t}),a&&(0,c.jsx)("p",{className:"text-sm text-text-muted",children:a})]})]}),o]}),e]})}i.Section=function({children:e,className:t,...a}){return(0,c.jsx)("div",{className:(0,n.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...a,children:e})},i.Row=function({children:e,className:t,...a}){return(0,c.jsx)("div",{className:(0,n.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...a,children:e})},i.ListItem=function({children:e,actions:t,className:a,...i}){return(0,c.jsxs)("div",{className:(0,n.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",a),...i,children:[(0,c.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,c.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:t})]})}},73321:(e,t,a)=>{"use strict";var c=a(74645);a.o(c,"useParams")&&a.d(t,{useParams:function(){return c.useParams}}),a.o(c,"usePathname")&&a.d(t,{usePathname:function(){return c.usePathname}}),a.o(c,"useRouter")&&a.d(t,{useRouter:function(){return c.useRouter}}),a.o(c,"useSearchParams")&&a.d(t,{useSearchParams:function(){return c.useSearchParams}})}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=25287)),_N_E=e.O()}]);
@@ -1,4 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{5214:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=s(17828)},17828:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,s(64054).createAsyncLocalStorage)()},21957:(e,t,s)=>{"use strict";function a({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return a}}),s(95155),s(47650),s(5214),s(2451),s(53887)},31355:(e,t,s)=>{Promise.resolve().then(s.bind(s,71825))},41112:(e,t,s)=>{"use strict";function a({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}}),s(1980)},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={bindSnapshot:function(){return o},createAsyncLocalStorage:function(){return i},createSnapshot:function(){return c}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let l="u">typeof globalThis&&globalThis.AsyncLocalStorage;function i(){return l?new l:new n}function o(e){return l?l.bind(e):n.bind(e)}function c(){return l?l.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let a=s(95155),r=s(12115),n=s(41112);function l(e){return{default:e&&"default"in e?e.default:e}}s(21957);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let t={...i,...e},s=(0,r.lazy)(()=>t.loader().then(l)),o=t.loading;function c(e){let l=o?(0,a.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?r.Suspense:r.Fragment,d=t.ssr?(0,a.jsxs)(a.Fragment,{children:[null,(0,a.jsx)(s,{...e})]}):(0,a.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(s,{...e})});return(0,a.jsx)(c,{...i?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},71825:(e,t,s)=>{"use strict";s.d(t,{default:()=>k});var a=s(95155),r=s(12115),n=s(71525);let l=[{id:"simple-chat",name:"Simple Chat",icon:"chat",description:"Basic text message",formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:"You are a helpful assistant."},{role:"user",content:"Hello! How are you today?"}],stream:!0},claude:{model:"claude-sonnet-4-20250514",system:"You are a helpful assistant.",max_tokens:1024,messages:[{role:"user",content:"Hello! How are you today?"}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"Hello! How are you today?"}]}],systemInstruction:{parts:[{text:"You are a helpful assistant."}]}},"openai-responses":{model:"gpt-4o",input:"Hello! How are you today?",instructions:"You are a helpful assistant."}}},{id:"tool-calling",name:"Tool Calling",icon:"build",description:"Function/tool invocation",formats:{openai:{model:"gpt-4o",messages:[{role:"user",content:"What's the weather in S\xe3o Paulo?"}],tools:[{type:"function",function:{name:"get_weather",description:"Get current weather for a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}}],stream:!0},claude:{model:"claude-sonnet-4-20250514",max_tokens:1024,messages:[{role:"user",content:"What's the weather in S\xe3o Paulo?"}],tools:[{name:"get_weather",description:"Get current weather for a location",input_schema:{type:"object",properties:{location:{type:"string",description:"City name"},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"What's the weather in S\xe3o Paulo?"}]}],tools:[{functionDeclarations:[{name:"get_weather",description:"Get current weather for a location",parameters:{type:"object",properties:{location:{type:"string",description:"City name"},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}]}]}}},{id:"multi-turn",name:"Multi-turn",icon:"forum",description:"Conversation with history",formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:"You are a coding assistant."},{role:"user",content:"Write a function to sort an array in Python."},{role:"assistant",content:"Here's a simple sort function:\n\n```python\ndef sort_array(arr):\n return sorted(arr)\n```"},{role:"user",content:"Now make it sort in descending order."}],stream:!0},claude:{model:"claude-sonnet-4-20250514",system:"You are a coding assistant.",max_tokens:1024,messages:[{role:"user",content:"Write a function to sort an array in Python."},{role:"assistant",content:"Here's a simple sort function:\n\n```python\ndef sort_array(arr):\n return sorted(arr)\n```"},{role:"user",content:"Now make it sort in descending order."}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"Write a function to sort an array in Python."}]},{role:"model",parts:[{text:"Here's a simple sort function:\n\n```python\ndef sort_array(arr):\n return sorted(arr)\n```"}]},{role:"user",parts:[{text:"Now make it sort in descending order."}]}],systemInstruction:{parts:[{text:"You are a coding assistant."}]}}}},{id:"thinking",name:"Thinking",icon:"psychology",description:"Extended thinking / reasoning",formats:{openai:{model:"o3-mini",messages:[{role:"user",content:"What is the sum of the first 100 prime numbers?"}],stream:!0},claude:{model:"claude-sonnet-4-20250514",max_tokens:16e3,thinking:{type:"enabled",budget_tokens:1e4},messages:[{role:"user",content:"What is the sum of the first 100 prime numbers?"}],stream:!0},gemini:{model:"gemini-2.5-flash-thinking",contents:[{role:"user",parts:[{text:"What is the sum of the first 100 prime numbers?"}]}],generationConfig:{thinkingConfig:{thinkingBudget:1e4}}}}},{id:"system-prompt",name:"System Prompt",icon:"settings",description:"Complex system instructions",formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:"You are a senior software engineer specializing in distributed systems. Answer questions concisely using industry best practices. Always provide code examples when relevant. Format your responses using markdown."},{role:"user",content:"How do I implement a circuit breaker pattern?"}],temperature:.7,stream:!0},claude:{model:"claude-sonnet-4-20250514",system:"You are a senior software engineer specializing in distributed systems. Answer questions concisely using industry best practices. Always provide code examples when relevant. Format your responses using markdown.",max_tokens:2048,messages:[{role:"user",content:"How do I implement a circuit breaker pattern?"}],temperature:.7,stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"How do I implement a circuit breaker pattern?"}]}],systemInstruction:{parts:[{text:"You are a senior software engineer specializing in distributed systems. Answer questions concisely using industry best practices. Always provide code examples when relevant. Format your responses using markdown."}]},generationConfig:{temperature:.7}}}},{id:"streaming",name:"Streaming",icon:"stream",description:"SSE streaming request",formats:{openai:{model:"gpt-4o",messages:[{role:"user",content:"Tell me a short story about a robot learning to paint."}],stream:!0,stream_options:{include_usage:!0}},claude:{model:"claude-sonnet-4-20250514",max_tokens:1024,messages:[{role:"user",content:"Tell me a short story about a robot learning to paint."}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:"Tell me a short story about a robot learning to paint."}]}]}}}],i={openai:{label:"OpenAI",color:"emerald",icon:"smart_toy"},"openai-responses":{label:"OpenAI Responses",color:"amber",icon:"swap_horiz"},claude:{label:"Claude",color:"orange",icon:"psychology"},gemini:{label:"Gemini",color:"blue",icon:"auto_awesome"},antigravity:{label:"Antigravity",color:"purple",icon:"rocket_launch"},kiro:{label:"Kiro",color:"cyan",icon:"terminal"},cursor:{label:"Cursor",color:"pink",icon:"edit"},codex:{label:"Codex",color:"yellow",icon:"code"}},o=Object.entries(i).map(([e,t])=>({value:e,label:t.label}));var c=s(75707),d=s.n(c);let m=d()(()=>s.e(8202).then(s.bind(s,28202)),{loadableGenerated:{webpack:()=>[require.resolveWeak("@monaco-editor/react")]},ssr:!1});function u(){let[e,t]=(0,r.useState)("claude"),[s,c]=(0,r.useState)("openai"),[d,u]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[h,f]=(0,r.useState)(null),[g,b]=(0,r.useState)(!1),[y,j]=(0,r.useState)(!1),[v,N]=(0,r.useState)(null),w=(0,r.useCallback)(async e=>{if(!e||e.trim().length<5)return void f(null);try{let s=JSON.parse(e);j(!0);let a=await fetch("/api/translator/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:s})}),r=await a.json();r.success&&(f(r.format),t(r.format))}catch{}finally{j(!1)}},[]);(0,r.useEffect)(()=>{let e=setTimeout(()=>{w(d)},600);return()=>clearTimeout(e)},[d,w]);let k=async()=>{if(d.trim()){b(!0),p("");try{let t=JSON.parse(d),a=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:e,targetFormat:s,body:t})}),r=await a.json();r.success?p(JSON.stringify(r.result,null,2)):p(JSON.stringify({error:r.error},null,2))}catch(e){p(JSON.stringify({error:e.message},null,2))}b(!1)}},S=async e=>{try{await navigator.clipboard.writeText(e)}catch{}},C=i[e]||i.openai,_=i[s]||i.openai;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:"Format Converter"}),(0,a.jsx)("p",{children:"Paste or type a JSON request body. The translator will auto-detect the source format and convert it to the target format. Use this to debug how OmniRoute translates requests between formats (OpenAI ↔ Claude ↔ Gemini ↔ Responses API)."})]})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col sm:flex-row items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Source Format"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] text-${C.color}-500`,children:C.icon}),(0,a.jsx)(n.l6,{value:e,onChange:e=>{t(e.target.value),f(null)},options:o,className:"flex-1"}),h&&(0,a.jsx)(n.Ex,{variant:"primary",size:"sm",icon:"auto_awesome",children:"Auto"})]})]}),(0,a.jsx)("button",{onClick:()=>{t(s),c(e),u(x),p(""),f(null)},className:"p-2 rounded-full hover:bg-primary/10 text-text-muted hover:text-primary transition-all mt-4 sm:mt-5",title:"Swap formats",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"swap_horiz"})}),(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Target Format"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] text-${_.color}-500`,children:_.icon}),(0,a.jsx)(n.l6,{value:s,onChange:e=>c(e.target.value),options:o,className:"flex-1"})]})]}),(0,a.jsx)("div",{className:"pt-0 sm:pt-5",children:(0,a.jsx)(n.$n,{icon:"arrow_forward",onClick:k,loading:g,disabled:!d.trim()||g,className:"whitespace-nowrap",children:"Translate"})})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"input"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Input"}),h&&(0,a.jsx)(n.Ex,{variant:"info",size:"sm",dot:!0,children:i[h]?.label||h}),y&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted animate-spin",children:"progress_activity"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>S(d),className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:"Copy",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,a.jsx)("button",{onClick:()=>{u(""),p(""),f(null),N(null)},className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]}),(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(m,{height:"400px",defaultLanguage:"json",value:d,onChange:e=>u(e||""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,formatOnPaste:!0,placeholder:"Paste a request body here or select a template below..."}})})]})}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"output"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Output"}),x&&(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:i[s]?.label||s})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:(0,a.jsx)("button",{onClick:()=>S(x),className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:"Copy",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})})})]}),(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(m,{height:"400px",defaultLanguage:"json",value:x,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,readOnly:!0}})})]})})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"library_books"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Example Templates"}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"— Click to load"})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2",children:l.map(t=>(0,a.jsxs)("button",{onClick:()=>{u(JSON.stringify(t.formats[e]||t.formats.openai,null,2)),N(t.id),p("")},className:`
2
- group flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all text-center
3
- ${v===t.id?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/30 hover:bg-primary/5 text-text-muted hover:text-text-main"}
4
- `,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] ${v===t.id?"text-primary":"text-text-muted group-hover:text-primary"} transition-colors`,children:t.icon}),(0,a.jsx)("span",{className:"text-xs font-medium leading-tight",children:t.name})]},t.id))}),v&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),"Template loads the request in"," ",(0,a.jsx)("strong",{className:"text-text-main",children:i[e]?.label||e})," ","format. Change Source Format to load in a different format."]})]})})]})}var x=s(55757);function p(e="openai"){let[t,s]=(0,r.useState)(e),[a,n]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),[a,r]=await Promise.all([e.json(),t.json()]),l=new Map((r.nodes||[]).map(e=>[e.id,e])),i=[...new Set((a.connections||[]).filter(e=>!1!==e.isActive).map(e=>e.provider))].map(e=>{let t=x.Q2[e],s=l.get(e),a=t?.name||s?.name||e;return!t&&e.startsWith(x.JH)&&(a=s?.name||"OpenAI Compatible"),!t&&e.startsWith(x.DI)&&(a=s?.name||"Anthropic Compatible"),{value:e,label:a}}).sort((e,t)=>e.label.localeCompare(t.label)),o=i.length>0?i:Object.entries(x.Q2).map(([e,t])=>({value:e,label:t.name}));n(o),o.length>0&&s(e=>o.some(t=>t.value===e)?e:o[0].value)}catch{let e=Object.entries(x.Q2).map(([e,t])=>({value:e,label:t.name}));n(e),e.length>0&&s(t=>e.some(e=>e.value===t)?t:e[0].value)}finally{i(!1)}})()},[]),{provider:t,setProvider:s,providerOptions:a,loading:l}}let h={openai:["gpt-","o1-","o3-","o4-"],"openai-responses":["gpt-","o1-","o3-","o4-"],claude:["claude-"],gemini:["gemini-"]};function f(){let[e,t]=(0,r.useState)(""),[s,a]=(0,r.useState)([]),[n,l]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/v1/models"),t=((await e.json()).data||[]).map(e=>e.id).sort((e,t)=>e.localeCompare(t));a(t)}catch{a([])}finally{l(!1)}})()},[]);let i=(0,r.useCallback)(e=>{if(0===s.length)return"";for(let t of h[e]||[]){let e=s.find(e=>e.startsWith(t));if(e)return e}return s[0]},[s]);return{model:e,setModel:t,availableModels:s,loading:n,pickModelForFormat:i}}let g=d()(()=>s.e(8202).then(s.bind(s,28202)),{loadableGenerated:{webpack:()=>[require.resolveWeak("@monaco-editor/react")]},ssr:!1});function b(){let{provider:e,setProvider:t,providerOptions:s}=p("openai"),{model:l,setModel:c,availableModels:d,pickModelForFormat:m}=f(),[u,x]=(0,r.useState)("openai"),[h,b]=(0,r.useState)(""),[y,j]=(0,r.useState)(!1),[v,N]=(0,r.useState)([]),[w,k]=(0,r.useState)(null),[S,C]=(0,r.useState)(null),_=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=m(u);e&&c(e)},[u,m,c]);let O=()=>{_.current?.scrollIntoView({behavior:"smooth"})},T=async()=>{if(!h.trim()||y)return;let t=h.trim();b(""),j(!0),N(e=>[...e,{role:"user",content:t}]);let s=[];try{let a,r=[...v.map(e=>({role:e.role,content:e.content})),{role:"user",content:t}];a="claude"===u?{model:l,max_tokens:1024,messages:r,stream:!0}:"gemini"===u?{model:l,contents:r.map(e=>({role:"assistant"===e.role?"model":"user",parts:[{text:e.content}]}))}:"openai-responses"===u?{model:l,input:r.map(e=>({type:"message",role:e.role,content:[{type:"input_text",text:e.content}]})),stream:!0}:{model:l,messages:r,stream:!0},s.push({id:1,name:"Client Request",description:"The request body as your client would send it",format:u,content:JSON.stringify(a,null,2),status:"done"});let n=await fetch("/api/translator/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:a})}),i=(await n.json()).format||u;s.push({id:2,name:"Format Detected",description:"OmniRoute auto-detects the API format from the request structure",format:i,content:JSON.stringify({detectedFormat:i,clientFormat:u,match:i===u},null,2),status:"done"});let o=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:i,targetFormat:"openai",body:a})}),c=await o.json();s.push({id:3,name:"OpenAI Intermediate",description:"All formats are first normalized to OpenAI format (the universal bridge)",format:"openai",content:JSON.stringify(c.result||c,null,2),status:c.success?"done":"error"});let d=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:"openai",provider:e,body:c.result})}),m=await d.json(),x=m.targetFormat||"openai";s.push({id:4,name:"Provider Format",description:"OpenAI format is translated to the provider's native format",format:x,content:JSON.stringify(m.result||m,null,2),status:m.success?"done":"error"});let p=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,body:m.result||c.result})});if(p.ok){let e=p.body.getReader(),t=new TextDecoder,a="";for(;;){let{done:s,value:r}=await e.read();if(s)break;a+=t.decode(r,{stream:!0})}s.push({id:5,name:"Provider Response",description:"The raw SSE stream from the provider API",format:x,content:a.slice(0,5e3)+(a.length>5e3?"\n... (truncated)":""),status:"done"});let r=function(e){let t="";for(let s of e.split("\n")){if(!s.startsWith("data: "))continue;let e=s.slice(6).trim();if("[DONE]"===e)break;try{let s=JSON.parse(e),a=s.choices?.[0]?.delta;a?.content&&(t+=a.content),"content_block_delta"===s.type&&s.delta?.text&&(t+=s.delta.text)}catch{}}return t||e.slice(0,500)}(a);N(e=>[...e,{role:"assistant",content:r||"(No text extracted)"}])}else{let e=await p.json().catch(()=>({error:"Request failed"}));s.push({id:5,name:"Provider Response",description:"The raw response from the provider API",format:x,content:JSON.stringify(e,null,2),status:"error"}),N(t=>[...t,{role:"assistant",content:`Error: ${e.error||"Request failed"}`}])}}catch(e){s.push({id:s.length+1,name:"Error",description:"An unexpected error occurred",format:"error",content:JSON.stringify({error:e.message},null,2),status:"error"}),N(t=>[...t,{role:"assistant",content:`Error: ${e.message}`}])}k(s),C(s.length>0?s[s.length-1].id:null),j(!1),setTimeout(O,100)};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:"Pipeline Debugger"}),(0,a.jsxs)("p",{children:["Send messages as a specific client format and see how each step of the translation pipeline works. The right panel shows the full flow:"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"Client Request → Format Detection → OpenAI Intermediate → Provider Format → Response"}),". Click any step to inspect the data at that stage."]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:"Client Format"}),(0,a.jsx)(n.l6,{value:u,onChange:e=>x(e.target.value),options:o.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:"Provider"}),(0,a.jsx)(n.l6,{value:e,onChange:e=>t(e.target.value),options:s})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:"Model"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:l,onChange:e=>c(e.target.value),list:"model-suggestions",placeholder:"Select or type a model name...",className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"model-suggestions",children:d.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),(0,a.jsxs)(n.Zp,{className:"min-h-[400px] flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 flex-1 overflow-y-auto max-h-[500px] space-y-3",children:[0===v.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"chat"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:"Send a message to see the translation pipeline"}),(0,a.jsxs)("p",{className:"text-xs text-center max-w-xs",children:["Your message will be formatted as a"," ",(0,a.jsx)("strong",{children:i[u]?.label})," request, translated through the pipeline, and sent to the selected provider."]})]}),v.map((e,t)=>(0,a.jsx)("div",{className:`flex ${"user"===e.role?"justify-end":"justify-start"}`,children:(0,a.jsxs)("div",{className:`max-w-[85%] rounded-lg px-3 py-2 text-sm ${"user"===e.role?"bg-primary/10 text-text-main border border-primary/20":"bg-bg-subtle text-text-main border border-border"}`,children:[(0,a.jsx)("p",{className:"text-[10px] font-semibold text-text-muted mb-1 uppercase",children:"user"===e.role?`You (${i[u]?.label})`:"Assistant"}),(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:e.content})]})},t)),(0,a.jsx)("div",{ref:_})]}),(0,a.jsx)("div",{className:"p-3 border-t border-border",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:h,onChange:e=>b(e.target.value),onKeyDown:e=>"Enter"===e.key&&!e.shiftKey&&T(),placeholder:"Type a message...",className:"flex-1 bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors",disabled:y}),(0,a.jsx)(n.$n,{icon:"send",onClick:T,loading:y,disabled:!h.trim()||y,children:"Send"})]})})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"account_tree"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Translation Pipeline"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Click on any step to inspect the data at that stage"})]})}),w?(0,a.jsx)("div",{className:"space-y-2",children:w.map((e,t)=>{let s=i[e.format]||{label:e.format,color:"gray",icon:"code"},r=S===e.id;return(0,a.jsxs)("div",{children:[t>0&&(0,a.jsx)("div",{className:"flex justify-center py-1",children:(0,a.jsx)("div",{className:"w-px h-4 bg-border"})}),(0,a.jsxs)(n.Zp,{className:"error"===e.status?"border-red-500/30":r?"border-primary/30":"",children:[(0,a.jsxs)("button",{onClick:()=>C(r?null:e.id),className:"w-full p-3 flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-7 h-7 rounded-full text-xs font-bold ${"error"===e.status?"bg-red-500/10 text-red-500":"done"===e.status?`bg-${s.color}-500/10 text-${s.color}-500`:"bg-bg-subtle text-text-muted"}`,children:"error"===e.status?"!":e.id}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-[10px] text-text-muted truncate",children:e.description})]}),(0,a.jsx)(n.Ex,{variant:"error"===e.status?"error":"default",size:"sm",children:s.label}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:r?"expand_less":"expand_more"})]}),r&&(0,a.jsx)("div",{className:"px-3 pb-3",children:(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(g,{height:"250px",defaultLanguage:"json",value:e.content,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:11,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,readOnly:!0}})})})]})]},e.id)})}):(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"account_tree"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:"Pipeline visualization"}),(0,a.jsx)("p",{className:"text-xs text-center max-w-xs",children:"Send a message to see how your request flows through detection → translation → provider call."})]})})]})]})]})}let y=[{id:"simple-chat",name:"Simple Chat",icon:"chat",templateId:"simple-chat"},{id:"tool-calling",name:"Tool Calling",icon:"build",templateId:"tool-calling"},{id:"multi-turn",name:"Multi-turn",icon:"forum",templateId:"multi-turn"},{id:"thinking",name:"Thinking",icon:"psychology",templateId:"thinking"},{id:"system-prompt",name:"System Prompt",icon:"settings",templateId:"system-prompt"},{id:"streaming",name:"Streaming",icon:"stream",templateId:"streaming"}];function j(){let[e,t]=(0,r.useState)("claude"),{provider:s,setProvider:c,providerOptions:d}=p("openai"),{model:m,setModel:u,availableModels:x,pickModelForFormat:h}=f(),[g,b]=(0,r.useState)({}),[j,v]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let t=h(e);t&&u(t)},[e,h,u]);let N=async t=>{b(e=>({...e,[t.id]:{status:"running"}}));let a=Date.now();try{let r=l.find(e=>e.id===t.templateId),n=r?.formats[e]||r?.formats.openai;if(!n)return void b(e=>({...e,[t.id]:{status:"error",error:"No template for this format",latency:0}}));let i={...n,model:m};n.contents&&(i.model=m);let o=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:e,provider:s,body:i})}),c=await o.json();if(!c.success)return void b(e=>({...e,[t.id]:{status:"error",error:`Translation failed: ${c.error}`,latency:Date.now()-a}}));let d=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:s,body:c.result})}),u=Date.now()-a;if(!d.ok){let e=await d.json().catch(()=>({}));b(s=>({...s,[t.id]:{status:"error",error:e.error||`HTTP ${d.status}`,latency:u,httpStatus:d.status}}));return}let x=d.body.getReader(),p=0;for(;;){let{done:e}=await x.read();if(e)break;p++}b(e=>({...e,[t.id]:{status:"pass",latency:Date.now()-a,chunks:p}}))}catch(e){b(s=>({...s,[t.id]:{status:"error",error:e.message,latency:Date.now()-a}}))}},w=async()=>{for(let e of(v(!0),b({}),y))await N(e);v(!1)},k=Object.values(g).filter(e=>"pass"===e.status).length,S=Object.values(g).filter(e=>"error"===e.status).length,C=k+S,_=C>0?Math.round(k/C*100):0,O=i[e]||i.openai;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:"Compatibility Tester"}),(0,a.jsx)("p",{children:"Run predefined scenarios (Simple Chat, Tool Calling, etc.) to verify translation and provider compatibility. Select a source format and target provider, then run all tests to see a compatibility percentage. Use this to find which features work across providers."})]})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-end gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Source Format"}),(0,a.jsx)(n.l6,{value:e,onChange:e=>{t(e.target.value),b({})},options:o.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsx)("div",{className:"flex items-center justify-center px-2",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px] text-text-muted",children:"arrow_forward"})}),(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Target Provider"}),(0,a.jsx)(n.l6,{value:s,onChange:e=>{c(e.target.value),b({})},options:d})]}),(0,a.jsx)(n.$n,{icon:"play_arrow",onClick:w,loading:j,disabled:j,children:"Run All Tests"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:"Model"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),list:"testbench-model-suggestions",placeholder:"Select or type a model name...",className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"testbench-model-suggestions",children:x.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),C>0&&(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Compatibility Report"}),(0,a.jsxs)(n.Ex,{variant:_>=80?"success":_>=50?"warning":"error",size:"lg",children:[_,"%"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," ",k," passed"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-red-500"})," ",S," failed"]})]})]}),(0,a.jsx)("div",{className:"w-full h-2 bg-bg-subtle rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r from-green-500 to-emerald-400 rounded-full transition-all duration-500",style:{width:`${_}%`}})})]})}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:y.map(e=>{let t=g[e.id],r=t?.status==="running";return(0,a.jsx)(n.Zp,{className:`transition-all ${t?.status==="pass"?"border-green-500/30":t?.status==="error"?"border-red-500/30":""}`,children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-9 h-9 rounded-lg ${t?.status==="pass"?"bg-green-500/10 text-green-500":t?.status==="error"?"bg-red-500/10 text-red-500":"bg-bg-subtle text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:r?"progress_activity":t?.status==="pass"?"check_circle":t?.status==="error"?"error":e.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted uppercase",children:[O.label," →"," ",d.find(e=>e.value===s)?.label||s]})]})]})}),t&&"running"!==t.status&&(0,a.jsx)("div",{className:`rounded-lg p-2 text-xs ${"pass"===t.status?"bg-green-500/5 text-green-600 dark:text-green-400":"bg-red-500/5 text-red-600 dark:text-red-400"}`,children:"pass"===t.status?(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:"✅ Passed"}),(0,a.jsxs)("span",{className:"text-text-muted",children:[t.latency,"ms • ",t.chunks," chunks"]})]}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:["❌ ",t.error]}),(0,a.jsxs)("p",{className:"text-text-muted mt-0.5",children:[t.latency,"ms"]})]})}),(0,a.jsx)(n.$n,{size:"sm",variant:t?.status==="pass"?"ghost":"outline",icon:r?"progress_activity":"play_arrow",onClick:()=>N(e),disabled:r||j,className:"w-full",children:r?"Running...":t?"Re-run":"Run Test"})]})},e.id)})})]})}function v(){let[e,t]=(0,r.useState)([]),[s,l]=(0,r.useState)(!0),[o,c]=(0,r.useState)(!0),d=(0,r.useRef)(null),m=async()=>{try{let e=await fetch("/api/translator/history?limit=50");if(e.ok){let s=await e.json();t(s.events||[])}}catch{}finally{l(!1)}};(0,r.useEffect)(()=>(m(),o&&(d.current=setInterval(m,3e3)),()=>{d.current&&clearInterval(d.current)}),[o]);let u=e.filter(e=>"success"===e.status).length,x=e.filter(e=>"error"===e.status).length,p=e.length>0?Math.round(e.reduce((e,t)=>e+(t.latency||0),0)/e.length):0;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:"Real-Time Translation Activity"}),(0,a.jsxs)("p",{children:["Shows translation events as API calls flow through OmniRoute. Events come from the in-memory buffer (resets on restart). Use"," ",(0,a.jsx)("strong",{className:"text-text-main",children:"Chat Tester"}),","," ",(0,a.jsx)("strong",{className:"text-text-main",children:"Test Bench"}),", or external API calls to generate events."]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,a.jsx)(N,{icon:"translate",label:"Total Translations",value:e.length,color:"blue"}),(0,a.jsx)(N,{icon:"check_circle",label:"Successful",value:u,color:"green"}),(0,a.jsx)(N,{icon:"error",label:"Errors",value:x,color:"red"}),(0,a.jsx)(N,{icon:"speed",label:"Avg Latency",value:`${p}ms`,color:"purple"})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${o?"text-green-500 animate-pulse":"text-text-muted"}`,children:o?"radio_button_checked":"radio_button_unchecked"}),(0,a.jsx)("button",{onClick:()=>c(!o),className:"text-sm text-text-main hover:text-primary transition-colors",children:o?"Live — Auto-refreshing":"Paused"})]}),(0,a.jsxs)("button",{onClick:m,className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"}),"Refresh"]})]})}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main mb-3",children:"Recent Translations"}),s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}):0===e.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"monitoring"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:"No translations yet"}),(0,a.jsx)("p",{className:"text-xs text-center max-w-sm",children:"Translation events appear here as requests flow through OmniRoute. Use any of these methods to generate events:"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mt-3 text-xs",children:[(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"Chat Tester tab"}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"Test Bench tab"}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"External API calls"}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:"IDE/CLI integrations"})]}),(0,a.jsx)("p",{className:"text-[10px] mt-3 text-text-muted/70",children:"Note: Events are stored in-memory and reset when the server restarts."})]}):(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:"text-left text-xs text-text-muted border-b border-border",children:[(0,a.jsx)("th",{className:"pb-2 pr-4",children:"Time"}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:"Source"}),(0,a.jsx)("th",{className:"pb-2 pr-4"}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:"Target"}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:"Model"}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:"Status"}),(0,a.jsx)("th",{className:"pb-2 text-right",children:"Latency"})]})}),(0,a.jsx)("tbody",{children:e.map((e,t)=>{let s=i[e.sourceFormat]||{label:e.sourceFormat||"?",color:"gray"},r=i[e.targetFormat]||{label:e.targetFormat||"?",color:"gray"};return(0,a.jsxs)("tr",{className:"border-b border-border/50 hover:bg-bg-subtle/50 transition-colors",children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-xs text-text-muted whitespace-nowrap",children:e.timestamp?new Date(e.timestamp).toLocaleTimeString():"—"}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:s.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"arrow_forward"})}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"primary",size:"sm",children:r.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-xs font-mono text-text-muted",children:e.model||"—"}),(0,a.jsx)("td",{className:"py-2 pr-4",children:"success"===e.status?(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:"OK"}):(0,a.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e.statusCode||"ERR"})}),(0,a.jsx)("td",{className:"py-2 text-right text-xs text-text-muted",children:e.latency?`${e.latency}ms`:"—"})]},e.id||t)})})]})})]})})]})}function N({icon:e,label:t,value:s,color:r}){return(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex items-center gap-3",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-${r}-500/10`,children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] text-${r}-500`,children:e})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-bold text-text-main",children:s}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:t})]})]})})}let w=[{value:"playground",label:"Playground",icon:"code"},{value:"chat-tester",label:"Chat Tester",icon:"chat"},{value:"test-bench",label:"Test Bench",icon:"science"},{value:"live-monitor",label:"Live Monitor",icon:"monitoring"}];function k(){let[e,t]=(0,r.useState)("playground");return(0,a.jsxs)("div",{className:"p-8 space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"translate"}),"Translator Playground"]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Debug, test, and visualize how OmniRoute translates API requests between providers"})]}),(0,a.jsx)(n.Iz,{options:w,value:e,onChange:t,size:"md"})]}),"playground"===e&&(0,a.jsx)(u,{}),"chat-tester"===e&&(0,a.jsx)(b,{}),"test-bench"===e&&(0,a.jsx)(j,{}),"live-monitor"===e&&(0,a.jsx)(v,{})]})}},75707:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});let a=s(73623)._(s(68635));function r(e,t){let s={};"function"==typeof e&&(s.loader=e);let r={...s,...t};return(0,a.default)({...r,modules:r.loadableGenerated?.modules})}("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)}},e=>{e.O(0,[8500,9751,782,7013,7896,1525,8441,3794,7358],()=>e(e.s=31355)),_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:()=>b});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(55757);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)({}),[g,b]=(0,l.useState)({}),[j,y]=(0,l.useState)(!0),[v,N]=(0,l.useState)(null),[k,w]=(0,l.useState)(!1),[A,C]=(0,l.useState)(120),[E,S]=(0,l.useState)(!0),[I,q]=(0,l.useState)("all"),M=(0,l.useRef)(null),P=(0,l.useRef)(null),$=(0,l.useRef)({}),L=(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([]),[]}},[]),T=(0,l.useCallback)(async(e,t)=>{let s=Date.now();if(!(s-($.current[e]||0)<3e4)){$.current[e]=s,f(t=>({...t,[e]:!0})),b(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){b(s=>({...s,[e]:t.message||"Failed to fetch quota"}))}finally{f(t=>({...t,[e]:!1}))}}},[]),R=(0,l.useCallback)(async(e,t)=>{await T(e,t),N(new Date)},[T]),_=(0,l.useCallback)(async()=>{if(!k){w(!0),C(120);try{let e=(await L()).filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType);await Promise.all(e.map(e=>T(e.id,e.provider))),N(new Date)}catch(e){console.error("Error refreshing all:",e)}finally{w(!1)}}},[k,L,T]);(0,l.useEffect)(()=>{(async()=>{S(!0),await _(),S(!1)})()},[]),(0,l.useEffect)(()=>{if(!j){M.current&&clearInterval(M.current),P.current&&clearInterval(P.current);return}return M.current=setInterval(_,12e4),P.current=setInterval(()=>{C(e=>e<=1?120:e-1)},1e3),()=>{M.current&&clearInterval(M.current),P.current&&clearInterval(P.current)}},[j,_]),(0,l.useEffect)(()=>{let e=()=>{document.hidden?(M.current&&clearInterval(M.current),P.current&&clearInterval(P.current)):j&&(M.current=setInterval(_,12e4),P.current=setInterval(()=>{C(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]),D=(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 D)e[t.id]=c(s[t.id]?.plan);return e},[D,s]),F=(0,l.useMemo)(()=>{let e={all:D.length,enterprise:0,business:0,ultra:0,pro:0,free:0,unknown:0};for(let t of D){let s=U[t.id]?.key||"unknown";e[s]=(e[s]||0)+1}return e},[D,U]),B=(0,l.useMemo)(()=>"all"===I?D:D.filter(e=>(U[e.id]?.key||"unknown")===I),[D,U,I]);return E?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(x.CardSkeleton,{}),(0,a.jsx)(x.CardSkeleton,{})]}):0===D.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!==D.length?` (filtered from ${D.length})`:""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{onClick:()=>y(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:["(",A,"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&&!F[e.key])return null;let t=I===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, #E54D5E)":"1px solid rgba(255,255,255,0.12)",background:t?"rgba(249,120,21,0.14)":"transparent",color:t?"var(--primary, #E54D5E)":"var(--text-muted)"},children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"opacity-85",children:F[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=g[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:v?(0,a.jsx)("span",{children:v.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===I)?.label||I}),"."]})]})]})}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 g(){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.jsx)("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)})})]})})}function b(){let[e,t]=(0,l.useState)("logs");return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(r.Iz,{options:[{value:"logs",label:"Logger"},{value:"proxy-logs",label:"Proxy"},{value:"limits",label:"Limits"}],value:e,onChange:t}),"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)(g,{}),(0,a.jsx)(f,{})]}),"logs"===e&&(0,a.jsx)(r.y7,{}),"proxy-logs"===e&&(0,a.jsx)(r.Lo,{})]})}},49448:(e,t,s)=>{Promise.resolve().then(s.bind(s,25852))}},e=>{e.O(0,[8500,9751,782,7013,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],{92122:(e,s,n)=>{Promise.resolve().then(n.bind(n,24229)),Promise.resolve().then(n.bind(n,23375)),Promise.resolve().then(n.bind(n,69902)),Promise.resolve().then(n.bind(n,39680)),Promise.resolve().then(n.bind(n,67578)),Promise.resolve().then(n.bind(n,56390)),Promise.resolve().then(n.bind(n,44817)),Promise.resolve().then(n.bind(n,73580)),Promise.resolve().then(n.bind(n,2674)),Promise.resolve().then(n.bind(n,40135)),Promise.resolve().then(n.bind(n,15419)),Promise.resolve().then(n.bind(n,89145)),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,51737)),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,53558)),Promise.resolve().then(n.bind(n,18056)),Promise.resolve().then(n.bind(n,22447)),Promise.resolve().then(n.bind(n,6148)),Promise.resolve().then(n.bind(n,11957)),Promise.resolve().then(n.bind(n,34713)),Promise.resolve().then(n.bind(n,13720)),Promise.resolve().then(n.bind(n,96957)),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,9751,782,7013,7896,1525,8441,3794,7358],()=>e(e.s=92122)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7852],{23066:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>i});var a=t(95155),r=t(12115),l=t(73321);function n(){let e=(0,l.useSearchParams)(),[s,t]=(0,r.useState)("processing");return(0,r.useEffect)(()=>{let s=e.get("code"),a=e.get("state"),r=e.get("error"),l={code:s,state:a,error:r,errorDescription:e.get("error_description"),fullUrl:window.location.href},n=!1;if(window.location.origin,window.opener)try{window.opener.postMessage({type:"oauth_callback",data:l},"*"),n=!0}catch(e){console.log("postMessage failed:",e)}try{let e=new BroadcastChannel("oauth_callback");e.postMessage(l),e.close(),n=!0}catch(e){console.log("BroadcastChannel failed:",e)}try{localStorage.setItem("oauth_callback",JSON.stringify({...l,timestamp:Date.now()})),n=!0}catch(e){console.log("localStorage failed:",e)}n&&(s||r)?setTimeout(()=>{window.opener?(t("success"),setTimeout(()=>{window.close(),setTimeout(()=>t("done"),500)},1500)):t("done")},0):setTimeout(()=>t("manual"),0)},[e]),(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,a.jsxs)("div",{className:"text-center p-8 max-w-md",children:["processing"===s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Processing..."}),(0,a.jsx)("p",{className:"text-text-muted",children:"Please wait while we complete the authorization."})]}),("success"===s||"done"===s)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Authorization Successful!"}),(0,a.jsx)("p",{className:"text-text-muted",children:"success"===s?"This window will close automatically...":"You can close this tab now."})]}),"manual"===s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-yellow-100 dark:bg-yellow-900/30 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-yellow-600",children:"info"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Copy This URL"}),(0,a.jsx)("p",{className:"text-text-muted mb-4",children:"Please copy the URL from the address bar and paste it in the application."}),(0,a.jsx)("div",{className:"bg-surface border border-border rounded-lg p-3 text-left",children:(0,a.jsx)("code",{className:"text-xs break-all",children:window.location.href})})]})]})})}function i(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,a.jsxs)("div",{className:"text-center p-8",children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,a.jsx)("p",{className:"text-text-muted",children:"Loading..."})]})}),children:(0,a.jsx)(n,{})})}},73321:(e,s,t)=>{"use strict";var a=t(74645);t.o(a,"useParams")&&t.d(s,{useParams:function(){return a.useParams}}),t.o(a,"usePathname")&&t.d(s,{usePathname:function(){return a.usePathname}}),t.o(a,"useRouter")&&t.d(s,{useRouter:function(){return a.useRouter}}),t.o(a,"useSearchParams")&&t.d(s,{useSearchParams:function(){return a.useSearchParams}})},84107:(e,s,t)=>{Promise.resolve().then(t.bind(t,23066))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=84107)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[200],{7366:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>n});var r=a(95155),s=a(98500);function n(){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-screen p-6 bg-[var(--bg-primary,#0a0a0f)] text-[var(--text-primary,#e0e0e0)] text-center",children:[(0,r.jsx)("div",{className:"text-[96px] font-extrabold leading-none mb-2",style:{background:"linear-gradient(135deg, #ef4444 0%, #f97316 50%, #eab308 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"403"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold mb-2",children:"Access Denied"}),(0,r.jsx)("p",{className:"text-[15px] text-[var(--text-secondary,#888)] max-w-[400px] leading-relaxed mb-8",children:"You don't have permission to access this resource. Check your API key or contact the administrator."}),(0,r.jsx)(s,{href:"/dashboard",className:"px-8 py-3 rounded-[10px] text-white text-sm font-semibold no-underline transition-all duration-200 shadow-[0_4px_16px_rgba(99,102,241,0.3)] hover:-translate-y-0.5",style:{background:"linear-gradient(135deg, #6366f1, #8b5cf6)"},children:"Go to Dashboard"})]})}},89661:(e,t,a)=>{Promise.resolve().then(a.bind(a,7366))}},e=>{e.O(0,[8500,8441,3794,7358],()=>e(e.s=89661)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2162],{39839:(e,s,t)=>{Promise.resolve().then(t.bind(t,50144))},50144:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>i});var a=t(95155),l=t(98500),r=t(71525);function i(){return(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,a.jsxs)("div",{className:"w-full max-w-lg",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-primary mb-2",children:"Reset Password"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Choose a method to recover access to your dashboard"})]}),(0,a.jsx)(r.Zp,{className:"mb-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-4 p-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-primary/10 text-primary shrink-0 mt-0.5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"terminal"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-1",children:"Method 1: CLI Reset"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-3",children:"Run the following command on the server where OmniRoute is running:"}),(0,a.jsx)("div",{className:"bg-black/30 rounded-lg p-3 mb-3 font-mono text-sm text-green-400 border border-white/5",children:(0,a.jsx)("code",{children:"npx omniroute reset-password"})}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"This will prompt you to set a new password. The server must be stopped first."})]})]})}),(0,a.jsx)(r.Zp,{className:"mb-6",children:(0,a.jsxs)("div",{className:"flex items-start gap-4 p-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-10 rounded-lg bg-amber-500/10 text-amber-500 shrink-0 mt-0.5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-1",children:"Method 2: Manual Reset"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-3",children:"Delete the password from the database and set a new one on startup:"}),(0,a.jsxs)("ol",{className:"text-sm text-text-muted space-y-2 list-decimal list-inside mb-3",children:[(0,a.jsx)("li",{children:"Stop the OmniRoute server"}),(0,a.jsxs)("li",{children:["Set a new password in your"," ",(0,a.jsx)("code",{className:"bg-black/30 px-1 rounded text-text-main",children:".env"})," file:",(0,a.jsx)("div",{className:"bg-black/30 rounded-lg p-2 mt-1 font-mono text-xs text-green-400 border border-white/5",children:"INITIAL_PASSWORD=your_new_password"})]}),(0,a.jsxs)("li",{children:["Delete"," ",(0,a.jsx)("code",{className:"bg-black/30 px-1 rounded text-text-main",children:"data/settings.json"})," ","(or remove the"," ",(0,a.jsx)("code",{className:"bg-black/30 px-1 rounded text-text-main",children:"passwordHash"})," ","field)"]}),(0,a.jsx)("li",{children:"Restart the server — it will use the new password"})]})]})]})}),(0,a.jsx)("div",{className:"text-center",children:(0,a.jsxs)(l,{href:"/login",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_back"}),"Back to Login"]})})]})})}}},e=>{e.O(0,[8500,9751,782,7013,7896,1525,8441,3794,7358],()=>e(e.s=39839)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7018],{58603:(e,t,s)=>{Promise.resolve().then(s.bind(s,99283))},94457:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var r=s(95155),a=s(14051);function l({size:e=20,className:t=""}){return(0,r.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,r.jsx)("circle",{cx:"16",cy:"16",r:"3",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"24",cy:"8",r:"2",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"8",cy:"24",r:"2",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"24",cy:"24",r:"2",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"16",cy:"5",r:"1.5",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"16",cy:"27",r:"1.5",fill:"currentColor"}),(0,r.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),(0,r.jsx)("line",{x1:"16",y1:"13",x2:"24",y2:"8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),(0,r.jsx)("line",{x1:"16",y1:"19",x2:"8",y2:"24",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),(0,r.jsx)("line",{x1:"16",y1:"19",x2:"24",y2:"24",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),(0,r.jsx)("line",{x1:"16",y1:"13",x2:"16",y2:"5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),(0,r.jsx)("line",{x1:"16",y1:"19",x2:"16",y2:"27",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}l.propTypes={size:a.number,className:a.string}},99283:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>j});var r=s(95155),a=s(39092),l=s(73321),o=s(12115),i=s(94457);function n(){let[e,t]=(0,o.useState)(!1),s=(0,l.useRouter)();return(0,r.jsxs)("nav",{className:"fixed top-0 z-50 w-full bg-[#0B0E14]/80 backdrop-blur-md border-b border-[#2D333B]",children:[(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-3 cursor-pointer bg-transparent border-none p-0",onClick:()=>s.push("/"),"aria-label":"Navigate to home",children:[(0,r.jsx)("div",{className:"size-8 rounded bg-linear-to-br from-[#E54D5E] to-[#C93D4E] flex items-center justify-center text-white",children:(0,r.jsx)(i.A,{size:20,className:"text-white"})}),(0,r.jsx)("h2",{className:"text-white text-xl font-bold tracking-tight",children:"OmniRoute"})]}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-8",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"/docs",children:"Docs"}),(0,r.jsxs)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors flex items-center gap-1",href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",children:["GitHub ",(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"hidden sm:flex h-9 items-center justify-center rounded-lg px-4 bg-[#E54D5E] hover:bg-[#C93D4E] transition-all text-white text-sm font-bold shadow-[0_0_15px_rgba(229,77,94,0.4)] hover:shadow-[0_0_20px_rgba(229,77,94,0.6)]",children:"Get Started"}),(0,r.jsx)("button",{className:"md:hidden text-white",onClick:()=>t(!e),children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e?"close":"menu"})})]})]}),e&&(0,r.jsx)("div",{className:"md:hidden border-t border-[#2D333B] bg-[#0B0E14]/95 backdrop-blur-md",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 p-6",children:[(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#features",onClick:()=>t(!1),children:"Features"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"#how-it-works",onClick:()=>t(!1),children:"How it Works"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"/docs",children:"Docs"}),(0,r.jsx)("a",{className:"text-gray-300 hover:text-white text-sm font-medium transition-colors",href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("button",{onClick:()=>s.push("/dashboard"),className:"h-9 rounded-lg bg-[#E54D5E] hover:bg-[#C93D4E] text-white text-sm font-bold",children:"Get Started"})]})})]})}function c(){return(0,r.jsxs)("section",{className:"relative pt-32 pb-20 px-6 min-h-[90vh] flex flex-col items-center justify-center overflow-hidden",children:[(0,r.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-[#E54D5E]/10 rounded-full blur-[120px] pointer-events-none"}),(0,r.jsxs)("div",{className:"relative z-10 max-w-4xl w-full text-center flex flex-col items-center gap-8",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-[#2D333B] bg-[#111520]/50 px-3 py-1 text-xs font-medium text-[#E54D5E]",children:[(0,r.jsx)("span",{className:"flex h-2 w-2 rounded-full bg-[#E54D5E] animate-pulse"}),"v1.0 is now live"]}),(0,r.jsxs)("h1",{className:"text-5xl md:text-7xl font-black leading-[1.1] tracking-tight",children:["One Endpoint for ",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#E54D5E]",children:"All AI Providers"})]}),(0,r.jsx)("p",{className:"text-lg md:text-xl text-gray-400 max-w-2xl mx-auto font-light",children:"AI endpoint proxy with web dashboard - A JavaScript port of CLIProxyAPI. Works seamlessly with Claude Code, OpenAI Codex, Cline, RooCode, and other CLI tools."}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 w-full",children:[(0,r.jsxs)("button",{className:"h-12 px-8 rounded-lg bg-[#E54D5E] hover:bg-[#C93D4E] text-white text-base font-bold transition-all shadow-[0_0_15px_rgba(229,77,94,0.4)] flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"rocket_launch"}),"Get Started"]}),(0,r.jsxs)("a",{href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",className:"h-12 px-8 rounded-lg border border-[#2D333B] bg-[#111520] hover:bg-[#2D333B] text-white text-base font-bold transition-all flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"}),"View on GitHub"]})]})]})]})}var d=s(5772);let x=[{id:"claude",name:"Claude Code",image:"/providers/claude.png"},{id:"codex",name:"OpenAI Codex",image:"/providers/codex.png"},{id:"cline",name:"Cline",image:"/providers/cline.png"},{id:"cursor",name:"Cursor",image:"/providers/cursor.png"}],m=[{id:"openai",name:"OpenAI",color:"bg-emerald-500",textColor:"text-white"},{id:"anthropic",name:"Anthropic",color:"bg-orange-400",textColor:"text-white"},{id:"gemini",name:"Gemini",color:"bg-blue-500",textColor:"text-white"},{id:"github",name:"GitHub Copilot",color:"bg-gray-700",textColor:"text-white"}];function h(){let[e,t]=(0,o.useState)(0);return(0,o.useEffect)(()=>{let e=setInterval(()=>{t(e=>(e+1)%m.length)},2e3);return()=>clearInterval(e)},[]),(0,r.jsxs)("div",{className:"mt-16 w-full max-w-4xl relative h-[360px] hidden md:flex items-center justify-center animate-[float_6s_ease-in-out_infinite]",children:[(0,r.jsxs)("div",{className:"relative z-20 w-32 h-32 rounded-full bg-[#111520] border-2 border-[#E54D5E] shadow-[0_0_40px_rgba(229,77,94,0.3)] flex flex-col items-center justify-center gap-1 group cursor-pointer hover:scale-105 transition-transform duration-500",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#E54D5E]",children:"hub"}),(0,r.jsx)("span",{className:"text-xs font-bold text-white tracking-widest uppercase",children:"OmniRoute"}),(0,r.jsx)("div",{className:"absolute inset-0 rounded-full border border-[#E54D5E]/30 animate-ping opacity-20"})]}),(0,r.jsx)("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 flex flex-col gap-7",children:x.map(e=>(0,r.jsx)("div",{className:"flex items-center gap-3 opacity-70 hover:opacity-100 transition-opacity group",children:(0,r.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-[#111520] border border-[#2D333B] flex items-center justify-center overflow-hidden p-2 hover:border-[#E54D5E]/50 transition-all hover:scale-105",children:(0,r.jsx)(d.default,{src:e.image,alt:e.name,width:48,height:48,className:"object-contain rounded-xl max-w-[48px] max-h-[48px]",sizes:"48px"})})},e.id))}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none stroke-yellow-700",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 50 C 250 70, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 140 C 250 140, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 210 C 250 210, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"}),(0,r.jsx)("path",{className:"animate-[dash_2s_linear_infinite]",d:"M 60 300 C 250 280, 250 180, 360 180",fill:"none",strokeDasharray:"5,5",strokeWidth:"2"})]}),(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full z-10 pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 50, 740 50",fill:"none",stroke:0===e?"#E54D5E":"rgb(75, 85, 99)",strokeWidth:0===e?"3":"2",className:0===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 130, 740 130",fill:"none",stroke:1===e?"#E54D5E":"rgb(75, 85, 99)",strokeWidth:1===e?"3":"2",className:1===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 230, 740 230",fill:"none",stroke:2===e?"#E54D5E":"rgb(75, 85, 99)",strokeWidth:2===e?"3":"2",className:2===e?"animate-pulse":""}),(0,r.jsx)("path",{d:"M 440 180 C 550 180, 550 310, 740 310",fill:"none",stroke:3===e?"#E54D5E":"rgb(75, 85, 99)",strokeWidth:3===e?"3":"2",className:3===e?"animate-pulse":""})]}),(0,r.jsx)("div",{className:"absolute right-0 top-0 bottom-0 flex flex-col justify-between py-6",children:m.map((t,s)=>(0,r.jsx)("div",{className:`px-4 py-2 rounded-lg ${t.color} ${t.textColor} flex items-center justify-center font-bold text-xs shadow-lg hover:scale-110 transition-all cursor-help min-w-[140px] ${e===s?"ring-4 ring-[#E54D5E]/50 scale-110":""}`,title:t.name,children:t.name},t.id))}),(0,r.jsx)("div",{className:"md:hidden mt-8 w-full p-4 rounded-lg bg-[#111520] border border-[#2D333B]",children:(0,r.jsx)("p",{className:"text-sm text-center text-gray-400",children:"Interactive diagram visible on desktop"})})]})}function u(){return(0,r.jsx)("section",{className:"py-24 border-y border-[#2D333B] bg-[#111520]/30",id:"how-it-works",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto px-6",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"How OmniRoute Works"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Data flows seamlessly from your application through our intelligent routing layer to the best provider for the job."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 relative",children:[(0,r.jsx)("div",{className:"hidden md:block absolute top-12 left-[16%] right-[16%] h-[2px] bg-linear-to-r from-gray-700 via-[#E54D5E] to-gray-700 -z-10"}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#0B0E14] border border-[#2D333B] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-gray-300",children:"terminal"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"1. CLI & SDKs"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Your requests start from your favorite tools or our unified SDK. Just change the base URL."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-center md:text-center",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#0B0E14] border-2 border-[#E54D5E] flex items-center justify-center shadow-[0_0_30px_rgba(229,77,94,0.2)] z-10 mx-auto",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-4xl text-[#E54D5E] animate-pulse",children:"hub"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2 text-[#E54D5E]",children:"2. OmniRoute Hub"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"Our engine analyzes the prompt, checks provider health, and routes for lowest latency or cost."})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 relative group md:items-end md:text-right",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-2xl bg-[#0B0E14] border border-[#2D333B] flex items-center justify-center shadow-xl group-hover:border-gray-500 transition-colors z-10 mx-auto md:mx-0",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"}),(0,r.jsx)("div",{className:"w-6 h-6 rounded bg-white/10"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-xl font-bold mb-2",children:"3. AI Providers"}),(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"The request is fulfilled by OpenAI, Anthropic, Gemini, or others instantly."})]})]})]})]})})}let f=[{icon:"link",title:"Unified Endpoint",desc:"Access all providers via a single standard API URL.",colors:{border:"hover:border-blue-500/50",bg:"hover:bg-blue-500/5",iconBg:"bg-blue-500/10",iconText:"text-blue-500",titleHover:"group-hover:text-blue-400"}},{icon:"bolt",title:"Easy Setup",desc:"Get up and running in minutes with npx command.",colors:{border:"hover:border-orange-500/50",bg:"hover:bg-orange-500/5",iconBg:"bg-orange-500/10",iconText:"text-orange-500",titleHover:"group-hover:text-orange-400"}},{icon:"shield_with_heart",title:"Model Fallback",desc:"Automatically switch providers on failure or high latency.",colors:{border:"hover:border-rose-500/50",bg:"hover:bg-rose-500/5",iconBg:"bg-rose-500/10",iconText:"text-rose-500",titleHover:"group-hover:text-rose-400"}},{icon:"monitoring",title:"Usage Tracking",desc:"Detailed analytics and cost monitoring across all models.",colors:{border:"hover:border-purple-500/50",bg:"hover:bg-purple-500/5",iconBg:"bg-purple-500/10",iconText:"text-purple-500",titleHover:"group-hover:text-purple-400"}},{icon:"key",title:"OAuth & API Keys",desc:"Securely manage credentials in one vault.",colors:{border:"hover:border-amber-500/50",bg:"hover:bg-amber-500/5",iconBg:"bg-amber-500/10",iconText:"text-amber-500",titleHover:"group-hover:text-amber-400"}},{icon:"cloud_sync",title:"Cloud Sync",desc:"Sync your configurations across devices instantly.",colors:{border:"hover:border-sky-500/50",bg:"hover:bg-sky-500/5",iconBg:"bg-sky-500/10",iconText:"text-sky-500",titleHover:"group-hover:text-sky-400"}},{icon:"terminal",title:"CLI Support",desc:"Works with Claude Code, Codex, Cline, Cursor, and more.",colors:{border:"hover:border-emerald-500/50",bg:"hover:bg-emerald-500/5",iconBg:"bg-emerald-500/10",iconText:"text-emerald-500",titleHover:"group-hover:text-emerald-400"}},{icon:"dashboard",title:"Dashboard",desc:"Visual dashboard for real-time traffic analysis.",colors:{border:"hover:border-fuchsia-500/50",bg:"hover:bg-fuchsia-500/5",iconBg:"bg-fuchsia-500/10",iconText:"text-fuchsia-500",titleHover:"group-hover:text-fuchsia-400"}}];function g(){return(0,r.jsx)("section",{className:"py-24 px-6",id:"features",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Powerful Features"}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:"Everything you need to manage your AI infrastructure in one place, built for scale."})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:f.map(e=>(0,r.jsxs)("div",{className:`p-6 rounded-xl bg-[#23180f] border border-[#3a2f27] ${e.colors.border} ${e.colors.bg} transition-all duration-300 group`,children:[(0,r.jsx)("div",{className:`w-10 h-10 rounded-lg ${e.colors.iconBg} flex items-center justify-center mb-4 ${e.colors.iconText} group-hover:scale-110 transition-transform duration-300`,children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:e.icon})}),(0,r.jsx)("h3",{className:`text-lg font-bold mb-2 ${e.colors.titleHover} transition-colors`,children:e.title}),(0,r.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:e.desc})]},e.title))})]})})}function b(){let[e,t]=(0,o.useState)(!1);return(0,r.jsx)("section",{className:"py-24 px-6 bg-[#080A0F]",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-16 items-start",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Get Started in 30 Seconds"}),(0,r.jsx)("p",{className:"text-gray-400 text-lg mb-8",children:"Install OmniRoute, configure your providers via web dashboard, and start routing AI requests."}),(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#E54D5E]/20 text-[#E54D5E] flex items-center justify-center font-bold",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Install OmniRoute"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Run npx command to start the server instantly"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#E54D5E]/20 text-[#E54D5E] flex items-center justify-center font-bold",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Open Dashboard"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Configure providers and API keys via web interface"})]})]}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"flex-none w-8 h-8 rounded-full bg-[#E54D5E]/20 text-[#E54D5E] flex items-center justify-center font-bold",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-bold text-lg",children:"Route Requests"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Point your CLI tools to http://localhost:20128"})]})]})]})]}),(0,r.jsx)("div",{className:"flex-1 w-full",children:(0,r.jsxs)("div",{className:"rounded-xl overflow-hidden bg-[#161B22] border border-[#2D333B] shadow-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 bg-[#111520] border-b border-gray-700",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-green-500"}),(0,r.jsx)("div",{className:"ml-2 text-xs text-gray-500 font-mono",children:"terminal"})]}),(0,r.jsxs)("div",{className:"p-6 font-mono text-sm leading-relaxed overflow-x-auto",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4 group cursor-pointer",onClick:()=>{navigator.clipboard.writeText("npx omniroute"),t(!0),setTimeout(()=>t(!1),2e3)},children:[(0,r.jsx)("span",{className:"text-green-400",children:"$"}),(0,r.jsx)("span",{className:"text-white",children:"npx omniroute"}),(0,r.jsx)("span",{className:"ml-auto text-gray-500 text-xs opacity-0 group-hover:opacity-100",children:e?"✓ Copied":"Copy"})]}),(0,r.jsxs)("div",{className:"text-gray-400 mb-6",children:[(0,r.jsx)("span",{className:"text-[#E54D5E]",children:">"})," Starting OmniRoute...",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#E54D5E]",children:">"})," Server running on"," ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-[#E54D5E]",children:">"})," Dashboard:"," ",(0,r.jsx)("span",{className:"text-blue-400",children:"http://localhost:20128/dashboard"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-green-400",children:">"})," Ready to route! ✓"]}),(0,r.jsx)("div",{className:"text-xs text-gray-500 mb-2 border-t border-gray-700 pt-4",children:"\uD83D\uDCDD Configure providers in dashboard or use environment variables"}),(0,r.jsxs)("div",{className:"text-gray-400 text-xs",children:[(0,r.jsx)("span",{className:"text-purple-400",children:"Data Location:"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" macOS/Linux:"})," ~/.omniroute/db.json",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"text-gray-500",children:" Windows:"})," %APPDATA%/omniroute/db.json"]})]})]})})]})})})}function p(){return(0,r.jsx)("footer",{className:"border-t border-[#2D333B] bg-[#080A0F] pt-16 pb-8 px-6",children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-8 mb-16",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,r.jsx)("div",{className:"size-6 rounded bg-[#E54D5E] flex items-center justify-center text-white",children:(0,r.jsx)(i.A,{size:16,className:"text-white"})}),(0,r.jsx)("h3",{className:"text-white text-lg font-bold",children:"OmniRoute"})]}),(0,r.jsx)("p",{className:"text-gray-500 text-sm max-w-xs mb-6",children:"The unified endpoint for AI generation. Connect, route, and manage your AI providers with ease."}),(0,r.jsx)("div",{className:"flex gap-4",children:(0,r.jsx)("a",{className:"text-gray-400 hover:text-white transition-colors",href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"code"})})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Product"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#E54D5E] text-sm transition-colors",href:"#features",children:"Features"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#E54D5E] text-sm transition-colors",href:"/dashboard",children:"Dashboard"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#E54D5E] text-sm transition-colors",href:"https://github.com/diegosouzapw/OmniRoute/releases",target:"_blank",rel:"noopener noreferrer",children:"Changelog"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Resources"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#E54D5E] text-sm transition-colors",href:"/docs",children:"Documentation"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#E54D5E] text-sm transition-colors",href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#E54D5E] text-sm transition-colors",href:"https://www.npmjs.com/package/omniroute",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("h4",{className:"font-bold text-white",children:"Legal"}),(0,r.jsx)("a",{className:"text-gray-400 hover:text-[#E54D5E] text-sm transition-colors",href:"https://github.com/diegosouzapw/OmniRoute/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:"MIT License"})]})]}),(0,r.jsxs)("div",{className:"border-t border-[#2D333B] pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:"\xa9 2025 OmniRoute. All rights reserved."}),(0,r.jsxs)("div",{className:"flex gap-6",children:[(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://github.com/diegosouzapw/OmniRoute",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),(0,r.jsx)("a",{className:"text-gray-600 hover:text-white text-sm transition-colors",href:"https://www.npmjs.com/package/omniroute",target:"_blank",rel:"noopener noreferrer",children:"NPM"})]})]})]})})}function j(){let e=(0,l.useRouter)();return(0,r.jsxs)("div",{className:"jsx-3ff9ed3cf43389 relative text-white font-sans overflow-x-hidden antialiased selection:bg-[#E54D5E] selection:text-white",children:[(0,r.jsxs)("div",{className:"jsx-3ff9ed3cf43389 fixed inset-0 z-0 overflow-hidden pointer-events-none bg-[#0B0E14]",children:[(0,r.jsx)("div",{style:{backgroundImage:"linear-gradient(to right, #E54D5E 1px, transparent 1px), linear-gradient(to bottom, #E54D5E 1px, transparent 1px)",backgroundSize:"50px 50px"},className:"jsx-3ff9ed3cf43389 absolute inset-0 opacity-[0.06]"}),(0,r.jsx)("div",{className:"jsx-3ff9ed3cf43389 absolute top-0 left-1/4 w-[700px] h-[700px] bg-[#E54D5E]/12 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"2s",animationDuration:"22s"},className:"jsx-3ff9ed3cf43389 absolute top-1/3 right-1/4 w-[600px] h-[600px] bg-purple-500/10 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{animationDelay:"4s",animationDuration:"25s"},className:"jsx-3ff9ed3cf43389 absolute bottom-0 left-1/2 w-[650px] h-[650px] bg-blue-500/8 rounded-full blur-[130px] animate-blob"}),(0,r.jsx)("div",{style:{background:"radial-gradient(circle at center, transparent 0%, rgba(11, 14, 20, 0.4) 100%)"},className:"jsx-3ff9ed3cf43389 absolute inset-0"})]}),(0,r.jsxs)("div",{className:"jsx-3ff9ed3cf43389 relative z-10",children:[(0,r.jsx)(n,{}),(0,r.jsxs)("main",{className:"jsx-3ff9ed3cf43389",children:[(0,r.jsxs)("div",{className:"jsx-3ff9ed3cf43389 relative",children:[(0,r.jsx)(c,{}),(0,r.jsx)("div",{className:"jsx-3ff9ed3cf43389 flex justify-center pb-20",children:(0,r.jsx)(h,{})})]}),(0,r.jsx)(b,{}),(0,r.jsx)(u,{}),(0,r.jsx)(g,{}),(0,r.jsxs)("section",{className:"jsx-3ff9ed3cf43389 py-32 px-6 relative overflow-hidden",children:[(0,r.jsx)("div",{className:"jsx-3ff9ed3cf43389 absolute inset-0 bg-linear-to-t from-[#E54D5E]/5 to-transparent pointer-events-none"}),(0,r.jsxs)("div",{className:"jsx-3ff9ed3cf43389 max-w-4xl mx-auto text-center relative z-10",children:[(0,r.jsx)("h2",{className:"jsx-3ff9ed3cf43389 text-4xl md:text-5xl font-black mb-6",children:"Ready to Simplify Your AI Infrastructure?"}),(0,r.jsx)("p",{className:"jsx-3ff9ed3cf43389 text-xl text-gray-400 mb-10 max-w-2xl mx-auto",children:"Join developers who are streamlining their AI integrations with OmniRoute. Open source and free to start."}),(0,r.jsxs)("div",{className:"jsx-3ff9ed3cf43389 flex flex-col sm:flex-row items-center justify-center gap-4",children:[(0,r.jsx)("button",{onClick:()=>e.push("/dashboard"),className:"jsx-3ff9ed3cf43389 w-full sm:w-auto h-14 px-10 rounded-lg bg-[#E54D5E] hover:bg-[#C93D4E] text-white text-lg font-bold transition-all shadow-[0_0_20px_rgba(229,77,94,0.5)]",children:"Start Free"}),(0,r.jsx)("button",{onClick:()=>e.push("/docs"),className:"jsx-3ff9ed3cf43389 w-full sm:w-auto h-14 px-10 rounded-lg border border-[#2D333B] hover:bg-[#111520] text-white text-lg font-bold transition-all",children:"Read Documentation"})]})]})]})]}),(0,r.jsx)(p,{})]}),(0,r.jsx)(a,{id:"3ff9ed3cf43389",children:"@keyframes float{0%,100%{transform:translatey(0)}50%{transform:translatey(-10px)}}@keyframes dash{to{stroke-dashoffset:-20}}@keyframes blob{0%,100%{transform:translate(0,0)scale(1)}33%{transform:translate(30px,-50px)scale(1.1)}66%{transform:translate(-20px,20px)scale(.9)}}.animate-blob{animation:blob 20s ease-in-out infinite}"})]})}}},e=>{e.O(0,[782,2065,8441,3794,7358],()=>e(e.s=58603)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{6526:(e,s,l)=>{Promise.resolve().then(l.t.bind(l,35154,23)),Promise.resolve().then(l.t.bind(l,51743,23)),Promise.resolve().then(l.bind(l,57896))},35154:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},51743:()=>{}},e=>{e.O(0,[1405,3334,9751,7896,8441,3794,7358],()=>e(e.s=6526)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{4230:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>i});var a=t(95155),r=t(12115),l=t(71525),n=t(73321);function i(){let[e,s]=(0,r.useState)(""),[t,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[o,x]=(0,r.useState)(null),m=(0,n.useRouter)();(0,r.useEffect)(()=>{!async function(){let e=new AbortController,s=setTimeout(()=>e.abort(),5e3),t=window.location.origin;try{let a=await fetch(`${t}/api/settings`,{signal:e.signal});if(clearTimeout(s),a.ok){let e=await a.json();if(!1===e.requireLogin){m.push("/dashboard"),m.refresh();return}x(!!e.hasPassword)}else x(!0)}catch(e){clearTimeout(s),x(!0)}}()},[m]);let u=async s=>{s.preventDefault(),d(!0),i("");try{let s=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(s.ok)m.push("/dashboard"),m.refresh();else{let e=await s.json();i(e.error||"Invalid password")}}catch(e){i("An error occurred. Please try again.")}finally{d(!1)}};return null===o?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),(0,a.jsx)("p",{className:"text-text-muted mt-4",children:"Loading..."})]})}):(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,a.jsxs)("div",{className:"w-full max-w-md",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-primary mb-2",children:"OmniRoute"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Enter your password to access the dashboard"})]}),(0,a.jsx)(l.Zp,{children:(0,a.jsxs)("form",{onSubmit:u,className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Password"}),(0,a.jsx)(l.pd,{type:"password",placeholder:"Enter password",value:e,onChange:e=>s(e.target.value),required:!0,autoFocus:!0}),t&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:t})]}),(0,a.jsx)(l.$n,{type:"submit",variant:"primary",className:"w-full",loading:c,children:"Login"}),(0,a.jsxs)("p",{className:"text-xs text-center text-text-muted mt-2",children:["Default password is ",(0,a.jsx)("code",{className:"bg-sidebar px-1 rounded",children:"123456"})]}),(0,a.jsx)("p",{className:"text-xs text-center mt-1",children:(0,a.jsx)("a",{href:"/forgot-password",className:"text-primary hover:underline",children:"Forgot password?"})})]})})]})})}},83465:(e,s,t)=>{Promise.resolve().then(t.bind(t,4230))}},e=>{e.O(0,[8500,9751,782,7013,7896,1525,8441,3794,7358],()=>e(e.s=83465)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345],{20712:(e,t,a)=>{Promise.resolve().then(a.bind(a,91369))},91369:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>s});var r=a(95155),n=a(98500);function s(){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-screen p-6 bg-[var(--bg-primary,#0a0a0f)] text-[var(--text-primary,#e0e0e0)] text-center",children:[(0,r.jsx)("div",{className:"text-[96px] font-extrabold leading-none mb-2 bg-gradient-to-br from-[#6366f1] via-[#8b5cf6] to-[#a855f7] bg-clip-text text-transparent",children:"404"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold mb-2",children:"Page not found"}),(0,r.jsx)("p",{className:"text-[15px] text-[var(--text-secondary,#888)] max-w-[400px] leading-relaxed mb-8",children:"The page you're looking for doesn't exist or has been moved."}),(0,r.jsx)(n,{href:"/dashboard",className:"px-8 py-3 rounded-[10px] text-white text-sm font-semibold no-underline transition-all duration-200 shadow-[0_4px_16px_rgba(99,102,241,0.3)] hover:-translate-y-0.5 bg-gradient-to-br from-[#6366f1] to-[#8b5cf6]",children:"Go to Dashboard"})]})}}},e=>{e.O(0,[8500,8441,3794,7358],()=>e(e.s=20712)),_N_E=e.O()}]);