omniroute 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (899) hide show
  1. package/README.md +36 -1139
  2. package/app/.next/BUILD_ID +1 -1
  3. package/app/.next/app-path-routes-manifest.json +42 -25
  4. package/app/.next/build-manifest.json +3 -3
  5. package/app/.next/prerender-manifest.json +75 -3
  6. package/app/.next/routes-manifest.json +104 -0
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  14. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -0
  17. package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -0
  18. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -0
  19. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
  20. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  23. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  26. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  29. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  32. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  35. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
  38. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
  41. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  44. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  47. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  49. package/app/.next/server/app/_global-error/page.js +3 -3
  50. package/app/.next/server/app/_global-error/page.js.nft.json +1 -1
  51. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/_global-error.html +2 -2
  53. package/app/.next/server/app/_global-error.rsc +10 -9
  54. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +10 -9
  55. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  56. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  57. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  58. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +2 -1
  59. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  60. package/app/.next/server/app/_not-found/page.js +2 -2
  61. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  62. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/_not-found.html +1 -1
  64. package/app/.next/server/app/_not-found.rsc +16 -12
  65. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +16 -12
  66. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  67. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -3
  68. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +8 -4
  69. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  70. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  71. package/app/.next/server/app/api/auth/login/route.js +1 -1
  72. package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  73. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/cache/route.js +2 -0
  76. package/app/.next/server/app/api/cache/route.js.nft.json +1 -0
  77. package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -0
  78. package/app/.next/server/app/api/cache/stats/route.js +1 -0
  79. package/app/.next/server/app/api/cache/stats/route.js.nft.json +1 -0
  80. package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -0
  81. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -157
  82. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  83. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  85. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
  87. package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  89. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  90. package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
  91. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  92. package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
  93. package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
  95. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  96. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
  97. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  100. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  102. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +1 -1
  104. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/cloud/auth/route.js +1 -156
  106. package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
  107. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -156
  109. package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
  110. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  111. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -156
  112. package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
  113. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  115. package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
  116. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  117. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  118. package/app/.next/server/app/api/combos/[id]/route.js.nft.json +1 -1
  119. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/combos/route.js +1 -1
  122. package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
  123. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/api/combos/test/route.js +1 -156
  125. package/app/.next/server/app/api/combos/test/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/compliance/audit-log/route.js +1 -0
  128. package/app/.next/server/app/api/compliance/audit-log/route.js.nft.json +1 -0
  129. package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -0
  130. package/app/.next/server/app/api/db-backups/route.js +1 -156
  131. package/app/.next/server/app/api/db-backups/route.js.nft.json +1 -1
  132. package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -0
  134. package/app/.next/server/app/api/evals/[suiteId]/route.js.nft.json +1 -0
  135. package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -0
  136. package/app/.next/server/app/api/evals/route.js +1 -0
  137. package/app/.next/server/app/api/evals/route.js.nft.json +1 -0
  138. package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -0
  139. package/app/.next/server/app/api/fallback/chains/route.js +3 -0
  140. package/app/.next/server/app/api/fallback/chains/route.js.nft.json +1 -0
  141. package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -0
  142. package/app/.next/server/app/api/init/route.js +1 -1
  143. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  144. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  146. package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
  147. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  148. package/app/.next/server/app/api/keys/route.js +1 -1
  149. package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
  150. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/models/alias/route.js +1 -1
  152. package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
  153. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  154. package/app/.next/server/app/api/models/availability/route.js +1 -0
  155. package/app/.next/server/app/api/models/availability/route.js.nft.json +1 -0
  156. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -0
  157. package/app/.next/server/app/api/models/catalog/route.js +2 -1
  158. package/app/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
  159. package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
  160. package/app/.next/server/app/api/models/route.js +2 -156
  161. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  162. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/api/monitoring/health/route.js +2 -0
  164. package/app/.next/server/app/api/monitoring/health/route.js.nft.json +1 -0
  165. package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -0
  166. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  167. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  168. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  170. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  171. package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  173. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  174. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  175. package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  179. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  180. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  181. package/app/.next/server/app/api/policies/route.js +3 -0
  182. package/app/.next/server/app/api/policies/route.js.nft.json +1 -0
  183. package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -0
  184. package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
  185. package/app/.next/server/app/api/pricing/models/route.js +1 -156
  186. package/app/.next/server/app/api/pricing/models/route.js.nft.json +1 -1
  187. package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
  188. package/app/.next/server/app/api/pricing/route.js +1 -156
  189. package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
  190. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  191. package/app/.next/server/app/api/provider-models/route.js +1 -156
  192. package/app/.next/server/app/api/provider-models/route.js.nft.json +1 -1
  193. package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
  194. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -156
  195. package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  196. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  197. package/app/.next/server/app/api/provider-nodes/route.js +2 -156
  198. package/app/.next/server/app/api/provider-nodes/route.js.nft.json +1 -1
  199. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  200. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/providers/[id]/models/route.js +2 -156
  202. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  203. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  204. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  205. package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
  206. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  208. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  209. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  210. package/app/.next/server/app/api/providers/client/route.js +1 -156
  211. package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
  212. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  213. package/app/.next/server/app/api/providers/route.js +2 -1
  214. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  215. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  216. package/app/.next/server/app/api/providers/test-batch/route.js +2 -156
  217. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  218. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  219. package/app/.next/server/app/api/providers/validate/route.js +1 -156
  220. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  221. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  222. package/app/.next/server/app/api/rate-limit/route.js +1 -156
  223. package/app/.next/server/app/api/rate-limit/route.js.nft.json +1 -1
  224. package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
  225. package/app/.next/server/app/api/rate-limits/route.js +1 -1
  226. package/app/.next/server/app/api/rate-limits/route.js.nft.json +1 -1
  227. package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
  228. package/app/.next/server/app/api/resilience/reset/route.js +1 -0
  229. package/app/.next/server/app/api/resilience/reset/route.js.nft.json +1 -0
  230. package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -0
  231. package/app/.next/server/app/api/resilience/route.js +1 -0
  232. package/app/.next/server/app/api/resilience/route.js.nft.json +1 -0
  233. package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -0
  234. package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  235. package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  236. package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -156
  237. package/app/.next/server/app/api/settings/combo-defaults/route.js.nft.json +1 -1
  238. package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
  239. package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
  240. package/app/.next/server/app/api/settings/proxy/route.js +1 -156
  241. package/app/.next/server/app/api/settings/proxy/route.js.nft.json +1 -1
  242. package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
  243. package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
  244. package/app/.next/server/app/api/settings/require-login/route.js +1 -156
  245. package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
  246. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  247. package/app/.next/server/app/api/settings/route.js +1 -1
  248. package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
  249. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  250. package/app/.next/server/app/api/settings/system-prompt/route.js +1 -156
  251. package/app/.next/server/app/api/settings/system-prompt/route.js.nft.json +1 -1
  252. package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
  253. package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -156
  254. package/app/.next/server/app/api/settings/thinking-budget/route.js.nft.json +1 -1
  255. package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
  256. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  257. package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
  258. package/app/.next/server/app/api/sync/cloud/route.js +1 -1
  259. package/app/.next/server/app/api/sync/cloud/route.js.nft.json +1 -1
  260. package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
  261. package/app/.next/server/app/api/sync/initialize/route.js +1 -1
  262. package/app/.next/server/app/api/sync/initialize/route.js.nft.json +1 -1
  263. package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
  264. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  265. package/app/.next/server/app/api/telemetry/summary/route.js +1 -0
  266. package/app/.next/server/app/api/telemetry/summary/route.js.nft.json +1 -0
  267. package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -0
  268. package/app/.next/server/app/api/token-health/route.js +1 -0
  269. package/app/.next/server/app/api/token-health/route.js.nft.json +1 -0
  270. package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -0
  271. package/app/.next/server/app/api/translator/detect/route.js +1 -1
  272. package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
  273. package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
  274. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  275. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  276. package/app/.next/server/app/api/translator/send/route.js +1 -156
  277. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  278. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  279. package/app/.next/server/app/api/translator/translate/route.js +1 -156
  280. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  281. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  282. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  283. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  284. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  285. package/app/.next/server/app/api/usage/analytics/route.js +1 -156
  286. package/app/.next/server/app/api/usage/analytics/route.js.nft.json +1 -1
  287. package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
  288. package/app/.next/server/app/api/usage/budget/route.js +3 -0
  289. package/app/.next/server/app/api/usage/budget/route.js.nft.json +1 -0
  290. package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -0
  291. package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -156
  292. package/app/.next/server/app/api/usage/call-logs/[id]/route.js.nft.json +1 -1
  293. package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
  294. package/app/.next/server/app/api/usage/call-logs/route.js +1 -156
  295. package/app/.next/server/app/api/usage/call-logs/route.js.nft.json +1 -1
  296. package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
  297. package/app/.next/server/app/api/usage/history/route.js +1 -156
  298. package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
  299. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  300. package/app/.next/server/app/api/usage/logs/route.js +1 -156
  301. package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
  302. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  303. package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
  304. package/app/.next/server/app/api/usage/request-logs/route.js +1 -156
  305. package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  306. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  307. package/app/.next/server/app/api/v1/api/chat/route.js +1 -156
  308. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  309. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  310. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -156
  311. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  312. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  313. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -156
  314. package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  315. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  316. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  317. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  318. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  319. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  320. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  321. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  322. package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
  323. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  324. package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  325. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  326. package/app/.next/server/app/api/v1/messages/route.js +1 -156
  327. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  328. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  329. package/app/.next/server/app/api/v1/models/route.js +2 -1
  330. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  331. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  332. package/app/.next/server/app/api/v1/moderations/route.js +1 -156
  333. package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
  334. package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
  335. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -156
  336. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
  337. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
  338. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
  339. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
  340. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
  341. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
  342. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
  343. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
  344. package/app/.next/server/app/api/v1/rerank/route.js +1 -156
  345. package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
  346. package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
  347. package/app/.next/server/app/api/v1/responses/route.js +1 -156
  348. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  349. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  350. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  351. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -156
  352. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  353. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  354. package/app/.next/server/app/api/v1beta/models/route.js +2 -1
  355. package/app/.next/server/app/api/v1beta/models/route.js.nft.json +1 -1
  356. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  357. package/app/.next/server/app/callback/page.js +2 -2
  358. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  359. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  360. package/app/.next/server/app/callback.html +1 -1
  361. package/app/.next/server/app/callback.rsc +17 -16
  362. package/app/.next/server/app/callback.segments/_full.segment.rsc +17 -16
  363. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  364. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -3
  365. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  366. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  367. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  368. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  369. package/app/.next/server/app/dashboard/cli-tools.rsc +16 -15
  370. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  371. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  372. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  373. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  374. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +16 -15
  375. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  376. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -3
  377. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  378. package/app/.next/server/app/dashboard/combos.html +1 -1
  379. package/app/.next/server/app/dashboard/combos.rsc +18 -17
  380. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  381. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  382. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  383. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  384. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +18 -17
  385. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  386. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -3
  387. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  388. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  389. package/app/.next/server/app/dashboard/endpoint.rsc +16 -15
  390. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  391. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  392. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  393. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  394. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +16 -15
  395. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  396. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -3
  397. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  398. package/app/.next/server/app/dashboard/health.html +1 -0
  399. package/app/.next/server/app/dashboard/health.meta +17 -0
  400. package/app/.next/server/app/dashboard/health.rsc +24 -0
  401. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +9 -0
  402. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +4 -0
  403. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +4 -0
  404. package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +5 -0
  405. package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +24 -0
  406. package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +6 -0
  407. package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +9 -0
  408. package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +5 -0
  409. package/app/.next/server/app/dashboard/onboarding.html +1 -1
  410. package/app/.next/server/app/dashboard/onboarding.rsc +18 -17
  411. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding/__PAGE__.segment.rsc +1 -1
  412. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding.segment.rsc +1 -1
  413. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  414. package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  415. package/app/.next/server/app/dashboard/onboarding.segments/_full.segment.rsc +18 -17
  416. package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +1 -1
  417. package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +4 -3
  418. package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +2 -2
  419. package/app/.next/server/app/dashboard/profile.html +1 -1
  420. package/app/.next/server/app/dashboard/profile.rsc +15 -14
  421. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  422. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  423. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  424. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  425. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +15 -14
  426. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  427. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -3
  428. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  429. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  430. package/app/.next/server/app/dashboard/providers/new.rsc +18 -17
  431. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  432. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  433. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  434. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  435. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  436. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +18 -17
  437. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  438. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -3
  439. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  440. package/app/.next/server/app/dashboard/providers.html +1 -1
  441. package/app/.next/server/app/dashboard/providers.rsc +18 -17
  442. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  443. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  444. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  445. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  446. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +18 -17
  447. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  448. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -3
  449. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  450. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  451. package/app/.next/server/app/dashboard/settings/pricing.rsc +18 -17
  452. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  453. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  454. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  455. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  456. package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  457. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +18 -17
  458. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  459. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -3
  460. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  461. package/app/.next/server/app/dashboard/settings.html +1 -1
  462. package/app/.next/server/app/dashboard/settings.rsc +18 -17
  463. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +2 -2
  464. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  465. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  466. package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  467. package/app/.next/server/app/dashboard/settings.segments/_full.segment.rsc +18 -17
  468. package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +1 -1
  469. package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +4 -3
  470. package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +2 -2
  471. package/app/.next/server/app/dashboard/translator.html +2 -2
  472. package/app/.next/server/app/dashboard/translator.rsc +15 -14
  473. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  474. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  475. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  476. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  477. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +15 -14
  478. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  479. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -3
  480. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  481. package/app/.next/server/app/dashboard/usage.html +2 -1
  482. package/app/.next/server/app/dashboard/usage.rsc +18 -17
  483. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  484. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  485. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  486. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  487. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +18 -17
  488. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  489. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -3
  490. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  491. package/app/.next/server/app/docs/page.js +3 -2
  492. package/app/.next/server/app/docs/page.js.nft.json +1 -1
  493. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  494. package/app/.next/server/app/docs.html +1 -1
  495. package/app/.next/server/app/docs.rsc +22 -24
  496. package/app/.next/server/app/docs.segments/_full.segment.rsc +22 -24
  497. package/app/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  498. package/app/.next/server/app/docs.segments/_index.segment.rsc +4 -3
  499. package/app/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  500. package/app/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  501. package/app/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  502. package/app/.next/server/app/forbidden/page.js +2 -0
  503. package/app/.next/server/app/forbidden/page.js.nft.json +1 -0
  504. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -0
  505. package/app/.next/server/app/forbidden.html +1 -0
  506. package/app/.next/server/app/forbidden.meta +15 -0
  507. package/app/.next/server/app/forbidden.rsc +23 -0
  508. package/app/.next/server/app/forbidden.segments/_full.segment.rsc +23 -0
  509. package/app/.next/server/app/forbidden.segments/_head.segment.rsc +6 -0
  510. package/app/.next/server/app/forbidden.segments/_index.segment.rsc +9 -0
  511. package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +5 -0
  512. package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +9 -0
  513. package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +4 -0
  514. package/app/.next/server/app/forgot-password/page.js +2 -0
  515. package/app/.next/server/app/forgot-password/page.js.nft.json +1 -0
  516. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -0
  517. package/app/.next/server/app/forgot-password.html +1 -0
  518. package/app/.next/server/app/forgot-password.meta +15 -0
  519. package/app/.next/server/app/forgot-password.rsc +23 -0
  520. package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +23 -0
  521. package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +6 -0
  522. package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +9 -0
  523. package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +5 -0
  524. package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +9 -0
  525. package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +4 -0
  526. package/app/.next/server/app/index.html +1 -1
  527. package/app/.next/server/app/index.rsc +14 -13
  528. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  529. package/app/.next/server/app/index.segments/_full.segment.rsc +14 -13
  530. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  531. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -3
  532. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  533. package/app/.next/server/app/landing/page.js +2 -2
  534. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  535. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  536. package/app/.next/server/app/landing.html +1 -1
  537. package/app/.next/server/app/landing.rsc +17 -16
  538. package/app/.next/server/app/landing.segments/_full.segment.rsc +17 -16
  539. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  540. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -3
  541. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  542. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  543. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  544. package/app/.next/server/app/login/page.js +2 -2
  545. package/app/.next/server/app/login/page.js.nft.json +1 -1
  546. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  547. package/app/.next/server/app/login.html +1 -1
  548. package/app/.next/server/app/login.rsc +17 -16
  549. package/app/.next/server/app/login.segments/_full.segment.rsc +17 -16
  550. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  551. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -3
  552. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  553. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  554. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  555. package/app/.next/server/app/page.js +2 -2
  556. package/app/.next/server/app/page.js.nft.json +1 -1
  557. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  558. package/app/.next/server/app/privacy/page.js +2 -2
  559. package/app/.next/server/app/privacy/page.js.nft.json +1 -1
  560. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  561. package/app/.next/server/app/privacy.html +1 -1
  562. package/app/.next/server/app/privacy.rsc +21 -23
  563. package/app/.next/server/app/privacy.segments/_full.segment.rsc +21 -23
  564. package/app/.next/server/app/privacy.segments/_head.segment.rsc +1 -1
  565. package/app/.next/server/app/privacy.segments/_index.segment.rsc +4 -3
  566. package/app/.next/server/app/privacy.segments/_tree.segment.rsc +2 -2
  567. package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +2 -2
  568. package/app/.next/server/app/privacy.segments/privacy.segment.rsc +1 -1
  569. package/app/.next/server/app/terms/page.js +2 -2
  570. package/app/.next/server/app/terms/page.js.nft.json +1 -1
  571. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  572. package/app/.next/server/app/terms.html +1 -1
  573. package/app/.next/server/app/terms.rsc +22 -20
  574. package/app/.next/server/app/terms.segments/_full.segment.rsc +22 -20
  575. package/app/.next/server/app/terms.segments/_head.segment.rsc +1 -1
  576. package/app/.next/server/app/terms.segments/_index.segment.rsc +4 -3
  577. package/app/.next/server/app/terms.segments/_tree.segment.rsc +2 -2
  578. package/app/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +1 -1
  579. package/app/.next/server/app/terms.segments/terms.segment.rsc +1 -1
  580. package/app/.next/server/app-paths-manifest.json +42 -25
  581. package/app/.next/server/chunks/1228.js +3 -0
  582. package/app/.next/server/chunks/1362.js +1 -1
  583. package/app/.next/server/chunks/152.js +1 -0
  584. package/app/.next/server/chunks/1746.js +1 -0
  585. package/app/.next/server/chunks/216.js +37 -0
  586. package/app/.next/server/chunks/2399.js +1 -1
  587. package/app/.next/server/chunks/3676.js +2 -0
  588. package/app/.next/server/chunks/4004.js +1 -0
  589. package/app/.next/server/chunks/4352.js +46 -0
  590. package/app/.next/server/chunks/4436.js +1 -1
  591. package/app/.next/server/chunks/4443.js +1 -1
  592. package/app/.next/server/chunks/{8259.js → 4469.js} +52 -2
  593. package/app/.next/server/chunks/4755.js +16 -2
  594. package/app/.next/server/chunks/{7132.js → 4832.js} +3 -3
  595. package/app/.next/server/chunks/5040.js +1 -0
  596. package/app/.next/server/chunks/5727.js +1 -0
  597. package/app/.next/server/chunks/7093.js +2 -0
  598. package/app/.next/server/chunks/7271.js +1 -0
  599. package/app/.next/server/chunks/7615.js +9 -2
  600. package/app/.next/server/chunks/7763.js +1 -0
  601. package/app/.next/server/chunks/7802.js +1 -0
  602. package/app/.next/server/chunks/7968.js +3 -1
  603. package/app/.next/server/chunks/8020.js +13 -0
  604. package/app/.next/server/chunks/8108.js +1 -1
  605. package/app/.next/server/chunks/8392.js +1 -0
  606. package/app/.next/server/chunks/8400.js +1 -1
  607. package/app/.next/server/chunks/8847.js +3 -0
  608. package/app/.next/server/chunks/9263.js +1 -0
  609. package/app/.next/server/middleware-build-manifest.js +1 -1
  610. package/app/.next/server/middleware.js +207 -2
  611. package/app/.next/server/pages/404.html +1 -1
  612. package/app/.next/server/pages/500.html +2 -2
  613. package/app/.next/server/server-reference-manifest.js +1 -1
  614. package/app/.next/server/server-reference-manifest.json +1 -1
  615. package/app/.next/static/H6LKncewEoggilnvYL9Ff/_buildManifest.js +1 -0
  616. package/app/.next/static/chunks/1525-ec661e96acc6574e.js +21 -0
  617. package/app/.next/static/chunks/3191-0bbb8ebd1bd32d1d.js +1 -0
  618. package/app/.next/static/chunks/{6941-0643e7aebf5ed645.js → 6941-77ce2b3be7709b94.js} +1 -1
  619. package/app/.next/static/chunks/7896-6e5648294ec51150.js +2 -0
  620. package/app/.next/static/chunks/9751-3a35163d337d54ea.js +37 -0
  621. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-148b0ad18f6bec86.js → page-4cec40aa933b932e.js} +1 -1
  622. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-962f1e2bfe0d0b8d.js +1 -0
  623. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-5caaa75c0ab78bc1.js +1 -0
  624. package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-81352b2272952085.js +1 -0
  625. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-3d3dabe4363d421d.js +1 -0
  626. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-c02303813bcb9777.js +1 -0
  627. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-57279ed20b5399be.js +1 -0
  628. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-4bd8ea64f2e8008b.js → page-9667287d75830fd5.js} +1 -1
  629. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-d08547fcb1031577.js +1 -0
  630. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-26179a630baa2686.js +1 -0
  631. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-c891465a1a2938d2.js → page-6190920e7526556c.js} +1 -1
  632. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-d1066b6c4c28fe46.js +1 -0
  633. package/app/.next/static/chunks/app/(dashboard)/layout-b6fc79d0628b97e3.js +1 -0
  634. package/app/.next/static/chunks/app/_global-error/page-c02303813bcb9777.js +1 -0
  635. package/app/.next/static/chunks/app/_not-found/page-c02303813bcb9777.js +1 -0
  636. package/app/.next/static/chunks/app/api/auth/login/route-c02303813bcb9777.js +1 -0
  637. package/app/.next/static/chunks/app/api/auth/logout/route-c02303813bcb9777.js +1 -0
  638. package/app/.next/static/chunks/app/api/cache/route-c02303813bcb9777.js +1 -0
  639. package/app/.next/static/chunks/app/api/cache/stats/route-c02303813bcb9777.js +1 -0
  640. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-c02303813bcb9777.js +1 -0
  641. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-c02303813bcb9777.js +1 -0
  642. package/app/.next/static/chunks/app/api/cli-tools/backups/route-c02303813bcb9777.js +1 -0
  643. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-c02303813bcb9777.js +1 -0
  644. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-c02303813bcb9777.js +1 -0
  645. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-c02303813bcb9777.js +1 -0
  646. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-c02303813bcb9777.js +1 -0
  647. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-c02303813bcb9777.js +1 -0
  648. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-c02303813bcb9777.js +1 -0
  649. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-c02303813bcb9777.js +1 -0
  650. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-c02303813bcb9777.js +1 -0
  651. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-c02303813bcb9777.js +1 -0
  652. package/app/.next/static/chunks/app/api/cloud/auth/route-c02303813bcb9777.js +1 -0
  653. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-c02303813bcb9777.js +1 -0
  654. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-c02303813bcb9777.js +1 -0
  655. package/app/.next/static/chunks/app/api/cloud/models/alias/route-c02303813bcb9777.js +1 -0
  656. package/app/.next/static/chunks/app/api/combos/[id]/route-c02303813bcb9777.js +1 -0
  657. package/app/.next/static/chunks/app/api/combos/metrics/route-c02303813bcb9777.js +1 -0
  658. package/app/.next/static/chunks/app/api/combos/route-c02303813bcb9777.js +1 -0
  659. package/app/.next/static/chunks/app/api/combos/test/route-c02303813bcb9777.js +1 -0
  660. package/app/.next/static/chunks/app/api/compliance/audit-log/route-c02303813bcb9777.js +1 -0
  661. package/app/.next/static/chunks/app/api/db-backups/route-c02303813bcb9777.js +1 -0
  662. package/app/.next/static/chunks/app/api/evals/[suiteId]/route-c02303813bcb9777.js +1 -0
  663. package/app/.next/static/chunks/app/api/evals/route-c02303813bcb9777.js +1 -0
  664. package/app/.next/static/chunks/app/api/fallback/chains/route-c02303813bcb9777.js +1 -0
  665. package/app/.next/static/chunks/app/api/init/route-c02303813bcb9777.js +1 -0
  666. package/app/.next/static/chunks/app/api/keys/[id]/route-c02303813bcb9777.js +1 -0
  667. package/app/.next/static/chunks/app/api/keys/route-c02303813bcb9777.js +1 -0
  668. package/app/.next/static/chunks/app/api/models/alias/route-c02303813bcb9777.js +1 -0
  669. package/app/.next/static/chunks/app/api/models/availability/route-c02303813bcb9777.js +1 -0
  670. package/app/.next/static/chunks/app/api/models/catalog/route-c02303813bcb9777.js +1 -0
  671. package/app/.next/static/chunks/app/api/models/route-c02303813bcb9777.js +1 -0
  672. package/app/.next/static/chunks/app/api/monitoring/health/route-c02303813bcb9777.js +1 -0
  673. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-c02303813bcb9777.js +1 -0
  674. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-c02303813bcb9777.js +1 -0
  675. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-c02303813bcb9777.js +1 -0
  676. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-c02303813bcb9777.js +1 -0
  677. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-c02303813bcb9777.js +1 -0
  678. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-c02303813bcb9777.js +1 -0
  679. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-c02303813bcb9777.js +1 -0
  680. package/app/.next/static/chunks/app/api/policies/route-c02303813bcb9777.js +1 -0
  681. package/app/.next/static/chunks/app/api/pricing/defaults/route-c02303813bcb9777.js +1 -0
  682. package/app/.next/static/chunks/app/api/pricing/models/route-c02303813bcb9777.js +1 -0
  683. package/app/.next/static/chunks/app/api/pricing/route-c02303813bcb9777.js +1 -0
  684. package/app/.next/static/chunks/app/api/provider-models/route-c02303813bcb9777.js +1 -0
  685. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-c02303813bcb9777.js +1 -0
  686. package/app/.next/static/chunks/app/api/provider-nodes/route-c02303813bcb9777.js +1 -0
  687. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-c02303813bcb9777.js +1 -0
  688. package/app/.next/static/chunks/app/api/providers/[id]/models/route-c02303813bcb9777.js +1 -0
  689. package/app/.next/static/chunks/app/api/providers/[id]/route-c02303813bcb9777.js +1 -0
  690. package/app/.next/static/chunks/app/api/providers/[id]/test/route-c02303813bcb9777.js +1 -0
  691. package/app/.next/static/chunks/app/api/providers/client/route-c02303813bcb9777.js +1 -0
  692. package/app/.next/static/chunks/app/api/providers/route-c02303813bcb9777.js +1 -0
  693. package/app/.next/static/chunks/app/api/providers/test-batch/route-c02303813bcb9777.js +1 -0
  694. package/app/.next/static/chunks/app/api/providers/validate/route-c02303813bcb9777.js +1 -0
  695. package/app/.next/static/chunks/app/api/rate-limit/route-c02303813bcb9777.js +1 -0
  696. package/app/.next/static/chunks/app/api/rate-limits/route-c02303813bcb9777.js +1 -0
  697. package/app/.next/static/chunks/app/api/resilience/reset/route-c02303813bcb9777.js +1 -0
  698. package/app/.next/static/chunks/app/api/resilience/route-c02303813bcb9777.js +1 -0
  699. package/app/.next/static/chunks/app/api/restart/route-c02303813bcb9777.js +1 -0
  700. package/app/.next/static/chunks/app/api/sessions/route-c02303813bcb9777.js +1 -0
  701. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-c02303813bcb9777.js +1 -0
  702. package/app/.next/static/chunks/app/api/settings/ip-filter/route-c02303813bcb9777.js +1 -0
  703. package/app/.next/static/chunks/app/api/settings/proxy/route-c02303813bcb9777.js +1 -0
  704. package/app/.next/static/chunks/app/api/settings/proxy/test/route-c02303813bcb9777.js +1 -0
  705. package/app/.next/static/chunks/app/api/settings/require-login/route-c02303813bcb9777.js +1 -0
  706. package/app/.next/static/chunks/app/api/settings/route-c02303813bcb9777.js +1 -0
  707. package/app/.next/static/chunks/app/api/settings/system-prompt/route-c02303813bcb9777.js +1 -0
  708. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-c02303813bcb9777.js +1 -0
  709. package/app/.next/static/chunks/app/api/shutdown/route-c02303813bcb9777.js +1 -0
  710. package/app/.next/static/chunks/app/api/storage/health/route-c02303813bcb9777.js +1 -0
  711. package/app/.next/static/chunks/app/api/sync/cloud/route-c02303813bcb9777.js +1 -0
  712. package/app/.next/static/chunks/app/api/sync/initialize/route-c02303813bcb9777.js +1 -0
  713. package/app/.next/static/chunks/app/api/tags/route-c02303813bcb9777.js +1 -0
  714. package/app/.next/static/chunks/app/api/telemetry/summary/route-c02303813bcb9777.js +1 -0
  715. package/app/.next/static/chunks/app/api/token-health/route-c02303813bcb9777.js +1 -0
  716. package/app/.next/static/chunks/app/api/translator/detect/route-c02303813bcb9777.js +1 -0
  717. package/app/.next/static/chunks/app/api/translator/history/route-c02303813bcb9777.js +1 -0
  718. package/app/.next/static/chunks/app/api/translator/load/route-c02303813bcb9777.js +1 -0
  719. package/app/.next/static/chunks/app/api/translator/save/route-c02303813bcb9777.js +1 -0
  720. package/app/.next/static/chunks/app/api/translator/send/route-c02303813bcb9777.js +1 -0
  721. package/app/.next/static/chunks/app/api/translator/translate/route-c02303813bcb9777.js +1 -0
  722. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-c02303813bcb9777.js +1 -0
  723. package/app/.next/static/chunks/app/api/usage/analytics/route-c02303813bcb9777.js +1 -0
  724. package/app/.next/static/chunks/app/api/usage/budget/route-c02303813bcb9777.js +1 -0
  725. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-c02303813bcb9777.js +1 -0
  726. package/app/.next/static/chunks/app/api/usage/call-logs/route-c02303813bcb9777.js +1 -0
  727. package/app/.next/static/chunks/app/api/usage/history/route-c02303813bcb9777.js +1 -0
  728. package/app/.next/static/chunks/app/api/usage/logs/route-c02303813bcb9777.js +1 -0
  729. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-c02303813bcb9777.js +1 -0
  730. package/app/.next/static/chunks/app/api/usage/request-logs/route-c02303813bcb9777.js +1 -0
  731. package/app/.next/static/chunks/app/api/v1/api/chat/route-c02303813bcb9777.js +1 -0
  732. package/app/.next/static/chunks/app/api/v1/audio/speech/route-c02303813bcb9777.js +1 -0
  733. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-c02303813bcb9777.js +1 -0
  734. package/app/.next/static/chunks/app/api/v1/chat/completions/route-c02303813bcb9777.js +1 -0
  735. package/app/.next/static/chunks/app/api/v1/embeddings/route-c02303813bcb9777.js +1 -0
  736. package/app/.next/static/chunks/app/api/v1/images/generations/route-c02303813bcb9777.js +1 -0
  737. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-c02303813bcb9777.js +1 -0
  738. package/app/.next/static/chunks/app/api/v1/messages/route-c02303813bcb9777.js +1 -0
  739. package/app/.next/static/chunks/app/api/v1/models/route-c02303813bcb9777.js +1 -0
  740. package/app/.next/static/chunks/app/api/v1/moderations/route-c02303813bcb9777.js +1 -0
  741. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-c02303813bcb9777.js +1 -0
  742. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-c02303813bcb9777.js +1 -0
  743. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-c02303813bcb9777.js +1 -0
  744. package/app/.next/static/chunks/app/api/v1/rerank/route-c02303813bcb9777.js +1 -0
  745. package/app/.next/static/chunks/app/api/v1/responses/route-c02303813bcb9777.js +1 -0
  746. package/app/.next/static/chunks/app/api/v1/route-c02303813bcb9777.js +1 -0
  747. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-c02303813bcb9777.js +1 -0
  748. package/app/.next/static/chunks/app/api/v1beta/models/route-c02303813bcb9777.js +1 -0
  749. package/app/.next/static/chunks/app/forbidden/page-6806872971c364f0.js +1 -0
  750. package/app/.next/static/chunks/app/forgot-password/page-9c116a597f3df4d1.js +1 -0
  751. package/app/.next/static/chunks/app/global-error-6abc2976016d7bd1.js +1 -0
  752. package/app/.next/static/chunks/app/layout-6504ce60623b0a41.js +1 -0
  753. package/app/.next/static/chunks/app/login/{page-e99ed6a85e91ae7c.js → page-93ac51059ef434b7.js} +1 -1
  754. package/app/.next/static/chunks/app/not-found-e1af8b9c5785b71b.js +1 -0
  755. package/app/.next/static/chunks/app/page-c02303813bcb9777.js +1 -0
  756. package/app/.next/static/chunks/main-app-c9da11a8061df107.js +1 -0
  757. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-c02303813bcb9777.js +1 -0
  758. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-c02303813bcb9777.js +1 -0
  759. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c02303813bcb9777.js +1 -0
  760. package/app/.next/static/css/2ecfad7c4409b17e.css +1 -0
  761. package/app/package.json +9 -5
  762. package/app/src/shared/utils/apiKey.js +5 -1
  763. package/bin/reset-password.mjs +116 -0
  764. package/package.json +9 -5
  765. package/app/.next/server/chunks/1483.js +0 -156
  766. package/app/.next/server/chunks/21.js +0 -46
  767. package/app/.next/server/chunks/2116.js +0 -1
  768. package/app/.next/server/chunks/2250.js +0 -1
  769. package/app/.next/server/chunks/3919.js +0 -1
  770. package/app/.next/server/chunks/481.js +0 -156
  771. package/app/.next/server/chunks/5640.js +0 -1
  772. package/app/.next/server/chunks/6194.js +0 -1
  773. package/app/.next/server/chunks/6937.js +0 -156
  774. package/app/.next/server/chunks/7471.js +0 -13
  775. package/app/.next/server/chunks/9188.js +0 -1
  776. package/app/.next/static/XnNWFvV2IXZ4xuX0F1Skg/_buildManifest.js +0 -1
  777. package/app/.next/static/chunks/1525-8aaae9ffdaa67144.js +0 -7
  778. package/app/.next/static/chunks/7896-4e519429f67f381e.js +0 -1
  779. package/app/.next/static/chunks/8013-04b90e92e614b5d9.js +0 -1
  780. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-49caa7328acff82d.js +0 -1
  781. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-ab8b870377087bc7.js +0 -1
  782. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-bc5764734a448526.js +0 -1
  783. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-c452284fb77ecee0.js +0 -1
  784. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-fb1fa9ae8a3af8c8.js +0 -1
  785. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-4140db5a52fc7323.js +0 -1
  786. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-70619a1bafdc9c4c.js +0 -1
  787. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-9ee5997edb778414.js +0 -1
  788. package/app/.next/static/chunks/app/(dashboard)/layout-0ee92d902ee7a39c.js +0 -1
  789. package/app/.next/static/chunks/app/_global-error/page-c452284fb77ecee0.js +0 -1
  790. package/app/.next/static/chunks/app/_not-found/page-a99a85b5268f1c54.js +0 -1
  791. package/app/.next/static/chunks/app/api/auth/login/route-c452284fb77ecee0.js +0 -1
  792. package/app/.next/static/chunks/app/api/auth/logout/route-c452284fb77ecee0.js +0 -1
  793. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-c452284fb77ecee0.js +0 -1
  794. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-c452284fb77ecee0.js +0 -1
  795. package/app/.next/static/chunks/app/api/cli-tools/backups/route-c452284fb77ecee0.js +0 -1
  796. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-c452284fb77ecee0.js +0 -1
  797. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-c452284fb77ecee0.js +0 -1
  798. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-c452284fb77ecee0.js +0 -1
  799. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-c452284fb77ecee0.js +0 -1
  800. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-c452284fb77ecee0.js +0 -1
  801. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-c452284fb77ecee0.js +0 -1
  802. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-c452284fb77ecee0.js +0 -1
  803. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-c452284fb77ecee0.js +0 -1
  804. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-c452284fb77ecee0.js +0 -1
  805. package/app/.next/static/chunks/app/api/cloud/auth/route-c452284fb77ecee0.js +0 -1
  806. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-c452284fb77ecee0.js +0 -1
  807. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-c452284fb77ecee0.js +0 -1
  808. package/app/.next/static/chunks/app/api/cloud/models/alias/route-c452284fb77ecee0.js +0 -1
  809. package/app/.next/static/chunks/app/api/combos/[id]/route-c452284fb77ecee0.js +0 -1
  810. package/app/.next/static/chunks/app/api/combos/metrics/route-c452284fb77ecee0.js +0 -1
  811. package/app/.next/static/chunks/app/api/combos/route-c452284fb77ecee0.js +0 -1
  812. package/app/.next/static/chunks/app/api/combos/test/route-c452284fb77ecee0.js +0 -1
  813. package/app/.next/static/chunks/app/api/db-backups/route-c452284fb77ecee0.js +0 -1
  814. package/app/.next/static/chunks/app/api/init/route-c452284fb77ecee0.js +0 -1
  815. package/app/.next/static/chunks/app/api/keys/[id]/route-c452284fb77ecee0.js +0 -1
  816. package/app/.next/static/chunks/app/api/keys/route-c452284fb77ecee0.js +0 -1
  817. package/app/.next/static/chunks/app/api/models/alias/route-c452284fb77ecee0.js +0 -1
  818. package/app/.next/static/chunks/app/api/models/catalog/route-c452284fb77ecee0.js +0 -1
  819. package/app/.next/static/chunks/app/api/models/route-c452284fb77ecee0.js +0 -1
  820. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-c452284fb77ecee0.js +0 -1
  821. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-c452284fb77ecee0.js +0 -1
  822. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-c452284fb77ecee0.js +0 -1
  823. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-c452284fb77ecee0.js +0 -1
  824. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-c452284fb77ecee0.js +0 -1
  825. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-c452284fb77ecee0.js +0 -1
  826. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-c452284fb77ecee0.js +0 -1
  827. package/app/.next/static/chunks/app/api/pricing/defaults/route-c452284fb77ecee0.js +0 -1
  828. package/app/.next/static/chunks/app/api/pricing/models/route-c452284fb77ecee0.js +0 -1
  829. package/app/.next/static/chunks/app/api/pricing/route-c452284fb77ecee0.js +0 -1
  830. package/app/.next/static/chunks/app/api/provider-models/route-c452284fb77ecee0.js +0 -1
  831. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-c452284fb77ecee0.js +0 -1
  832. package/app/.next/static/chunks/app/api/provider-nodes/route-c452284fb77ecee0.js +0 -1
  833. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-c452284fb77ecee0.js +0 -1
  834. package/app/.next/static/chunks/app/api/providers/[id]/models/route-c452284fb77ecee0.js +0 -1
  835. package/app/.next/static/chunks/app/api/providers/[id]/route-c452284fb77ecee0.js +0 -1
  836. package/app/.next/static/chunks/app/api/providers/[id]/test/route-c452284fb77ecee0.js +0 -1
  837. package/app/.next/static/chunks/app/api/providers/client/route-c452284fb77ecee0.js +0 -1
  838. package/app/.next/static/chunks/app/api/providers/route-c452284fb77ecee0.js +0 -1
  839. package/app/.next/static/chunks/app/api/providers/test-batch/route-c452284fb77ecee0.js +0 -1
  840. package/app/.next/static/chunks/app/api/providers/validate/route-c452284fb77ecee0.js +0 -1
  841. package/app/.next/static/chunks/app/api/rate-limit/route-c452284fb77ecee0.js +0 -1
  842. package/app/.next/static/chunks/app/api/rate-limits/route-c452284fb77ecee0.js +0 -1
  843. package/app/.next/static/chunks/app/api/restart/route-c452284fb77ecee0.js +0 -1
  844. package/app/.next/static/chunks/app/api/sessions/route-c452284fb77ecee0.js +0 -1
  845. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-c452284fb77ecee0.js +0 -1
  846. package/app/.next/static/chunks/app/api/settings/ip-filter/route-c452284fb77ecee0.js +0 -1
  847. package/app/.next/static/chunks/app/api/settings/proxy/route-c452284fb77ecee0.js +0 -1
  848. package/app/.next/static/chunks/app/api/settings/proxy/test/route-c452284fb77ecee0.js +0 -1
  849. package/app/.next/static/chunks/app/api/settings/require-login/route-c452284fb77ecee0.js +0 -1
  850. package/app/.next/static/chunks/app/api/settings/route-c452284fb77ecee0.js +0 -1
  851. package/app/.next/static/chunks/app/api/settings/system-prompt/route-c452284fb77ecee0.js +0 -1
  852. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-c452284fb77ecee0.js +0 -1
  853. package/app/.next/static/chunks/app/api/shutdown/route-c452284fb77ecee0.js +0 -1
  854. package/app/.next/static/chunks/app/api/storage/health/route-c452284fb77ecee0.js +0 -1
  855. package/app/.next/static/chunks/app/api/sync/cloud/route-c452284fb77ecee0.js +0 -1
  856. package/app/.next/static/chunks/app/api/sync/initialize/route-c452284fb77ecee0.js +0 -1
  857. package/app/.next/static/chunks/app/api/tags/route-c452284fb77ecee0.js +0 -1
  858. package/app/.next/static/chunks/app/api/translator/detect/route-c452284fb77ecee0.js +0 -1
  859. package/app/.next/static/chunks/app/api/translator/history/route-c452284fb77ecee0.js +0 -1
  860. package/app/.next/static/chunks/app/api/translator/load/route-c452284fb77ecee0.js +0 -1
  861. package/app/.next/static/chunks/app/api/translator/save/route-c452284fb77ecee0.js +0 -1
  862. package/app/.next/static/chunks/app/api/translator/send/route-c452284fb77ecee0.js +0 -1
  863. package/app/.next/static/chunks/app/api/translator/translate/route-c452284fb77ecee0.js +0 -1
  864. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-c452284fb77ecee0.js +0 -1
  865. package/app/.next/static/chunks/app/api/usage/analytics/route-c452284fb77ecee0.js +0 -1
  866. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-c452284fb77ecee0.js +0 -1
  867. package/app/.next/static/chunks/app/api/usage/call-logs/route-c452284fb77ecee0.js +0 -1
  868. package/app/.next/static/chunks/app/api/usage/history/route-c452284fb77ecee0.js +0 -1
  869. package/app/.next/static/chunks/app/api/usage/logs/route-c452284fb77ecee0.js +0 -1
  870. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-c452284fb77ecee0.js +0 -1
  871. package/app/.next/static/chunks/app/api/usage/request-logs/route-c452284fb77ecee0.js +0 -1
  872. package/app/.next/static/chunks/app/api/v1/api/chat/route-c452284fb77ecee0.js +0 -1
  873. package/app/.next/static/chunks/app/api/v1/audio/speech/route-c452284fb77ecee0.js +0 -1
  874. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-c452284fb77ecee0.js +0 -1
  875. package/app/.next/static/chunks/app/api/v1/chat/completions/route-c452284fb77ecee0.js +0 -1
  876. package/app/.next/static/chunks/app/api/v1/embeddings/route-c452284fb77ecee0.js +0 -1
  877. package/app/.next/static/chunks/app/api/v1/images/generations/route-c452284fb77ecee0.js +0 -1
  878. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-c452284fb77ecee0.js +0 -1
  879. package/app/.next/static/chunks/app/api/v1/messages/route-c452284fb77ecee0.js +0 -1
  880. package/app/.next/static/chunks/app/api/v1/models/route-c452284fb77ecee0.js +0 -1
  881. package/app/.next/static/chunks/app/api/v1/moderations/route-c452284fb77ecee0.js +0 -1
  882. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-c452284fb77ecee0.js +0 -1
  883. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-c452284fb77ecee0.js +0 -1
  884. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-c452284fb77ecee0.js +0 -1
  885. package/app/.next/static/chunks/app/api/v1/rerank/route-c452284fb77ecee0.js +0 -1
  886. package/app/.next/static/chunks/app/api/v1/responses/route-c452284fb77ecee0.js +0 -1
  887. package/app/.next/static/chunks/app/api/v1/route-c452284fb77ecee0.js +0 -1
  888. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-c452284fb77ecee0.js +0 -1
  889. package/app/.next/static/chunks/app/api/v1beta/models/route-c452284fb77ecee0.js +0 -1
  890. package/app/.next/static/chunks/app/layout-485b011f69e6ed37.js +0 -1
  891. package/app/.next/static/chunks/app/page-c452284fb77ecee0.js +0 -1
  892. package/app/.next/static/chunks/main-app-fbc16f70c595b197.js +0 -1
  893. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-c452284fb77ecee0.js +0 -1
  894. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-c452284fb77ecee0.js +0 -1
  895. package/app/.next/static/chunks/next/dist/client/components/builtin/global-error-d91548a7b6ba5970.js +0 -1
  896. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-c452284fb77ecee0.js +0 -1
  897. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c452284fb77ecee0.js +0 -1
  898. package/app/.next/static/css/5309860f6e486620.css +0 -1
  899. /package/app/.next/static/{XnNWFvV2IXZ4xuX0F1Skg → H6LKncewEoggilnvYL9Ff}/_ssgManifest.js +0 -0
@@ -1,7 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1525],{2946:(e,t,s)=>{s.d(t,{D:()=>o});var r=s(12115),a=s(83711);function l(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function n(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function i(){return!1}function o(){let{theme:e,setTheme:t,toggleTheme:s,initTheme:o}=(0,a.A)(),d=(0,r.useSyncExternalStore)(l,n,i);(0,r.useEffect)(()=>{o()},[o]),(0,r.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>o();return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[e,o]);let c="dark"===e||"system"===e&&d;return{theme:e,setTheme:t,toggleTheme:s,isDark:c}}},5704:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(95155),a=s(14051),l=s(66137);function n({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,r.jsx)(l.default,{variant:"card"})}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}n.propTypes={children:a.node.isRequired}},5708:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(95155),a=s(12115),l=s(61592);function n({label:e,type:t="text",placeholder:s,value:n,onChange:i,error:o,hint:d,icon:c,disabled:x=!1,required:m=!1,className:u,inputClassName:p,id:h,...b}){let f=(0,a.useId)(),g=h||f,j=o?`${g}-error`:void 0,y=d&&!o?`${g}-hint`:void 0,v=[j,y].filter(Boolean).join(" ")||void 0;return(0,r.jsxs)("div",{className:(0,l.cn)("flex flex-col gap-1.5",u),children:[e&&(0,r.jsxs)("label",{htmlFor:g,className:"text-sm font-medium text-text-main",children:[e,m&&(0,r.jsx)("span",{className:"text-red-500 ml-1","aria-hidden":"true",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[c&&(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:c})}),(0,r.jsx)("input",{id:g,type:t,placeholder:s,value:n,onChange:i,disabled:x,required:m,"aria-required":m||void 0,"aria-invalid":!!o||void 0,"aria-describedby":v,className:(0,l.cn)("w-full py-2 px-3 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md","placeholder-text-muted/60","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all shadow-inner disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",o?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",p),...b})]}),o&&(0,r.jsxs)("p",{id:j,className:"text-xs text-red-500 flex items-center gap-1",role:"alert",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"error"}),o]}),d&&!o&&(0,r.jsx)("p",{id:y,className:"text-xs text-text-muted",children:d})]})}},6024:(e,t,s)=>{s.d(t,{default:()=>x});var r=s(95155),a=s(12115),l=s(67578),n=s(99225),i=s(78362);let o=[{key:"all",label:"All"},{key:"error",label:"Errors",icon:"error"},{key:"ok",label:"Success",icon:"check_circle"},{key:"timeout",label:"Timeout",icon:"timer_off"}],d=[{key:"status",label:"Status"},{key:"proxy",label:"Proxy"},{key:"type",label:"Type"},{key:"level",label:"Level"},{key:"provider",label:"Provider"},{key:"target",label:"Target"},{key:"latency",label:"Latency"},{key:"ip",label:"Public IP"},{key:"time",label:"Time"}],c=Object.fromEntries(d.map(e=>[e.key,!0]));function x(){let[e,t]=(0,a.useState)([]),[s,x]=(0,a.useState)(!0),[u,p]=(0,a.useState)(!0),[h,b]=(0,a.useState)(""),[f,g]=(0,a.useState)("all"),[j,y]=(0,a.useState)(""),[v,N]=(0,a.useState)(""),[k,w]=(0,a.useState)(""),[C,S]=(0,a.useState)("newest"),[T,I]=(0,a.useState)(null),$=(0,a.useRef)(null),O=(0,a.useRef)(!1),[A,E]=(0,a.useState)(()=>{try{let e=localStorage.getItem("proxyLoggerVisibleColumns");return e?{...c,...JSON.parse(e)}:c}catch{return c}}),R=(0,a.useCallback)(e=>{E(t=>{let s={...t,[e]:!t[e]};try{localStorage.setItem("proxyLoggerVisibleColumns",JSON.stringify(s))}catch{}return s})},[]),M=(0,a.useCallback)(async(e=!1)=>{e&&x(!0);try{let e=new URLSearchParams;h&&e.set("search",h),"error"===f&&e.set("status","error"),"ok"===f&&e.set("status","ok"),"timeout"===f&&e.set("status","timeout"),j&&e.set("type",j),v&&e.set("provider",v),k&&e.set("level",k),e.set("limit","300");let s=await fetch(`/api/usage/proxy-logs?${e}`);if(s.ok){let e=await s.json();t(e)}}catch(e){console.error("Failed to fetch proxy logs:",e)}finally{e&&x(!1)}},[h,f,j,v,k]);(0,a.useEffect)(()=>{let e=!O.current;O.current=!0,M(e)},[M]),(0,a.useEffect)(()=>($.current&&clearInterval($.current),u&&($.current=setInterval(()=>M(!1),3e3)),()=>{$.current&&clearInterval($.current)}),[u,M]);let F=(0,a.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{switch(C){case"oldest":return new Date(e.timestamp)-new Date(t.timestamp);case"latency_desc":return(t.latencyMs||0)-(e.latencyMs||0);case"latency_asc":return(e.latencyMs||0)-(t.latencyMs||0);default:return new Date(t.timestamp)-new Date(e.timestamp)}}),t},[e,C]),L=[...new Set(e.map(e=>e.provider).filter(Boolean))].sort(),P=[...new Set(e.map(e=>e.proxy?.type).filter(Boolean))].sort(),_=[...new Set(e.map(e=>e.level).filter(Boolean))].sort(),D=e.length,K=e.filter(e=>"success"===e.status).length,z=e.filter(e=>"error"===e.status).length,U=e.filter(e=>"timeout"===e.status).length,q=e.filter(e=>"direct"===e.level).length;return(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsxs)("button",{onClick:()=>p(!u),className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium border transition-colors ${u?"bg-red-500/10 border-red-500/30 text-red-400":"bg-bg-subtle border-border text-text-muted"}`,children:[(0,r.jsx)("span",{className:`w-2 h-2 rounded-full ${u?"bg-red-500 animate-pulse":"bg-text-muted"}`}),u?"Recording":"Paused"]}),(0,r.jsxs)("div",{className:"flex-1 min-w-[200px] relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-3 top-1/2 -translate-y-1/2 text-text-muted text-[18px]",children:"search"}),(0,r.jsx)("input",{type:"text",placeholder:"Search host, provider, target, IP...",value:h,onChange:e=>b(e.target.value),className:"w-full pl-10 pr-4 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-primary"})]}),(0,r.jsxs)("select",{value:j,onChange:e=>y(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[120px]",children:[(0,r.jsx)("option",{value:"",children:"All Types"}),P.map(e=>(0,r.jsx)("option",{value:e,children:(n.Gp[e]?.label||e).toUpperCase()},e))]}),(0,r.jsxs)("select",{value:k,onChange:e=>w(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[120px]",children:[(0,r.jsx)("option",{value:"",children:"All Levels"}),_.map(e=>(0,r.jsx)("option",{value:e,children:n.Ie[e]?.label||e},e))]}),(0,r.jsxs)("select",{value:v,onChange:e=>N(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[140px]",children:[(0,r.jsx)("option",{value:"",children:"All Providers"}),L.map(e=>{let t=n.RY[e];return(0,r.jsx)("option",{value:e,children:t?.label||e.toUpperCase()},e)})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-bg-subtle border border-border font-mono",children:[D," total"]}),(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-emerald-500/10 text-emerald-400 font-mono",children:[K," OK"]}),z>0&&(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-red-500/10 text-red-400 font-mono",children:[z," ERR"]}),U>0&&(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-amber-500/10 text-amber-400 font-mono",children:[U," TMO"]}),q>0&&(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-gray-500/10 text-gray-400 font-mono",children:[q," direct"]})]}),(0,r.jsxs)("select",{value:C,onChange:e=>S(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[140px]",children:[(0,r.jsx)("option",{value:"newest",children:"Newest"}),(0,r.jsx)("option",{value:"oldest",children:"Oldest"}),(0,r.jsx)("option",{value:"latency_desc",children:"Latency ↓"}),(0,r.jsx)("option",{value:"latency_asc",children:"Latency ↑"})]}),(0,r.jsx)("button",{onClick:()=>M(!1),className:"p-2 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"refresh"})})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>(0,r.jsxs)("button",{onClick:()=>g(f===e.key?"all":e.key),className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border transition-all ${f===e.key?"error"===e.key?"bg-red-500/20 text-red-400 border-red-500/40":"ok"===e.key?"bg-emerald-500/20 text-emerald-400 border-emerald-500/40":"timeout"===e.key?"bg-amber-500/20 text-amber-400 border-amber-500/40":"bg-primary text-white border-primary":"bg-bg-subtle border-border text-text-muted hover:border-text-muted"}`,children:[e.icon&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon}),e.label]},e.key)),L.length>0&&(0,r.jsx)("span",{className:"w-px h-5 bg-border mx-1"}),L.map(e=>{let t=n.RY[e]||{bg:"#374151",text:"#fff",label:e.toUpperCase()},s=v===e;return(0,r.jsx)("button",{onClick:()=>N(s?"":e),className:`px-3 py-1 rounded-full text-xs font-bold uppercase border transition-all ${s?"border-white/40 ring-1 ring-white/20":"border-transparent opacity-70 hover:opacity-100"}`,style:{backgroundColor:s?t.bg:`${t.bg}33`,color:s?t.text:t.bg},children:t.label},e)})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-1",children:"Columns"}),d.map(e=>(0,r.jsx)("button",{onClick:()=>R(e.key),className:`px-2 py-0.5 rounded text-[10px] font-medium border transition-all ${A[e.key]?"bg-primary/15 text-primary border-primary/30":"bg-bg-subtle text-text-muted border-border opacity-50 hover:opacity-80"}`,children:e.label},e.key))]}),(0,r.jsx)(l.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,r.jsx)("div",{className:"p-0 overflow-x-auto max-h-[calc(100vh-320px)] overflow-y-auto",children:s&&0===e.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading proxy logs..."}):0===e.length?(0,r.jsxs)("div",{className:"p-8 text-center text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-2 block opacity-40",children:"vpn_lock"}),"No proxy logs yet. Configure proxies and make API calls to see them here."]}):0===F.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs match the current filters."}):(0,r.jsxs)("table",{className:"w-full text-left border-collapse text-xs",children:[(0,r.jsx)("thead",{className:"sticky top-0 z-10",style:{backgroundColor:"var(--bg-primary, #0f1117)"},children:(0,r.jsxs)("tr",{className:"border-b border-border",style:{backgroundColor:"var(--bg-primary, #0f1117)"},children:[A.status&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Status"}),A.proxy&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Proxy"}),A.type&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Type"}),A.level&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Level"}),A.provider&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Provider"}),A.target&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Target"}),A.latency&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px] text-right",children:"Latency"}),A.ip&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Public IP"}),A.time&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px] text-right",children:"Time"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border/30",children:F.map(e=>{let t=(0,n.Yh)(e.status),s=n.Gp[e.proxy?.type]||{bg:"#6B7280",text:"#fff",label:e.proxy?.type||"-"},a=n.Ie[e.level]||n.Ie.direct,l=n.RY[e.provider]||{bg:"#374151",text:"#fff",label:(e.provider||"-").toUpperCase()},o="error"===e.status||"timeout"===e.status;return(0,r.jsxs)("tr",{onClick:()=>I(T?.id===e.id?null:e),className:`cursor-pointer hover:bg-primary/5 transition-colors ${o?"bg-red-500/5":""}`,children:[A.status&&(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-[10px] font-bold min-w-[50px] text-center uppercase",style:{backgroundColor:t.bg,color:t.text},children:e.status})}),A.proxy&&(0,r.jsx)("td",{className:"px-3 py-2 font-mono text-[11px] text-primary",children:e.proxy?`${e.proxy.host}:${e.proxy.port}`:"—"}),A.type&&(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-[9px] font-bold uppercase",style:{backgroundColor:s.bg,color:s.text},children:s.label})}),A.level&&(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-[9px] font-bold uppercase",style:{backgroundColor:a.bg,color:a.text},children:a.label})}),A.provider&&(0,r.jsx)("td",{className:"px-3 py-2",children:e.provider?(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-[9px] font-bold uppercase",style:{backgroundColor:l.bg,color:l.text},children:l.label}):(0,r.jsx)("span",{className:"text-text-muted text-[10px]",children:"—"})}),A.target&&(0,r.jsx)("td",{className:"px-3 py-2 text-text-muted truncate max-w-[200px] font-mono text-[10px]",title:e.targetUrl,children:(0,i.Y1)(e.targetUrl)}),A.latency&&(0,r.jsx)("td",{className:"px-3 py-2 text-right text-text-muted font-mono",children:(0,i.a3)(e.latencyMs)}),A.ip&&(0,r.jsx)("td",{className:"px-3 py-2 font-mono text-[11px] text-emerald-400",children:e.publicIp||"—"}),A.time&&(0,r.jsx)("td",{className:"px-3 py-2 text-right text-text-muted",children:(0,i.fU)(e.timestamp)})]},e.id)})})]})})}),T&&(0,r.jsx)(m,{log:T,onClose:()=>I(null)})]})}function m({log:e,onClose:t}){(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let s=(0,n.Yh)(e.status),l=n.Gp[e.proxy?.type]||{bg:"#6B7280",text:"#fff",label:e.proxy?.type||"-"},o=n.Ie[e.level]||n.Ie.direct,d=n.RY[e.provider]||{bg:"#374151",text:"#fff",label:(e.provider||"-").toUpperCase()};return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[5vh]",onClick:t,children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-bg-primary border border-border rounded-xl w-full max-w-[700px] max-h-[90vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 py-4 border-b border-border bg-bg-primary/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded text-xs font-bold uppercase",style:{backgroundColor:s.bg,color:s.text},children:e.status}),(0,r.jsx)("span",{className:"font-bold text-lg",children:"Proxy Event"})]}),(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),(0,r.jsxs)("div",{className:"p-6 flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 p-4 bg-bg-subtle rounded-xl border border-border",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Time"}),(0,r.jsx)("div",{className:"text-sm font-medium",children:(e=>{try{let t=new Date(e);return t.toLocaleDateString("pt-BR")+", "+t.toLocaleTimeString("en-US",{hour12:!1})}catch{return e}})(e.timestamp)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Latency"}),(0,r.jsx)("div",{className:"text-sm font-medium",children:(0,i.a3)(e.latencyMs)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Public IP"}),(0,r.jsx)("div",{className:"text-sm font-medium font-mono text-emerald-400",children:e.publicIp||"—"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Proxy"}),(0,r.jsx)("div",{className:"text-sm font-medium font-mono text-primary",children:e.proxy?`${e.proxy.type}://${e.proxy.host}:${e.proxy.port}`:"Direct"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Type"}),(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded text-[10px] font-bold uppercase",style:{backgroundColor:l.bg,color:l.text},children:l.label})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Level"}),(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded text-[10px] font-bold uppercase",style:{backgroundColor:o.bg,color:o.text},children:o.label})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Provider"}),e.provider?(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded text-[10px] font-bold uppercase",style:{backgroundColor:d.bg,color:d.text},children:d.label}):(0,r.jsx)("div",{className:"text-sm text-text-muted",children:"—"})]}),(0,r.jsxs)("div",{className:"col-span-2",children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Target URL"}),(0,r.jsx)("div",{className:"text-sm font-medium font-mono text-text-muted break-all",children:e.targetUrl||"—"})]})]}),e.error&&(0,r.jsxs)("div",{className:"p-4 rounded-xl bg-red-500/10 border border-red-500/30",children:[(0,r.jsx)("div",{className:"text-[10px] text-red-400 uppercase tracking-wider mb-1 font-bold",children:"Error"}),(0,r.jsx)("div",{className:"text-sm text-red-300 font-mono",children:e.error})]}),e.proxy&&(0,r.jsxs)("div",{className:"p-4 rounded-xl bg-bg-subtle border border-border",children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-2 font-bold",children:"Proxy Configuration"}),(0,r.jsx)("pre",{className:"text-xs font-mono text-text-primary bg-black/20 rounded-lg p-3 overflow-x-auto",children:JSON.stringify(e.proxy,null,2)})]})]})]})]})}},13720:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(95155),a=s(12115),l=s(61592);function n({label:e,options:t=[],value:s,onChange:n,placeholder:i="Select an option",error:o,hint:d,disabled:c=!1,required:x=!1,className:m,selectClassName:u,id:p,...h}){let b=(0,a.useId)(),f=p||b,g=o?`${f}-error`:void 0,j=d&&!o?`${f}-hint`:void 0,y=[g,j].filter(Boolean).join(" ")||void 0;return(0,r.jsxs)("div",{className:(0,l.cn)("flex flex-col gap-1.5",m),children:[e&&(0,r.jsxs)("label",{htmlFor:f,className:"text-sm font-medium text-text-main",children:[e,x&&(0,r.jsx)("span",{className:"text-red-500 ml-1","aria-hidden":"true",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{id:f,value:s,onChange:n,disabled:c,required:x,"aria-required":x||void 0,"aria-invalid":!!o||void 0,"aria-describedby":y,className:(0,l.cn)("w-full py-2 px-3 pr-10 text-sm text-text-main","bg-surface border border-black/10 dark:border-white/10 rounded-md appearance-none","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",o?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",u),...h,children:[(0,r.jsx)("option",{value:"",disabled:!0,className:"bg-surface text-text-muted",children:i}),t.map(e=>(0,r.jsx)("option",{value:e.value,className:"bg-surface text-text-main",children:e.label},e.value))]}),(0,r.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted","aria-hidden":"true",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),o&&(0,r.jsxs)("p",{id:g,className:"text-xs text-red-500 flex items-center gap-1",role:"alert",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"error"}),o]}),d&&!o&&(0,r.jsx)("p",{id:j,className:"text-xs text-text-muted",children:d})]})}},15419:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(95155),a=s(98500),l=s(81172);let n=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"https://github.com/decolua/omniroute/releases",external:!0}],i=[{label:"Documentation",href:"/docs"},{label:"API Reference",href:"/docs#api-reference"},{label:"Help Center",href:"https://github.com/decolua/omniroute/discussions",external:!0}],o=[{label:"About",href:"https://github.com/decolua/omniroute",external:!0},{label:"Blog",href:"https://github.com/decolua/omniroute/releases",external:!0},{label:"Contact",href:"https://github.com/decolua/omniroute/issues/new/choose",external:!0},{label:"Terms",href:"/terms"},{label:"Privacy",href:"/privacy"}];function d(){let e=e=>e.external?(0,r.jsx)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary transition-colors",children:e.label}):(0,r.jsx)(a,{href:e.href,className:"hover:text-primary transition-colors",children:e.label});return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:l.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"https://github.com/decolua/omniroute/discussions",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Community Discussions",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"https://github.com/decolua/omniroute",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:n.map(t=>(0,r.jsx)("li",{children:e(t)},t.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(t=>(0,r.jsx)("li",{children:e(t)},t.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(t=>(0,r.jsx)("li",{children:e(t)},t.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",l.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)("a",{href:"/docs",className:"hover:text-primary transition-colors",children:"Documentation"}),(0,r.jsx)(a,{href:"/terms",className:"hover:text-primary transition-colors",children:"Terms"}),(0,r.jsx)(a,{href:"/privacy",className:"hover:text-primary transition-colors",children:"Privacy"}),(0,r.jsx)("a",{href:"https://github.com/decolua/omniroute/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary transition-colors",children:"License"})]})]})]})})}},16620:(e,t,s)=>{s.d(t,{default:()=>b});var r=s(95155),a=s(12115),l=s(14051),n=s(98500),i=s(73321),o=s(61592),d=s(81172),c=s(39680),x=s(34405);let m=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],u=[{href:"/dashboard/translator",label:"Translator",icon:"translate"}],p=[{href:"/dashboard/settings",label:"Settings",icon:"settings"}],h=[{href:"/docs",label:"Docs",icon:"menu_book"},{href:"https://github.com/decolua/omniroute/issues",label:"Issues",icon:"bug_report",external:!0}];function b({onClose:e,collapsed:t=!1,onToggleCollapse:s}){let l=(0,i.usePathname)(),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[N,k]=(0,a.useState)(!1),[w,C]=(0,a.useState)(!1),[S,T]=(0,a.useState)(!1);(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>T(e?.enableRequestLogs===!0)).catch(()=>{})},[]);let I=async()=>{v(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(e){}v(!1),f(!1),C(!0)},$=async()=>{k(!0);try{await fetch("/api/restart",{method:"POST"})}catch(e){}k(!1),j(!1),C(!0),setTimeout(()=>{globalThis.location.reload()},3e3)},O=s=>{var a;let i=!s.external&&("/dashboard/endpoint"===(a=s.href)?"/dashboard"===l||l.startsWith("/dashboard/endpoint"):l.startsWith(a)),d=(0,o.cn)("flex items-center gap-3 rounded-lg transition-all group",t?"justify-center px-2 py-2.5":"px-4 py-2",i?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),c=(0,o.cn)("material-symbols-outlined text-[18px]",i?"fill-1":"group-hover:text-primary transition-colors"),x=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:c,children:s.icon}),!t&&(0,r.jsx)("span",{className:"text-sm font-medium",children:s.label})]});return s.external?(0,r.jsx)("a",{href:s.href,target:"_blank",rel:"noopener noreferrer",onClick:e,title:t?s.label:void 0,className:d,children:x},s.href):(0,r.jsx)(n,{href:s.href,onClick:e,title:t?s.label:void 0,className:d,children:x},s.href)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:(0,o.cn)("flex flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-all duration-300 ease-in-out",t?"w-16":"w-72"),children:[(0,r.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-3 focus:bg-primary focus:text-white focus:rounded-md focus:m-2",children:"Skip to content"}),(0,r.jsxs)("div",{className:(0,o.cn)("flex items-center gap-2 pt-5 pb-2",t?"px-3 justify-center":"px-6"),"aria-hidden":"true",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"}),!t&&(0,r.jsx)("div",{className:"flex-1"}),s&&(0,r.jsx)("button",{onClick:s,title:t?"Expand sidebar":"Collapse sidebar","aria-expanded":!t,"aria-label":t?"Expand sidebar":"Collapse sidebar",className:(0,o.cn)("p-1 rounded-md text-text-muted/50 hover:text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",t&&"mt-2"),children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:t?"chevron_right":"chevron_left"})})]}),(0,r.jsx)("div",{className:(0,o.cn)("py-4",t?"px-2":"px-6"),children:(0,r.jsxs)(n,{href:"/dashboard",className:(0,o.cn)("flex items-center",t?"justify-center":"gap-3"),children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-9 rounded bg-linear-to-br from-[#f97815] to-[#c2590a] shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-white text-[20px]",children:"hub"})}),!t&&(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:d.vQ.name}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["v",d.vQ.version]})]})]})}),(0,r.jsxs)("nav",{"aria-label":"Main navigation",className:(0,o.cn)("flex-1 py-2 space-y-1 overflow-y-auto custom-scrollbar",t?"px-2":"px-4"),children:[m.map(O),S&&(0,r.jsxs)("div",{className:"pt-4 mt-2",children:[!t&&(0,r.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Debug"}),t&&(0,r.jsx)("div",{className:"border-t border-black/5 dark:border-white/5 mb-2"}),u.map(O)]}),(0,r.jsxs)("div",{className:"pt-4 mt-2",children:[!t&&(0,r.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),t&&(0,r.jsx)("div",{className:"border-t border-black/5 dark:border-white/5 mb-2"}),p.map(O)]}),(0,r.jsxs)("div",{className:"pt-4 mt-2",children:[!t&&(0,r.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Help"}),t&&(0,r.jsx)("div",{className:"border-t border-black/5 dark:border-white/5 mb-2"}),h.map(O)]})]}),(0,r.jsxs)("div",{className:(0,o.cn)("border-t border-black/5 dark:border-white/5",t?"p-2 flex flex-col gap-1":"p-3 flex gap-2"),children:[(0,r.jsxs)("button",{onClick:()=>j(!0),title:"Restart server",className:(0,o.cn)("flex items-center justify-center gap-2 rounded-lg font-medium transition-all","text-amber-500 hover:bg-amber-500/10 border border-amber-500/20 hover:border-amber-500/40",t?"p-2":"flex-1 px-3 py-2 text-sm"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"restart_alt"}),!t&&"Restart"]}),(0,r.jsxs)("button",{onClick:()=>f(!0),title:"Shutdown server",className:(0,o.cn)("flex items-center justify-center gap-2 rounded-lg font-medium transition-all","text-red-500 hover:bg-red-500/10 border border-red-500/20 hover:border-red-500/40",t?"p-2":"flex-1 px-3 py-2 text-sm"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"}),!t&&"Shutdown"]})]})]}),(0,r.jsx)(x.ConfirmModal,{isOpen:b,onClose:()=>f(!1),onConfirm:I,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:y}),(0,r.jsx)(x.ConfirmModal,{isOpen:g,onClose:()=>j(!1),onConfirm:$,title:"Restart Proxy",message:"Are you sure you want to restart the proxy server? It will be back online in a few seconds.",confirmText:"Restart",cancelText:"Cancel",variant:"warning",loading:N}),w&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center p-8",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped or is restarting."}),(0,r.jsx)(c.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}b.propTypes={onClose:l.func,collapsed:l.bool,onToggleCollapse:l.func}},18056:(e,t,s)=>{s.d(t,{default:()=>o});var r=s(95155),a=s(12115),l=s(14051),n=s(71525),i=s(26853);function o({isOpen:e,provider:t,providerInfo:s,onSuccess:l,onClose:o}){let[d,c]=(0,a.useState)("waiting"),[x,m]=(0,a.useState)(null),[u,p]=(0,a.useState)(""),[h,b]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1),[j,y]=(0,a.useState)(null),[v,N]=(0,a.useState)(!1),k=(0,a.useRef)(null),{copied:w,copy:C}=(0,i.C)(),[S,T]=(0,a.useState)(!1),[I,$]=(0,a.useState)("/callback?code=..."),O=(0,a.useRef)(!1),A=(0,a.useRef)(!1);(0,a.useEffect)(()=>{T("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),$(`${window.location.origin}/callback?code=...`)},[]);let E=(0,a.useCallback)(async(e,s)=>{if(x)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:x.redirectUri,codeVerifier:x.codeVerifier,state:s})}),a=await r.json();if(!r.ok)throw Error(a.error);c("success"),l?.()}catch(e){b(e.message),c("error")}},[x,t,l]),R=(0,a.useCallback)(async(e,s,r,a)=>{N(!0);for(let n=0;n<60;n++){await new Promise(e=>setTimeout(e,1e3*r));try{let n=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:s,extraData:a})}),i=await n.json();if(i.success){c("success"),N(!1),l?.();return}if("expired_token"===i.error||"access_denied"===i.error)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(r=Math.min(r+5,30))}catch(e){b(e.message),c("error"),N(!1);return}}b("Authorization timeout"),c("error"),N(!1)},[t,l]),M=(0,a.useCallback)(async()=>{if(t)try{if(b(null),"github"===t||"qwen"===t||"kiro"===t||"kimi-coding"===t||"kilocode"===t){g(!0),c("waiting");let e=await fetch(`/api/oauth/${t}/device-code`),s=await e.json();if(!e.ok)throw Error(s.error);y(s);let r=s.verification_uri_complete||s.verification_uri;r&&window.open(r,"oauth_verify");let a="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret}:null;R(s.device_code,s.codeVerifier,s.interval||5,a);return}if("codex"===t){try{let e=await fetch("/api/oauth/codex/start-callback-server"),t=await e.json();if(!e.ok)throw Error(t.error);m({...t,redirectUri:t.redirectUri}),c("waiting"),window.open(t.authUrl,"oauth_auth"),N(!0);for(let e=0;e<150;e++){await new Promise(e=>setTimeout(e,2e3));let e=await fetch("/api/oauth/codex/poll-callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();if(t.success){c("success"),N(!1),l?.();return}if(t.error&&!t.pending)throw Error(t.errorDescription||t.error)}throw N(!1),Error("Authorization timeout")}catch(e){N(!1),c("input"),b(e.message+" — You can paste the callback URL manually below.")}return}let e=window.location.port||("https:"===window.location.protocol?"443":"80"),s=`http://localhost:${e}/callback`,r=await fetch(`/api/oauth/${t}/authorize?redirect_uri=${encodeURIComponent(s)}`),a=await r.json();if(!r.ok)throw Error(a.error);m({...a,redirectUri:s}),S?(c("waiting"),k.current=window.open(a.authUrl,"oauth_popup","width=600,height=700"),k.current||c("input")):(c("input"),window.open(a.authUrl,"oauth_auth"))}catch(e){b(e.message),c("error")}},[t,S,R,l]);(0,a.useEffect)(()=>{e||(A.current=!1)},[e]),(0,a.useEffect)(()=>{e&&t&&(A.current||(A.current=!0,m(null),p(""),b(null),g(!1),y(null),N(!1),M()))},[e,t,M]),(0,a.useEffect)(()=>{let e;if(!x)return;O.current=!1;let t=async e=>{if(O.current)return;let{code:t,state:s,error:r,errorDescription:a}=e;if(r){O.current=!0,b(a||r),c("error");return}t&&(O.current=!0,await E(t,s))},s=e=>{let s=window.location.port,r=e.origin.match(/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/)&&new URL(e.origin).port===s;(e.origin===window.location.origin||r)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",s);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let s=JSON.parse(e.newValue);t(s),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let s=JSON.parse(e);s.timestamp&&Date.now()-s.timestamp<3e4&&(t(s),localStorage.removeItem("oauth_callback"))}}catch{}return()=>{window.removeEventListener("message",s),window.removeEventListener("storage",r),e&&e.close()}},[x,E]);let F=async()=>{try{b(null);let e=new URL(u),t=e.searchParams.get("code"),s=e.searchParams.get("state"),r=e.searchParams.get("error");if(r)throw Error(e.searchParams.get("error_description")||r);if(!t)throw Error("No authorization code found in URL");await E(t,s)}catch(e){b(e.message),c("error")}};return t&&s?(0,r.jsx)(n.aF,{isOpen:e,title:`Connect ${s.name}`,onClose:o,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===d&&!f&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,r.jsx)(n.$n,{variant:"ghost",onClick:()=>c("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===d&&f&&j&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:j.verification_uri}),(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"verify_url"===w?"check":"content_copy",onClick:()=>C(j.verification_uri,"verify_url")})]})]}),(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:j.user_code}),(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"user_code"===w?"check":"content_copy",onClick:()=>C(j.user_code,"user_code")})]})]})]}),v&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===d&&!f&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.pd,{value:x?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(n.$n,{variant:"secondary",icon:"auth_url"===w?"check":"content_copy",onClick:()=>C(x?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,r.jsx)(n.pd,{value:u,onChange:e=>p(e.target.value),placeholder:I,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:F,fullWidth:!0,disabled:!u,children:"Connect"}),(0,r.jsx)(n.$n,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===d&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.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,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",s.name," account has been connected."]}),(0,r.jsx)(n.$n,{onClick:o,fullWidth:!0,children:"Done"})]}),"error"===d&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:h}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:M,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(n.$n,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}o.propTypes={isOpen:l.bool.isRequired,provider:l.string,providerInfo:l.shape({name:l.string}),onSuccess:l.func,onClose:l.func.isRequired}},22447:(e,t,s)=>{s.d(t,{default:()=>u});var r=s(95155),a=s(12115),l=s(14051),n=s(34405),i=s(39680),o=s(41463);let d=[{value:"http",label:"HTTP"},{value:"https",label:"HTTPS"},{value:"socks5",label:"SOCKS5"}],c="true"===o.env.NEXT_PUBLIC_ENABLE_SOCKS5_PROXY,x=c?d:d.filter(e=>"socks5"!==e.value),m={global:"Global",provider:"Provider",combo:"Combo",key:"Key",direct:"Direct (none)"};function u({isOpen:e,onClose:t,level:s,levelId:l,levelLabel:o,onSaved:d}){let[u,p]=(0,a.useState)(x[0]?.value||"http"),[h,b]=(0,a.useState)(""),[f,g]=(0,a.useState)(""),[j,y]=(0,a.useState)(""),[v,N]=(0,a.useState)(""),[k,w]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[T,I]=(0,a.useState)(!1),[$,O]=(0,a.useState)(null),[A,E]=(0,a.useState)(!0),[R,M]=(0,a.useState)(null),[F,L]=(0,a.useState)(!1),[P,_]=(0,a.useState)(null),D=e=>"socks5"===e?"1080":"8080";(0,a.useEffect)(()=>{e&&(O(null),_(null),E(!0),(async()=>{try{let e=new URLSearchParams({level:s});l&&e.set("id",l);let t=await fetch(`/api/settings/proxy?${e}`);if(t.ok){let e=(await t.json()).proxy;if(e&&e.host){let t=String(e.type||"http").toLowerCase(),s=x.some(e=>e.value===t);p(s?t:x[0]?.value||"http"),b(e.host||""),g(e.port||""),y(e.username||""),N(e.password||""),w(!!(e.username||e.password)),L(!0),"socks5"!==t||c||_("SOCKS5 is configured but hidden because NEXT_PUBLIC_ENABLE_SOCKS5_PROXY=false.")}else K(),L(!1)}if("global"!==s&&l){let e=await fetch("/api/settings/proxy");if(e.ok){let t=await e.json();"key"===s||"combo"===s?t.global&&M({level:"Global",proxy:t.global}):"provider"===s&&t.global&&M({level:"Global",proxy:t.global})}}}catch(e){console.error("Error loading proxy config:",e)}finally{E(!1)}})())},[e,s,l]);let K=()=>{p(x[0]?.value||"http"),b(""),g(""),y(""),N(""),w(!1),_(null)},z=async()=>{if(h.trim()){_(null),S(!0);try{let e={type:u,host:h.trim(),port:f.trim()||D(u),username:j.trim(),password:v.trim()},t=await fetch("/api/settings/proxy",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:s,id:l,proxy:e})}),r=await t.json().catch(()=>({}));if(!t.ok)return void _(r?.error?.message||"Failed to save proxy configuration");L(!0),d?.()}catch(e){console.error("Error saving proxy:",e),_(e.message||"Failed to save proxy configuration")}finally{S(!1)}}},U=async()=>{_(null),S(!0);try{let e=new URLSearchParams({level:s});l&&e.set("id",l);let t=await fetch(`/api/settings/proxy?${e}`,{method:"DELETE"}),r=await t.json().catch(()=>({}));if(!t.ok)return void _(r?.error?.message||"Failed to clear proxy configuration");K(),L(!1),O(null),d?.()}catch(e){console.error("Error clearing proxy:",e),_(e.message||"Failed to clear proxy configuration")}finally{S(!1)}},q=async()=>{if(h.trim()){_(null),I(!0),O(null);try{let e={type:u,host:h.trim(),port:f.trim()||D(u),username:j.trim(),password:v.trim()},t=await fetch("/api/settings/proxy/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxy:e})}),s=await t.json().catch(()=>({}));if(!t.ok){let e=s?.error?.message||"Connection failed";O({success:!1,error:e}),_(e);return}O(s)}catch(e){O({success:!1,error:e.message}),_(e.message||"Connection failed")}finally{I(!1)}}},B="global"===s?"Global Proxy Configuration":`${m[s]} Proxy — ${o||l||""}`;return(0,r.jsx)(n.default,{isOpen:e,onClose:t,title:B,maxWidth:"lg",children:A?(0,r.jsx)("div",{className:"py-8 text-center text-text-muted animate-pulse",children:"Loading proxy configuration..."}):(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:["global"!==s&&!F&&R&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-blue-500/10 border border-blue-500/20 text-sm",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-400 text-base",children:"subdirectory_arrow_right"}),(0,r.jsxs)("span",{className:"text-blue-300",children:["Inheriting from ",(0,r.jsx)("strong",{children:R.level}),": ",R.proxy?.type,"://",R.proxy?.host,":",R.proxy?.port]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs text-text-muted mb-1.5 block uppercase tracking-wider font-medium",children:"Proxy Type"}),(0,r.jsx)("div",{className:"flex gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:x.map(e=>(0,r.jsx)("button",{onClick:()=>p(e.value),className:`flex-1 px-4 py-2 rounded-md text-sm font-medium transition-all ${u===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,r.jsxs)("div",{className:"col-span-2",children:[(0,r.jsx)("label",{className:"text-xs text-text-muted mb-1.5 block uppercase tracking-wider font-medium",children:"Host"}),(0,r.jsx)("input",{type:"text",value:h,onChange:e=>b(e.target.value),placeholder:"1.2.3.4 or proxy.example.com",className:"w-full px-3 py-2.5 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary placeholder:text-text-muted/50 focus:outline-none focus:border-primary transition-colors"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs text-text-muted mb-1.5 block uppercase tracking-wider font-medium",children:"Port"}),(0,r.jsx)("input",{type:"text",value:f,onChange:e=>g(e.target.value),placeholder:D(u),className:"w-full px-3 py-2.5 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary placeholder:text-text-muted/50 focus:outline-none focus:border-primary transition-colors"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{onClick:()=>w(!k),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-primary transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base",children:k?"expand_less":"expand_more"}),"Authentication (optional)"]}),k&&(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs text-text-muted mb-1.5 block uppercase tracking-wider font-medium",children:"Username"}),(0,r.jsx)("input",{type:"text",value:j,onChange:e=>y(e.target.value),placeholder:"Username",className:"w-full px-3 py-2.5 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary placeholder:text-text-muted/50 focus:outline-none focus:border-primary transition-colors"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs text-text-muted mb-1.5 block uppercase tracking-wider font-medium",children:"Password"}),(0,r.jsx)("input",{type:"password",value:v,onChange:e=>N(e.target.value),placeholder:"Password",className:"w-full px-3 py-2.5 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary placeholder:text-text-muted/50 focus:outline-none focus:border-primary transition-colors"})]})]})]}),P&&(0,r.jsx)("div",{className:"px-4 py-3 rounded-lg border border-red-500/30 bg-red-500/10 text-sm text-red-400",children:P}),$&&(0,r.jsxs)("div",{className:`flex items-center gap-3 px-4 py-3 rounded-lg border ${$.success?"bg-emerald-500/10 border-emerald-500/30":"bg-red-500/10 border-red-500/30"}`,children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-xl ${$.success?"text-emerald-400":"text-red-400"}`,children:$.success?"check_circle":"error"}),(0,r.jsx)("div",{className:"flex-1",children:$.success?(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-sm font-medium text-emerald-400",children:"Connected"}),(0,r.jsxs)("span",{className:"text-text-muted text-xs ml-2",children:["IP: ",(0,r.jsx)("span",{className:"font-mono text-emerald-300",children:$.publicIp}),$.latencyMs&&` \xb7 ${$.latencyMs}ms`]})]}):(0,r.jsxs)("div",{className:"text-sm text-red-400",children:[$.error||"Connection failed",$.latencyMs&&(0,r.jsxs)("span",{className:"text-text-muted text-xs ml-2",children:["(",$.latencyMs,"ms)"]})]})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.default,{size:"sm",variant:"secondary",icon:"speed",onClick:q,loading:T,disabled:!h.trim(),children:"Test Connection"}),F&&(0,r.jsx)(i.default,{size:"sm",variant:"ghost",icon:"delete",onClick:U,disabled:C,className:"!text-red-400 hover:!bg-red-500/10",children:"Clear"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.default,{size:"sm",variant:"secondary",onClick:t,children:"Cancel"}),(0,r.jsx)(i.default,{size:"sm",icon:"save",onClick:z,loading:C,disabled:!h.trim(),children:"Save"})]})]})]})})}u.propTypes={isOpen:l.bool.isRequired,onClose:l.func.isRequired,level:l.oneOf(["global","provider","combo","key"]).isRequired,levelId:l.string,levelLabel:l.string,onSaved:l.func}},23375:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(61592);let l={default:"bg-black/5 dark:bg-white/10 text-text-muted",primary:"bg-primary/10 text-primary",success:"bg-green-500/10 text-green-600 dark:text-green-400",warning:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",error:"bg-red-500/10 text-red-600 dark:text-red-400",info:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},n={sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function i({children:e,variant:t="default",size:s="md",dot:i=!1,icon:o,className:d}){return(0,r.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",l[t],n[s],d),children:[i&&(0,r.jsx)("span",{"aria-hidden":"true",className:(0,a.cn)("size-1.5 rounded-full","success"===t&&"bg-green-500","warning"===t&&"bg-yellow-500","error"===t&&"bg-red-500","info"===t&&"bg-blue-500","primary"===t&&"bg-primary","default"===t&&"bg-gray-500")}),o&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:o}),e]})}},24229:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(61592);function l({src:e,alt:t="Avatar",name:s,size:l="md",className:n}){let i={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return e?(0,r.jsx)("div",{className:(0,a.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[l],n),style:{backgroundImage:`url(${e})`},role:"img","aria-label":t}):(0,r.jsx)("div",{className:(0,a.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[l],(e=>{if(!e)return"bg-primary";let t=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],s=e.charCodeAt(0)%t.length;return t[s]})(s),n),role:"img","aria-label":t,children:(e=>{if(!e)return"?";let t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()})(s)})}},25861:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(95155),a=s(12115),l=s(14051),n=s(18056),i=s(78966),o=s(85764);function d({isOpen:e,providerInfo:t,onSuccess:s,onClose:l}){let[d,c]=(0,a.useState)(null),[x,m]=(0,a.useState)(null),[u,p]=(0,a.useState)(null),h=(0,a.useCallback)((e,t)=>{"builder-id"===e?c("builder-id"):"idc"===e?(c("idc"),p(t)):"social"===e?(c("social"),m(t.provider)):"import"===e&&s?.()},[s]),b=()=>{c(null),m(null),p(null)};return d?"builder-id"===d||"idc"===d?(0,r.jsx)(n.default,{isOpen:e,provider:"kiro",providerInfo:t,onSuccess:()=>{c(null),p(null),s?.()},onClose:b,idcConfig:u}):"social"===d&&x?(0,r.jsx)(o.default,{isOpen:e,provider:x,onSuccess:()=>{c(null),m(null),s?.()},onClose:b}):null:(0,r.jsx)(i.default,{isOpen:e,onMethodSelect:h,onClose:l})}d.propTypes={isOpen:l.bool.isRequired,providerInfo:l.shape({name:l.string}),onSuccess:l.func,onClose:l.func.isRequired}},26693:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(12115),l=s(34405),n=s(39680);function i({isOpen:e,onClose:t,title:s="Manual Configuration",configs:i=[]}){let[o,d]=(0,a.useState)(null),c=async(e,t)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",t.style.top="-9999px",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t)}d(t),setTimeout(()=>d(null),2e3)}catch(e){console.log("Failed to copy:",e)}};return(0,r.jsx)(l.default,{isOpen:e,onClose:t,title:s,size:"xl",children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:i.map((e,t)=>(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.filename}),(0,r.jsxs)(n.default,{variant:"ghost",size:"sm",onClick:()=>c(e.content,t),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:o===t?"check":"content_copy"}),o===t?"Copied!":"Copy"]})]}),(0,r.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:e.content})]},t))})})}},26853:(e,t,s)=>{s.d(t,{C:()=>l});var r=s(12115);function a(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",t.style.top="-9999px",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch{}document.body.removeChild(t)}function l(e=2e3){let[t,s]=(0,r.useState)(null),n=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)(async(t,r="default")=>{try{navigator.clipboard&&window.isSecureContext?await navigator.clipboard.writeText(t):a(t)}catch{a(t)}s(r),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{s(null)},e)},[e])}}},31117:(e,t,s)=>{s.d(t,{default:()=>R});var r=s(95155),a=s(12115),l=s(67578),n=s(78076),i=s(78362),o=s(99225),d=s(80662),c=s(85506),x=s(32539),m=s(59656),u=s(58021),p=s(84618),h=s(71276),b=s(80865),f=s(53201),g=s(67389);function j({active:e,payload:t,label:s,formatter:a}){return e&&t?.length?(0,r.jsxs)("div",{className:"rounded-lg border border-white/10 bg-surface px-3 py-2 text-xs shadow-lg",children:[s&&(0,r.jsx)("div",{className:"font-semibold text-text-main mb-1",children:s}),t.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:e.color}}),(0,r.jsxs)("span",{children:[e.name,":"]}),(0,r.jsx)("span",{className:"font-mono font-medium text-text-main",children:a?a(e.value):e.value})]},t))]}):null}function y({active:e,sortOrder:t}){return e?(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px] text-primary",children:"asc"===t?"expand_less":"expand_more"}):(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px] opacity-0 group-hover:opacity-30",children:"unfold_more"})}function v({icon:e,label:t,value:s,subValue:a,color:n="text-text-main"}){return(0,r.jsxs)(l.default,{className:"px-4 py-3 flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-xs uppercase font-semibold tracking-wider",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:e}),t]}),(0,r.jsx)("span",{className:`text-2xl font-bold ${n}`,children:s}),a&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:a})]})}function N({activityMap:e}){let t=(0,a.useMemo)(()=>{let t=new Date,s=[],r=0;for(let a=364;a>=0;a--){let l=new Date(t);l.setDate(l.getDate()-a);let n=`${l.getFullYear()}-${String(l.getMonth()+1).padStart(2,"0")}-${String(l.getDate()).padStart(2,"0")}`,i=e?.[n]||0;i>r&&(r=i),s.push({date:n,value:i,dayOfWeek:l.getDay()})}return{days:s,maxVal:r}},[e]),s=(0,a.useMemo)(()=>{let e=[],s=[],r=t.days[0]?.dayOfWeek||0;for(let e=0;e<r;e++)s.push(null);for(let r of t.days)s.push(r),7===s.length&&(e.push(s),s=[]);return s.length>0&&e.push(s),e},[t]),n=(0,a.useMemo)(()=>{let e=[],t=-1;return s.forEach((s,r)=>{let a=s.find(e=>null!==e);if(a){let s=new Date(a.date).getMonth();s!==t&&(e.push({weekIdx:r,label:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s]}),t=s)}}),e},[s]);return(0,r.jsxs)(l.default,{className:"p-4 h-full",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider",children:"Activity"}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:[Object.keys(e||{}).length," active days \xb7"," ",(0,i.VK)(Object.values(e||{}).reduce((e,t)=>e+t,0))," tokens \xb7 365 days"]})]}),(0,r.jsx)("div",{className:"flex gap-[3px] mb-1 ml-6",style:{fontSize:"10px"},children:n.map((e,t)=>(0,r.jsx)("span",{className:"text-text-muted",style:{position:"relative",left:`${13*e.weekIdx}px`,marginLeft:0===t?0:"-20px"},children:e.label},t))}),(0,r.jsxs)("div",{className:"flex gap-[3px] overflow-x-auto",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-[3px] shrink-0 text-[10px] text-text-muted pr-1",children:[(0,r.jsx)("span",{className:"h-[10px]"}),(0,r.jsx)("span",{className:"h-[10px] leading-[10px]",children:"Mon"}),(0,r.jsx)("span",{className:"h-[10px]"}),(0,r.jsx)("span",{className:"h-[10px] leading-[10px]",children:"Wed"}),(0,r.jsx)("span",{className:"h-[10px]"}),(0,r.jsx)("span",{className:"h-[10px] leading-[10px]",children:"Fri"}),(0,r.jsx)("span",{className:"h-[10px]"})]}),s.map((e,s)=>(0,r.jsx)("div",{className:"flex flex-col gap-[3px]",children:e.map((e,s)=>(0,r.jsx)("div",{title:e?`${e.date}: ${(0,i.xW)(e.value)} tokens`:"",className:`w-[10px] h-[10px] rounded-[2px] ${e?function(e){if(!e||0===e)return"bg-white/[0.04]";let s=Math.min(e/(t.maxVal||1),1);return s<.25?"bg-primary/20":s<.5?"bg-primary/40":s<.75?"bg-primary/60":"bg-primary/90"}(e.value):"bg-transparent"}`},s))},s))]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 mt-2 ml-6 text-[10px] text-text-muted",children:[(0,r.jsx)("span",{children:"Less"}),(0,r.jsx)("div",{className:"w-[10px] h-[10px] rounded-[2px] bg-white/[0.04]"}),(0,r.jsx)("div",{className:"w-[10px] h-[10px] rounded-[2px] bg-primary/20"}),(0,r.jsx)("div",{className:"w-[10px] h-[10px] rounded-[2px] bg-primary/40"}),(0,r.jsx)("div",{className:"w-[10px] h-[10px] rounded-[2px] bg-primary/60"}),(0,r.jsx)("div",{className:"w-[10px] h-[10px] rounded-[2px] bg-primary/90"}),(0,r.jsx)("span",{children:"More"})]})]})}function k({dailyTrend:e}){let t=(0,a.useMemo)(()=>(e||[]).map(e=>({date:e.date.slice(5),Input:e.promptTokens,Output:e.completionTokens,Cost:e.cost||0})),[e]),s=(0,a.useMemo)(()=>t.some(e=>e.Cost>0),[t]);return t.length?(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Token & Cost Trend"}),(0,r.jsx)(d.u,{width:"100%",height:140,children:(0,r.jsxs)(c.X,{data:t,margin:{top:0,right:40*!!s,left:0,bottom:0},children:[(0,r.jsx)(x.W,{dataKey:"date",tick:{fontSize:9,fill:"var(--text-muted)"},axisLine:!1,tickLine:!1,interval:Math.max(Math.floor(t.length/6),0)}),s&&(0,r.jsx)(m.h,{yAxisId:"cost",orientation:"right",tick:{fontSize:8,fill:"#f59e0b"},axisLine:!1,tickLine:!1,tickFormatter:e=>`$${e.toFixed(2)}`,width:36}),(0,r.jsx)(u.m,{content:(0,r.jsx)(w,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),(0,r.jsx)(p.yP,{dataKey:"Input",stackId:"a",fill:"var(--primary)",opacity:.7,radius:[0,0,0,0],animationDuration:600}),(0,r.jsx)(p.yP,{dataKey:"Output",stackId:"a",fill:"#10b981",opacity:.7,radius:[3,3,0,0],animationDuration:600}),s&&(0,r.jsx)(h.N1,{yAxisId:"cost",type:"monotone",dataKey:"Cost",stroke:"#f59e0b",strokeWidth:2,dot:!1,animationDuration:600})]})}),(0,r.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-[10px] text-text-muted",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full bg-primary/70"})," Input"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500/70"})," Output"]}),s&&(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full bg-amber-500/70"})," Cost ($)"]})]})]}):(0,r.jsxs)(l.default,{className:"p-4",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Token Trend"}),(0,r.jsx)("div",{className:"text-center text-text-muted text-sm py-8",children:"No data"})]})}function w({active:e,payload:t,label:s}){return e&&t?.length?(0,r.jsxs)("div",{className:"rounded-lg border border-white/10 bg-surface px-3 py-2 text-xs shadow-lg",children:[s&&(0,r.jsx)("div",{className:"font-semibold text-text-main mb-1",children:s}),t.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:e.color}}),(0,r.jsxs)("span",{children:[e.name,":"]}),(0,r.jsx)("span",{className:"font-mono font-medium text-text-main",children:"Cost"===e.name?(0,i.F0)(e.value):(0,i.VK)(e.value)})]},t))]}):null}function C({byAccount:e}){let t=(0,a.useMemo)(()=>e||[],[e]),s=t.length>0,n=(0,a.useMemo)(()=>t.slice(0,8).map((e,t)=>({name:e.account,value:e.totalTokens,fill:(0,o.ng)(t)})),[t]);return s?(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"By Account"}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(d.u,{width:120,height:120,children:(0,r.jsxs)(b.r,{children:[(0,r.jsx)(f.Fq,{data:n,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:28,outerRadius:55,paddingAngle:1,animationDuration:600,children:n.map((e,t)=>(0,r.jsx)(g.f,{fill:e.fill,stroke:"none"},t))}),(0,r.jsx)(u.m,{content:(0,r.jsx)(j,{formatter:i.VK})})]})}),(0,r.jsx)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:n.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:e.fill}}),(0,r.jsx)("span",{className:"truncate text-text-main",children:e.name})]}),(0,r.jsx)("span",{className:"font-mono font-medium text-text-muted shrink-0",children:(0,i.VK)(e.value)})]},t))})]})]}):(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"By Account"}),(0,r.jsx)("div",{className:"text-center text-text-muted text-sm py-8",children:"No data"})]})}function S({byApiKey:e}){let t=(0,a.useMemo)(()=>e||[],[e]),s=t.length>0,n=(0,a.useMemo)(()=>t.slice(0,8).map((e,t)=>({name:(0,i.VO)(e.apiKeyName,e.apiKeyId),fullName:e.apiKeyName||e.apiKeyId||"unknown",value:e.totalTokens,fill:(0,o.ng)(t)})),[t]);return s?(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"By API Key"}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(d.u,{width:120,height:120,children:(0,r.jsxs)(b.r,{children:[(0,r.jsx)(f.Fq,{data:n,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:28,outerRadius:55,paddingAngle:1,animationDuration:600,children:n.map((e,t)=>(0,r.jsx)(g.f,{fill:e.fill,stroke:"none"},t))}),(0,r.jsx)(u.m,{content:(0,r.jsx)(j,{formatter:i.VK})})]})}),(0,r.jsx)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:n.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:e.fill}}),(0,r.jsx)("span",{className:"truncate text-text-main",title:e.fullName,children:e.name})]}),(0,r.jsx)("span",{className:"font-mono font-medium text-text-muted shrink-0",children:(0,i.VK)(e.value)})]},`${e.fullName}-${t}`))})]})]}):(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"By API Key"}),(0,r.jsx)("div",{className:"text-center text-text-muted text-sm py-8",children:"No data"})]})}function T({byApiKey:e}){let[t,s]=(0,a.useState)(""),[n,o]=(0,a.useState)("totalTokens"),[d,c]=(0,a.useState)("desc"),x=(0,a.useMemo)(()=>e||[],[e]),m=(0,a.useMemo)(()=>{let e=t.trim().toLowerCase();return e?x.filter(t=>(t.apiKeyName||"").toLowerCase().includes(e)||(t.apiKeyId||"").toLowerCase().includes(e)):x},[x,t]),u=(0,a.useMemo)(()=>{let e=[...m];return e.sort((e,t)=>{let s=e[n]??0,r=t[n]??0;return"string"==typeof s?"asc"===d?s.localeCompare(r):r.localeCompare(s):"asc"===d?s-r:r-s}),e},[m,n,d]),p=(0,a.useCallback)(e=>{n===e?c(e=>"asc"===e?"desc":"asc"):(o(e),c("desc"))},[n]);return x.length>0?(0,r.jsxs)(l.default,{className:"overflow-hidden",children:[(0,r.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between gap-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider",children:"API Key Breakdown"}),(0,r.jsx)("input",{type:"text",value:t,onChange:e=>s(e.target.value),placeholder:"Filter API key...",className:"w-full max-w-[220px] px-3 py-1.5 rounded-lg bg-bg-subtle border border-border text-xs text-text-primary placeholder:text-text-muted focus:outline-none focus:border-primary"})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{className:"text-xs text-text-muted uppercase bg-black/[0.02] dark:bg-white/[0.02]",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-4 py-2.5 text-left cursor-pointer group",onClick:()=>p("apiKeyName"),children:["API Key ",(0,r.jsx)(y,{active:"apiKeyName"===n,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>p("requests"),children:["Requests ",(0,r.jsx)(y,{active:"requests"===n,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>p("promptTokens"),children:["Input ",(0,r.jsx)(y,{active:"promptTokens"===n,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>p("completionTokens"),children:["Output"," ",(0,r.jsx)(y,{active:"completionTokens"===n,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>p("totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(y,{active:"totalTokens"===n,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>p("cost"),children:["Cost ",(0,r.jsx)(y,{active:"cost"===n,sortOrder:d})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[u.map((e,t)=>(0,r.jsxs)("tr",{className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,r.jsx)("td",{className:"px-4 py-2.5",children:(0,r.jsx)("span",{className:"font-medium",title:e.apiKeyName||e.apiKeyId||"unknown",children:(0,i.VO)(e.apiKeyName,e.apiKeyId)})}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-text-muted",children:(0,i.xW)(e.requests)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-primary",children:(0,i.VK)(e.promptTokens)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-emerald-500",children:(0,i.VK)(e.completionTokens)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono font-semibold",children:(0,i.VK)(e.totalTokens)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-amber-500",children:(0,i.F0)(e.cost)})]},`${e.apiKeyId||e.apiKeyName||"key"}-${t}`)),0===u.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-text-muted",children:"No API key matches this filter."})})]})]})})]}):(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"API Key Breakdown"}),(0,r.jsx)("div",{className:"text-center text-text-muted text-sm py-8",children:"No data"})]})}function I({activityMap:e}){let t=(0,a.useMemo)(()=>{if(!e)return null;let t=new Date,s=null,r=0;for(let a=0;a<7;a++){let l=new Date(t);l.setDate(l.getDate()-a);let n=`${l.getFullYear()}-${String(l.getMonth()+1).padStart(2,"0")}-${String(l.getDate()).padStart(2,"0")}`,i=e[n]||0;i>r&&(r=i,s=n)}if(!s||0===r)return null;let a=new Date(s+"T12:00:00");return{weekday:["domingo","segunda","ter\xe7a","quarta","quinta","sexta","s\xe1bado"][a.getDay()],label:`${a.getDate()} de ${["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"][a.getMonth()]}`,tokens:r}},[e]);return(0,r.jsxs)(l.default,{className:"p-4 flex flex-col justify-center",style:{flex:1,minHeight:0},children:[(0,r.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-muted)"},children:"Most Active Day"}),t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"text-xl font-bold capitalize",style:{lineHeight:1.2},children:t.weekday}),(0,r.jsxs)("span",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:[t.label," \xb7 ",(0,i.VK)(t.tokens)," tokens"]})]}):(0,r.jsx)("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Sem dados nos \xfaltimos 7 dias"})]})}function $({activityMap:e}){let t=(0,a.useMemo)(()=>{if(!e)return[];let t=new Date,s=[],r=0;for(let a=6;a>=0;a--){let l=new Date(t);l.setDate(l.getDate()-a);let n=`${l.getFullYear()}-${String(l.getMonth()+1).padStart(2,"0")}-${String(l.getDate()).padStart(2,"0")}`,i=e[n]||0;i>r&&(r=i);let o=["DOM","SEG","TER","QUA","QUI","SEX","S\xc1B"];s.push({key:n,val:i,label:o[l.getDay()]})}return s.map(e=>({...e,intensity:r>0?e.val/r:0}))},[e]);return(0,r.jsxs)(l.default,{className:"p-4 flex flex-col justify-center",style:{flex:1,minHeight:0},children:[(0,r.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Weekly"}),(0,r.jsx)("div",{style:{display:"flex",alignItems:"flex-end",gap:6,justifyContent:"center"},children:t.map((e,t)=>{var s;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[(0,r.jsx)("div",{title:`${e.key}: ${(0,i.xW)(e.val)} tokens`,style:{width:36,height:36,borderRadius:8,...0===(s=e.intensity)?{background:"rgba(255,255,255,0.04)"}:{background:`rgba(217, 119, 87, ${(.15+.75*s).toFixed(2)})`},transition:"all 0.2s",cursor:"default"}}),(0,r.jsx)("span",{style:{fontSize:9,fontWeight:600,color:"var(--text-muted)",letterSpacing:"0.03em"},children:e.label})]},t)})})]})}function O({byModel:e,summary:t}){let[s,n]=(0,a.useState)("totalTokens"),[d,c]=(0,a.useState)("desc"),x=(0,a.useCallback)(e=>{s===e?c(e=>"asc"===e?"desc":"asc"):(n(e),c("desc"))},[s]),m=(0,a.useMemo)(()=>{let t=[...e||[]];return t.sort((e,t)=>{let r=e[s]??0,a=t[s]??0;return"string"==typeof r?"asc"===d?r.localeCompare(a):a.localeCompare(r):"asc"===d?r-a:a-r}),t},[e,s,d]);return(0,r.jsxs)(l.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border",children:(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider",children:"Model Breakdown"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{className:"text-xs text-text-muted uppercase bg-black/[0.02] dark:bg-white/[0.02]",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-4 py-2.5 text-left cursor-pointer group",onClick:()=>x("model"),children:["Model ",(0,r.jsx)(y,{active:"model"===s,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>x("requests"),children:["Requests ",(0,r.jsx)(y,{active:"requests"===s,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>x("promptTokens"),children:["Input ",(0,r.jsx)(y,{active:"promptTokens"===s,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>x("completionTokens"),children:["Output"," ",(0,r.jsx)(y,{active:"completionTokens"===s,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>x("totalTokens"),children:["Total ",(0,r.jsx)(y,{active:"totalTokens"===s,sortOrder:d})]}),(0,r.jsxs)("th",{className:"px-4 py-2.5 text-right cursor-pointer group",onClick:()=>x("cost"),children:["Cost ",(0,r.jsx)(y,{active:"cost"===s,sortOrder:d})]}),(0,r.jsx)("th",{className:"px-4 py-2.5 text-right w-36",children:"Share"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border",children:m.map((e,t)=>(0,r.jsxs)("tr",{className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,r.jsx)("td",{className:"px-4 py-2.5",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:(0,o.ng)(t)}}),(0,r.jsx)("span",{className:"font-medium",children:e.model})]})}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-text-muted",children:(0,i.xW)(e.requests)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-primary",children:(0,i.VK)(e.promptTokens)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-emerald-500",children:(0,i.VK)(e.completionTokens)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono font-semibold",children:(0,i.VK)(e.totalTokens)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right font-mono text-amber-500",children:(0,i.F0)(e.cost)}),(0,r.jsx)("td",{className:"px-4 py-2.5 text-right",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,r.jsx)("div",{className:"w-16 h-1.5 rounded-full bg-white/[0.06] overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all",style:{width:`${e.pct}%`,backgroundColor:(0,o.ng)(t)}})}),(0,r.jsxs)("span",{className:"text-xs font-mono text-text-muted w-10 text-right",children:[e.pct,"%"]})]})})]},e.model))})]})})]})}let A=["#f59e0b","#ef4444","#8b5cf6","#10b981","#06b6d4","#ec4899","#f97316","#6366f1","#14b8a6","#a855f7"];function E({byProvider:e}){let t=(0,a.useMemo)(()=>e||[],[e]),s=t.length>0&&t.some(e=>e.cost>0),n=(0,a.useMemo)(()=>t.filter(e=>e.cost>0).sort((e,t)=>t.cost-e.cost).slice(0,8).map((e,t)=>({name:e.provider,value:e.cost,fill:A[t%A.length]})),[t]);return s?(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Cost by Provider"}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(d.u,{width:120,height:120,children:(0,r.jsxs)(b.r,{children:[(0,r.jsx)(f.Fq,{data:n,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:28,outerRadius:55,paddingAngle:1,animationDuration:600,children:n.map((e,t)=>(0,r.jsx)(g.f,{fill:e.fill,stroke:"none"},t))}),(0,r.jsx)(u.m,{content:(0,r.jsx)(j,{formatter:i.F0})})]})}),(0,r.jsx)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:n.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:e.fill}}),(0,r.jsx)("span",{className:"truncate text-text-main capitalize",children:e.name})]}),(0,r.jsx)("span",{className:"font-mono font-medium text-amber-500 shrink-0",children:(0,i.F0)(e.value)})]},t))})]})]}):(0,r.jsxs)(l.default,{className:"p-4 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Cost by Provider"}),(0,r.jsx)("div",{className:"text-center text-text-muted text-sm py-8",children:"No cost data"})]})}function R(){let[e,t]=(0,a.useState)("30d"),[s,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(!0),[x,m]=(0,a.useState)(null),u=(0,a.useCallback)(async()=>{try{c(!0);let t=await fetch(`/api/usage/analytics?range=${e}`);if(!t.ok)throw Error("Failed to fetch");let s=await t.json();o(s),m(null)}catch(e){m(e.message)}finally{c(!1)}},[e]);if((0,a.useEffect)(()=>{u()},[u]),d&&!s)return(0,r.jsx)(n.CardSkeleton,{});if(x)return(0,r.jsxs)(l.default,{className:"p-6 text-center text-red-500",children:["Error: ",x]});let p=s?.summary||{};return(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:"analytics"}),"Usage Analytics"]}),(0,r.jsx)("div",{className:"flex items-center gap-1 bg-black/[0.03] dark:bg-white/[0.03] rounded-lg p-1 border border-black/5 dark:border-white/5",children:[{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"90d",label:"90D"},{value:"ytd",label:"YTD"},{value:"all",label:"All"}].map(s=>(0,r.jsx)("button",{onClick:()=>t(s.value),className:`px-3 py-1 rounded-md text-xs font-semibold transition-all ${e===s.value?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:s.label},s.value))})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-7 gap-3",children:[(0,r.jsx)(v,{icon:"generating_tokens",label:"Total Tokens",value:(0,i.VK)(p.totalTokens),subValue:`${(0,i.xW)(p.totalRequests)} requests`}),(0,r.jsx)(v,{icon:"input",label:"Input Tokens",value:(0,i.VK)(p.promptTokens),color:"text-primary"}),(0,r.jsx)(v,{icon:"output",label:"Output Tokens",value:(0,i.VK)(p.completionTokens),color:"text-emerald-500"}),(0,r.jsx)(v,{icon:"payments",label:"Est. Cost",value:(0,i.F0)(p.totalCost),color:"text-amber-500"}),(0,r.jsx)(v,{icon:"group",label:"Accounts",value:p.uniqueAccounts||0}),(0,r.jsx)(v,{icon:"vpn_key",label:"API Keys",value:p.uniqueApiKeys||0}),(0,r.jsx)(v,{icon:"model_training",label:"Models",value:p.uniqueModels||0})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16,alignItems:"stretch"},children:[(0,r.jsx)(N,{activityMap:s?.activityMap}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,r.jsx)(I,{activityMap:s?.activityMap}),(0,r.jsx)($,{activityMap:s?.activityMap})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,r.jsx)(k,{dailyTrend:s?.dailyTrend}),(0,r.jsx)(E,{byProvider:s?.byProvider})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,r.jsx)(C,{byAccount:s?.byAccount}),(0,r.jsx)(S,{byApiKey:s?.byApiKey})]}),(0,r.jsx)(T,{byApiKey:s?.byApiKey}),(0,r.jsx)(O,{byModel:s?.byModel,summary:p}),(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,r.jsxs)(l.default,{className:"px-4 py-3 text-center",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold",children:"Requests"}),(0,r.jsx)("div",{className:"text-lg font-bold mt-1",children:(0,i.xW)(p.totalRequests)})]}),(0,r.jsxs)(l.default,{className:"px-4 py-3 text-center",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold",children:"Streak"}),(0,r.jsxs)("div",{className:"text-lg font-bold mt-1",children:[p.streak||0,"d"]})]}),(0,r.jsxs)(l.default,{className:"px-4 py-3 text-center",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold",children:"Total Tokens"}),(0,r.jsx)("div",{className:"text-lg font-bold mt-1",children:(0,i.VK)(p.totalTokens)})]}),(0,r.jsxs)(l.default,{className:"px-4 py-3 text-center",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase font-semibold",children:"Usage Cost"}),(0,r.jsx)("div",{className:"text-lg font-bold text-amber-500 mt-1",children:(0,i.F0)(p.totalCost)})]})]})]})}},33205:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(95155),a=s(73321),l=s(98500),n=s(5772),i=s(14051),o=s(71525),d=s(64745);function c({onMenuClick:e,showMenuButton:t=!0}){let s=(0,a.usePathname)(),i=(0,a.useRouter)(),{title:c,description:x,breadcrumbs:m}=(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/providers\/([^/]+)$/);if(t){let e=t[1],s=d.zN[e]||d.IS[e]||d.fg[e];if(s)return{title:s.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:s.name,image:`/providers/${s.id}.png`}]};if(e.startsWith(d.JH))return{title:"OpenAI Compatible",description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:"OpenAI Compatible",image:"/providers/oai-cc.png"}]};if(e.startsWith(d.DI))return{title:"Anthropic Compatible",description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:"Anthropic Compatible",image:"/providers/anthropic-m.png"}]}}return e.includes("/providers")?{title:"Providers",description:"Manage your AI provider connections",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(s),u=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(i.push("/login"),i.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,r.jsxs)("header",{className:"flex items-center justify-between px-8 py-5 border-b border-black/5 dark:border-white/5 bg-bg/80 backdrop-blur-xl z-10 sticky top-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-3 lg:hidden",children:t&&(0,r.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,r.jsx)("div",{className:"hidden lg:flex flex-col",children:m.length>0?(0,r.jsx)("div",{className:"flex items-center gap-2",children:m.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,r.jsx)(l,{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,r.jsx)(n.default,{src:e.image,alt:e.label,width:28,height:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",sizes:"28px",onError:e=>{e.currentTarget.style.display="none"}}),(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:e.label})]})]},`${e.label}-${e.href||"current"}`))}):c?(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:c}),x&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:x})]}):null}),(0,r.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,r.jsx)(o.UW,{}),(0,r.jsx)("button",{onClick:u,className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-all",title:"Logout",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"logout"})})]})]})}c.propTypes={onMenuClick:i.func,showMenuButton:i.bool}},33730:(e,t,s)=>{s.d(t,{default:()=>o});var r=s(95155),a=s(12115),l=s(16620),n=s(33205);let i="sidebar-collapsed";function o({children:e}){let[t,s]=(0,a.useState)(!1),[o,d]=(0,a.useState)(()=>{try{return"true"===localStorage.getItem(i)}catch{return!1}});return(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[t&&(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>s(!1)}),(0,r.jsx)("div",{className:"hidden lg:flex",children:(0,r.jsx)(l.default,{collapsed:o,onToggleCollapse:()=>{let e=!o;d(e),localStorage.setItem(i,String(e))}})}),(0,r.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,r.jsx)(l.default,{onClose:()=>s(!1)})}),(0,r.jsxs)("main",{id:"main-content",className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300",children:[(0,r.jsx)(n.default,{onMenuClick:()=>s(!0)}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 lg:p-10",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:e})})]})]})}},34405:(e,t,s)=>{s.d(t,{ConfirmModal:()=>o,default:()=>i});var r=s(95155),a=s(12115),l=s(61592),n=s(39680);function i({isOpen:e,onClose:t,title:s,children:n,footer:i,size:o="md",closeOnOverlay:d=!0,showCloseButton:c=!0,className:x}){let m=(0,a.useId)(),u=(0,a.useRef)(null);return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),(0,a.useEffect)(()=>{if(!e||!u.current)return;let t=u.current,s='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',r=t.querySelector(s);r&&setTimeout(()=>r.focus(),50);let a=e=>{if("Tab"!==e.key)return;let r=[...t.querySelectorAll(s)];if(0===r.length)return;let a=r[0],l=r[r.length-1];e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):e.shiftKey||document.activeElement!==l||(e.preventDefault(),a.focus())};return t.addEventListener("keydown",a),()=>t.removeEventListener("keydown",a)},[e]),e)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:d?t:void 0,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,className:(0,l.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[o],x),children:[(s||c)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mr-4","aria-hidden":"true",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),s&&(0,r.jsx)("h2",{id:m,className:"text-lg font-semibold text-text-main",children:s})]}),c&&(0,r.jsx)("button",{onClick:t,"aria-label":"Close",className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:n}),i&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:i})]})]}):null}function o({isOpen:e,onClose:t,onConfirm:s,title:a="Confirm",message:l,confirmText:o="Confirm",cancelText:d="Cancel",variant:c="danger",loading:x=!1}){return(0,r.jsx)(i,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{variant:"ghost",onClick:t,disabled:x,children:d}),(0,r.jsx)(n.default,{variant:c,onClick:s,loading:x,children:o})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:l})})}},34713:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(61592);function l({options:e=[],value:t,onChange:s,size:l="md",className:n,"aria-label":i}){let o={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,r.jsx)("div",{role:"tablist","aria-label":i,className:(0,a.cn)("inline-flex items-center p-1 rounded-lg","bg-black/5 dark:bg-white/5",n),children:e.map(e=>(0,r.jsxs)("button",{role:"tab","aria-selected":t===e.value,tabIndex:t===e.value?0:-1,onClick:()=>s(e.value),className:(0,a.cn)("px-4 rounded-md font-medium transition-all",o[l],t===e.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[e.icon&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5","aria-hidden":"true",children:e.icon}),e.label]},e.value))})}},39680:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(61592);let l={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},n={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function i({children:e,variant:t="primary",size:s="md",icon:i,iconRight:o,disabled:d=!1,loading:c=!1,fullWidth:x=!1,className:m,...u}){return(0,r.jsxs)("button",{type:"button",className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[s],x&&"w-full",m),disabled:d||c,"aria-busy":c||void 0,...u,children:[c?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px] pointer-events-none","aria-hidden":"true",children:"progress_activity"}):i?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] pointer-events-none","aria-hidden":"true",children:i}):null,e,o&&!c&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px] pointer-events-none","aria-hidden":"true",children:o})]})}},41566:(e,t,s)=>{s.d(t,{default:()=>u});var r=s(95155),a=s(12115),l=s(14051),n=s(73321),i=s(67578),o=s(23375),d=s(78076),c=s(78362);function x({field:e,currentSort:t,currentOrder:s}){return t!==e?(0,r.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,r.jsx)("span",{className:"ml-1",children:"asc"===s?"↑":"↓"})}function m({data:e,colorClass:t="bg-primary"}){let s=Math.max(...e,1);return(0,r.jsx)("div",{className:"flex items-end gap-1 h-8 w-24",children:e.slice(-9).map((e,a)=>(0,r.jsx)("div",{className:`flex-1 rounded-t-sm transition-all duration-500 ${t}`,style:{height:`${Math.max(e/s*100,5)}%`},title:String(e)},`bar-${a}-${e}`))})}function u(){let e=(0,n.useRouter)(),t=(0,n.useSearchParams)(),s=t.get("sortBy")||"rawModel",l=t.get("sortOrder")||"asc",[u,p]=(0,a.useState)(null),[h,b]=(0,a.useState)(!0),[f,g]=(0,a.useState)(!0),[j,y]=(0,a.useState)("tokens"),[v,N]=(0,a.useState)(5e3),k=(0,a.useRef)(0),w=r=>{let a=new URLSearchParams(t.toString());s===r?a.set("sortOrder","asc"===l?"desc":"asc"):(a.set("sortBy",r),a.set("sortOrder","asc")),e.replace(`?${a.toString()}`,{scroll:!1})},C=(0,a.useCallback)((e,t={})=>Object.entries(e||{}).map(([e,s])=>{let r=(s.promptTokens||0)+(s.completionTokens||0),a=s.cost||0,l=r>0?(s.promptTokens||0)*(a/r):0,n=r>0?(s.completionTokens||0)*(a/r):0;return{...s,key:e,totalTokens:r,totalCost:a,inputCost:l,outputCost:n,pending:t[e]||0}}).sort((e,t)=>{let r=e[s],a=t[s];return("string"==typeof r&&(r=r.toLowerCase()),"string"==typeof a&&(a=a.toLowerCase()),r<a)?"asc"===l?-1:1:r>a?"asc"===l?1:-1:0}),[s,l]),S=(0,a.useMemo)(()=>C(u?.byModel,u?.pending?.byModel),[u?.byModel,u?.pending?.byModel,C]),T=(0,a.useMemo)(()=>{let e={};return u?.pending?.byAccount&&Object.entries(u.byAccount||{}).forEach(([t,s])=>{let r=u.pending.byAccount[s.connectionId];if(r){let a=s.provider?`${s.rawModel} (${s.provider})`:s.rawModel;e[t]=r[a]||0}}),C(u?.byAccount,e)},[u?.byAccount,u?.pending?.byAccount,C]),I=(0,a.useCallback)(async(e=!0)=>{e&&b(!0);try{let e=await fetch("/api/usage/history");if(e.ok){let t=await e.json();p(t);let s=t.totalRequests||0;s>k.current?N(5e3):N(e=>Math.min(2*e,6e4)),k.current=s}}catch(e){console.error("Failed to fetch usage stats:",e)}finally{e&&b(!1)}},[]);if((0,a.useEffect)(()=>{I()},[I]),(0,a.useEffect)(()=>{let e,t=!0,s=()=>{(t=!document.hidden)&&f&&I(!1)};return document.addEventListener("visibilitychange",s),f&&(e&&clearInterval(e),e=setInterval(()=>{t&&I(!1)},v)),()=>{e&&clearInterval(e),document.removeEventListener("visibilitychange",s)}},[f,v,I]),h)return(0,r.jsx)(d.CardSkeleton,{});if(!u)return(0,r.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let $=e=>(0,c.xW)(e),O=e=>{if(!e)return"Never";let t=new Date(e),s=Math.floor((new Date-t)/6e4);return s<1?"Just now":s<60?`${s}m ago`:s<1440?`${Math.floor(s/60)}h ago`:t.toLocaleDateString()};return(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Usage Overview"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:[(0,r.jsx)("button",{onClick:()=>y("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===j?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,r.jsx)("button",{onClick:()=>y("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===j?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"})]}),(0,r.jsxs)("div",{className:"text-sm font-medium text-text-muted flex items-center gap-2",children:[(0,r.jsxs)("span",{children:["Auto Refresh (",v/1e3,"s)"]}),(0,r.jsx)("button",{type:"button",onClick:()=>g(!f),role:"switch","aria-checked":f,"aria-label":"Toggle auto refresh",className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${f?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,r.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${f?"translate-x-5":"translate-x-1"}`})})]})]})]}),(u.activeRequests||[]).length>0&&(0,r.jsx)(i.default,{className:"p-3 border-primary/20 bg-primary/5",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-primary font-semibold text-sm uppercase tracking-wider",children:[(0,r.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,r.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),(0,r.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),"Active Requests"]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-3",children:u.activeRequests.map(e=>(0,r.jsxs)("div",{className:"px-3 py-1.5 rounded-md bg-bg-subtle border border-primary/20 text-xs font-mono shadow-sm",children:[(0,r.jsx)("span",{className:"text-primary font-bold",children:e.model}),(0,r.jsx)("span",{className:"mx-1 text-text-muted",children:"|"}),(0,r.jsx)("span",{className:"text-text",children:e.provider}),(0,r.jsx)("span",{className:"mx-1 text-text-muted",children:"|"}),(0,r.jsx)("span",{className:"text-text font-medium",children:e.account}),e.count>1&&(0,r.jsxs)("span",{className:"ml-2 px-1.5 py-0.5 rounded bg-primary text-white font-bold",children:["x",e.count]})]},`${e.model}-${e.provider}-${e.account}`))})]})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,r.jsx)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,r.jsx)("span",{className:"text-2xl font-bold",children:$(u.totalRequests)})]}),(0,r.jsx)(m,{data:(u.last10Minutes||[]).map(e=>e.requests),colorClass:"bg-text-muted/30"})]})}),(0,r.jsx)(i.default,{className:"px-4 py-3 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-primary",children:$(u.totalPromptTokens)})]}),(0,r.jsx)(m,{data:(u.last10Minutes||[]).map(e=>e.promptTokens),colorClass:"bg-primary/50"})]})}),(0,r.jsx)(i.default,{className:"px-4 py-2 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-success",children:$(u.totalCompletionTokens)})]}),(0,r.jsx)("div",{className:"w-px bg-border self-stretch mx-2"}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Cost"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-warning",children:(0,c.F0)(u.totalCost)})]})]})})]}),(0,r.jsxs)(i.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:"Usage by Model"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("rawModel"),children:["Model ",(0,r.jsx)(x,{field:"rawModel",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("provider"),children:["Provider"," ",(0,r.jsx)(x,{field:"provider",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("requests"),children:["Requests"," ",(0,r.jsx)(x,{field:"requests",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("lastUsed"),children:["Last Used"," ",(0,r.jsx)(x,{field:"lastUsed",currentSort:s,currentOrder:l})]}),"tokens"===j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Tokens"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Tokens"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(x,{field:"totalTokens",currentSort:s,currentOrder:l})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Cost"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Cost"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("cost"),children:["Total Cost"," ",(0,r.jsx)(x,{field:"cost",currentSort:s,currentOrder:l})]})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[S.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-bg-subtle/20",children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(o.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:$(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:O(e.lastUsed)}),"tokens"===j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:$(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:(0,c.F0)(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:(0,c.F0)(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:(0,c.F0)(e.totalCost)})]})]},e.key)),0===S.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:8,className:"px-6 py-8 text-center text-text-muted",children:"No usage recorded yet. Make some requests to see data here."})})]})]})})]}),(0,r.jsxs)(i.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:"Usage by Account"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("rawModel"),children:["Model ",(0,r.jsx)(x,{field:"rawModel",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("provider"),children:["Provider"," ",(0,r.jsx)(x,{field:"provider",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("accountName"),children:["Account"," ",(0,r.jsx)(x,{field:"accountName",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("requests"),children:["Requests"," ",(0,r.jsx)(x,{field:"requests",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("lastUsed"),children:["Last Used"," ",(0,r.jsx)(x,{field:"lastUsed",currentSort:s,currentOrder:l})]}),"tokens"===j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Tokens"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Tokens"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(x,{field:"totalTokens",currentSort:s,currentOrder:l})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Cost"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Cost"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("cost"),children:["Total Cost"," ",(0,r.jsx)(x,{field:"cost",currentSort:s,currentOrder:l})]})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[T.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-bg-subtle/20",children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(o.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)("span",{className:`font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.accountName||`Account ${e.connectionId?.slice(0,8)}...`})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:$(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:O(e.lastUsed)}),"tokens"===j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:$(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:(0,c.F0)(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:(0,c.F0)(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:(0,c.F0)(e.totalCost)})]})]},e.key)),0===T.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:9,className:"px-6 py-8 text-center text-text-muted",children:"No account-specific usage recorded yet. Make requests using OAuth accounts to see data here."})})]})]})})]})]})}x.propTypes={field:l.string.isRequired,currentSort:l.string.isRequired,currentOrder:l.string.isRequired},m.propTypes={data:l.arrayOf(l.number).isRequired,colorClass:l.string}},43144:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(61592);function l({checked:e=!1,onChange:t,label:s,description:l,disabled:n=!1,size:i="md",className:o}){let d={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",n&&"opacity-50 cursor-not-allowed",o),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":s?void 0:l||"Toggle",disabled:n,onClick:()=>{!n&&t&&t(!e)},className:(0,a.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-1 focus:ring-primary/30",e?"bg-primary":"bg-black/10 dark:bg-white/20",d[i].track,n&&"cursor-not-allowed"),children:(0,r.jsx)("span",{"aria-hidden":"true",className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?d[i].translate:"translate-x-0.5",d[i].thumb,"mt-0.5")})}),(s||l)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[s&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:s}),l&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:l})]})]})}},44817:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(12115),l=s(14051),n=s(71525);function i({isOpen:e,onSuccess:t,onClose:s}){let[l,i]=(0,a.useState)(""),[o,d]=(0,a.useState)(""),[c,x]=(0,a.useState)(null),[m,u]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(async()=>{h(!0),x(null),f(!1);try{let e=await fetch("/api/oauth/cursor/auto-import"),t=await e.json();t.found?(i(t.accessToken),d(t.machineId),f(!0)):x(t.error||"Could not auto-detect tokens")}catch(e){x("Failed to auto-detect tokens")}finally{h(!1)}})()},[e]);let g=async()=>{if(!l.trim())return void x("Please enter an access token");if(!o.trim())return void x("Please enter a machine ID");u(!0),x(null);try{let e=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:l.trim(),machineId:o.trim()})}),r=await e.json();if(!e.ok)throw Error(r.error||"Import failed");t?.(),s()}catch(e){x(e.message)}finally{u(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Connect Cursor IDE",onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[p&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!p&&(0,r.jsxs)(r.Fragment,{children:[b&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),!b&&!c&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{value:l,onChange:e=>i(e.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(n.pd,{value:o,onChange:e=>d(e.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),c&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:c})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:g,fullWidth:!0,disabled:m||!l.trim()||!o.trim(),children:m?"Importing...":"Import Token"}),(0,r.jsx)(n.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}i.propTypes={isOpen:l.bool.isRequired,onSuccess:l.func,onClose:l.func.isRequired}},61592:(e,t,s)=>{s.d(t,{cn:()=>r});function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},66137:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(95155),a=s(2946),l=s(61592);function n({className:e,variant:t="default"}){let{theme:s,toggleTheme:n,isDark:i}=(0,a.D)(),o={default:(0,l.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted","hover:bg-black/5","hover:text-text-main","transition-colors"),card:(0,l.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60","hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-md","text-text-muted-light hover:text-primary","hover:text-primary","transition-all group")};return(0,r.jsx)("button",{onClick:n,className:(0,l.cn)(o[t],e),"aria-label":`Switch to ${i?"light":"dark"} mode`,title:`Switch to ${i?"light":"dark"} mode`,children:(0,r.jsx)("span",{className:(0,l.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:i?"light_mode":"dark_mode"})})}},67578:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(95155),a=s(61592);function l({children:e,title:t,subtitle:s,icon:l,action:n,padding:i="md",hover:o=!1,className:d,...c}){return(0,r.jsxs)("div",{className:(0,a.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",o&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[i],d),...c,children:[(t||n)&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,r.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l})}),(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("h3",{className:"text-text-main font-semibold",children:t}),s&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:s})]})]}),n]}),e]})}l.Section=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...s,children:e})},l.Row=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.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),...s,children:e})},l.ListItem=function({children:e,actions:t,className:s,...l}){return(0,r.jsxs)("div",{className:(0,a.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",s),...l,children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,r.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:t})]})}},68661:(e,t,s)=>{s.d(t,{default:()=>m});var r=s(95155),a=s(12115),l=s(67578),n=s(99225),i=s(78362);let o=[{key:"all",label:"All"},{key:"error",label:"Errors",icon:"error"},{key:"ok",label:"Success",icon:"check_circle"},{key:"combo",label:"Combo",icon:"hub"}],d=[{key:"status",label:"Status"},{key:"model",label:"Model"},{key:"provider",label:"Provider"},{key:"protocol",label:"Protocol"},{key:"account",label:"Account"},{key:"apiKey",label:"API Key"},{key:"combo",label:"Combo"},{key:"tokens",label:"Tokens"},{key:"duration",label:"Duration"},{key:"time",label:"Time"}],c=Object.fromEntries(d.map(e=>[e.key,!0]));function x(e){return(e?.tokens?.in||0)+(e?.tokens?.out||0)}function m(){let[e,t]=(0,a.useState)([]),[s,m]=(0,a.useState)(!0),[p,h]=(0,a.useState)(!0),[b,f]=(0,a.useState)(""),[g,j]=(0,a.useState)("all"),[y,v]=(0,a.useState)(""),[N,k]=(0,a.useState)(""),[w,C]=(0,a.useState)(""),[S,T]=(0,a.useState)(""),[I,$]=(0,a.useState)("newest"),[O,A]=(0,a.useState)(null),[E,R]=(0,a.useState)(!1),[M,F]=(0,a.useState)(null),L=(0,a.useRef)(null),P=(0,a.useRef)(!1),[_,D]=(0,a.useState)(()=>{try{let e=localStorage.getItem("loggerVisibleColumns");return e?{...c,...JSON.parse(e)}:c}catch{return c}}),K=(0,a.useCallback)(e=>{D(t=>{let s={...t,[e]:!t[e]};try{localStorage.setItem("loggerVisibleColumns",JSON.stringify(s))}catch{}return s})},[]),z=(0,a.useCallback)(async(e=!1)=>{e&&m(!0);try{let e=new URLSearchParams;b&&e.set("search",b),"error"===g&&e.set("status","error"),"ok"===g&&e.set("status","ok"),"combo"===g&&e.set("combo","1"),y&&e.set("model",y),w&&e.set("provider",w),N&&e.set("account",N),S&&e.set("apiKey",S),e.set("limit","300");let s=await fetch(`/api/usage/call-logs?${e}`);if(s.ok){let e=await s.json();t(e)}}catch(e){console.error("Failed to fetch call logs:",e)}finally{e&&m(!1)}},[b,g,y,N,w,S]);(0,a.useEffect)(()=>{let e=!P.current;P.current=!0,z(e)},[z]),(0,a.useEffect)(()=>(L.current&&clearInterval(L.current),p&&(L.current=setInterval(()=>z(!1),3e3)),()=>{L.current&&clearInterval(L.current)}),[p,z]);let U=(0,a.useMemo)(()=>"combo"===g?e.filter(e=>e.comboName):e,[g,e]),q=(0,a.useMemo)(()=>{let e=[...U];return e.sort((e,t)=>{switch(I){case"oldest":return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime();case"tokens_desc":return x(t)-x(e);case"tokens_asc":return x(e)-x(t);case"duration_desc":return(t.duration||0)-(e.duration||0);case"duration_asc":return(e.duration||0)-(t.duration||0);case"status_desc":return(t.status||0)-(e.status||0);case"status_asc":return(e.status||0)-(t.status||0);case"model_asc":return(e.model||"").localeCompare(t.model||"");case"model_desc":return(t.model||"").localeCompare(e.model||"");default:return new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()}}),e},[U,I]),B=async e=>{A(e),R(!0),F(null);try{let t=await fetch(`/api/usage/call-logs/${e.id}`);if(t.ok){let e=await t.json();F(e)}}catch(e){console.error("Failed to fetch log detail:",e)}finally{R(!1)}},W=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{try{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}catch{return!1}}},V=[...new Set(e.map(e=>e.account).filter(e=>e&&"-"!==e))],Y=[...new Set(e.map(e=>e.model).filter(Boolean))].sort(),G=[...new Set(e.map(e=>e.provider).filter(e=>e&&"-"!==e))].sort(),J=[...new Set(e.map(e=>e.apiKeyId||e.apiKeyName).filter(Boolean))].sort(),H=U.length,Q=U.filter(e=>e.status>=200&&e.status<300).length,X=U.filter(e=>e.status>=400).length,Z=e.filter(e=>e.comboName).length,ee=J.length;return(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsxs)("button",{onClick:()=>h(!p),className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium border transition-colors ${p?"bg-red-500/10 border-red-500/30 text-red-400":"bg-bg-subtle border-border text-text-muted"}`,children:[(0,r.jsx)("span",{className:`w-2 h-2 rounded-full ${p?"bg-red-500 animate-pulse":"bg-text-muted"}`}),p?"Recording":"Paused"]}),(0,r.jsxs)("div",{className:"flex-1 min-w-[200px] relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-3 top-1/2 -translate-y-1/2 text-text-muted text-[18px]",children:"search"}),(0,r.jsx)("input",{type:"text",placeholder:"Search model, provider, account, API key, combo...",value:b,onChange:e=>f(e.target.value),className:"w-full pl-10 pr-4 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:border-primary"})]}),(0,r.jsxs)("select",{value:w,onChange:e=>C(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[140px]",children:[(0,r.jsx)("option",{value:"",children:"All Providers"}),G.map(e=>{let t=n.RY[e];return(0,r.jsx)("option",{value:e,children:t?.label||e.toUpperCase()},e)})]}),(0,r.jsxs)("select",{value:y,onChange:e=>v(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[180px]",children:[(0,r.jsx)("option",{value:"",children:"All Models"}),Y.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),(0,r.jsxs)("select",{value:N,onChange:e=>k(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[140px]",children:[(0,r.jsx)("option",{value:"",children:"All Accounts"}),V.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),(0,r.jsxs)("select",{value:S,onChange:e=>T(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[160px]",children:[(0,r.jsx)("option",{value:"",children:"All API Keys"}),J.map(t=>{let s=e.find(e=>(e.apiKeyId||e.apiKeyName)===t),a=(0,i.VO)(s?.apiKeyName,s?.apiKeyId);return(0,r.jsx)("option",{value:t,children:a},t)})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-bg-subtle border border-border font-mono",children:[H," total"]}),(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-emerald-500/10 text-emerald-400 font-mono",children:[Q," OK"]}),X>0&&(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-red-500/10 text-red-400 font-mono",children:[X," ERR"]}),Z>0&&(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-violet-500/10 text-violet-300 font-mono",children:[Z," combo"]}),ee>0&&(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-primary/10 text-primary font-mono",children:[ee," keys"]}),(0,r.jsxs)("span",{className:"px-2 py-1 rounded bg-bg-subtle border border-border font-mono",children:[q.length," shown"]})]}),(0,r.jsxs)("select",{value:I,onChange:e=>$(e.target.value),className:"px-3 py-2 rounded-lg bg-bg-subtle border border-border text-sm text-text-primary focus:outline-none focus:border-primary appearance-none cursor-pointer min-w-[150px]",title:"Sort logs",children:[(0,r.jsx)("option",{value:"newest",children:"Newest"}),(0,r.jsx)("option",{value:"oldest",children:"Oldest"}),(0,r.jsx)("option",{value:"tokens_desc",children:"Tokens ↓"}),(0,r.jsx)("option",{value:"tokens_asc",children:"Tokens ↑"}),(0,r.jsx)("option",{value:"duration_desc",children:"Duration ↓"}),(0,r.jsx)("option",{value:"duration_asc",children:"Duration ↑"}),(0,r.jsx)("option",{value:"status_desc",children:"Status ↓"}),(0,r.jsx)("option",{value:"status_asc",children:"Status ↑"}),(0,r.jsx)("option",{value:"model_asc",children:"Model A-Z"}),(0,r.jsx)("option",{value:"model_desc",children:"Model Z-A"})]}),(0,r.jsx)("button",{onClick:()=>z(!1),className:"p-2 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"refresh"})})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>(0,r.jsxs)("button",{onClick:()=>j(g===e.key?"all":e.key),className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border transition-all ${g===e.key?"error"===e.key?"bg-red-500/20 text-red-400 border-red-500/40":"ok"===e.key?"bg-emerald-500/20 text-emerald-400 border-emerald-500/40":"combo"===e.key?"bg-violet-500/20 text-violet-300 border-violet-500/40":"bg-primary text-white border-primary":"bg-bg-subtle border-border text-text-muted hover:border-text-muted"}`,children:[e.icon&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon}),e.label]},e.key)),G.length>0&&(0,r.jsx)("span",{className:"w-px h-5 bg-border mx-1"}),G.map(e=>{let t=n.RY[e]||{bg:"#374151",text:"#fff",label:e.toUpperCase()},s=w===e;return(0,r.jsx)("button",{onClick:()=>C(s?"":e),className:`px-3 py-1 rounded-full text-xs font-bold uppercase border transition-all ${s?"border-white/40 ring-1 ring-white/20":"border-transparent opacity-70 hover:opacity-100"}`,style:{backgroundColor:s?t.bg:`${t.bg}33`,color:s?t.text:t.bg},children:t.label},e)})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-1",children:"Columns"}),d.map(e=>(0,r.jsx)("button",{onClick:()=>K(e.key),className:`px-2 py-0.5 rounded text-[10px] font-medium border transition-all ${_[e.key]?"bg-primary/15 text-primary border-primary/30":"bg-bg-subtle text-text-muted border-border opacity-50 hover:opacity-80"}`,children:e.label},e.key))]}),(0,r.jsx)(l.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,r.jsx)("div",{className:"p-0 overflow-x-auto max-h-[calc(100vh-320px)] overflow-y-auto",children:s&&0===e.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===e.length?(0,r.jsxs)("div",{className:"p-8 text-center text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-2 block opacity-40",children:"receipt_long"}),"No logs recorded yet. Make some API calls to see them here."]}):0===q.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs match the current filters."}):(0,r.jsxs)("table",{className:"w-full text-left border-collapse text-xs",children:[(0,r.jsx)("thead",{className:"sticky top-0 z-10",style:{backgroundColor:"var(--bg-primary, #0f1117)"},children:(0,r.jsxs)("tr",{className:"border-b border-border",style:{backgroundColor:"var(--bg-primary, #0f1117)"},children:[_.status&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Status"}),_.model&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Model"}),_.provider&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Provider"}),_.protocol&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Protocol"}),_.account&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Account"}),_.apiKey&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"API Key"}),_.combo&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px]",children:"Combo"}),_.tokens&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px] text-right",children:"Tokens"}),_.duration&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px] text-right",children:"Duration"}),_.time&&(0,r.jsx)("th",{className:"px-3 py-2.5 font-semibold text-text-muted uppercase tracking-wider text-[10px] text-right",children:"Time"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border/30",children:q.map(e=>{let t=(0,n._Z)(e.status),s=e.sourceFormat||e.provider,a=n.Kf[s]||n.Kf[e.provider]||{bg:"#6B7280",text:"#fff",label:(s||e.provider||"-").toUpperCase()},l=n.RY[e.provider]||{bg:"#374151",text:"#fff",label:(e.provider||"-").toUpperCase()},o=e.status>=400;return(0,r.jsxs)("tr",{onClick:()=>B(e),className:`cursor-pointer hover:bg-primary/5 transition-colors ${o?"bg-red-500/5":""}`,children:[_.status&&(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-[10px] font-bold min-w-[36px] text-center",style:{backgroundColor:t.bg,color:t.text},children:e.status||"..."})}),_.model&&(0,r.jsx)("td",{className:"px-3 py-2 font-medium text-primary font-mono text-[11px]",children:e.model}),_.provider&&(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-[9px] font-bold uppercase",style:{backgroundColor:l.bg,color:l.text},children:l.label})}),_.protocol&&(0,r.jsx)("td",{className:"px-3 py-2",children:(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded text-[9px] font-bold uppercase",style:{backgroundColor:a.bg,color:a.text},children:a.label})}),_.account&&(0,r.jsx)("td",{className:"px-3 py-2 text-text-muted truncate max-w-[120px]",title:e.account,children:(0,i.Ib)(e.account)}),_.apiKey&&(0,r.jsx)("td",{className:"px-3 py-2 text-text-muted truncate max-w-[140px]",title:e.apiKeyName||e.apiKeyId||"No API key",children:(0,i.VO)(e.apiKeyName,e.apiKeyId)}),_.combo&&(0,r.jsx)("td",{className:"px-3 py-2",children:e.comboName?(0,r.jsx)("span",{className:"inline-block px-2 py-0.5 rounded-full text-[9px] font-bold bg-violet-500/20 text-violet-300 border border-violet-500/30",children:e.comboName}):(0,r.jsx)("span",{className:"text-text-muted text-[10px]",children:"—"})}),_.tokens&&(0,r.jsxs)("td",{className:"px-3 py-2 text-right whitespace-nowrap",children:[(0,r.jsx)("span",{className:"text-text-muted",children:"I:"})," ",(0,r.jsx)("span",{className:"text-primary",children:e.tokens?.in?.toLocaleString()||0}),(0,r.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,r.jsx)("span",{className:"text-text-muted",children:"O:"})," ",(0,r.jsx)("span",{className:"text-emerald-400",children:e.tokens?.out?.toLocaleString()||0})]}),_.duration&&(0,r.jsx)("td",{className:"px-3 py-2 text-right text-text-muted font-mono",children:(0,i.a3)(e.duration)}),_.time&&(0,r.jsx)("td",{className:"px-3 py-2 text-right text-text-muted",children:(0,i.fU)(e.timestamp)})]},e.id)})})]})})}),(0,r.jsxs)("div",{className:"text-[10px] text-text-muted italic",children:["Call logs are also saved as JSON files to ",(0,r.jsx)("code",{children:"{DATA_DIR}/call_logs/"})," with 7-day rotation."]}),O&&(0,r.jsx)(u,{log:O,detail:M,loading:E,onClose:()=>{A(null),F(null)},onCopy:W})]})}function u({log:e,detail:t,loading:s,onClose:l,onCopy:o}){(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]);let d=(0,n._Z)(e.status),c=e.sourceFormat||e.provider,x=n.Kf[c]||n.Kf[e.provider]||{bg:"#6B7280",text:"#fff",label:(c||e.provider||"-").toUpperCase()},m=n.RY[e.provider]||{bg:"#374151",text:"#fff",label:(e.provider||"-").toUpperCase()},u=t?.requestBody?JSON.stringify(t.requestBody,null,2):null,h=t?.responseBody?JSON.stringify(t.responseBody,null,2):null;return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[5vh]",onClick:l,children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-bg-primary border border-border rounded-xl w-full max-w-[900px] max-h-[90vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 py-4 border-b border-border bg-bg-primary/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded text-xs font-bold",style:{backgroundColor:d.bg,color:d.text},children:e.status}),(0,r.jsx)("span",{className:"font-bold text-lg",children:e.method}),(0,r.jsx)("span",{className:"text-text-muted font-mono text-sm",children:e.path})]}),(0,r.jsx)("button",{onClick:l,className:"p-1.5 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),(0,r.jsxs)("div",{className:"p-6 flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-bg-subtle rounded-xl border border-border",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Time"}),(0,r.jsx)("div",{className:"text-sm font-medium",children:(e=>{try{let t=new Date(e);return t.toLocaleDateString("pt-BR")+", "+t.toLocaleTimeString("en-US",{hour12:!1})}catch{return e}})(e.timestamp)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Duration"}),(0,r.jsx)("div",{className:"text-sm font-medium",children:(0,i.a3)(e.duration)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Tokens (I/O)"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-primary/20 text-primary text-xs font-bold",children:["In: ",(t?.tokens?.in||e.tokens?.in||0).toLocaleString()]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/20 text-emerald-400 text-xs font-bold",children:["Out: ",(t?.tokens?.out||e.tokens?.out||0).toLocaleString()]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Model"}),(0,r.jsx)("div",{className:"text-sm font-medium text-primary font-mono",children:e.model})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Provider"}),(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded text-[10px] font-bold uppercase",style:{backgroundColor:m.bg,color:m.text},children:m.label})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Protocol"}),(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded text-[10px] font-bold uppercase",style:{backgroundColor:x.bg,color:x.text},children:x.label})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Account"}),(0,r.jsx)("div",{className:"text-sm font-medium",children:t?.account||e.account||"-"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"API Key"}),(0,r.jsx)("div",{className:"text-sm font-medium",title:t?.apiKeyName||t?.apiKeyId||e.apiKeyName||e.apiKeyId||"No API key",children:(0,i.VO)(t?.apiKeyName||e.apiKeyName,t?.apiKeyId||e.apiKeyId)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider mb-1",children:"Combo"}),t?.comboName||e.comboName?(0,r.jsx)("span",{className:"inline-block px-2.5 py-1 rounded-full text-[10px] font-bold bg-violet-500/20 text-violet-300 border border-violet-500/30",children:t?.comboName||e.comboName}):(0,r.jsx)("div",{className:"text-sm text-text-muted",children:"—"})]})]}),(t?.error||e.error)&&(0,r.jsxs)("div",{className:"p-4 rounded-xl bg-red-500/10 border border-red-500/30",children:[(0,r.jsx)("div",{className:"text-[10px] text-red-400 uppercase tracking-wider mb-1 font-bold",children:"Error"}),(0,r.jsx)("div",{className:"text-sm text-red-300 font-mono",children:t?.error||e.error})]}),s?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted animate-pulse",children:"Loading request details..."}):(0,r.jsxs)(r.Fragment,{children:[u&&(0,r.jsx)(p,{title:"Request Payload",json:u,onCopy:()=>o(u)}),h&&(0,r.jsx)(p,{title:"Response Payload",json:h,onCopy:()=>o(h)}),!u&&!h&&!s&&(0,r.jsxs)("div",{className:"p-6 text-center text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40",children:"info"}),(0,r.jsx)("p",{className:"text-sm",children:"No payload data available for this log entry."}),(0,r.jsx)("p",{className:"text-xs mt-1",children:"Request/response bodies are only captured for non-streaming calls or when streaming completes normally."})]})]})]})]})]})}function p({title:e,json:t,onCopy:s}){let[l,n]=(0,a.useState)(!1),i=async()=>{!1!==await s()&&(n(!0),setTimeout(()=>n(!1),2e3))};return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("h3",{className:"text-[11px] text-text-muted uppercase tracking-wider font-bold",children:e}),(0,r.jsxs)("button",{onClick:i,className:"flex items-center gap-1 px-2 py-1 text-xs text-text-muted hover:text-text-primary transition-colors",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:l?"check":"content_copy"}),l?"Copied!":"Copy"]})]}),(0,r.jsx)("pre",{className:"p-4 rounded-xl bg-black/30 border border-border overflow-x-auto text-xs font-mono text-text-primary max-h-[600px] overflow-y-auto leading-relaxed whitespace-pre-wrap break-words",children:t})]})}},71525:(e,t,s)=>{s.d(t,{Ex:()=>d.default,$n:()=>r.default,Zp:()=>n.default,Qv:()=>o.CardSkeleton,G9:()=>y.default,pd:()=>a.default,Mh:()=>j.default,uR:()=>p.default,aF:()=>i.default,rq:()=>u.default,LF:()=>m.default,KN:()=>f.default,Lo:()=>g.default,y7:()=>b.default,Iz:()=>v.default,l6:()=>l.default,UW:()=>x.default,lM:()=>c.default,cn:()=>h.default});var r=s(39680),a=s(5708),l=s(13720),n=s(67578),i=s(34405),o=s(78076);s(24229);var d=s(23375),c=s(43144),x=s(66137);s(57896),s(16620),s(33205),s(15419);var m=s(18056),u=s(97418),p=s(26693);s(41566);var h=s(31117),b=s(68661),f=s(22447),g=s(6024);s(78966);var j=s(25861);s(85764);var y=s(44817),v=s(34713);s(33730),s(5704)},78076:(e,t,s)=>{s.d(t,{CardSkeleton:()=>o,PageLoading:()=>n,Skeleton:()=>i,Spinner:()=>l,default:()=>d});var r=s(95155),a=s(61592);function l({size:e="md",className:t}){return(0,r.jsx)("span",{role:"status","aria-label":"Loading",className:(0,a.cn)("material-symbols-outlined animate-spin text-primary",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[e],t),children:"progress_activity"})}function n({message:e="Loading..."}){return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,r.jsx)(l,{size:"xl"}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:e})]})}function i({className:e,...t}){return(0,r.jsx)("div",{"aria-hidden":"true",className:(0,a.cn)("animate-pulse rounded-lg bg-border",e),...t})}function o(){return(0,r.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)(i,{className:"h-4 w-24"}),(0,r.jsx)(i,{className:"size-10 rounded-lg"})]}),(0,r.jsx)(i,{className:"h-8 w-16 mb-2"}),(0,r.jsx)(i,{className:"h-3 w-20"})]})}function d({type:e="spinner",...t}){switch(e){case"page":return(0,r.jsx)(n,{...t});case"skeleton":return(0,r.jsx)(i,{...t});case"card":return(0,r.jsx)(o,{...t});default:return(0,r.jsx)(l,{...t})}}},78362:(e,t,s)=>{function r(e){try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return"-"}}function a(e){return e?e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`:"-"}function l(e,t=2,s=2){return e?e.length<=t+s?`${e.slice(0,1)}***`:`${e.slice(0,t)}***${e.slice(-s)}`:""}function n(e){if(!e||"-"===e)return"-";let t=e.indexOf("@");return t>3?e.slice(0,3)+"***"+e.slice(t):e.length>8?e.slice(0,5)+"***":e}function i(e,t){if(!e&&!t)return"—";let s=e?l(e,2,1):"key";return t?`${s} (${l(t,4,4)})`:s}function o(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:new Intl.NumberFormat().format(e||0)}function d(e){return new Intl.NumberFormat().format(e||0)}function c(e){return`$${(e||0).toFixed(2)}`}function x(e,t=50){if(!e)return"-";try{let s=new URL(e),r=s.hostname+s.pathname;return r.length>t?r.slice(0,t)+"…":r}catch{return e.length>t?e.slice(0,t)+"…":e}}s.d(t,{F0:()=>c,Ib:()=>n,VK:()=>o,VO:()=>i,Y1:()=>x,a3:()=>a,fU:()=>r,xW:()=>d})},78966:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(95155),a=s(12115),l=s(14051),n=s(71525);function i({isOpen:e,onMethodSelect:t,onClose:s}){let[l,i]=(0,a.useState)(null),[o,d]=(0,a.useState)(""),[c,x]=(0,a.useState)("us-east-1"),[m,u]=(0,a.useState)(""),[p,h]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"import"===l&&e&&(async()=>{j(!0),h(null),v(!1);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(u(t.refreshToken),v(!0)):h(t.error||"Could not auto-detect token")}catch(e){h("Failed to auto-detect token")}finally{j(!1)}})()},[l,e]);let N=e=>{i(e),h(null)},k=()=>{i(null),h(null)},w=async()=>{if(!m.trim())return void h("Please enter a refresh token");f(!0),h(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:m.trim()})}),t=await e.json();if(!e.ok)throw Error(t.error||"Import failed");s()}catch(e){h(e.message)}finally{f(!1)}},C=e=>{t("social",{provider:e})};return(0,r.jsx)(n.aF,{isOpen:e,title:"Connect Kiro",onClose:s,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!l&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,r.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,r.jsx)("button",{onClick:()=>N("idc"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,r.jsx)("button",{onClick:()=>N("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>N("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>N("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(n.pd,{value:o,onChange:e=>d(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,r.jsx)(n.pd,{value:c,onChange:e=>x(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),p&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:()=>{o.trim()?t("idc",{startUrl:o.trim(),region:c}):h("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,r.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:()=>C("google"),fullWidth:!0,children:"Continue with Google"}),(0,r.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:()=>C("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,r.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[g&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!g&&(0,r.jsxs)(r.Fragment,{children:[y&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!y&&!p&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(n.pd,{value:m,onChange:e=>u(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),p&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:w,fullWidth:!0,disabled:b||!m.trim(),children:b?"Importing...":"Import Token"}),(0,r.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}i.propTypes={isOpen:l.bool.isRequired,onMethodSelect:l.func.isRequired,onClose:l.func.isRequired}},85764:(e,t,s)=>{s.d(t,{default:()=>o});var r=s(95155),a=s(12115),l=s(14051),n=s(71525),i=s(26853);function o({isOpen:e,provider:t,onSuccess:s,onClose:l}){let[o,d]=(0,a.useState)("loading"),[c,x]=(0,a.useState)(""),[m,u]=(0,a.useState)(null),[p,h]=(0,a.useState)(""),[b,f]=(0,a.useState)(null),{copied:g,copy:j}=(0,i.C)();(0,a.useEffect)(()=>{e&&t&&(async()=>{try{f(null),d("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),s=await e.json();if(!e.ok)throw Error(s.error);u(s),x(s.authUrl),d("input"),window.open(s.authUrl,"kiro_social_auth")}catch(e){f(e.message),d("error")}})()},[e,t]);let y=async()=>{try{let e;f(null);try{e=new URL(p)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let a=e.searchParams.get("error");if(a)throw Error(e.searchParams.get("error_description")||a);if(!r)throw Error("No authorization code found in URL");let l=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:m.codeVerifier,provider:t})}),n=await l.json();if(!l.ok)throw Error(n.error);d("success"),s?.()}catch(e){f(e.message),d("error")}},v="google"===t?"Google":"GitHub";return(0,r.jsx)(n.aF,{isOpen:e,title:`Connect Kiro via ${v}`,onClose:l,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===o&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",v," authentication"]})]}),"input"===o&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.pd,{value:c,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(n.$n,{variant:"secondary",icon:"auth_url"===g?"check":"content_copy",onClick:()=>j(c,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(n.pd,{value:p,onChange:e=>h(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:y,fullWidth:!0,disabled:!p,children:"Connect"}),(0,r.jsx)(n.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===o&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.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,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",v," has been connected."]}),(0,r.jsx)(n.$n,{onClick:l,fullWidth:!0,children:"Done"})]}),"error"===o&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:()=>d("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(n.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}o.propTypes={isOpen:l.bool.isRequired,provider:l.oneOf(["google","github"]).isRequired,onSuccess:l.func,onClose:l.func.isRequired}},97418:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(95155),a=s(12115),l=s(14051),n=s(34405),i=s(18595),o=s(64745);let d=[...Object.keys(o.zN),...Object.keys(o.IS),...Object.keys(o.fg)];function c({isOpen:e,onClose:t,onSelect:s,selectedModel:l,activeProviders:c=[],title:x="Select Model",modelAliases:m={}}){let[u,p]=(0,a.useState)(""),[h,b]=(0,a.useState)([]),[f,g]=(0,a.useState)([]),[j,y]=(0,a.useState)({}),v=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();b(t.combos||[])}catch(e){console.error("Error fetching combos:",e),b([])}};(0,a.useEffect)(()=>{e&&v()},[e]);let N=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();g(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),g([])}};(0,a.useEffect)(()=>{e&&N()},[e]);let k=async()=>{try{let e=await fetch("/api/provider-models");if(!e.ok)throw Error(`Failed to fetch custom models: ${e.status}`);let t=await e.json();y(t.models||{})}catch(e){console.error("Error fetching custom models:",e),y({})}};(0,a.useEffect)(()=>{e&&k()},[e]);let w=(0,a.useMemo)(()=>({...o.zN,...o.IS,...o.fg}),[]),C=(0,a.useMemo)(()=>{let e={};return[...new Set([...c.map(e=>e.provider)])].sort((e,t)=>{let s=d.indexOf(e),r=d.indexOf(t);return(-1===s?999:s)-(-1===r?999:r)}).forEach(t=>{let s=i.Xg[t]||t,r=w[t]||{name:t,color:"#666"},a=(0,o.mq)(t)||(0,o.gb)(t),l=j[t]||[];if(r.passthroughModels){let a=Object.entries(m).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:t})),n=l.filter(e=>!a.some(t=>t.id===e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${s}/${e.id}`,isCustom:!0})),i=[...a,...n];if(i.length>0){let a=f.find(e=>e.id===t),l=a?.name||r.name;e[t]={name:l,alias:s,color:r.color,models:i}}}else if(a){let s=f.find(e=>e.id===t),a=s?.name||r.name,n=Object.entries(m).filter(([,e])=>e.startsWith(`${t}/`)).map(([e,s])=>({id:s.replace(`${t}/`,""),name:e,value:s})),i=l.filter(e=>!n.some(t=>t.id===e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${t}/${e.id}`,isCustom:!0})),o=[...n,...i];o.length>0&&(e[t]={name:a,alias:s?.prefix||t,color:r.color,models:o,isCustom:!0,hasModels:!0})}else{let a=(0,i.KC)(t),n=[...a.map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`})),...l.filter(e=>!a.some(t=>t.id===e.id)).map(e=>({id:e.id,name:e.name||e.id,value:`${s}/${e.id}`,isCustom:!0}))];n.length>0&&(e[t]={name:r.name,alias:s,color:r.color,models:n})}}),e},[c,m,w,f,j]),S=(0,a.useMemo)(()=>{if(!u.trim())return h;let e=u.toLowerCase();return h.filter(t=>t.name.toLowerCase().includes(e))},[h,u]),T=(0,a.useMemo)(()=>{if(!u.trim())return C;let e=u.toLowerCase(),t={};return Object.entries(C).forEach(([s,r])=>{let a=r.models.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)),l=r.name.toLowerCase().includes(e);(a.length>0||l)&&(t[s]={...r,models:a})}),t},[C,u]),I=e=>{s(e),t(),p("")};return(0,r.jsxs)(n.default,{isOpen:e,onClose:()=>{t(),p("")},title:x,size:"md",className:"p-4!",children:[(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,r.jsx)("input",{type:"text",placeholder:"Search...",value:u,onChange:e=>p(e.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,r.jsxs)("div",{className:"max-h-[300px] overflow-y-auto space-y-3",children:[S.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",S.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:S.map(e=>{let t=l===e.name;return(0,r.jsx)("button",{onClick:()=>I({id:e.name,name:e.name,value:e.name}),className:`
2
- px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
3
- ${t?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
4
- `,children:e.name},e.id)})})]}),Object.entries(T).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t.color}}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=l===e.value;return(0,r.jsxs)("button",{onClick:()=>I(e),className:`
5
- px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
6
- ${t?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
7
- `,children:[e.name,e.isCustom?" ★":""]},e.id)})})]},e)),0===Object.keys(T).length&&0===S.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}c.propTypes={isOpen:l.bool.isRequired,onClose:l.func.isRequired,onSelect:l.func.isRequired,selectedModel:l.string,activeProviders:l.arrayOf(l.shape({provider:l.string.isRequired})),title:l.string,modelAliases:l.object}},99225:(e,t,s)=>{s.d(t,{Gp:()=>l,Ie:()=>n,Kf:()=>a,RY:()=>r,Yh:()=>c,_Z:()=>d,ng:()=>o});let r={github:{bg:"#6e40c9",text:"#fff",label:"GitHub"},kiro:{bg:"#FF9900",text:"#000",label:"Kiro"},antigravity:{bg:"#4285F4",text:"#fff",label:"AG"},claude:{bg:"#D97757",text:"#fff",label:"Claude"},codex:{bg:"#10A37F",text:"#fff",label:"Codex"},gemini:{bg:"#34A853",text:"#fff",label:"Gemini"},qwen:{bg:"#6366F1",text:"#fff",label:"Qwen"},iflow:{bg:"#EC4899",text:"#fff",label:"iFlow"},fireworks:{bg:"#F97316",text:"#fff",label:"Fireworks"},kimi:{bg:"#06B6D4",text:"#fff",label:"Kimi"},"gemini-cli":{bg:"#34A853",text:"#fff",label:"Gemini CLI"}},a={openai:{bg:"#10A37F",text:"#fff",label:"OpenAI"},claude:{bg:"#D97757",text:"#fff",label:"Claude"},gemini:{bg:"#4285F4",text:"#fff",label:"Gemini"},warmup:{bg:"#F59E0B",text:"#000",label:"Warmup"},bypass:{bg:"#6B7280",text:"#fff",label:"Bypass"}},l={http:{bg:"#3B82F6",text:"#fff",label:"HTTP"},https:{bg:"#10B981",text:"#fff",label:"HTTPS"},socks5:{bg:"#8B5CF6",text:"#fff",label:"SOCKS5"}},n={key:{bg:"#F59E0B",text:"#000",label:"Key"},combo:{bg:"#8B5CF6",text:"#fff",label:"Combo"},provider:{bg:"#3B82F6",text:"#fff",label:"Provider"},global:{bg:"#6B7280",text:"#fff",label:"Global"},direct:{bg:"#374151",text:"#9CA3AF",label:"Direct"}},i=["#D97757","#60A5FA","#34D399","#A78BFA","#F472B6","#FBBF24","#38BDF8","#FB923C","#818CF8","#2DD4BF","#E879F9","#F87171","#4ADE80","#C084FC","#FB7185"];function o(e){return i[e%i.length]}function d(e){return e>=200&&e<300?{bg:"#059669",text:"#fff"}:e>=400&&e<500?{bg:"#D97706",text:"#fff"}:e>=500?{bg:"#DC2626",text:"#fff"}:0===e?{bg:"#6366F1",text:"#fff"}:{bg:"#6B7280",text:"#fff"}}function c(e){return"success"===e?{bg:"#059669",text:"#fff"}:"error"===e?{bg:"#DC2626",text:"#fff"}:"timeout"===e?{bg:"#D97706",text:"#fff"}:{bg:"#6B7280",text:"#fff"}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7896],{18595:(e,a,i)=>{i.d(a,{KC:()=>t.KC,Xg:()=>t.Xg});var t=i(80237);Object.entries(i(64745).Q2).filter(([,e])=>e.passthroughModels).map(([e])=>e),Object.entries(t.vq).flatMap(([e,a])=>a.map(a=>({provider:e,model:a.id,name:a.name})))},57896:(e,a,i)=>{i.d(a,{ThemeProvider:()=>r});var t=i(95155),o=i(12115),n=i(83711);function r({children:e}){let{initTheme:a}=(0,n.A)();return(0,o.useEffect)(()=>{a()},[a]),(0,t.jsx)(t.Fragment,{children:e})}},64745:(e,a,i)=>{i.d(a,{DI:()=>s,IS:()=>t,JH:()=>r,MA:()=>c,Q2:()=>m,fg:()=>n,gb:()=>d,mq:()=>l,wG:()=>u,wb:()=>h,zN:()=>o,zt:()=>p});let t={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},o={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},"kimi-coding":{id:"kimi-coding",alias:"kmc",name:"Kimi Coding",icon:"psychology",color:"#1E40AF",textIcon:"KC"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},n={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://www.cerebras.ai"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://developer.nvidia.com/nim"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"}},r="openai-compatible-",s="anthropic-compatible-";function l(e){return"string"==typeof e&&e.startsWith(r)}function d(e){return"string"==typeof e&&e.startsWith(s)}let m={...t,...o,...n},c={oauth:{id:"oauth",name:"OAuth",icon:"lock"},apikey:{id:"apikey",name:"API Key",icon:"key"}};function p(e){for(let a of Object.values(m))if(a.alias===e||a.id===e)return a;return null}function u(e){let a=m[e];return a?.alias||e}Object.values(m).reduce((e,a)=>(e[a.alias]=a.id,e),{}),Object.values(m).reduce((e,a)=>(e[a.id]=a.alias,e),{});let h=["antigravity","kiro","github","codex","claude"]},80237:(e,a,i)=>{i.d(a,{Xg:()=>r,vq:()=>n,KC:()=>s}),i(41463);let t={claude:{id:"claude",alias:"cc",format:"claude",executor:"default",baseUrl:"https://api.anthropic.com/v1/messages",urlSuffix:"?beta=true",authType:"oauth",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/1.0.83 (external, cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.3.0","X-Stainless-Package-Version":"0.55.1","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":"arm64","X-Stainless-Os":"MacOS","X-Stainless-Timeout":"60"},oauth:{clientIdEnv:"CLAUDE_OAUTH_CLIENT_ID",clientIdDefault:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://console.anthropic.com/v1/oauth/token"},models:[{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-opus-4-5-20251101",name:"Claude 4.5 Opus"},{id:"claude-sonnet-4-5-20250929",name:"Claude 4.5 Sonnet"},{id:"claude-haiku-4-5-20251001",name:"Claude 4.5 Haiku"}]},gemini:{id:"gemini",alias:"gemini",format:"gemini",executor:"default",baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",urlBuilder:(e,a,i)=>`${e}/${a}:${i?"streamGenerateContent?alt=sse":"generateContent"}`,authType:"apikey",authHeader:"x-goog-api-key",oauth:{clientIdEnv:"GEMINI_OAUTH_CLIENT_ID",clientIdDefault:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecretEnv:"GEMINI_OAUTH_CLIENT_SECRET",clientSecretDefault:""},models:[{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}]},"gemini-cli":{id:"gemini-cli",alias:"gc",format:"gemini-cli",executor:"gemini-cli",baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",urlBuilder:(e,a,i)=>`${e}:${i?"streamGenerateContent?alt=sse":"generateContent"}`,authType:"oauth",authHeader:"bearer",oauth:{clientIdEnv:"GEMINI_CLI_OAUTH_CLIENT_ID",clientIdDefault:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecretEnv:"GEMINI_CLI_OAUTH_CLIENT_SECRET",clientSecretDefault:""},models:[{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}]},codex:{id:"codex",alias:"cx",format:"openai-responses",executor:"codex",baseUrl:"https://chatgpt.com/backend-api/codex/responses",authType:"oauth",authHeader:"bearer",headers:{Version:"0.92.0","Openai-Beta":"responses=experimental","User-Agent":"codex-cli/0.92.0 (Windows 10.0.26100; x64)"},oauth:{clientIdEnv:"CODEX_OAUTH_CLIENT_ID",clientIdDefault:"app_EMoamEEZ73f0CkXaXp7hrann",clientSecretEnv:"CODEX_OAUTH_CLIENT_SECRET",clientSecretDefault:"",tokenUrl:"https://auth.openai.com/oauth/token"},models:[{id:"gpt-5.3-codex",name:"GPT 5.3 Codex"},{id:"gpt-5.3-codex-xhigh",name:"GPT 5.3 Codex (xHigh)"},{id:"gpt-5.3-codex-high",name:"GPT 5.3 Codex (High)"},{id:"gpt-5.3-codex-low",name:"GPT 5.3 Codex (Low)"},{id:"gpt-5.3-codex-none",name:"GPT 5.3 Codex (None)"},{id:"gpt-5.1-codex-mini",name:"GPT 5.1 Codex Mini"},{id:"gpt-5.1-codex-mini-high",name:"GPT 5.1 Codex Mini (High)"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"},{id:"gpt-5.2",name:"GPT 5.2"},{id:"gpt-5.1-codex-max",name:"GPT 5.1 Codex Max"},{id:"gpt-5.1-codex",name:"GPT 5.1 Codex"},{id:"gpt-5.1",name:"GPT 5.1"},{id:"gpt-5-codex",name:"GPT 5 Codex"},{id:"gpt-5-codex-mini",name:"GPT 5 Codex Mini"}]},qwen:{id:"qwen",alias:"qw",format:"openai",executor:"default",baseUrl:"https://portal.qwen.ai/v1/chat/completions",authType:"oauth",authHeader:"bearer",headers:{"User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"gl-node/22.17.0"},oauth:{clientIdEnv:"QWEN_OAUTH_CLIENT_ID",clientIdDefault:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash"},{id:"vision-model",name:"Qwen3 Vision Model"}]},iflow:{id:"iflow",alias:"if",format:"openai",executor:"default",baseUrl:"https://apis.iflow.cn/v1/chat/completions",authType:"oauth",authHeader:"bearer",headers:{"User-Agent":"iFlow-Cli"},oauth:{clientIdEnv:"IFLOW_OAUTH_CLIENT_ID",clientIdDefault:"10009311001",clientSecretEnv:"IFLOW_OAUTH_CLIENT_SECRET",clientSecretDefault:"",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"kimi-k2",name:"Kimi K2"},{id:"kimi-k2-thinking",name:"Kimi K2 Thinking"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"deepseek-r1",name:"DeepSeek R1"},{id:"deepseek-v3.2-chat",name:"DeepSeek V3.2 Chat"},{id:"deepseek-v3.2-reasoner",name:"DeepSeek V3.2 Reasoner"},{id:"minimax-m2.1",name:"MiniMax M2.1"},{id:"glm-4.7",name:"GLM 4.7"}]},antigravity:{id:"antigravity",alias:"ag",format:"antigravity",executor:"antigravity",baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://cloudcode-pa.googleapis.com"],urlBuilder:(e,a,i)=>`${e}${i?"/v1internal:streamGenerateContent?alt=sse":"/v1internal:generateContent"}`,authType:"oauth",authHeader:"bearer",headers:{"User-Agent":"antigravity/1.104.0 darwin/arm64"},oauth:{clientIdEnv:"ANTIGRAVITY_OAUTH_CLIENT_ID",clientIdDefault:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecretEnv:"ANTIGRAVITY_OAUTH_CLIENT_SECRET",clientSecretDefault:""},models:[{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking"},{id:"claude-opus-4-5-thinking",name:"Claude Opus 4.5 Thinking"},{id:"claude-sonnet-4-5-thinking",name:"Claude Sonnet 4.5 Thinking"},{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5"},{id:"gemini-3-pro-high",name:"Gemini 3 Pro High"},{id:"gemini-3-pro-low",name:"Gemini 3 Pro Low"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-3-flash",name:"Gemini 3 Flash"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"}]},github:{id:"github",alias:"gh",format:"openai",executor:"github",baseUrl:"https://api.githubcopilot.com/chat/completions",responsesBaseUrl:"https://api.githubcopilot.com/responses",authType:"oauth",authHeader:"bearer",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.107.1","editor-plugin-version":"copilot-chat/0.26.7","user-agent":"GitHubCopilotChat/0.26.7","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},models:[{id:"gpt-4.1",name:"GPT-4.1"},{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-3.5-turbo",name:"GPT-3.5 Turbo"},{id:"gpt-5",name:"GPT-5"},{id:"gpt-5-mini",name:"GPT-5 Mini"},{id:"gpt-5-codex",name:"GPT-5 Codex",targetFormat:"openai-responses"},{id:"gpt-5.1",name:"GPT-5.1"},{id:"gpt-5.1-codex",name:"GPT-5.1 Codex",targetFormat:"openai-responses"},{id:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini",targetFormat:"openai-responses"},{id:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",targetFormat:"openai-responses"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5.2-codex",name:"GPT-5.2 Codex",targetFormat:"openai-responses"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"},{id:"claude-opus-4.1",name:"Claude Opus 4.1"},{id:"claude-opus-4.6",name:"Claude Opus 4.6"},{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5 (Full ID)"},{id:"claude-sonnet-4",name:"Claude Sonnet 4"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"grok-code-fast-1",name:"Grok Code Fast 1"},{id:"oswe-vscode-prime",name:"Raptor Mini"}]},kiro:{id:"kiro",alias:"kr",format:"kiro",executor:"kiro",baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",authType:"oauth",authHeader:"bearer",headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},oauth:{tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},models:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"}]},cursor:{id:"cursor",alias:"cu",format:"cursor",executor:"cursor",baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",authType:"oauth",authHeader:"bearer",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"1.1.3",models:[{id:"default",name:"Auto (Server Picks)"},{id:"claude-4.5-opus-high-thinking",name:"Claude 4.5 Opus High Thinking"},{id:"claude-4.5-opus-high",name:"Claude 4.5 Opus High"},{id:"claude-4.5-sonnet-thinking",name:"Claude 4.5 Sonnet Thinking"},{id:"claude-4.5-sonnet",name:"Claude 4.5 Sonnet"},{id:"claude-4.5-haiku",name:"Claude 4.5 Haiku"},{id:"claude-4.5-opus",name:"Claude 4.5 Opus"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"}]},openai:{id:"openai",alias:"openai",format:"openai",executor:"default",baseUrl:"https://api.openai.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"o1",name:"O1"},{id:"o1-mini",name:"O1 Mini"}]},anthropic:{id:"anthropic",alias:"anthropic",format:"claude",executor:"default",baseUrl:"https://api.anthropic.com/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01"},models:[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"claude-opus-4-20250514",name:"Claude Opus 4"},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"}]},openrouter:{id:"openrouter",alias:"openrouter",format:"openai",executor:"default",baseUrl:"https://openrouter.ai/api/v1/chat/completions",authType:"apikey",authHeader:"bearer",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"},models:[{id:"auto",name:"Auto (Best Available)"}]},glm:{id:"glm",alias:"glm",format:"claude",executor:"default",baseUrl:"https://api.z.ai/api/anthropic/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},models:[{id:"glm-4.7-flash",name:"GLM 4.7 Flash"},{id:"glm-4.7",name:"GLM 4.7"},{id:"glm-4.6v",name:"GLM 4.6V (Vision)"},{id:"glm-4.6",name:"GLM 4.6"},{id:"glm-4.5v",name:"GLM 4.5V (Vision)"},{id:"glm-4.5",name:"GLM 4.5"},{id:"glm-4.5-air",name:"GLM 4.5 Air"},{id:"glm-4-32b",name:"GLM 4 32B"}]},kimi:{id:"kimi",alias:"kimi",format:"openai",executor:"default",baseUrl:"https://api.moonshot.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"}]},"kimi-coding":{id:"kimi-coding",alias:"kmc",format:"claude",executor:"default",baseUrl:"https://api.kimi.com/coding/v1/messages",urlSuffix:"?beta=true",authType:"oauth",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},oauth:{clientIdEnv:"KIMI_CODING_OAUTH_CLIENT_ID",clientIdDefault:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token",authUrl:"https://auth.kimi.com/api/oauth/device_authorization"},models:[{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"}]},kilocode:{id:"kilocode",alias:"kc",format:"openrouter",executor:"openrouter",baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",authType:"oauth",authHeader:"Authorization",authPrefix:"Bearer ",oauth:{initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},models:[{id:"anthropic/claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"anthropic/claude-opus-4-20250514",name:"Claude Opus 4"},{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"openai/gpt-4.1",name:"GPT-4.1"},{id:"openai/o3",name:"o3"},{id:"deepseek/deepseek-chat",name:"DeepSeek Chat"},{id:"deepseek/deepseek-reasoner",name:"DeepSeek Reasoner"}],passthroughModels:!0},cline:{id:"cline",alias:"cl",format:"openai",executor:"openai",baseUrl:"https://api.cline.bot/api/v1/chat/completions",authType:"oauth",authHeader:"Authorization",authPrefix:"Bearer ",oauth:{tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh",authUrl:"https://api.cline.bot/api/v1/auth/authorize"},extraHeaders:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},models:[{id:"anthropic/claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"anthropic/claude-opus-4-20250514",name:"Claude Opus 4"},{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"openai/gpt-4.1",name:"GPT-4.1"},{id:"openai/o3",name:"o3"},{id:"deepseek/deepseek-chat",name:"DeepSeek Chat"}],passthroughModels:!0},minimax:{id:"minimax",alias:"minimax",format:"claude",executor:"default",baseUrl:"https://api.minimax.io/anthropic/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},models:[{id:"MiniMax-M2.1",name:"MiniMax M2.1"}]},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",format:"claude",executor:"default",baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},models:[{id:"MiniMax-M2.1",name:"MiniMax M2.1"}]},deepseek:{id:"deepseek",alias:"ds",format:"openai",executor:"default",baseUrl:"https://api.deepseek.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"deepseek-chat",name:"DeepSeek V3.2 Chat"},{id:"deepseek-reasoner",name:"DeepSeek V3.2 Reasoner"}]},groq:{id:"groq",alias:"groq",format:"openai",executor:"default",baseUrl:"https://api.groq.com/openai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"llama-3.3-70b-versatile",name:"Llama 3.3 70B"},{id:"meta-llama/llama-4-maverick-17b-128e-instruct",name:"Llama 4 Maverick"},{id:"qwen/qwen3-32b",name:"Qwen3 32B"},{id:"openai/gpt-oss-120b",name:"GPT-OSS 120B"}]},xai:{id:"xai",alias:"xai",format:"openai",executor:"default",baseUrl:"https://api.x.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"grok-4",name:"Grok 4"},{id:"grok-4-fast-reasoning",name:"Grok 4 Fast Reasoning"},{id:"grok-code-fast-1",name:"Grok Code Fast"},{id:"grok-3",name:"Grok 3"}]},mistral:{id:"mistral",alias:"mistral",format:"openai",executor:"default",baseUrl:"https://api.mistral.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"mistral-large-latest",name:"Mistral Large 3"},{id:"codestral-latest",name:"Codestral"},{id:"mistral-medium-latest",name:"Mistral Medium 3"}]},perplexity:{id:"perplexity",alias:"pplx",format:"openai",executor:"default",baseUrl:"https://api.perplexity.ai/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"sonar-pro",name:"Sonar Pro"},{id:"sonar",name:"Sonar"}]},together:{id:"together",alias:"together",format:"openai",executor:"default",baseUrl:"https://api.together.xyz/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"meta-llama/Llama-3.3-70B-Instruct-Turbo",name:"Llama 3.3 70B Turbo"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"Qwen/Qwen3-235B-A22B",name:"Qwen3 235B"},{id:"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",name:"Llama 4 Maverick"}]},fireworks:{id:"fireworks",alias:"fireworks",format:"openai",executor:"default",baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"accounts/fireworks/models/deepseek-v3p1",name:"DeepSeek V3.1"},{id:"accounts/fireworks/models/llama-v3p3-70b-instruct",name:"Llama 3.3 70B"},{id:"accounts/fireworks/models/qwen3-235b-a22b",name:"Qwen3 235B"}]},cerebras:{id:"cerebras",alias:"cerebras",format:"openai",executor:"default",baseUrl:"https://api.cerebras.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"gpt-oss-120b",name:"GPT OSS 120B"},{id:"zai-glm-4.7",name:"ZAI GLM 4.7"},{id:"llama-3.3-70b",name:"Llama 3.3 70B"},{id:"llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout"},{id:"qwen-3-235b-a22b-instruct-2507",name:"Qwen3 235B A22B"},{id:"qwen-3-32b",name:"Qwen3 32B"}]},cohere:{id:"cohere",alias:"cohere",format:"openai",executor:"default",baseUrl:"https://api.cohere.com/v2/chat",authType:"apikey",authHeader:"bearer",models:[{id:"command-r-plus-08-2024",name:"Command R+ (Aug 2024)"},{id:"command-r-08-2024",name:"Command R (Aug 2024)"},{id:"command-a-03-2025",name:"Command A (Mar 2025)"}]},nvidia:{id:"nvidia",alias:"nvidia",format:"openai",executor:"default",baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"moonshotai/kimi-k2.5",name:"Kimi K2.5"},{id:"z-ai/glm4.7",name:"GLM 4.7"},{id:"deepseek-ai/deepseek-v3.2",name:"DeepSeek V3.2"},{id:"nvidia/llama-3.3-70b-instruct",name:"Llama 3.3 70B"},{id:"meta/llama-4-maverick-17b-128e-instruct",name:"Llama 4 Maverick"},{id:"deepseek/deepseek-r1",name:"DeepSeek R1"}]},nebius:{id:"nebius",alias:"nebius",format:"openai",executor:"default",baseUrl:"https://api.tokenfactory.nebius.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama 3.3 70B Instruct"}]},siliconflow:{id:"siliconflow",alias:"siliconflow",format:"openai",executor:"default",baseUrl:"https://api.siliconflow.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"deepseek-ai/DeepSeek-V3.2",name:"DeepSeek V3.2"},{id:"deepseek-ai/DeepSeek-V3.1",name:"DeepSeek V3.1"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"Qwen/Qwen3-235B-A22B-Instruct-2507",name:"Qwen3 235B"},{id:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen3 Coder 480B"},{id:"Qwen/Qwen3-32B",name:"Qwen3 32B"},{id:"moonshotai/Kimi-K2.5",name:"Kimi K2.5"},{id:"zai-org/GLM-4.7",name:"GLM 4.7"},{id:"openai/gpt-oss-120b",name:"GPT OSS 120B"},{id:"baidu/ERNIE-4.5-300B-A47B",name:"ERNIE 4.5 300B"}]},hyperbolic:{id:"hyperbolic",alias:"hyp",format:"openai",executor:"default",baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"Qwen/QwQ-32B",name:"QwQ 32B"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"deepseek-ai/DeepSeek-V3",name:"DeepSeek V3"},{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama 3.3 70B"},{id:"meta-llama/Llama-3.2-3B-Instruct",name:"Llama 3.2 3B"},{id:"Qwen/Qwen2.5-72B-Instruct",name:"Qwen 2.5 72B"},{id:"Qwen/Qwen2.5-Coder-32B-Instruct",name:"Qwen 2.5 Coder 32B"},{id:"NousResearch/Hermes-3-Llama-3.1-70B",name:"Hermes 3 70B"}]}},o=new Map;for(let e of Object.values(t))e.alias&&e.alias!==e.id&&o.set(e.alias,e);let n=function(){let e={};for(let a of Object.values(t))if(a.models&&a.models.length>0){let i=a.alias||a.id;e[i]||(e[i]=a.models)}return e}(),r=function(){let e={};for(let a of Object.values(t))e[a.id]=a.alias||a.id;return e}();function s(e){return n[r[e]||e]||[]}},81172:(e,a,i)=>{i.d(a,{Q2:()=>t.Q2,fg:()=>t.fg,vQ:()=>o,MA:()=>t.MA,zN:()=>t.zN,B2:()=>n});var t=i(64745);i(18595);let o={name:"OmniRoute",description:"AI Gateway for Multi-Provider LLMs",version:"0.2.0"},n={storageKey:"theme",defaultTheme:"system"}},83711:(e,a,i)=>{i.d(a,{A:()=>s});var t=i(1934),o=i(31692),n=i(81172);function r(e){let a=document.documentElement,i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"dark"===("system"===e?i:e)?a.classList.add("dark"):a.classList.remove("dark")}let s=(0,t.v)((0,o.Zr)((e,a)=>({theme:n.B2.defaultTheme,setTheme:a=>{e({theme:a}),r(a)},toggleTheme:()=>{let i="dark"===a().theme?"light":"dark";e({theme:i}),r(i)},initTheme:()=>{r(a().theme)}}),{name:n.B2.storageKey}))}}]);