vansrouter 0.8.1 → 0.8.3

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 (902) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/routes-manifest.json +22 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  55. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  56. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  57. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  58. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  59. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  60. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  61. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  62. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  65. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  66. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  67. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  69. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  70. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  71. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  72. package/app/.next-cli-build/server/app/api/auth/check/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  81. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  83. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  86. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  88. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  90. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  92. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  94. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  96. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  100. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  102. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  106. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  108. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  110. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  135. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +3 -3
  192. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  229. package/app/.next-cli-build/server/app/callback.html +1 -1
  230. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  231. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  232. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  233. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  234. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  235. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  236. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  237. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  238. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  239. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  240. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  243. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  244. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  246. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  248. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  249. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  250. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  253. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  254. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  256. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  258. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  259. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  260. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  263. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  264. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  266. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  268. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  269. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  270. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  273. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  274. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  276. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  279. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  280. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  284. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  285. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  287. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  289. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  290. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  291. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  294. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  295. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  297. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  300. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  301. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  304. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  305. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  307. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  309. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  310. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  311. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  315. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  316. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  318. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  321. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  322. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  325. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  326. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  328. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  331. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  332. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  335. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  336. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  338. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  340. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  341. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  342. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  345. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  346. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  348. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  353. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  354. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  356. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  360. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  363. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  364. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  367. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  368. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  369. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  370. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  373. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  374. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  377. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  378. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  379. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  380. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  382. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  383. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  384. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  387. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  388. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  389. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  390. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  393. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  394. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  397. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  398. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  400. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  401. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  402. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  403. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  404. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  406. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  407. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  409. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  410. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  413. package/app/.next-cli-build/server/app/landing.html +1 -1
  414. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  415. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  416. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  418. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  419. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  421. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  422. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  423. package/app/.next-cli-build/server/app/login.html +1 -1
  424. package/app/.next-cli-build/server/app/login.rsc +5 -5
  425. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  426. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  428. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  430. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  432. package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
  434. package/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  435. package/app/.next-cli-build/server/chunks/3141.js +9 -0
  436. package/app/.next-cli-build/server/chunks/383.js +1 -1
  437. package/app/.next-cli-build/server/chunks/4544.js +1 -1
  438. package/app/.next-cli-build/server/chunks/4574.js +1 -1
  439. package/app/.next-cli-build/server/chunks/5006.js +1 -1
  440. package/app/.next-cli-build/server/chunks/5598.js +1 -1
  441. package/app/.next-cli-build/server/chunks/6009.js +1 -0
  442. package/app/.next-cli-build/server/chunks/6159.js +1 -1
  443. package/app/.next-cli-build/server/chunks/8121.js +9 -0
  444. package/app/.next-cli-build/server/chunks/9633.js +1 -1
  445. package/app/.next-cli-build/server/chunks/9984.js +1 -1
  446. package/app/.next-cli-build/server/instrumentation.js +1 -1
  447. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  448. package/app/.next-cli-build/server/middleware.js +1 -1
  449. package/app/.next-cli-build/server/pages/404.html +1 -1
  450. package/app/.next-cli-build/server/pages/500.html +1 -1
  451. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  452. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  453. package/app/.next-cli-build/static/chunks/{4385-44b1e0069eefa215.js → 4385-b678299e9f7997d0.js} +1 -1
  454. package/app/.next-cli-build/static/chunks/497-a4efc19d4e6d5742.js +1 -0
  455. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-3675446d31ef1ed1.js +10 -0
  456. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-a3da2d8345735ec6.js +1 -0
  457. package/app/node_modules/@swc/helpers/LICENSE +201 -0
  458. package/app/node_modules/@swc/helpers/_/_apply_decorated_descriptor/package.json +4 -0
  459. package/app/node_modules/@swc/helpers/_/_apply_decs_2203_r/package.json +4 -0
  460. package/app/node_modules/@swc/helpers/_/_array_like_to_array/package.json +4 -0
  461. package/app/node_modules/@swc/helpers/_/_array_with_holes/package.json +4 -0
  462. package/app/node_modules/@swc/helpers/_/_array_without_holes/package.json +4 -0
  463. package/app/node_modules/@swc/helpers/_/_assert_this_initialized/package.json +4 -0
  464. package/app/node_modules/@swc/helpers/_/_async_generator/package.json +4 -0
  465. package/app/node_modules/@swc/helpers/_/_async_generator_delegate/package.json +4 -0
  466. package/app/node_modules/@swc/helpers/_/_async_iterator/package.json +4 -0
  467. package/app/node_modules/@swc/helpers/_/_async_to_generator/package.json +4 -0
  468. package/app/node_modules/@swc/helpers/_/_await_async_generator/package.json +4 -0
  469. package/app/node_modules/@swc/helpers/_/_await_value/package.json +4 -0
  470. package/app/node_modules/@swc/helpers/_/_call_super/package.json +4 -0
  471. package/app/node_modules/@swc/helpers/_/_check_private_redeclaration/package.json +4 -0
  472. package/app/node_modules/@swc/helpers/_/_class_apply_descriptor_destructure/package.json +4 -0
  473. package/app/node_modules/@swc/helpers/_/_class_apply_descriptor_get/package.json +4 -0
  474. package/app/node_modules/@swc/helpers/_/_class_apply_descriptor_set/package.json +4 -0
  475. package/app/node_modules/@swc/helpers/_/_class_apply_descriptor_update/package.json +4 -0
  476. package/app/node_modules/@swc/helpers/_/_class_call_check/package.json +4 -0
  477. package/app/node_modules/@swc/helpers/_/_class_check_private_static_access/package.json +4 -0
  478. package/app/node_modules/@swc/helpers/_/_class_check_private_static_field_descriptor/package.json +4 -0
  479. package/app/node_modules/@swc/helpers/_/_class_extract_field_descriptor/package.json +4 -0
  480. package/app/node_modules/@swc/helpers/_/_class_name_tdz_error/package.json +4 -0
  481. package/app/node_modules/@swc/helpers/_/_class_private_field_destructure/package.json +4 -0
  482. package/app/node_modules/@swc/helpers/_/_class_private_field_get/package.json +4 -0
  483. package/app/node_modules/@swc/helpers/_/_class_private_field_init/package.json +4 -0
  484. package/app/node_modules/@swc/helpers/_/_class_private_field_loose_base/package.json +4 -0
  485. package/app/node_modules/@swc/helpers/_/_class_private_field_loose_key/package.json +4 -0
  486. package/app/node_modules/@swc/helpers/_/_class_private_field_set/package.json +4 -0
  487. package/app/node_modules/@swc/helpers/_/_class_private_field_update/package.json +4 -0
  488. package/app/node_modules/@swc/helpers/_/_class_private_method_get/package.json +4 -0
  489. package/app/node_modules/@swc/helpers/_/_class_private_method_init/package.json +4 -0
  490. package/app/node_modules/@swc/helpers/_/_class_private_method_set/package.json +4 -0
  491. package/app/node_modules/@swc/helpers/_/_class_static_private_field_destructure/package.json +4 -0
  492. package/app/node_modules/@swc/helpers/_/_class_static_private_field_spec_get/package.json +4 -0
  493. package/app/node_modules/@swc/helpers/_/_class_static_private_field_spec_set/package.json +4 -0
  494. package/app/node_modules/@swc/helpers/_/_class_static_private_field_update/package.json +4 -0
  495. package/app/node_modules/@swc/helpers/_/_class_static_private_method_get/package.json +4 -0
  496. package/app/node_modules/@swc/helpers/_/_construct/package.json +4 -0
  497. package/app/node_modules/@swc/helpers/_/_create_class/package.json +4 -0
  498. package/app/node_modules/@swc/helpers/_/_create_for_of_iterator_helper_loose/package.json +4 -0
  499. package/app/node_modules/@swc/helpers/_/_create_super/package.json +4 -0
  500. package/app/node_modules/@swc/helpers/_/_decorate/package.json +4 -0
  501. package/app/node_modules/@swc/helpers/_/_defaults/package.json +4 -0
  502. package/app/node_modules/@swc/helpers/_/_define_enumerable_properties/package.json +4 -0
  503. package/app/node_modules/@swc/helpers/_/_define_property/package.json +4 -0
  504. package/app/node_modules/@swc/helpers/_/_dispose/package.json +4 -0
  505. package/app/node_modules/@swc/helpers/_/_export_star/package.json +4 -0
  506. package/app/node_modules/@swc/helpers/_/_extends/package.json +4 -0
  507. package/app/node_modules/@swc/helpers/_/_get/package.json +4 -0
  508. package/app/node_modules/@swc/helpers/_/_get_prototype_of/package.json +4 -0
  509. package/app/node_modules/@swc/helpers/_/_identity/package.json +4 -0
  510. package/app/node_modules/@swc/helpers/_/_inherits/package.json +4 -0
  511. package/app/node_modules/@swc/helpers/_/_inherits_loose/package.json +4 -0
  512. package/app/node_modules/@swc/helpers/_/_initializer_define_property/package.json +4 -0
  513. package/app/node_modules/@swc/helpers/_/_initializer_warning_helper/package.json +4 -0
  514. package/app/node_modules/@swc/helpers/_/_instanceof/package.json +4 -0
  515. package/app/node_modules/@swc/helpers/_/_interop_require_default/package.json +4 -0
  516. package/app/node_modules/@swc/helpers/_/_interop_require_wildcard/package.json +4 -0
  517. package/app/node_modules/@swc/helpers/_/_is_native_function/package.json +4 -0
  518. package/app/node_modules/@swc/helpers/_/_is_native_reflect_construct/package.json +4 -0
  519. package/app/node_modules/@swc/helpers/_/_iterable_to_array/package.json +4 -0
  520. package/app/node_modules/@swc/helpers/_/_iterable_to_array_limit/package.json +4 -0
  521. package/app/node_modules/@swc/helpers/_/_iterable_to_array_limit_loose/package.json +4 -0
  522. package/app/node_modules/@swc/helpers/_/_jsx/package.json +4 -0
  523. package/app/node_modules/@swc/helpers/_/_new_arrow_check/package.json +4 -0
  524. package/app/node_modules/@swc/helpers/_/_non_iterable_rest/package.json +4 -0
  525. package/app/node_modules/@swc/helpers/_/_non_iterable_spread/package.json +4 -0
  526. package/app/node_modules/@swc/helpers/_/_object_destructuring_empty/package.json +4 -0
  527. package/app/node_modules/@swc/helpers/_/_object_spread/package.json +4 -0
  528. package/app/node_modules/@swc/helpers/_/_object_spread_props/package.json +4 -0
  529. package/app/node_modules/@swc/helpers/_/_object_without_properties/package.json +4 -0
  530. package/app/node_modules/@swc/helpers/_/_object_without_properties_loose/package.json +4 -0
  531. package/app/node_modules/@swc/helpers/_/_possible_constructor_return/package.json +4 -0
  532. package/app/node_modules/@swc/helpers/_/_read_only_error/package.json +4 -0
  533. package/app/node_modules/@swc/helpers/_/_set/package.json +4 -0
  534. package/app/node_modules/@swc/helpers/_/_set_prototype_of/package.json +4 -0
  535. package/app/node_modules/@swc/helpers/_/_skip_first_generator_next/package.json +4 -0
  536. package/app/node_modules/@swc/helpers/_/_sliced_to_array/package.json +4 -0
  537. package/app/node_modules/@swc/helpers/_/_sliced_to_array_loose/package.json +4 -0
  538. package/app/node_modules/@swc/helpers/_/_super_prop_base/package.json +4 -0
  539. package/app/node_modules/@swc/helpers/_/_tagged_template_literal/package.json +4 -0
  540. package/app/node_modules/@swc/helpers/_/_tagged_template_literal_loose/package.json +4 -0
  541. package/app/node_modules/@swc/helpers/_/_throw/package.json +4 -0
  542. package/app/node_modules/@swc/helpers/_/_to_array/package.json +4 -0
  543. package/app/node_modules/@swc/helpers/_/_to_consumable_array/package.json +4 -0
  544. package/app/node_modules/@swc/helpers/_/_to_primitive/package.json +4 -0
  545. package/app/node_modules/@swc/helpers/_/_to_property_key/package.json +4 -0
  546. package/app/node_modules/@swc/helpers/_/_ts_add_disposable_resource/package.json +4 -0
  547. package/app/node_modules/@swc/helpers/_/_ts_decorate/package.json +4 -0
  548. package/app/node_modules/@swc/helpers/_/_ts_dispose_resources/package.json +4 -0
  549. package/app/node_modules/@swc/helpers/_/_ts_generator/package.json +4 -0
  550. package/app/node_modules/@swc/helpers/_/_ts_metadata/package.json +4 -0
  551. package/app/node_modules/@swc/helpers/_/_ts_param/package.json +4 -0
  552. package/app/node_modules/@swc/helpers/_/_ts_values/package.json +4 -0
  553. package/app/node_modules/@swc/helpers/_/_type_of/package.json +4 -0
  554. package/app/node_modules/@swc/helpers/_/_unsupported_iterable_to_array/package.json +4 -0
  555. package/app/node_modules/@swc/helpers/_/_update/package.json +4 -0
  556. package/app/node_modules/@swc/helpers/_/_using/package.json +4 -0
  557. package/app/node_modules/@swc/helpers/_/_using_ctx/package.json +4 -0
  558. package/app/node_modules/@swc/helpers/_/_wrap_async_generator/package.json +4 -0
  559. package/app/node_modules/@swc/helpers/_/_wrap_native_super/package.json +4 -0
  560. package/app/node_modules/@swc/helpers/_/_write_only_error/package.json +4 -0
  561. package/app/node_modules/@swc/helpers/_/index/package.json +4 -0
  562. package/app/node_modules/@swc/helpers/cjs/_apply_decorated_descriptor.cjs +35 -0
  563. package/app/node_modules/@swc/helpers/cjs/_apply_decs_2203_r.cjs +550 -0
  564. package/app/node_modules/@swc/helpers/cjs/_array_like_to_array.cjs +10 -0
  565. package/app/node_modules/@swc/helpers/cjs/_array_with_holes.cjs +6 -0
  566. package/app/node_modules/@swc/helpers/cjs/_array_without_holes.cjs +8 -0
  567. package/app/node_modules/@swc/helpers/cjs/_assert_this_initialized.cjs +8 -0
  568. package/app/node_modules/@swc/helpers/cjs/_async_generator.cjs +78 -0
  569. package/app/node_modules/@swc/helpers/cjs/_async_generator_delegate.cjs +49 -0
  570. package/app/node_modules/@swc/helpers/cjs/_async_iterator.cjs +46 -0
  571. package/app/node_modules/@swc/helpers/cjs/_async_to_generator.cjs +33 -0
  572. package/app/node_modules/@swc/helpers/cjs/_await_async_generator.cjs +8 -0
  573. package/app/node_modules/@swc/helpers/cjs/_await_value.cjs +6 -0
  574. package/app/node_modules/@swc/helpers/cjs/_call_super.cjs +19 -0
  575. package/app/node_modules/@swc/helpers/cjs/_check_private_redeclaration.cjs +8 -0
  576. package/app/node_modules/@swc/helpers/cjs/_class_apply_descriptor_destructure.cjs +25 -0
  577. package/app/node_modules/@swc/helpers/cjs/_class_apply_descriptor_get.cjs +8 -0
  578. package/app/node_modules/@swc/helpers/cjs/_class_apply_descriptor_set.cjs +15 -0
  579. package/app/node_modules/@swc/helpers/cjs/_class_apply_descriptor_update.cjs +30 -0
  580. package/app/node_modules/@swc/helpers/cjs/_class_call_check.cjs +6 -0
  581. package/app/node_modules/@swc/helpers/cjs/_class_check_private_static_access.cjs +6 -0
  582. package/app/node_modules/@swc/helpers/cjs/_class_check_private_static_field_descriptor.cjs +8 -0
  583. package/app/node_modules/@swc/helpers/cjs/_class_extract_field_descriptor.cjs +8 -0
  584. package/app/node_modules/@swc/helpers/cjs/_class_name_tdz_error.cjs +6 -0
  585. package/app/node_modules/@swc/helpers/cjs/_class_private_field_destructure.cjs +10 -0
  586. package/app/node_modules/@swc/helpers/cjs/_class_private_field_get.cjs +10 -0
  587. package/app/node_modules/@swc/helpers/cjs/_class_private_field_init.cjs +9 -0
  588. package/app/node_modules/@swc/helpers/cjs/_class_private_field_loose_base.cjs +10 -0
  589. package/app/node_modules/@swc/helpers/cjs/_class_private_field_loose_key.cjs +8 -0
  590. package/app/node_modules/@swc/helpers/cjs/_class_private_field_set.cjs +11 -0
  591. package/app/node_modules/@swc/helpers/cjs/_class_private_field_update.cjs +10 -0
  592. package/app/node_modules/@swc/helpers/cjs/_class_private_method_get.cjs +8 -0
  593. package/app/node_modules/@swc/helpers/cjs/_class_private_method_init.cjs +9 -0
  594. package/app/node_modules/@swc/helpers/cjs/_class_private_method_set.cjs +6 -0
  595. package/app/node_modules/@swc/helpers/cjs/_class_static_private_field_destructure.cjs +13 -0
  596. package/app/node_modules/@swc/helpers/cjs/_class_static_private_field_spec_get.cjs +13 -0
  597. package/app/node_modules/@swc/helpers/cjs/_class_static_private_field_spec_set.cjs +14 -0
  598. package/app/node_modules/@swc/helpers/cjs/_class_static_private_field_update.cjs +13 -0
  599. package/app/node_modules/@swc/helpers/cjs/_class_static_private_method_get.cjs +10 -0
  600. package/app/node_modules/@swc/helpers/cjs/_construct.cjs +22 -0
  601. package/app/node_modules/@swc/helpers/cjs/_create_class.cjs +20 -0
  602. package/app/node_modules/@swc/helpers/cjs/_create_for_of_iterator_helper_loose.cjs +24 -0
  603. package/app/node_modules/@swc/helpers/cjs/_create_super.cjs +23 -0
  604. package/app/node_modules/@swc/helpers/cjs/_decorate.cjs +270 -0
  605. package/app/node_modules/@swc/helpers/cjs/_defaults.cjs +15 -0
  606. package/app/node_modules/@swc/helpers/cjs/_define_enumerable_properties.cjs +26 -0
  607. package/app/node_modules/@swc/helpers/cjs/_define_property.cjs +10 -0
  608. package/app/node_modules/@swc/helpers/cjs/_dispose.cjs +43 -0
  609. package/app/node_modules/@swc/helpers/cjs/_export_star.cjs +17 -0
  610. package/app/node_modules/@swc/helpers/cjs/_extends.cjs +15 -0
  611. package/app/node_modules/@swc/helpers/cjs/_get.cjs +23 -0
  612. package/app/node_modules/@swc/helpers/cjs/_get_prototype_of.cjs +10 -0
  613. package/app/node_modules/@swc/helpers/cjs/_identity.cjs +7 -0
  614. package/app/node_modules/@swc/helpers/cjs/_inherits.cjs +14 -0
  615. package/app/node_modules/@swc/helpers/cjs/_inherits_loose.cjs +8 -0
  616. package/app/node_modules/@swc/helpers/cjs/_initializer_define_property.cjs +13 -0
  617. package/app/node_modules/@swc/helpers/cjs/_initializer_warning_helper.cjs +11 -0
  618. package/app/node_modules/@swc/helpers/cjs/_instanceof.cjs +8 -0
  619. package/app/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +6 -0
  620. package/app/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +38 -0
  621. package/app/node_modules/@swc/helpers/cjs/_is_native_function.cjs +6 -0
  622. package/app/node_modules/@swc/helpers/cjs/_is_native_reflect_construct.cjs +18 -0
  623. package/app/node_modules/@swc/helpers/cjs/_iterable_to_array.cjs +8 -0
  624. package/app/node_modules/@swc/helpers/cjs/_iterable_to_array_limit.cjs +31 -0
  625. package/app/node_modules/@swc/helpers/cjs/_iterable_to_array_limit_loose.cjs +17 -0
  626. package/app/node_modules/@swc/helpers/cjs/_jsx.cjs +28 -0
  627. package/app/node_modules/@swc/helpers/cjs/_new_arrow_check.cjs +6 -0
  628. package/app/node_modules/@swc/helpers/cjs/_non_iterable_rest.cjs +6 -0
  629. package/app/node_modules/@swc/helpers/cjs/_non_iterable_spread.cjs +6 -0
  630. package/app/node_modules/@swc/helpers/cjs/_object_destructuring_empty.cjs +8 -0
  631. package/app/node_modules/@swc/helpers/cjs/_object_spread.cjs +25 -0
  632. package/app/node_modules/@swc/helpers/cjs/_object_spread_props.cjs +30 -0
  633. package/app/node_modules/@swc/helpers/cjs/_object_without_properties.cjs +23 -0
  634. package/app/node_modules/@swc/helpers/cjs/_object_without_properties_loose.cjs +18 -0
  635. package/app/node_modules/@swc/helpers/cjs/_possible_constructor_return.cjs +11 -0
  636. package/app/node_modules/@swc/helpers/cjs/_read_only_error.cjs +6 -0
  637. package/app/node_modules/@swc/helpers/cjs/_set.cjs +44 -0
  638. package/app/node_modules/@swc/helpers/cjs/_set_prototype_of.cjs +12 -0
  639. package/app/node_modules/@swc/helpers/cjs/_skip_first_generator_next.cjs +11 -0
  640. package/app/node_modules/@swc/helpers/cjs/_sliced_to_array.cjs +11 -0
  641. package/app/node_modules/@swc/helpers/cjs/_sliced_to_array_loose.cjs +11 -0
  642. package/app/node_modules/@swc/helpers/cjs/_super_prop_base.cjs +13 -0
  643. package/app/node_modules/@swc/helpers/cjs/_tagged_template_literal.cjs +8 -0
  644. package/app/node_modules/@swc/helpers/cjs/_tagged_template_literal_loose.cjs +10 -0
  645. package/app/node_modules/@swc/helpers/cjs/_throw.cjs +6 -0
  646. package/app/node_modules/@swc/helpers/cjs/_to_array.cjs +11 -0
  647. package/app/node_modules/@swc/helpers/cjs/_to_consumable_array.cjs +11 -0
  648. package/app/node_modules/@swc/helpers/cjs/_to_primitive.cjs +18 -0
  649. package/app/node_modules/@swc/helpers/cjs/_to_property_key.cjs +11 -0
  650. package/app/node_modules/@swc/helpers/cjs/_ts_add_disposable_resource.cjs +3 -0
  651. package/app/node_modules/@swc/helpers/cjs/_ts_decorate.cjs +3 -0
  652. package/app/node_modules/@swc/helpers/cjs/_ts_dispose_resources.cjs +3 -0
  653. package/app/node_modules/@swc/helpers/cjs/_ts_generator.cjs +3 -0
  654. package/app/node_modules/@swc/helpers/cjs/_ts_metadata.cjs +3 -0
  655. package/app/node_modules/@swc/helpers/cjs/_ts_param.cjs +3 -0
  656. package/app/node_modules/@swc/helpers/cjs/_ts_values.cjs +3 -0
  657. package/app/node_modules/@swc/helpers/cjs/_type_of.cjs +8 -0
  658. package/app/node_modules/@swc/helpers/cjs/_unsupported_iterable_to_array.cjs +15 -0
  659. package/app/node_modules/@swc/helpers/cjs/_update.cjs +16 -0
  660. package/app/node_modules/@swc/helpers/cjs/_using.cjs +24 -0
  661. package/app/node_modules/@swc/helpers/cjs/_using_ctx.cjs +75 -0
  662. package/app/node_modules/@swc/helpers/cjs/_wrap_async_generator.cjs +10 -0
  663. package/app/node_modules/@swc/helpers/cjs/_wrap_native_super.cjs +28 -0
  664. package/app/node_modules/@swc/helpers/cjs/_write_only_error.cjs +6 -0
  665. package/app/node_modules/@swc/helpers/cjs/index.cjs +423 -0
  666. package/app/node_modules/@swc/helpers/esm/_apply_decorated_descriptor.js +33 -0
  667. package/app/node_modules/@swc/helpers/esm/_apply_decs_2203_r.js +548 -0
  668. package/app/node_modules/@swc/helpers/esm/_array_like_to_array.js +8 -0
  669. package/app/node_modules/@swc/helpers/esm/_array_with_holes.js +4 -0
  670. package/app/node_modules/@swc/helpers/esm/_array_without_holes.js +6 -0
  671. package/app/node_modules/@swc/helpers/esm/_assert_this_initialized.js +6 -0
  672. package/app/node_modules/@swc/helpers/esm/_async_generator.js +76 -0
  673. package/app/node_modules/@swc/helpers/esm/_async_generator_delegate.js +47 -0
  674. package/app/node_modules/@swc/helpers/esm/_async_iterator.js +44 -0
  675. package/app/node_modules/@swc/helpers/esm/_async_to_generator.js +31 -0
  676. package/app/node_modules/@swc/helpers/esm/_await_async_generator.js +6 -0
  677. package/app/node_modules/@swc/helpers/esm/_await_value.js +4 -0
  678. package/app/node_modules/@swc/helpers/esm/_call_super.js +17 -0
  679. package/app/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +6 -0
  680. package/app/node_modules/@swc/helpers/esm/_class_apply_descriptor_destructure.js +23 -0
  681. package/app/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js +6 -0
  682. package/app/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js +13 -0
  683. package/app/node_modules/@swc/helpers/esm/_class_apply_descriptor_update.js +28 -0
  684. package/app/node_modules/@swc/helpers/esm/_class_call_check.js +4 -0
  685. package/app/node_modules/@swc/helpers/esm/_class_check_private_static_access.js +4 -0
  686. package/app/node_modules/@swc/helpers/esm/_class_check_private_static_field_descriptor.js +6 -0
  687. package/app/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js +6 -0
  688. package/app/node_modules/@swc/helpers/esm/_class_name_tdz_error.js +4 -0
  689. package/app/node_modules/@swc/helpers/esm/_class_private_field_destructure.js +8 -0
  690. package/app/node_modules/@swc/helpers/esm/_class_private_field_get.js +8 -0
  691. package/app/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
  692. package/app/node_modules/@swc/helpers/esm/_class_private_field_loose_base.js +8 -0
  693. package/app/node_modules/@swc/helpers/esm/_class_private_field_loose_key.js +6 -0
  694. package/app/node_modules/@swc/helpers/esm/_class_private_field_set.js +9 -0
  695. package/app/node_modules/@swc/helpers/esm/_class_private_field_update.js +8 -0
  696. package/app/node_modules/@swc/helpers/esm/_class_private_method_get.js +6 -0
  697. package/app/node_modules/@swc/helpers/esm/_class_private_method_init.js +7 -0
  698. package/app/node_modules/@swc/helpers/esm/_class_private_method_set.js +4 -0
  699. package/app/node_modules/@swc/helpers/esm/_class_static_private_field_destructure.js +11 -0
  700. package/app/node_modules/@swc/helpers/esm/_class_static_private_field_spec_get.js +11 -0
  701. package/app/node_modules/@swc/helpers/esm/_class_static_private_field_spec_set.js +12 -0
  702. package/app/node_modules/@swc/helpers/esm/_class_static_private_field_update.js +11 -0
  703. package/app/node_modules/@swc/helpers/esm/_class_static_private_method_get.js +8 -0
  704. package/app/node_modules/@swc/helpers/esm/_construct.js +20 -0
  705. package/app/node_modules/@swc/helpers/esm/_create_class.js +18 -0
  706. package/app/node_modules/@swc/helpers/esm/_create_for_of_iterator_helper_loose.js +22 -0
  707. package/app/node_modules/@swc/helpers/esm/_create_super.js +21 -0
  708. package/app/node_modules/@swc/helpers/esm/_decorate.js +268 -0
  709. package/app/node_modules/@swc/helpers/esm/_defaults.js +13 -0
  710. package/app/node_modules/@swc/helpers/esm/_define_enumerable_properties.js +24 -0
  711. package/app/node_modules/@swc/helpers/esm/_define_property.js +8 -0
  712. package/app/node_modules/@swc/helpers/esm/_dispose.js +41 -0
  713. package/app/node_modules/@swc/helpers/esm/_export_star.js +15 -0
  714. package/app/node_modules/@swc/helpers/esm/_extends.js +13 -0
  715. package/app/node_modules/@swc/helpers/esm/_get.js +21 -0
  716. package/app/node_modules/@swc/helpers/esm/_get_prototype_of.js +8 -0
  717. package/app/node_modules/@swc/helpers/esm/_identity.js +5 -0
  718. package/app/node_modules/@swc/helpers/esm/_inherits.js +12 -0
  719. package/app/node_modules/@swc/helpers/esm/_inherits_loose.js +6 -0
  720. package/app/node_modules/@swc/helpers/esm/_initializer_define_property.js +11 -0
  721. package/app/node_modules/@swc/helpers/esm/_initializer_warning_helper.js +9 -0
  722. package/app/node_modules/@swc/helpers/esm/_instanceof.js +6 -0
  723. package/app/node_modules/@swc/helpers/esm/_interop_require_default.js +4 -0
  724. package/app/node_modules/@swc/helpers/esm/_interop_require_wildcard.js +36 -0
  725. package/app/node_modules/@swc/helpers/esm/_is_native_function.js +4 -0
  726. package/app/node_modules/@swc/helpers/esm/_is_native_reflect_construct.js +16 -0
  727. package/app/node_modules/@swc/helpers/esm/_iterable_to_array.js +6 -0
  728. package/app/node_modules/@swc/helpers/esm/_iterable_to_array_limit.js +29 -0
  729. package/app/node_modules/@swc/helpers/esm/_iterable_to_array_limit_loose.js +15 -0
  730. package/app/node_modules/@swc/helpers/esm/_jsx.js +26 -0
  731. package/app/node_modules/@swc/helpers/esm/_new_arrow_check.js +4 -0
  732. package/app/node_modules/@swc/helpers/esm/_non_iterable_rest.js +4 -0
  733. package/app/node_modules/@swc/helpers/esm/_non_iterable_spread.js +4 -0
  734. package/app/node_modules/@swc/helpers/esm/_object_destructuring_empty.js +6 -0
  735. package/app/node_modules/@swc/helpers/esm/_object_spread.js +23 -0
  736. package/app/node_modules/@swc/helpers/esm/_object_spread_props.js +28 -0
  737. package/app/node_modules/@swc/helpers/esm/_object_without_properties.js +21 -0
  738. package/app/node_modules/@swc/helpers/esm/_object_without_properties_loose.js +16 -0
  739. package/app/node_modules/@swc/helpers/esm/_possible_constructor_return.js +9 -0
  740. package/app/node_modules/@swc/helpers/esm/_read_only_error.js +4 -0
  741. package/app/node_modules/@swc/helpers/esm/_set.js +42 -0
  742. package/app/node_modules/@swc/helpers/esm/_set_prototype_of.js +10 -0
  743. package/app/node_modules/@swc/helpers/esm/_skip_first_generator_next.js +9 -0
  744. package/app/node_modules/@swc/helpers/esm/_sliced_to_array.js +9 -0
  745. package/app/node_modules/@swc/helpers/esm/_sliced_to_array_loose.js +9 -0
  746. package/app/node_modules/@swc/helpers/esm/_super_prop_base.js +11 -0
  747. package/app/node_modules/@swc/helpers/esm/_tagged_template_literal.js +6 -0
  748. package/app/node_modules/@swc/helpers/esm/_tagged_template_literal_loose.js +8 -0
  749. package/app/node_modules/@swc/helpers/esm/_throw.js +4 -0
  750. package/app/node_modules/@swc/helpers/esm/_to_array.js +9 -0
  751. package/app/node_modules/@swc/helpers/esm/_to_consumable_array.js +9 -0
  752. package/app/node_modules/@swc/helpers/esm/_to_primitive.js +16 -0
  753. package/app/node_modules/@swc/helpers/esm/_to_property_key.js +9 -0
  754. package/app/node_modules/@swc/helpers/esm/_ts_add_disposable_resource.js +1 -0
  755. package/app/node_modules/@swc/helpers/esm/_ts_decorate.js +1 -0
  756. package/app/node_modules/@swc/helpers/esm/_ts_dispose_resources.js +1 -0
  757. package/app/node_modules/@swc/helpers/esm/_ts_generator.js +1 -0
  758. package/app/node_modules/@swc/helpers/esm/_ts_metadata.js +1 -0
  759. package/app/node_modules/@swc/helpers/esm/_ts_param.js +1 -0
  760. package/app/node_modules/@swc/helpers/esm/_ts_values.js +1 -0
  761. package/app/node_modules/@swc/helpers/esm/_type_of.js +6 -0
  762. package/app/node_modules/@swc/helpers/esm/_unsupported_iterable_to_array.js +13 -0
  763. package/app/node_modules/@swc/helpers/esm/_update.js +14 -0
  764. package/app/node_modules/@swc/helpers/esm/_using.js +22 -0
  765. package/app/node_modules/@swc/helpers/esm/_using_ctx.js +73 -0
  766. package/app/node_modules/@swc/helpers/esm/_wrap_async_generator.js +8 -0
  767. package/app/node_modules/@swc/helpers/esm/_wrap_native_super.js +26 -0
  768. package/app/node_modules/@swc/helpers/esm/_write_only_error.js +4 -0
  769. package/app/node_modules/@swc/helpers/esm/index.js +106 -0
  770. package/app/node_modules/@swc/helpers/package.json +471 -0
  771. package/app/node_modules/@swc/helpers/scripts/ast_grep.js +229 -0
  772. package/app/node_modules/@swc/helpers/scripts/build.js +121 -0
  773. package/app/node_modules/@swc/helpers/scripts/errors.js +1 -0
  774. package/app/node_modules/@swc/helpers/scripts/utils.js +3 -0
  775. package/app/node_modules/@swc/helpers/src/_apply_decorated_descriptor.mjs +1 -0
  776. package/app/node_modules/@swc/helpers/src/_apply_decs_2203_r.mjs +1 -0
  777. package/app/node_modules/@swc/helpers/src/_array_like_to_array.mjs +1 -0
  778. package/app/node_modules/@swc/helpers/src/_array_with_holes.mjs +1 -0
  779. package/app/node_modules/@swc/helpers/src/_array_without_holes.mjs +1 -0
  780. package/app/node_modules/@swc/helpers/src/_assert_this_initialized.mjs +1 -0
  781. package/app/node_modules/@swc/helpers/src/_async_generator.mjs +1 -0
  782. package/app/node_modules/@swc/helpers/src/_async_generator_delegate.mjs +1 -0
  783. package/app/node_modules/@swc/helpers/src/_async_iterator.mjs +1 -0
  784. package/app/node_modules/@swc/helpers/src/_async_to_generator.mjs +1 -0
  785. package/app/node_modules/@swc/helpers/src/_await_async_generator.mjs +1 -0
  786. package/app/node_modules/@swc/helpers/src/_await_value.mjs +1 -0
  787. package/app/node_modules/@swc/helpers/src/_call_super.mjs +1 -0
  788. package/app/node_modules/@swc/helpers/src/_check_private_redeclaration.mjs +1 -0
  789. package/app/node_modules/@swc/helpers/src/_class_apply_descriptor_destructure.mjs +1 -0
  790. package/app/node_modules/@swc/helpers/src/_class_apply_descriptor_get.mjs +1 -0
  791. package/app/node_modules/@swc/helpers/src/_class_apply_descriptor_set.mjs +1 -0
  792. package/app/node_modules/@swc/helpers/src/_class_apply_descriptor_update.mjs +1 -0
  793. package/app/node_modules/@swc/helpers/src/_class_call_check.mjs +1 -0
  794. package/app/node_modules/@swc/helpers/src/_class_check_private_static_access.mjs +1 -0
  795. package/app/node_modules/@swc/helpers/src/_class_check_private_static_field_descriptor.mjs +1 -0
  796. package/app/node_modules/@swc/helpers/src/_class_extract_field_descriptor.mjs +1 -0
  797. package/app/node_modules/@swc/helpers/src/_class_name_tdz_error.mjs +1 -0
  798. package/app/node_modules/@swc/helpers/src/_class_private_field_destructure.mjs +1 -0
  799. package/app/node_modules/@swc/helpers/src/_class_private_field_get.mjs +1 -0
  800. package/app/node_modules/@swc/helpers/src/_class_private_field_init.mjs +1 -0
  801. package/app/node_modules/@swc/helpers/src/_class_private_field_loose_base.mjs +1 -0
  802. package/app/node_modules/@swc/helpers/src/_class_private_field_loose_key.mjs +1 -0
  803. package/app/node_modules/@swc/helpers/src/_class_private_field_set.mjs +1 -0
  804. package/app/node_modules/@swc/helpers/src/_class_private_field_update.mjs +1 -0
  805. package/app/node_modules/@swc/helpers/src/_class_private_method_get.mjs +1 -0
  806. package/app/node_modules/@swc/helpers/src/_class_private_method_init.mjs +1 -0
  807. package/app/node_modules/@swc/helpers/src/_class_private_method_set.mjs +1 -0
  808. package/app/node_modules/@swc/helpers/src/_class_static_private_field_destructure.mjs +1 -0
  809. package/app/node_modules/@swc/helpers/src/_class_static_private_field_spec_get.mjs +1 -0
  810. package/app/node_modules/@swc/helpers/src/_class_static_private_field_spec_set.mjs +1 -0
  811. package/app/node_modules/@swc/helpers/src/_class_static_private_field_update.mjs +1 -0
  812. package/app/node_modules/@swc/helpers/src/_class_static_private_method_get.mjs +1 -0
  813. package/app/node_modules/@swc/helpers/src/_construct.mjs +1 -0
  814. package/app/node_modules/@swc/helpers/src/_create_class.mjs +1 -0
  815. package/app/node_modules/@swc/helpers/src/_create_for_of_iterator_helper_loose.mjs +1 -0
  816. package/app/node_modules/@swc/helpers/src/_create_super.mjs +1 -0
  817. package/app/node_modules/@swc/helpers/src/_decorate.mjs +1 -0
  818. package/app/node_modules/@swc/helpers/src/_defaults.mjs +1 -0
  819. package/app/node_modules/@swc/helpers/src/_define_enumerable_properties.mjs +1 -0
  820. package/app/node_modules/@swc/helpers/src/_define_property.mjs +1 -0
  821. package/app/node_modules/@swc/helpers/src/_dispose.mjs +1 -0
  822. package/app/node_modules/@swc/helpers/src/_export_star.mjs +1 -0
  823. package/app/node_modules/@swc/helpers/src/_extends.mjs +1 -0
  824. package/app/node_modules/@swc/helpers/src/_get.mjs +1 -0
  825. package/app/node_modules/@swc/helpers/src/_get_prototype_of.mjs +1 -0
  826. package/app/node_modules/@swc/helpers/src/_identity.mjs +1 -0
  827. package/app/node_modules/@swc/helpers/src/_inherits.mjs +1 -0
  828. package/app/node_modules/@swc/helpers/src/_inherits_loose.mjs +1 -0
  829. package/app/node_modules/@swc/helpers/src/_initializer_define_property.mjs +1 -0
  830. package/app/node_modules/@swc/helpers/src/_initializer_warning_helper.mjs +1 -0
  831. package/app/node_modules/@swc/helpers/src/_instanceof.mjs +1 -0
  832. package/app/node_modules/@swc/helpers/src/_interop_require_default.mjs +1 -0
  833. package/app/node_modules/@swc/helpers/src/_interop_require_wildcard.mjs +1 -0
  834. package/app/node_modules/@swc/helpers/src/_is_native_function.mjs +1 -0
  835. package/app/node_modules/@swc/helpers/src/_is_native_reflect_construct.mjs +1 -0
  836. package/app/node_modules/@swc/helpers/src/_iterable_to_array.mjs +1 -0
  837. package/app/node_modules/@swc/helpers/src/_iterable_to_array_limit.mjs +1 -0
  838. package/app/node_modules/@swc/helpers/src/_iterable_to_array_limit_loose.mjs +1 -0
  839. package/app/node_modules/@swc/helpers/src/_jsx.mjs +1 -0
  840. package/app/node_modules/@swc/helpers/src/_new_arrow_check.mjs +1 -0
  841. package/app/node_modules/@swc/helpers/src/_non_iterable_rest.mjs +1 -0
  842. package/app/node_modules/@swc/helpers/src/_non_iterable_spread.mjs +1 -0
  843. package/app/node_modules/@swc/helpers/src/_object_destructuring_empty.mjs +1 -0
  844. package/app/node_modules/@swc/helpers/src/_object_spread.mjs +1 -0
  845. package/app/node_modules/@swc/helpers/src/_object_spread_props.mjs +1 -0
  846. package/app/node_modules/@swc/helpers/src/_object_without_properties.mjs +1 -0
  847. package/app/node_modules/@swc/helpers/src/_object_without_properties_loose.mjs +1 -0
  848. package/app/node_modules/@swc/helpers/src/_possible_constructor_return.mjs +1 -0
  849. package/app/node_modules/@swc/helpers/src/_read_only_error.mjs +1 -0
  850. package/app/node_modules/@swc/helpers/src/_set.mjs +1 -0
  851. package/app/node_modules/@swc/helpers/src/_set_prototype_of.mjs +1 -0
  852. package/app/node_modules/@swc/helpers/src/_skip_first_generator_next.mjs +1 -0
  853. package/app/node_modules/@swc/helpers/src/_sliced_to_array.mjs +1 -0
  854. package/app/node_modules/@swc/helpers/src/_sliced_to_array_loose.mjs +1 -0
  855. package/app/node_modules/@swc/helpers/src/_super_prop_base.mjs +1 -0
  856. package/app/node_modules/@swc/helpers/src/_tagged_template_literal.mjs +1 -0
  857. package/app/node_modules/@swc/helpers/src/_tagged_template_literal_loose.mjs +1 -0
  858. package/app/node_modules/@swc/helpers/src/_throw.mjs +1 -0
  859. package/app/node_modules/@swc/helpers/src/_to_array.mjs +1 -0
  860. package/app/node_modules/@swc/helpers/src/_to_consumable_array.mjs +1 -0
  861. package/app/node_modules/@swc/helpers/src/_to_primitive.mjs +1 -0
  862. package/app/node_modules/@swc/helpers/src/_to_property_key.mjs +1 -0
  863. package/app/node_modules/@swc/helpers/src/_ts_add_disposable_resource.mjs +1 -0
  864. package/app/node_modules/@swc/helpers/src/_ts_decorate.mjs +1 -0
  865. package/app/node_modules/@swc/helpers/src/_ts_dispose_resources.mjs +1 -0
  866. package/app/node_modules/@swc/helpers/src/_ts_generator.mjs +1 -0
  867. package/app/node_modules/@swc/helpers/src/_ts_metadata.mjs +1 -0
  868. package/app/node_modules/@swc/helpers/src/_ts_param.mjs +1 -0
  869. package/app/node_modules/@swc/helpers/src/_ts_values.mjs +1 -0
  870. package/app/node_modules/@swc/helpers/src/_type_of.mjs +1 -0
  871. package/app/node_modules/@swc/helpers/src/_unsupported_iterable_to_array.mjs +1 -0
  872. package/app/node_modules/@swc/helpers/src/_update.mjs +1 -0
  873. package/app/node_modules/@swc/helpers/src/_using.mjs +1 -0
  874. package/app/node_modules/@swc/helpers/src/_using_ctx.mjs +1 -0
  875. package/app/node_modules/@swc/helpers/src/_wrap_async_generator.mjs +1 -0
  876. package/app/node_modules/@swc/helpers/src/_wrap_native_super.mjs +1 -0
  877. package/app/node_modules/@swc/helpers/src/_write_only_error.mjs +1 -0
  878. package/app/node_modules/@swc/helpers/src/index.mjs +1 -0
  879. package/app/package.json +3 -1
  880. package/app/public/providers/gigachat.webp +0 -0
  881. package/app/public/providers/heroku.webp +0 -0
  882. package/app/public/providers/llamagate.webp +0 -0
  883. package/app/public/providers/nanogpt.webp +0 -0
  884. package/app/public/providers/nscale.webp +0 -0
  885. package/app/public/providers/ovhcloud.webp +0 -0
  886. package/app/public/providers/predibase.webp +0 -0
  887. package/package.json +1 -1
  888. package/app/.next-cli-build/server/chunks/1500.js +0 -9
  889. package/app/.next-cli-build/server/chunks/1613.js +0 -9
  890. package/app/.next-cli-build/server/chunks/2564.js +0 -1
  891. package/app/.next-cli-build/server/chunks/3652.js +0 -9
  892. package/app/.next-cli-build/server/chunks/4042.js +0 -1
  893. package/app/.next-cli-build/server/chunks/4327.js +0 -9
  894. package/app/.next-cli-build/server/chunks/4486.js +0 -9
  895. package/app/.next-cli-build/server/chunks/6333.js +0 -9
  896. package/app/.next-cli-build/server/chunks/8685.js +0 -9
  897. package/app/.next-cli-build/server/chunks/9294.js +0 -9
  898. package/app/.next-cli-build/static/chunks/497-4e5f78e924e1b3ac.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-794575f7237c2fd7.js +0 -10
  900. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-f1d9bf293afc3684.js +0 -1
  901. /package/app/.next-cli-build/static/{t6yaZcs7Jx5MGCTvAlJGL → nogJvT0i3XfAyuCMTqFX9}/_buildManifest.js +0 -0
  902. /package/app/.next-cli-build/static/{t6yaZcs7Jx5MGCTvAlJGL → nogJvT0i3XfAyuCMTqFX9}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[497],{497:(e,t,s)=>{s.r(t),s.d(t,{AddCustomEmbeddingModal:()=>tt,AuthLayout:()=>eJ,Avatar:()=>p,Badge:()=>h.A,Button:()=>a.A,CapacityBadges:()=>eH.A,Card:()=>i.A,CardSkeleton:()=>d.CardSkeleton,ChangelogModal:()=>tr,ComboFormModal:()=>e2,ConfirmModal:()=>o.u,CursorAuthModal:()=>e8,DashboardLayout:()=>eX,EditConnectionModal:()=>te,Footer:()=>es,GitLabAuthModal:()=>e7,Header:()=>J,HeaderMenu:()=>q,IFlowCookieModal:()=>e9,Input:()=>l.A,KiroAuthModal:()=>e3,KiroOAuthWrapper:()=>e4,KiroSocialOAuthModal:()=>e6,LanguageSwitcher:()=>B.A,Loading:()=>d.Ay,ManualConfigModal:()=>e1,McpMarketplaceModal:()=>e5,Modal:()=>o.A,ModelSelectModal:()=>e0,NineRemoteButton:()=>eq,NoAuthProxyCard:()=>ts,OAuthModal:()=>eY,PageLoading:()=>d.WL,ProviderInfoCard:()=>ta,RequestLogger:()=>eK,SegmentedControl:()=>eQ,Select:()=>n.A,Sidebar:()=>F,Skeleton:()=>d.EA,Spinner:()=>d.y$,ThemeProvider:()=>j.ThemeProvider,ThemeToggle:()=>y,Toggle:()=>b.A,Tooltip:()=>eV.A,UsageStats:()=>e_});var r=s(8511),a=s(8140),l=s(1488),n=s(6860),i=s(2758),o=s(7665),d=s(7056),c=s(5102),m=s(7837),x=s(3916);let u={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"};function p({src:e,alt:t="Avatar",name:s,size:r="md",className:a}){return e?(0,c.jsx)("span",{className:(0,x.cn)("relative inline-block rounded-full overflow-hidden","ring-2 ring-white dark:ring-surface-dark shadow-sm",u[r],a),children:(0,c.jsx)(m.default,{src:e,alt:t,fill:!0,sizes:"48px",className:"object-cover",unoptimized:!0})}):(0,c.jsx)("span",{className:(0,x.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",u[r],function(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),a),"aria-label":t,children:function(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)})}var h=s(7955),b=s(2252),f=s(9526);let g={default:(0,x.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted hover:text-text-main","hover:bg-surface-2 transition-colors"),card:(0,x.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-[var(--shadow-warm)]","text-text-muted hover:text-brand-500","transition-all group")};function y({className:e,variant:t="default"}){let{isDark:s,toggleTheme:r}=(0,f.D)();return(0,c.jsx)("button",{type:"button",onClick:r,className:(0,x.cn)(g[t],e),"aria-label":`Switch to ${s?"light":"dark"} mode`,title:`Switch to ${s?"light":"dark"} mode`,children:(0,c.jsx)("span",{className:(0,x.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:s?"light_mode":"dark_mode"})})}var j=s(9319),v=s(2030),N=s(3885),w=s.n(N),k=s(3278),C=s(1434),S=s(1038),T=s(1577),M=s(9387);let A=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"cast",label:"Desktop",desc:"Screen sharing"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],E=[{icon:"qr_code_scanner",text:"Scan QR to connect instantly"},{icon:"wifi_off",text:"No port forwarding needed"},{icon:"devices",text:"Works on any device"}];function L({isOpen:e,onClose:t}){let s=(0,v.useRef)(t);return((0,v.useEffect)(()=>{s.current=t}),(0,v.useEffect)(()=>{if(!e)return;document.body.style.overflow="hidden";let t=e=>{"Escape"===e.key&&s.current()};return document.addEventListener("keydown",t),()=>{document.body.style.overflow="",document.removeEventListener("keydown",t)}},[e]),e)?(0,M.createPortal)((0,c.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,c.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:t,"aria-hidden":"true"}),(0,c.jsxs)("div",{className:"relative w-full max-w-sm rounded-[14px] overflow-hidden shadow-[var(--shadow-elev)] fade-in flex flex-col bg-surface border border-border-subtle",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[(0,c.jsx)("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center bg-primary",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),(0,c.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-mono",children:"9Remote"})]}),(0,c.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-base",children:"close"})})]}),(0,c.jsxs)("div",{className:"px-7 py-7 pb-9 flex flex-col gap-6",children:[(0,c.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[(0,c.jsx)("div",{className:"w-14 h-14 rounded-[14px] flex items-center justify-center mb-1 bg-primary shadow-[var(--shadow-warm)]",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-white text-[30px]",children:"terminal"})}),(0,c.jsx)("h1",{className:"text-lg font-bold text-text-main tracking-tight",children:"9Remote"}),(0,c.jsx)("p",{className:"text-xs text-text-muted leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),(0,c.jsx)("div",{className:"flex gap-2 w-full",children:A.map(({icon:e,label:t,desc:s})=>(0,c.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1.5 py-4 px-1 rounded-[10px] border border-border-subtle bg-surface-2",children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:e}),(0,c.jsx)("p",{className:"text-xs font-semibold text-text-main",children:t}),(0,c.jsx)("p",{className:"text-[10px] text-text-muted text-center leading-4",children:s})]},t))}),(0,c.jsx)("div",{className:"flex flex-col gap-3 w-full",children:E.map(({icon:e,text:t})=>(0,c.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,c.jsx)("span",{className:"material-symbols-outlined flex-shrink-0 text-primary text-[16px]",children:e}),(0,c.jsx)("span",{className:"text-xs text-text-muted",children:t})]},e))}),(0,c.jsxs)("button",{type:"button",onClick:()=>window.open("https://9remote.cc","_blank"),className:"w-full py-3 flex items-center justify-center gap-2 text-sm font-semibold text-white rounded-[10px] bg-primary hover:bg-primary-hover shadow-[var(--shadow-warm)] active:scale-[0.98] transition-all",children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-base",children:"open_in_new"}),"Get 9Remote"]})]})]})]}),document.body):null}let $=["embedding","image","tts","stt"],P="/dashboard/media-providers/web",R=[{href:"/dashboard/endpoint",label:"Endpoint & Key",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/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/token-saver",label:"Token Saver",icon:"savings"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],z=[{href:"/dashboard/console-log",label:"Console Log",icon:"terminal"},{href:"/dashboard/translator",label:"Translator",icon:"translate"}],I=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"}];function F({onClose:e}){let t=(0,k.usePathname)(),[s,r]=(0,v.useState)(!1),[l,n]=(0,v.useState)(!1),[i,d]=(0,v.useState)(!1),[m,u]=(0,v.useState)(null),[p,h]=(0,v.useState)(!1),[b,f]=(0,v.useState)(!1),[g,y]=(0,v.useState)(0),[j,N]=(0,v.useState)(!1),{copied:M,copy:A}=(0,T.C)(2e3),E=C.h0.installCmdLatest;(0,v.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{e.enableTranslator&&N(!0)}).catch(()=>{})},[]),(0,v.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&u(e)}).catch(()=>{})},[]);let D=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e),U=async()=>{try{await navigator.clipboard.writeText(E)}catch{}A(E);let e=C.h0.shutdownCountdownSec;y(e);let t=setInterval(()=>{y(e-=1),e<=0&&(clearInterval(t),fetch("/api/version/shutdown",{method:"POST"}).catch(()=>{}),d(!0))},1e3)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("aside",{className:"flex w-72 flex-col border-r border-border-subtle bg-vibrancy backdrop-blur-xl transition-colors duration-300 min-h-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 px-6 pt-5 pb-2",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),(0,c.jsxs)("div",{className:"px-6 py-4 flex flex-col gap-2",children:[(0,c.jsxs)(w(),{href:"/dashboard",className:"flex items-center gap-3",children:[(0,c.jsx)("div",{className:"flex items-center justify-center size-9 rounded-[10px] bg-gradient-to-br from-brand-500 to-brand-700 shadow-[var(--shadow-warm)]",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-white text-[20px]",children:"hub"})}),(0,c.jsxs)("div",{className:"flex flex-col",children:[(0,c.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:C.vQ.name}),(0,c.jsxs)("span",{className:"text-xs text-text-muted",children:["v",C.vQ.version]})]})]}),m&&(0,c.jsxs)("div",{className:"flex flex-col gap-1.5 rounded p-1 -m-1",children:[(0,c.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",m.latestVersion]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("button",{onClick:()=>h(!0),className:"px-2 py-1 rounded bg-green-600 hover:bg-green-700 dark:bg-amber-500 dark:hover:bg-amber-600 text-white text-[11px] font-semibold transition-colors cursor-pointer",children:m.canAutoRestart?"Update & Restart":"Update now"}),(0,c.jsx)("button",{onClick:()=>A(m.installCommand||E),title:"Copy install command",className:"flex-1 text-left hover:opacity-80 transition-opacity cursor-pointer min-w-0",children:(0,c.jsx)("code",{className:"block text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono truncate",children:M?"✓ copied!":m.installCommand||E})})]})]})]}),(0,c.jsxs)("nav",{className:"flex-1 px-4 py-2 space-y-0.5 overflow-y-auto custom-scrollbar",children:[R.map(t=>(0,c.jsxs)(w(),{href:t.href,onClick:e,className:(0,x.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",D(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:(0,x.cn)("material-symbols-outlined text-[18px]",D(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,c.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href)),(0,c.jsxs)("div",{className:"pt-3 mt-2 space-y-0.5",children:[(0,c.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),(0,c.jsxs)("button",{onClick:()=>r(e=>!e),className:(0,x.cn)("w-full flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",t.startsWith("/dashboard/media-providers")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"perm_media"}),(0,c.jsx)("span",{className:"text-[13px] font-medium flex-1 text-left",children:"Media Providers"}),(0,c.jsx)("span",{className:"material-symbols-outlined text-[14px] transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"},children:"expand_more"})]}),s&&(0,c.jsxs)("div",{className:"pl-4",children:[S.rj.filter(e=>$.includes(e.id)).map(s=>(0,c.jsxs)(w(),{href:`/dashboard/media-providers/${s.id}`,onClick:e,className:(0,x.cn)("flex items-center gap-3 px-4 py-1 rounded-lg transition-all group",t.startsWith(`/dashboard/media-providers/${s.id}`)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:s.icon}),(0,c.jsx)("span",{className:"text-sm",children:s.label})]},s.id)),(0,c.jsxs)(w(),{href:P,onClick:e,className:(0,x.cn)("flex items-center gap-3 px-4 py-1 rounded-lg transition-all group",t.startsWith(P)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"travel_explore"}),(0,c.jsx)("span",{className:"text-sm",children:"Web Fetch & Search"})]},"web")]}),I.map(t=>(0,c.jsxs)(w(),{href:t.href,onClick:e,className:(0,x.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",D(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:(0,x.cn)("material-symbols-outlined text-[18px]",D(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,c.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href)),z.map(t=>"/dashboard/translator"!==t.href||j?(0,c.jsxs)(w(),{href:t.href,onClick:e,className:(0,x.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",D(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:(0,x.cn)("material-symbols-outlined text-[18px]",D(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,c.jsx)("span",{className:"text-[13px] font-medium",children:t.label})]},t.href):null),(0,c.jsxs)("button",{onClick:()=>n(!0),className:(0,x.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group w-full","text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[18px] group-hover:text-primary transition-colors",children:"computer"}),(0,c.jsx)("span",{className:"text-[13px] font-medium",children:"Remote"})]}),(0,c.jsxs)(w(),{href:"/dashboard/profile",onClick:e,className:(0,x.cn)("flex items-center gap-3 px-3 py-1 rounded-lg transition-all group",D("/dashboard/profile")?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"),children:[(0,c.jsx)("span",{className:(0,x.cn)("material-symbols-outlined text-[18px]",D("/dashboard/profile")?"fill-1":"group-hover:text-primary transition-colors"),children:"settings"}),(0,c.jsx)("span",{className:"text-[13px] font-medium",children:"Settings"})]})]})]})]}),(0,c.jsx)(L,{isOpen:l,onClose:()=>n(!1)}),(0,c.jsx)(o.u,{isOpen:p,onClose:()=>h(!1),onConfirm:()=>{h(!1),f(!0)},title:"Update VansRouter",message:`Show install command for v${m?.latestVersion||""}? You can copy it and shutdown to install manually.`,confirmText:"Show Command",cancelText:"Cancel",variant:"primary"}),(i||b)&&(0,c.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm p-6",children:b?(0,c.jsx)(O,{latestVersion:m?.latestVersion,installCmd:E,copied:M,onCopyAndShutdown:U,onCancel:()=>{f(!1),y(0)},countdown:g,isDisconnected:i}):(0,c.jsxs)("div",{className:"text-center p-8",children:[(0,c.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,c.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,c.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,c.jsx)(a.A,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}function O({latestVersion:e,installCmd:t,copied:s,onCopyAndShutdown:r,onCancel:l,countdown:n,isDisconnected:i}){let o=n>0;return(0,c.jsxs)("div",{className:"w-full max-w-lg rounded-xl bg-neutral-900/95 border border-white/10 p-6 text-white",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,c.jsx)("div",{className:"flex items-center justify-center size-11 rounded-full bg-amber-500/20 text-amber-400",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"content_copy"})}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("h2",{className:"text-lg font-semibold",children:["Update VansRouter",e?` to v${e}`:""]}),(0,c.jsx)("p",{className:"text-xs text-white/60",children:i?"Server stopped. Paste the command into a terminal to install.":o?`Command copied. Server will stop in ${n}s...`:"Click the button below to copy the install command and shutdown."})]})]}),(0,c.jsx)("p",{className:"text-sm text-white/80 mb-2",children:"Install command:"}),(0,c.jsx)("div",{className:"w-full px-3 py-2 rounded bg-white/5 mb-4",children:(0,c.jsx)("code",{className:"text-xs font-mono text-amber-400 break-all",children:t})}),(0,c.jsxs)("ol",{className:"text-xs text-white/70 space-y-1 list-decimal list-inside mb-4",children:[(0,c.jsxs)("li",{children:["Click ",(0,c.jsx)("strong",{children:"Copy & Shutdown"})," below."]}),(0,c.jsx)("li",{children:"Paste the command into your terminal and press Enter."}),(0,c.jsxs)("li",{children:["Run ",(0,c.jsx)("code",{className:"px-1 rounded bg-white/10 text-green-400",children:"vansrouter"})," again after install."]})]}),i?(0,c.jsx)(a.A,{variant:"secondary",fullWidth:!0,onClick:()=>globalThis.location.reload(),children:"Reload Page"}):(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(a.A,{variant:"secondary",onClick:l,disabled:o,children:"Cancel"}),(0,c.jsx)(a.A,{variant:"primary",fullWidth:!0,onClick:r,disabled:o,children:s?"✓ Copied — shutting down...":o?`Shutting down in ${n}s`:"Copy & Shutdown"})]})]})}var D=s(1704),U=s(6127);function _({icon:e,label:t,onClick:s,trailing:r,danger:a}){return(0,c.jsxs)("button",{type:"button",onClick:s,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${a?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,c.jsx)("span",{className:`material-symbols-outlined text-[20px] ${a?"":"text-text-muted"}`,children:e}),(0,c.jsx)("span",{className:"flex-1 text-left",children:t}),r&&(0,c.jsx)("span",{className:"text-base",children:r})]})}function q({onLogout:e}){let[t,s]=(0,v.useState)(!1),[r,a]=(0,v.useState)(!1),[l,n]=(0,v.useState)(!1),[i,d]=(0,v.useState)(!1),{toggleTheme:m,isDark:x}=(0,f.D)(),u=(0,v.useRef)(null),p=async()=>{d(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}d(!1),n(!1)};return(0,v.useEffect)(()=>{let e=e=>{u.current&&!u.current.contains(e.target)&&s(!1)};if(t)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"relative",ref:u,children:[(0,c.jsx)("button",{type:"button",onClick:()=>s(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu",children:(0,c.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),t&&(0,c.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,c.jsx)(_,{icon:"history",label:"Change Log",onClick:()=>{s(!1),a(!0)}}),(0,c.jsx)(_,{icon:x?"light_mode":"dark_mode",label:"Theme",onClick:()=>{m(),s(!1)}}),(0,c.jsx)(_,{icon:"power_settings_new",label:"Shutdown",danger:!0,onClick:()=>{s(!1),n(!0)}}),(0,c.jsx)(_,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{s(!1),e()}})]})]}),(0,c.jsx)(U.default,{isOpen:r,onClose:()=>a(!1)}),(0,c.jsx)(o.u,{isOpen:l,onClose:()=>n(!1),onConfirm:p,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:i})]})}var K=s(238),W=s(4104),B=s(8657);function Q(){let[e,t]=(0,v.useState)(!1),s=function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${K.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,K.QC)(t)}();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{type:"button",onClick:()=>t(!0),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Language","data-i18n-skip":"true",children:(0,c.jsx)("span",{className:"text-lg leading-none",children:W.h[s]||"\uD83C\uDF10"})}),(0,c.jsx)(B.A,{hideTrigger:!0,isOpen:e,onClose:()=>t(!1)})]})}function V({isOpen:e,onClose:t}){let[s,r]=(0,v.useState)({data:null,loading:!1,error:""}),a=(0,v.useRef)(null),l=(0,v.useRef)(!1);(0,v.useEffect)(()=>{e&&!l.current&&(l.current=!0,Promise.resolve().then(()=>{C.Nu.donateUrl?(r(e=>({...e,loading:!0,error:""})),fetch(C.Nu.donateUrl,{cache:"no-store"}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>r(t=>({...t,data:e,loading:!1}))).catch(e=>r(t=>({...t,error:e.message||"Failed to load",loading:!1})))):r({data:null,loading:!1,error:"Donate is not configured."})}))},[e]);let n=(0,v.useRef)(t);if((0,v.useEffect)(()=>{n.current=t}),(0,v.useEffect)(()=>{let t=e=>{a.current&&!a.current.contains(e.target)&&n.current()};if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,v.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&n.current()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),!e||"u"<typeof document)return null;let{data:i,loading:o,error:d}=s;return(0,M.createPortal)((0,c.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,c.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),(0,c.jsxs)("div",{ref:a,className:"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 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,c.jsxs)("h2",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-pink-500",children:"volunteer_activism"}),i?.title||"Support 9Router"]}),(0,c.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,c.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[o&&(0,c.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,c.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),d&&(0,c.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load donate info: ",d]}),!o&&!d&&i&&(0,c.jsxs)(c.Fragment,{children:[i.message&&(0,c.jsx)("p",{className:"text-text-muted text-sm mb-6 text-center",children:i.message}),(0,c.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:i.channels?.map(e=>(0,c.jsx)(H,{channel:e},e.id))})]})]})]})]}),document.body)}function H({channel:e}){let{label:t,description:s,icon:r,color:a,url:l,qr:n}=e,i=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-3",style:{backgroundColor:`${a}20`,color:a},children:(0,c.jsx)("span",{className:"material-symbols-outlined text-[26px]",children:r})}),(0,c.jsx)("div",{className:"font-semibold text-text-main mb-1",children:t}),s&&(0,c.jsx)("div",{className:"text-xs text-text-muted mb-3 text-center",children:s}),n&&(0,c.jsx)(m.default,{src:n,alt:`${t} QR`,className:"w-full max-w-[180px] aspect-square object-contain rounded-lg bg-white p-1",width:180,height:180,unoptimized:!0})]});return(0,c.jsxs)("div",{className:"flex flex-col items-center p-4 rounded-xl border border-black/10 dark:border-white/10 bg-surface/50 hover:border-pink-500/40 transition-colors",children:[i,l&&(0,c.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium text-white hover:opacity-90 transition-opacity",style:{backgroundColor:a},children:["Open",(0,c.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"})]})]})}var G=s(1389),X=s(264);function J({onMenuClick:e,showMenuButton:t=!0}){let s=(0,k.usePathname)(),[r,a]=(0,v.useState)(""),[l,n]=(0,v.useState)(""),[i,o]=(0,v.useState)(!1),{title:d,description:m,icon:x,breadcrumbs:u}=(0,v.useMemo)(()=>(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(t){let e=t[1],s=t[2],r=S.rj.find(t=>t.id===e),a=S.Q2[s];return{title:a?.name||s,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${e}`},{label:r?.label||e,href:`/dashboard/media-providers/${e}`},{label:a?.name||s,image:`/providers/${s}.webp`}]}}let s=e.match(/\/media-providers\/([^/]+)$/);if(s){let e=s[1],t=S.rj.find(t=>t.id===e);return{title:t?.label||e,description:`Manage your ${t?.label||e} providers`,icon:t?.icon||"perm_media",breadcrumbs:[]}}let r=e.match(/\/providers\/([^/]+)$/);if(r){let e=r[1],t=C.zN[e]||C.fg[e];if(t)return{title:t.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:t.name,image:`/providers/${t.id}.webp`}]}}return e.includes("/providers")&&!e.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:e.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:e.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:e.includes("/mitm")?{title:"MITM Proxy",description:"Intercept CLI tool traffic and route through 9Router",icon:"security",breadcrumbs:[]}:e.includes("/token-saver")?{title:"Token Saver",description:"Compress prompts and outputs to save tokens",icon:"savings",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:e.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:e.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use 9Router — no install needed",icon:"extension",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:e.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:e.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(s),[s]);(0,v.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/auth/status",{cache:"no-store"});if(!t.ok)return;let s=await t.json();e||(a(s?.displayName||s?.oidcName||s?.oidcEmail||""),n(s?.loginMethod||""))}catch{e||(a(""),n(""))}}(),()=>{e=!0}},[]);let p=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(e){console.error("Failed to logout:",e)}};return(0,c.jsxs)("header",{className:"shrink-0 flex items-center justify-between gap-3 px-4 lg:px-8 pt-3 pb-2 border-b border-border-subtle bg-surface/60 backdrop-blur-xl lg:bg-transparent lg:backdrop-blur-none z-20",children:[(0,c.jsx)("div",{className:"flex items-center gap-3 lg:hidden shrink-0",children:t&&(0,c.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,c.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,c.jsx)("div",{className:"flex flex-col min-w-0 flex-1",children:u.length>0?(0,c.jsx)("div",{className:"flex items-center gap-2",children:u.map((e,t)=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,c.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,c.jsx)(w(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,c.jsx)(D.A,{src:e.image,alt:e.label,size:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",fallbackText:e.label.slice(0,2).toUpperCase()}),(0,c.jsx)("h1",{className:"text-base lg:text-2xl font-semibold text-text-main tracking-tight truncate",children:(0,X.Tl)(e.label)})]})]},`${e.label}-${e.href||"current"}`))}):d?(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,c.jsx)("span",{className:"material-symbols-outlined text-primary text-xl lg:text-2xl",children:x}),(0,c.jsx)("h1",{className:"text-base lg:text-2xl font-semibold tracking-tight truncate",children:(0,X.Tl)(d)})]}),m&&(0,c.jsx)("p",{className:"hidden lg:block text-sm text-text-muted truncate",children:(0,X.Tl)(m)})]}):null}),(0,c.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[r&&"OIDC"===l&&(0,c.jsxs)("div",{className:"hidden sm:flex items-center max-w-[220px] px-3 py-1.5 rounded-full border border-border bg-surface/70 text-xs text-text-muted truncate",children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1.5 text-primary",children:"person"}),(0,c.jsx)("span",{className:"truncate",children:r}),(0,c.jsx)("span",{className:"ml-2 shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-primary",children:"OIDC"})]}),(0,c.jsx)(Z,{}),(0,c.jsxs)("button",{onClick:()=>o(!0),className:"flex items-center gap-1.5 px-3 h-8 rounded-lg border border-pink-500/30 bg-pink-500/10 text-pink-600 dark:text-pink-400 hover:bg-pink-500/20 transition-colors text-sm font-medium","aria-label":"Donate",children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"volunteer_activism"}),(0,c.jsx)("span",{className:"hidden sm:inline",children:"Donate"})]}),(0,c.jsx)(y,{}),(0,c.jsx)(Q,{}),(0,c.jsx)(q,{onLogout:p})]}),(0,c.jsx)(V,{isOpen:i,onClose:()=>o(!1)})]})}function Z(){let e=(0,G.C)(e=>e.visible),t=(0,G.C)(e=>e.query),s=(0,G.C)(e=>e.placeholder),r=(0,G.C)(e=>e.setQuery);return e?(0,c.jsxs)("div",{className:"relative w-[160px] sm:w-[220px]",children:[(0,c.jsx)("span",{className:"material-symbols-outlined absolute left-2 top-1/2 -translate-y-1/2 text-text-muted text-[16px] pointer-events-none",children:"search"}),(0,c.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value),placeholder:s,className:"w-full h-8 pl-7 pr-7 rounded-lg border border-border bg-surface/60 text-sm focus:outline-none focus:border-primary/50 transition-colors"}),t&&(0,c.jsx)("button",{type:"button",onClick:()=>r(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main p-0.5 rounded","aria-label":"Clear search",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}):null}let Y=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],ee=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],et=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function es(){return(0,c.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,c.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,c.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,c.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,c.jsx)("div",{className:"size-6 text-primary",children:(0,c.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,c.jsx)("path",{clipRule:"evenodd",d:"M12.08 24L4 19.25L9.96 8.75L18.04 13.5L18.04 4H29.96L29.96 13.5L38.04 8.75L44 19.25L35.92 24L44 28.75L38.04 39.25L29.96 34.5L29.96 44H18.04L18.04 34.5L9.96 39.25L4 28.75L12.08 24Z",fillRule:"evenodd"})})}),(0,c.jsx)("span",{className:"text-xl font-bold text-text-main",children:C.vQ.name})]}),(0,c.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,c.jsxs)("div",{className:"flex gap-4",children:[(0,c.jsx)("button",{type:"button",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,c.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,c.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,c.jsx)("button",{type:"button",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,c.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,c.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,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,c.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:Y.map(e=>(0,c.jsx)("li",{children:(0,c.jsx)(w(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,c.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:ee.map(e=>(0,c.jsx)("li",{children:(0,c.jsx)(w(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,c.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:et.map(e=>(0,c.jsx)("li",{children:(0,c.jsx)(w(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,c.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,c.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 2025 ",C.vQ.name," Inc. All rights reserved."]}),(0,c.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,c.jsx)(w(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,c.jsx)(w(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}let er=new Intl.NumberFormat,ea=e=>er.format(e||0);function el({stats:e}){let t;return(0,c.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 sm:gap-4",children:[(0,c.jsxs)(i.A,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,c.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,c.jsx)("span",{className:"truncate text-2xl font-bold",children:ea(e.totalRequests)})]}),(0,c.jsxs)(i.A,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,c.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,c.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:ea(e.totalPromptTokens)})]}),(0,c.jsxs)(i.A,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,c.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,c.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:ea(e.totalCompletionTokens)})]}),(0,c.jsxs)(i.A,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,c.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,c.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",(t=e.totalCost,`$${(t||0).toFixed(2)}`)]}),(0,c.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]})}let en=new Intl.NumberFormat,ei=e=>en.format(e||0),eo=e=>`$${(e||0).toFixed(2)}`;function ed(e){if(!e)return"Never";let t=Math.floor((Date.now()-new Date(e))/6e4);return t<1?"Just now":t<60?`${t}m ago`:t<1440?`${Math.floor(t/60)}h ago`:new Date(e).toLocaleDateString()}function ec({field:e,currentSort:t,currentOrder:s}){return t!==e?(0,c.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,c.jsx)("span",{className:"ml-1",children:"asc"===s?"↑":"↓"})}function em({item:e,viewMode:t,isSummary:s=!1}){return"tokens"===t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.promptTokens?"—":ei(e.promptTokens)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.completionTokens?"—":ei(e.completionTokens)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:ei(e.totalTokens)})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.inputCost?"—":eo(e.inputCost)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:s&&void 0===e.outputCost?"—":eo(e.outputCost)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:eo(e.totalCost||e.cost)})]})}function ex({title:e,columns:t,groupedData:s,tableType:r,sortBy:a,sortOrder:l,onToggleSort:n,viewMode:o,storageKey:d,renderDetailCells:m,renderSummaryCells:x,emptyMessage:u}){let[p,h]=(0,v.useState)(()=>{try{let e=localStorage.getItem(d);if(e)return new Set(JSON.parse(e))}catch{}return new Set}),b=(0,v.useCallback)(e=>{h(t=>{let s=new Set(t);s.has(e)?s.delete(e):s.add(e);try{localStorage.setItem(d,JSON.stringify([...s]))}catch(e){console.error(`Failed to save ${d}:`,e)}return s})},[d]),f=(0,v.useMemo)(()=>"tokens"===o?[{field:"promptTokens",label:"Input Tokens"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[o]),g=t.length+f.length;return(0,c.jsxs)(i.A,{className:"overflow-hidden",children:[(0,c.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,c.jsx)("h3",{className:"font-semibold",children:e})}),(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,c.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,c.jsxs)("tr",{children:[t.map(e=>(0,c.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===e.align?"text-right":""}`,onClick:()=>n(r,e.field),children:[e.label," ",(0,c.jsx)(ec,{field:e.field,currentSort:a,currentOrder:l})]},e.field)),f.map(e=>(0,c.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>n(r,e.field),children:[e.label," ",(0,c.jsx)(ec,{field:e.field,currentSort:a,currentOrder:l})]},e.field))]})}),(0,c.jsxs)("tbody",{className:"divide-y divide-border",children:[s.map(e=>(0,c.jsxs)(v.Fragment,{children:[(0,c.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>b(e.groupKey),children:[(0,c.jsx)("td",{className:"px-6 py-3",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${p.has(e.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,c.jsx)("span",{className:`font-medium transition-colors ${e.summary.pending>0?"text-primary":""}`,children:e.groupKey})]})}),x(e),(0,c.jsx)(em,{item:e.summary,viewMode:o,isSummary:!0})]}),p.has(e.groupKey)&&e.items.map(e=>(0,c.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(e),(0,c.jsx)(em,{item:e,viewMode:o})]},`detail-${e.key}`))]},e.groupKey)),0===s.length&&(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:g,className:"px-6 py-8 text-center text-text-muted",children:u})})]})]})})]})}var eu=s(3084),ep=s(1163);s(6195);let eh=[],eb=[],ef={padding:.2,duration:200},eg={provider:function({data:e}){let{label:t,color:s,imageUrl:r,textIcon:a,active:l}=e,[n,i]=(0,v.useState)(!1);return(0,c.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:l?s:"var(--color-border)",boxShadow:l?`0 0 16px ${s}40`:"none",minWidth:"150px"},children:[(0,c.jsx)(eu.h7,{type:"target",position:ep.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)(eu.h7,{type:"target",position:ep.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)(eu.h7,{type:"target",position:ep.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)(eu.h7,{type:"target",position:ep.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${s}15`},children:n?(0,c.jsx)("span",{className:"text-sm font-bold",style:{color:s},children:a}):(0,c.jsx)(m.default,{src:r,alt:t,className:"w-6 h-6 rounded-sm object-contain",width:24,height:24,onError:()=>i(!0),unoptimized:!0})}),(0,c.jsx)("span",{className:"text-base font-medium truncate",style:{color:l?s:"var(--color-text)"},children:t}),l&&(0,c.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,c.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:s}}),(0,c.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:s}})]})]})},router:function({data:e}){return(0,c.jsxs)("div",{className:"flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]",children:[(0,c.jsx)(eu.h7,{type:"source",position:ep.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)(eu.h7,{type:"source",position:ep.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)(eu.h7,{type:"source",position:ep.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)(eu.h7,{type:"source",position:ep.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,c.jsx)(m.default,{src:"/favicon.svg",alt:"VansAI",className:"w-6 h-6 mr-2",width:24,height:24}),(0,c.jsx)("span",{className:"text-sm font-bold text-primary",children:"VansAI"}),e.activeCount>0&&(0,c.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:e.activeCount})]})}};function ey({providers:e=eh,activeRequests:t=eb,lastProvider:s="",errorProvider:r=""}){let a=(0,v.useMemo)(()=>t.flatMap(e=>{let t=e.provider?.toLowerCase();return t?[t]:[]}).sort().join(","),[t]),l=s?.toLowerCase()||"",n=r?.toLowerCase()||"",i=(0,v.useMemo)(()=>new Set(a?a.split(","):[]),[a]),o=(0,v.useMemo)(()=>new Set(l?[l]:[]),[l]),d=(0,v.useMemo)(()=>new Set(n?[n]:[]),[n]),[m,x]=(0,v.useState)({}),[u,p]=(0,v.useState)(new Set),[h,b]=(0,v.useState)(0);(0,v.useEffect)(()=>{let e=Date.now();x(t=>{let s={...t};for(let t of i)s[t]||(s[t]=e);for(let e of Object.keys(s))i.has(e)||delete s[e];return s})},[i]),(0,v.useEffect)(()=>{if(0===i.size)return;let e=setInterval(()=>b(e=>e+1),1e3);return()=>clearInterval(e)},[i]),(0,v.useEffect)(()=>{let e=Date.now(),t=new Set;for(let s of i){let r=m[s];(!r||e-r<6e4)&&t.add(s)}p(t)},[i,h,m]);let{nodes:f,edges:g}=(0,v.useMemo)(()=>(function(e,t,s,r){let a=e.length,l=Math.max(320,204*a/(2*Math.PI)),n=Math.max(200,.55*l);if(0===a)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let i=[],o=[];return i.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:t.size},draggable:!1}),e.forEach((e,d)=>{var c,m;let x,u,p=(c=e.provider,S.Q2[c]||{color:"#6b7280",name:c}),h=t.has(e.provider?.toLowerCase()),b=!h&&s.has(e.provider?.toLowerCase()),f=!h&&r.has(e.provider?.toLowerCase()),g=`provider-${e.provider}`,y={label:(p.name!==e.provider?p.name:null)||e.nodeName||e.name||e.provider,color:p.color||"#6b7280",imageUrl:(m=e.provider,`/providers/${m}.webp`),textIcon:p.textIcon||(e.provider||"?").slice(0,2).toUpperCase(),active:h},j=-Math.PI/2+2*Math.PI*d/a,v=l*Math.cos(j),N=n*Math.sin(j);Math.abs(j+Math.PI/2)<Math.PI/4||Math.abs(j-3*Math.PI/2)<Math.PI/4?(x="top",u="bottom"):Math.abs(j-Math.PI/2)<Math.PI/4?(x="bottom",u="top"):v>0?(x="right",u="left"):(x="left",u="right"),i.push({id:g,type:"provider",position:{x:v-90,y:N-15},data:y,draggable:!1}),o.push({id:`e-${g}`,source:"router",sourceHandle:x,target:g,targetHandle:u,animated:h,style:(p.color,f?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:h?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:b?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:i,edges:o}})(e,u,o,d),[e,u,o,d]),y=(0,v.useMemo)(()=>e.map(e=>e.provider).sort().join(","),[e]),j=(0,v.useRef)(null),N=(0,v.useRef)(null),w=(0,v.useCallback)(e=>{j.current=e,setTimeout(()=>e.fitView(ef),50)},[]);return(0,v.useEffect)(()=>{let e=N.current;if(!e)return;let t=new ResizeObserver(()=>{j.current&&j.current.fitView(ef)});return t.observe(e),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{if(j.current){let e=setTimeout(()=>j.current.fitView(ef),50);return()=>clearTimeout(e)}},[f.length]),(0,c.jsx)("div",{ref:N,className:"h-[320px] w-full min-w-0 rounded-lg border border-border bg-bg-subtle/30 sm:h-[480px]",children:0===e.length?(0,c.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,c.jsx)(eu.Gc,{nodes:f,edges:g,nodeTypes:eg,fitView:!0,fitViewOptions:ef,minZoom:.1,maxZoom:2,onInit:w,proOptions:{hideAttribution:!0},panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:(0,c.jsx)(eu.H2,{showInteractive:!1,className:"react-flow-controls-custom"})},y)})}let ej=(0,r.default)(()=>s.e(5709).then(s.bind(s,5709)).then(e=>{let{AreaChart:t,Area:s,XAxis:r,YAxis:a,CartesianGrid:l,Tooltip:n,ResponsiveContainer:i}=e;function o({data:e,viewMode:d,fmtTokens:m,fmtCost:x}){return(0,c.jsx)(i,{width:"100%",height:220,children:(0,c.jsxs)(t,{data:e,margin:{top:4,right:8,left:0,bottom:0},children:[(0,c.jsxs)("defs",{children:[(0,c.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,c.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,c.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,c.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,c.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,c.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,c.jsx)(l,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,c.jsx)(r,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,c.jsx)(a,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===d?m:x,width:50}),(0,c.jsx)(n,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(e,t)=>"tokens"===t?[m(e),"Tokens"]:[x(e),"Cost"]}),"tokens"===d?(0,c.jsx)(s,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,c.jsx)(s,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})})}return o.displayName="RechartsChart",{default:o}}),{loadableGenerated:{webpack:()=>[5709]},ssr:!1,loading:()=>(0,c.jsx)("div",{className:"h-[220px] w-full rounded-lg border border-border bg-bg-subtle/30","aria-label":"Loading chart"})}),ev=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0),eN=e=>`$${(e||0).toFixed(4)}`;function ew({period:e="7d"}){let[t,s]=(0,v.useState)([]),[r,a]=(0,v.useState)(!0),[l,n]=(0,v.useState)("tokens"),o=(0,v.useRef)(null),d=(0,v.useCallback)(async()=>{a(!0);try{let t=await fetch(`/api/usage/chart?period=${e}`);if(t.ok){let e=await t.json();s(e)}}catch(e){console.error("Failed to fetch chart data:",e)}finally{a(!1)}},[e]);(0,v.useEffect)(()=>{o.current!==e&&(o.current=e,d())},[d,e]);let m=t.some(e=>e.tokens>0||e.cost>0);return(0,c.jsxs)(i.A,{className:"flex min-w-0 flex-col gap-3 p-3 sm:p-4",children:[(0,c.jsxs)("div",{className:"grid w-full grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:w-auto sm:self-start",children:[(0,c.jsx)("button",{type:"button",onClick:()=>n("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===l?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,c.jsx)("button",{type:"button",onClick:()=>n("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===l?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),r?(0,c.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):m?(0,c.jsx)(ej,{data:t,viewMode:l,fmtTokens:ev,fmtCost:eN}):(0,c.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}function ek(e){let t=S.Q2[e];return!t?.serviceKinds||t.serviceKinds.includes("llm")}let eC=(0,c.jsx)("div",{className:"grid min-w-0 grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 sm:gap-4",children:Array.from({length:4}).map((e,t)=>(0,c.jsx)("div",{className:"h-24 w-full animate-pulse rounded-lg border border-border bg-bg-subtle/50","aria-hidden":"true"},t))}),eS=(0,c.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-2 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",children:[(0,c.jsx)("div",{className:"h-[320px] w-full animate-pulse rounded-lg border border-border bg-bg-subtle/50 sm:h-[480px]","aria-hidden":"true"}),(0,c.jsx)("div",{className:"h-[320px] w-full animate-pulse rounded-lg border border-border bg-bg-subtle/50 sm:h-[480px]","aria-hidden":"true"})]}),eT=(0,c.jsx)("div",{className:"h-[220px] w-full animate-pulse rounded-lg border border-border bg-bg-subtle/50","aria-hidden":"true"}),eM=(0,c.jsx)("div",{className:"h-64 w-full animate-pulse rounded-lg border border-border bg-bg-subtle/50","aria-hidden":"true"});function eA({timestamp:e}){let t,[,s]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let e=setInterval(()=>s(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,c.jsx)(c.Fragment,{children:(t=Math.floor((Date.now()-new Date(e))/1e3))<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`})}let eE=[];function eL({requests:e=eE}){return(0,c.jsxs)(i.A,{className:"flex min-w-0 flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,c.jsx)("div",{className:"px-1 py-2 border-b border-border shrink-0",children:(0,c.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"})}),e.length?(0,c.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,c.jsxs)("table",{className:"w-full min-w-[300px] border-collapse text-xs",children:[(0,c.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,c.jsxs)("tr",{className:"border-b border-border",children:[(0,c.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2",children:(0,c.jsx)("span",{className:"sr-only",children:"Status"})}),(0,c.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,c.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,c.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,c.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let s=!e.status||"ok"===e.status||"success"===e.status;return(0,c.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,c.jsx)("td",{className:"py-1.5",children:(0,c.jsx)("span",{className:`block w-1.5 h-1.5 rounded-full ${s?"bg-success":"bg-error"}`,"aria-label":s?"Success":"Error"})}),(0,c.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[120px]",title:e.model,children:e.model}),(0,c.jsxs)("td",{className:"py-1.5 text-right whitespace-nowrap",children:[(0,c.jsxs)("span",{className:"text-primary",children:[ei(e.promptTokens),"↑"]})," ",(0,c.jsxs)("span",{className:"text-success",children:[ei(e.completionTokens),"↓"]})]}),(0,c.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,c.jsx)(eA,{timestamp:e.timestamp})})]},`${e.timestamp}-${e.model}-${t}`)})})]})}):(0,c.jsx)("div",{className:"flex-1 flex items-center justify-center text-text-muted text-sm",children:"No requests yet."})]})}function e$(e,t={},s,r){return 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 a=e[s],l=t[s];return("string"==typeof a&&(a=a.toLowerCase()),"string"==typeof l&&(l=l.toLowerCase()),a<l)?"asc"===r?-1:1:a>l?"asc"===r?1:-1:0})}function eP(e,t){if(!Array.isArray(e))return[];let s={};return e.forEach(e=>{let r=function(e,t){switch(t){case"rawModel":return e.rawModel||"Unknown Model";case"accountName":return e.accountName||`Account ${e.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return e.keyName||"Unknown Key";case"endpoint":return e.endpoint||"Unknown Endpoint";default:return e[t]||"Unknown"}}(e,t);s[r]||(s[r]={groupKey:r,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let a=s[r].summary;a.requests+=e.requests||0,a.promptTokens+=e.promptTokens||0,a.completionTokens+=e.completionTokens||0,a.totalTokens+=e.totalTokens||0,a.cost+=e.cost||0,a.inputCost+=e.inputCost||0,a.outputCost+=e.outputCost||0,a.pending+=e.pending||0,e.lastUsed&&(!a.lastUsed||new Date(e.lastUsed)>new Date(a.lastUsed))&&(a.lastUsed=e.lastUsed),s[r].items.push(e)}),Object.values(s)}let eR=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],ez=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"accountName",label:"Account"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],eI=[{field:"keyName",label:"API Key Name"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],eF=[{field:"endpoint",label:"Endpoint"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],eO=[{value:"model",label:"Usage by Model"},{value:"account",label:"Usage by Account"},{value:"apiKey",label:"Usage by API Key"},{value:"endpoint",label:"Usage by Endpoint"}],eD=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function eU({period:e,setPeriod:t,fetching:s}){return(0,c.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto sm:self-end",children:[(0,c.jsx)("div",{className:"grid flex-1 grid-cols-5 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:flex sm:flex-none",children:eD.map(r=>(0,c.jsx)("button",{type:"button",onClick:()=>t(r.value),disabled:s,className:`rounded-md px-3 py-1 text-sm font-medium transition-colors ${e===r.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-bg-hover hover:text-text"}`,children:r.label},r.value))}),s&&(0,c.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]})}function e_({period:e,setPeriod:t,hidePeriodSelector:s=!1}={}){let r=(0,k.useRouter)(),a=(0,k.useSearchParams)(),l=a.get("sortBy")||"rawModel",n=a.get("sortOrder")||"asc",[i,o]=(0,v.useState)(null),[d,m]=(0,v.useState)({loading:!0,fetching:!1}),x=d.loading,u=d.fetching,[p,b]=(0,v.useState)("model"),[f,g]=(0,v.useState)("costs"),[y,j]=(0,v.useState)([]),[N,w]=(0,v.useState)("today"),C=(0,v.useRef)(!0),T=(0,v.useRef)(!1),M=e??N;(0,v.useEffect)(()=>{let e=new AbortController;return Promise.all([fetch("/api/providers",{signal:e.signal}).then(e=>e.ok?e.json():null),fetch("/api/provider-nodes",{signal:e.signal}).then(e=>e.ok?e.json():null)]).then(([t,s])=>{if(e.signal.aborted)return;let r={};for(let e of s?.nodes||[])r[e.id]=e.name;let a=new Set;j([...(t?.connections||[]).reduce((e,t)=>(!1===t.isActive||!ek(t.provider)||a.has(t.provider)||(a.add(t.provider),e.push({...t,nodeName:r[t.provider]||null})),e),[]),...Object.values(S.IS).reduce((e,t)=>(t.noAuth&&!a.has(t.id)&&ek(t.id)&&e.push({provider:t.id,name:t.name}),e),[])])}).catch(()=>{}),()=>e.abort()},[]),(0,v.useEffect)(()=>{C.current?(C.current=!1,m({loading:!0,fetching:!1})):m({loading:!1,fetching:!0});let e=new AbortController;return fetch(`/api/usage/stats?period=${M}`,{signal:e.signal}).then(e=>e.ok?e.json():null).then(t=>{!e.signal.aborted&&t&&(T.current=!0,o(e=>({...e,...t})))}).catch(()=>{}).finally(()=>{e.signal.aborted||m({loading:!1,fetching:!1})}),()=>e.abort()},[M]),(0,v.useEffect)(()=>{let e=new EventSource("/api/usage/stream");return e.onmessage=e=>{try{let t=JSON.parse(e.data);o(e=>e?{...e,activeRequests:t.activeRequests,recentRequests:t.recentRequests,errorProvider:t.errorProvider,pending:t.pending}:e),T.current&&m(e=>({...e,loading:!1}))}catch(e){console.error("[SSE CLIENT] parse error:",e)}},e.onerror=()=>m(e=>({...e,loading:!1})),()=>e.close()},[]);let A=(0,v.useCallback)((e,t)=>{let s=new URLSearchParams(a.toString());s.get("sortBy")===t?s.set("sortOrder","asc"===s.get("sortOrder")?"desc":"asc"):(s.set("sortBy",t),s.set("sortOrder","asc")),r.replace(`?${s.toString()}`,{scroll:!1})},[a,r]),E=(0,v.useMemo)(()=>{if(!i)return null;switch(p){case"model":{let e=i.pending?.byModel||{};return{columns:eR,groupedData:eP(e$(i.byModel,e,l,n),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.summary.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,c.jsx)("td",{className:"px-6 py-3",children:(0,c.jsx)(h.A,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.lastUsed)})]})}}case"account":{let e={};return i?.pending?.byAccount&&Object.entries(i.byAccount||{}).forEach(([t,s])=>{let r=i.pending.byAccount[s.connectionId];if(r){let a=s.provider?`${s.rawModel} (${s.provider})`:s.rawModel;e[t]=r[a]||0}}),{columns:ez,groupedData:eP(e$(i.byAccount,e,l,n),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,c.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.summary.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.accountName||`Account ${e.connectionId?.slice(0,8)}...`}),(0,c.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,c.jsx)("td",{className:"px-6 py-3",children:(0,c.jsx)(h.A,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.lastUsed)})]})}}case"apiKey":return{columns:eI,groupedData:eP(e$(i.byApiKey,{},l,n),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,c.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.summary.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 font-medium",children:e.keyName}),(0,c.jsx)("td",{className:"px-6 py-3",children:e.rawModel}),(0,c.jsx)("td",{className:"px-6 py-3",children:(0,c.jsx)(h.A,{variant:"neutral",size:"sm",children:e.provider})}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.lastUsed)})]})};default:return{columns:eF,groupedData:eP(e$(i.byEndpoint,{},l,n),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,c.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.summary.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.summary.lastUsed)})]}),renderDetailCells:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:e.endpoint}),(0,c.jsx)("td",{className:"px-6 py-3",children:e.rawModel}),(0,c.jsx)("td",{className:"px-6 py-3",children:(0,c.jsx)(h.A,{variant:"neutral",size:"sm",children:e.provider})}),(0,c.jsx)("td",{className:"px-6 py-3 text-right",children:ei(e.requests)}),(0,c.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:ed(e.lastUsed)})]})}}},[i,p,l,n]);return i||x?(0,c.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[!s&&(0,c.jsx)(eU,{period:M,setPeriod:t??w,fetching:u}),x?eC:(0,c.jsx)(el,{stats:i}),x?eS:(0,c.jsxs)("div",{className:"grid min-w-0 grid-cols-1 items-stretch gap-2 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",children:[(0,c.jsx)(ey,{providers:y,activeRequests:i.activeRequests||[],lastProvider:i.recentRequests?.[0]?.provider||"",errorProvider:i.errorProvider||""}),(0,c.jsx)(eL,{requests:i.recentRequests||[]})]}),x?eT:(0,c.jsx)(ew,{period:M}),(0,c.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,c.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,c.jsx)("select",{value:p,onChange:e=>b(e.target.value),className:"w-full rounded-lg border border-border bg-surface px-3 py-1.5 text-sm font-medium text-text-main focus:outline-none focus:ring-2 focus:ring-primary/50 sm:w-auto",style:{colorScheme:"auto"},children:eO.map(e=>(0,c.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,c.jsxs)("div",{className:"grid grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:flex",children:[(0,c.jsx)("button",{type:"button",onClick:()=>g("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===f?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"}),(0,c.jsx)("button",{type:"button",onClick:()=>g("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===f?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"})]})]}),x?eM:E&&(0,c.jsx)(ex,{title:"",columns:E.columns,groupedData:E.groupedData,tableType:p,sortBy:l,sortOrder:n,onToggleSort:A,viewMode:f,storageKey:E.storageKey,renderSummaryCells:E.renderSummaryCells,renderDetailCells:E.renderDetailCells,emptyMessage:E.emptyMessage})]})]}):(0,c.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."})}function eq(){let[e,t]=(0,v.useState)(!1);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("button",{type:"button",onClick:()=>t(!0),className:"relative flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg transition-all text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5",title:"9Remote",children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"computer"}),(0,c.jsx)("span",{className:"text-xs font-medium",children:"Remote"})]}),(0,c.jsx)(L,{isOpen:e,onClose:()=>t(!1)})]})}function eK(){let[e,t]=(0,v.useState)([]),[s,r]=(0,v.useState)(!0),[a,l]=(0,v.useState)(!0);(0,v.useEffect)(()=>{n()},[]),(0,v.useEffect)(()=>{let e;return a&&(e=setInterval(()=>{n(!1)},3e3)),()=>clearInterval(e)},[a]);let n=async(e=!0)=>{e&&r(!0);try{let e=await fetch("/api/usage/request-logs");if(e.ok){let s=await e.json();t(s)}}catch(e){console.error("Failed to fetch logs:",e)}finally{e&&r(!1)}};return(0,c.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,c.jsx)("div",{className:"flex items-center gap-2",children:(0,c.jsxs)("span",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,c.jsx)("span",{children:"Auto Refresh (3s)"}),(0,c.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-label":"Auto Refresh (3s)",onClick:()=>l(!a),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${a?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,c.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${a?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,c.jsx)(i.A,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,c.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:s&&0===e.length?(0,c.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===e.length?(0,c.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,c.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,c.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,c.jsxs)("tr",{children:[(0,c.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,c.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,c.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,c.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,c.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,c.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,c.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,c.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let s=e.split(" | ");if(s.length<7)return null;let r=s[6],a=r.includes("PENDING"),l=r.includes("FAILED"),n=r.includes("OK");return(0,c.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${a?"bg-primary/5":""}`,children:[(0,c.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:s[0]}),(0,c.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:s[1]}),(0,c.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,c.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:s[2]})}),(0,c.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:s[3],children:s[3]}),(0,c.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:s[4]}),(0,c.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:s[5]}),(0,c.jsx)("td",{className:`px-3 py-1.5 font-bold ${n?"text-success":l?"text-error":"text-primary animate-pulse"}`,children:r})]},`${s[0]}-${s[1]}-${s[3]}`)})})]})})}),(0,c.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are loaded from the request history database."})]})}let eW={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"},eB=[];function eQ({options:e=eB,value:t,onChange:s,size:r="md",className:a}){return(0,c.jsx)("div",{className:(0,x.cn)("inline-flex items-center p-1 rounded-[10px] overflow-x-auto","bg-surface-2",a),children:e.map(e=>(0,c.jsxs)("button",{type:"button",onClick:()=>s(e.value),className:(0,x.cn)("shrink-0 px-4 rounded-[8px] font-medium transition-all",eW[r],t===e.value?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[e.icon&&(0,c.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:e.icon}),e.label]},e.value))})}var eV=s(8419),eH=s(4260),eG=s(5795);function eX({children:e}){let[t,s]=(0,v.useState)(!1),r=(0,k.usePathname)(),a=(0,eG.i)(e=>e.notifications),l=(0,eG.i)(e=>e.removeNotification);return(0,v.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key&&s(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,c.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,c.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:a.map(e=>{var t;let s="success"===(t=e.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===t?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===t?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,c.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${s.wrapper}`,children:(0,c.jsxs)("div",{className:"flex items-start gap-2",children:[(0,c.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:s.icon}),(0,c.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,c.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,c.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,c.jsx)("button",{type:"button",onClick:()=>l(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,c.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),t&&(0,c.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>s(!1),"aria-hidden":"true"}),(0,c.jsx)("div",{className:"hidden lg:flex",children:(0,c.jsx)(F,{})}),(0,c.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,c.jsx)(F,{onClose:()=>s(!1)})}),(0,c.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300 isolate",children:[(0,c.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none -z-10","aria-hidden":"true"}),(0,c.jsx)(J,{onMenuClick:()=>s(!0)},r),(0,c.jsx)("div",{className:`flex-1 overflow-y-auto custom-scrollbar ${"/dashboard/basic-chat"===r?"":"p-6 lg:p-10"} ${"/dashboard/basic-chat"===r?"flex flex-col overflow-hidden":""}`,children:(0,c.jsx)("div",{className:`${"/dashboard/basic-chat"===r?"flex-1 w-full h-full flex flex-col":"max-w-7xl mx-auto"}`,children:e})})]})]})}function eJ({children:e}){return(0,c.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,c.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,c.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,c.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,c.jsx)(y,{variant:"card"})}),(0,c.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})]})}let eZ=e=>(0,r.default)(e,{ssr:!1,loading:()=>null}),eY=eZ(()=>s.e(2884).then(s.bind(s,2884))),e0=eZ(()=>Promise.all([s.e(7236),s.e(5737),s.e(9078)]).then(s.bind(s,9078))),e1=eZ(()=>s.e(1409).then(s.bind(s,1409))),e2=eZ(()=>Promise.all([s.e(7236),s.e(5737),s.e(1049)]).then(s.bind(s,1049))),e5=eZ(()=>s.e(3124).then(s.bind(s,3124))),e3=eZ(()=>s.e(6474).then(s.bind(s,6474))),e4=eZ(()=>Promise.all([s.e(6474),s.e(3257)]).then(s.bind(s,3257))),e6=eZ(()=>s.e(5560).then(s.bind(s,5560))),e8=eZ(()=>s.e(6909).then(s.bind(s,9290))),e9=eZ(()=>s.e(9146).then(s.bind(s,9146))),e7=eZ(()=>s.e(3386).then(s.bind(s,3386))),te=eZ(()=>s.e(3657).then(s.bind(s,3657))),tt=eZ(()=>s.e(406).then(s.bind(s,406))),ts=eZ(()=>s.e(3245).then(s.bind(s,3245))),tr=eZ(()=>Promise.resolve().then(s.bind(s,6127))),ta=eZ(()=>s.e(1567).then(s.bind(s,1567)))},1389:(e,t,s)=>{s.d(t,{C:()=>r});let r=(0,s(4156).v)(e=>({query:"",placeholder:"",visible:!1,setQuery:t=>e({query:t}),register:(t="Search...")=>e({visible:!0,placeholder:t,query:""}),unregister:()=>e({visible:!1,placeholder:"",query:""})}))},1488:(e,t,s)=>{s.d(t,{A:()=>l});var r=s(5102),a=s(3916);function l({label:e,type:t="text",placeholder:s,value:n,onChange:i,error:o,hint:d,icon:c,disabled:m=!1,required:x=!1,className:u,inputClassName:p,...h}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",u),children:[e&&(0,r.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,x&&(0,r.jsx)("span",{className:"text-red-500 ml-1",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]",children:c})}),(0,r.jsx)("input",{type:t,placeholder:s,value:n,onChange:i,disabled:m,className:(0,a.cn)("w-full py-2.5 px-3 text-sm text-text-main bg-surface-2 rounded-[10px]","border border-transparent placeholder-text-muted/70","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",o&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",p),...h})]}),o&&(0,r.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),o]}),d&&!o&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:d})]})}},1577:(e,t,s)=>{s.d(t,{C:()=>a});var r=s(2030);function a(e=2e3){let[t,s]=(0,r.useState)(null),l=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{(async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}})(),s(r),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},1704:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(5102),a=s(2030),l=s(7837);function n({src:e,alt:t,size:s=32,className:i="",fallbackText:o="?",fallbackColor:d}){let[c,m]=(0,a.useState)(!1);return!e||c?(0,r.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${i}`.trim(),style:{width:s,height:s,color:d,fontSize:Math.max(10,Math.floor(.38*s))},children:o}):(0,r.jsx)(l.default,{src:e,alt:t,width:s,height:s,className:i,onError:()=>m(!0),unoptimized:!0})}},2252:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(5102),a=s(3916);let l={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"}};function n({checked:e=!1,onChange:t,label:s,description:i,disabled:o=!1,size:d="md",className:c,"aria-label":m,title:x}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",o&&"opacity-50 cursor-not-allowed",c),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":m||s||x||"Toggle",disabled:o,onClick:()=>{!o&&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-2 focus:ring-brand-500/30",e?"bg-brand-500":"bg-surface-3",l[d].track,o&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?l[d].translate:"translate-x-0.5",l[d].thumb,"mt-0.5")})}),(s||i)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[s&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:s}),i&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:i})]})]})}},2758:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(5102),a=s(3916);let l={none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"};function n({children:e,title:t,subtitle:s,icon:i,action:o,padding:d="md",hover:c=!1,elev:m=!1,className:x,...u}){return(0,r.jsxs)("div",{className:(0,a.cn)("bg-surface border border-border-subtle",m?"rounded-[14px] shadow-[var(--shadow-elev)]":"rounded-[14px] shadow-[var(--shadow-soft)]",c&&"hover:shadow-[var(--shadow-warm)] hover:border-brand-500/30 transition-all cursor-pointer",l[d],x),...u,children:[(t||o)&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,r.jsx)("div",{className:"p-2 rounded-[10px] bg-bg text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i})}),(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})]})]}),o]}),e]})}n.Section=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-4 rounded-[10px]","bg-bg border border-border-subtle",t),...s,children:e})},n.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-border-subtle last:border-b-0","hover:bg-surface-2/50",t),...s,children:e})},n.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-border-subtle last:border-b-0","hover:bg-surface-2/50 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 transition-opacity",children:t})]})}},3916:(e,t,s)=>{s.d(t,{cn:()=>r});function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},4104:(e,t,s)=>{s.d(t,{h:()=>r});let r={en:"\uD83C\uDDFA\uD83C\uDDF8",vi:"\uD83C\uDDFB\uD83C\uDDF3","zh-CN":"\uD83C\uDDE8\uD83C\uDDF3","zh-TW":"\uD83C\uDDF9\uD83C\uDDFC",ja:"\uD83C\uDDEF\uD83C\uDDF5","pt-BR":"\uD83C\uDDE7\uD83C\uDDF7","pt-PT":"\uD83C\uDDF5\uD83C\uDDF9",ko:"\uD83C\uDDF0\uD83C\uDDF7",es:"\uD83C\uDDEA\uD83C\uDDF8",de:"\uD83C\uDDE9\uD83C\uDDEA",fr:"\uD83C\uDDEB\uD83C\uDDF7",he:"\uD83C\uDDEE\uD83C\uDDF1",ar:"\uD83C\uDDF8\uD83C\uDDE6",ru:"\uD83C\uDDF7\uD83C\uDDFA",pl:"\uD83C\uDDF5\uD83C\uDDF1",cs:"\uD83C\uDDE8\uD83C\uDDFF",nl:"\uD83C\uDDF3\uD83C\uDDF1",tr:"\uD83C\uDDF9\uD83C\uDDF7",uk:"\uD83C\uDDFA\uD83C\uDDE6",tl:"\uD83C\uDDF5\uD83C\uDDED",id:"\uD83C\uDDEE\uD83C\uDDE9",th:"\uD83C\uDDF9\uD83C\uDDED",hi:"\uD83C\uDDEE\uD83C\uDDF3",bn:"\uD83C\uDDE7\uD83C\uDDE9",ur:"\uD83C\uDDF5\uD83C\uDDF0",ro:"\uD83C\uDDF7\uD83C\uDDF4",sv:"\uD83C\uDDF8\uD83C\uDDEA",it:"\uD83C\uDDEE\uD83C\uDDF9",el:"\uD83C\uDDEC\uD83C\uDDF7",hu:"\uD83C\uDDED\uD83C\uDDFA",fi:"\uD83C\uDDEB\uD83C\uDDEE",da:"\uD83C\uDDE9\uD83C\uDDF0",no:"\uD83C\uDDF3\uD83C\uDDF4"}},4260:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(5102),a=s(5223),l=s(8419);function n({caps:e,className:t="",colorOverride:s,size:i=16}){if(!e)return null;let o=Object.keys(a.bs).filter(t=>e[t]);return 0===o.length?null:(0,r.jsx)("span",{className:`inline-flex items-center gap-0.5 ${t}`,children:o.map(e=>(0,r.jsx)(l.A,{text:`${a.bs[e].label} — ${a.bs[e].desc}`,children:(0,r.jsx)("span",{className:`material-symbols-outlined leading-none cursor-help ${s||a.bs[e].color}`,style:{fontSize:`${i}px`},children:a.bs[e].icon})},e))})}},5795:(e,t,s)=>{s.d(t,{i:()=>l});var r=s(4156);let a=0,l=(0,r.v)((e,t)=>({notifications:[],addNotification:s=>{let r=++a,l={id:r,type:s.type||"info",message:s.message,title:s.title||null,duration:s.duration??5e3,dismissible:s.dismissible??!0,createdAt:Date.now()};return e(e=>({notifications:[...e.notifications,l]})),l.duration>0&&setTimeout(()=>t().removeNotification(r),l.duration),r},removeNotification:t=>{e(e=>({notifications:e.notifications.filter(e=>e.id!==t)}))},clearAll:()=>e({notifications:[]}),success:(e,s)=>t().addNotification({type:"success",message:e,title:s}),error:(e,s)=>t().addNotification({type:"error",message:e,title:s,duration:8e3}),warning:(e,s)=>t().addNotification({type:"warning",message:e,title:s}),info:(e,s)=>t().addNotification({type:"info",message:e,title:s})}))},6127:(e,t,s)=>{s.r(t),s.d(t,{default:()=>o});var r=s(5102),a=s(2030),l=s(9387),n=s(5383),i=s(1434);function o({isOpen:e,onClose:t}){let[d,c]=(0,a.useState)({html:"",loading:!1,error:""}),m=(0,a.useRef)(null),x=(0,a.useRef)(!1);(0,a.useEffect)(()=>{e&&!x.current&&(x.current=!0,c(e=>({...e,loading:!0,error:""})),fetch(i.Nu.changelogUrl).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(e=>c(t=>{var r;return{...t,html:(r=n.xI.parse(e),s(2807).sanitize(r,{FORBID_TAGS:["script","iframe","object","embed","form"],FORBID_ATTR:["onerror","onload","onclick"]})),loading:!1}})).catch(e=>c(t=>({...t,error:e.message||"Failed to load",loading:!1}))))},[e]);let u=(0,a.useRef)(t);if((0,a.useEffect)(()=>{u.current=t}),(0,a.useEffect)(()=>{let t=e=>{m.current&&!m.current.contains(e.target)&&u.current()};if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&u.current()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),!e||"u"<typeof document)return null;let{html:p,loading:h,error:b}=d;return(0,l.createPortal)((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:t,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:m,className:"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 max-w-3xl flex flex-col max-h-[85vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Change Log"}),(0,r.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsxs)("div",{className:"p-6 overflow-y-auto flex-1",children:[h&&(0,r.jsxs)("div",{className:"flex items-center justify-center py-10 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"progress_activity"}),"Loading..."]}),b&&(0,r.jsxs)("div",{className:"text-red-500 py-4",children:["Failed to load changelog: ",b]}),!h&&!b&&p&&(0,r.jsx)("div",{className:"changelog-body text-text-main",dangerouslySetInnerHTML:{__html:p}})]})]})]}),document.body)}n.xI.setOptions({gfm:!0,breaks:!0})},6860:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(5102),a=s(3916);let l=[];function n({label:e,options:t=l,value:s,onChange:i,placeholder:o="Select an option",error:d,hint:c,disabled:m=!1,required:x=!1,className:u,selectClassName:p,...h}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",u),children:[e&&(0,r.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,x&&(0,r.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:s,onChange:i,disabled:m,className:(0,a.cn)("w-full py-2.5 px-3 pr-10 text-sm text-text-main","bg-surface-2 border border-transparent rounded-[10px] appearance-none","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",d&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",p),...h,children:[(0,r.jsx)("option",{value:"",disabled:!0,children:o}),t.map(e=>(0,r.jsx)("option",{value:e.value,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",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),d&&(0,r.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),d]}),c&&!d&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:c})]})}},7056:(e,t,s)=>{s.d(t,{Ay:()=>c,CardSkeleton:()=>d,EA:()=>o,WL:()=>i,y$:()=>n});var r=s(5102),a=s(3916);let l={sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"};function n({size:e="md",className:t}){return(0,r.jsx)("span",{className:(0,a.cn)("material-symbols-outlined animate-spin text-brand-500",l[e],t),children:"progress_activity"})}function i({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)(n,{size:"xl"}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:e})]})}function o({className:e,...t}){return(0,r.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-[10px] bg-surface-2",e),...t})}function d(){return(0,r.jsxs)("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface shadow-[var(--shadow-soft)]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)(o,{className:"h-4 w-24"}),(0,r.jsx)(o,{className:"size-10 rounded-[10px]"})]}),(0,r.jsx)(o,{className:"h-8 w-16 mb-2"}),(0,r.jsx)(o,{className:"h-3 w-20"})]})}function c({type:e="spinner",...t}){switch(e){case"page":return(0,r.jsx)(i,{...t});case"skeleton":return(0,r.jsx)(o,{...t});case"card":return(0,r.jsx)(d,{...t});default:return(0,r.jsx)(n,{...t})}}},7665:(e,t,s)=>{s.d(t,{A:()=>d,u:()=>c});var r=s(5102),a=s(2030),l=s(3916),n=s(8140),i=s(8419);let o={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"};function d({isOpen:e,onClose:t,title:s,children:n,footer:c,size:m="md",closeOnOverlay:x=!0,showTrafficLights:u=!0,className:p}){let h=o[m]||o.md,b=(0,a.useRef)(t);return((0,a.useEffect)(()=>{b.current=t}),(0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&b.current()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[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/50 backdrop-blur-[2px] fade-in",onClick:x?t:void 0,"aria-hidden":"true"}),(0,r.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",h,p),children:[(s||u)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[u&&(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,r.jsx)(i.A,{text:"Close",position:"top",color:"#FF5F56",children:(0,r.jsx)("button",{type:"button",onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,r.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),s&&(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})]}),(0,r.jsx)("button",{type:"button",onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:n}),c&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:c})]})]}):null}function c({isOpen:e,onClose:t,onConfirm:s,title:a="Confirm",message:l,confirmText:i="Confirm",cancelText:o="Cancel",variant:m="danger",loading:x=!1}){return(0,r.jsx)(d,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.A,{variant:"ghost",onClick:t,disabled:x,children:o}),(0,r.jsx)(n.A,{variant:m,onClick:s,loading:x,children:i})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:l})})}},7955:(e,t,s)=>{s.d(t,{A:()=>i});var r=s(5102),a=s(3916);let l={default:"bg-surface-2 text-text-muted",primary:"bg-brand-500/10 text-brand-600 dark:text-brand-300",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:o=!1,icon:d,className:c}){return(0,r.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",l[t],n[s],c),children:[o&&(0,r.jsx)("span",{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-brand-500","default"===t&&"bg-gray-500")}),d&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:d}),e]})}},8140:(e,t,s)=>{s.d(t,{A:()=>i});var r=s(5102),a=s(3916);let l={primary:"bg-brand-500 hover:bg-brand-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",secondary:"bg-surface-2 hover:bg-surface-3 text-text-main border border-border disabled:opacity-50",outline:"border border-border text-text-main hover:bg-surface-2 hover:border-brand-500/40",ghost:"text-text-muted hover:bg-surface-2 hover:text-text-main",danger:"bg-red-500 hover:bg-red-600 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted",success:"bg-green-600 hover:bg-green-700 text-white shadow-sm disabled:bg-surface-3 disabled:text-text-muted"},n={sm:"h-7 px-3 text-xs rounded-[8px]",md:"h-9 px-4 text-sm rounded-[10px]",lg:"h-11 px-6 text-sm rounded-[10px]"};function i({children:e,variant:t="primary",size:s="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:x=!1,className:u,...p}){return(0,r.jsxs)("button",{type:"button",className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[s],x&&"w-full",u),disabled:c||m,...p,children:[m?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},8419:(e,t,s)=>{s.d(t,{A:()=>a});var r=s(5102);function a({text:e,children:t,position:s="top",color:l}){let n=l?"":"bg-gray-900";return(0,r.jsxs)("div",{className:"relative inline-flex group/tt",children:[t,(0,r.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[s]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${n} text-white opacity-0 group-hover/tt:opacity-100 transition-opacity duration-150 whitespace-normal`,style:l?{backgroundColor:l}:{},children:e})]})}},8657:(e,t,s)=>{s.d(t,{A:()=>d});var r=s(5102),a=s(2030),l=s(9387),n=s(238),i=s(264);let o=e=>({en:{name:"English",flag:"\uD83C\uDDFA\uD83C\uDDF8"},vi:{name:"Tiếng Việt",flag:"\uD83C\uDDFB\uD83C\uDDF3"},"zh-CN":{name:"简体中文",flag:"\uD83C\uDDE8\uD83C\uDDF3"},"zh-TW":{name:"繁體中文",flag:"\uD83C\uDDF9\uD83C\uDDFC"},ja:{name:"日本語",flag:"\uD83C\uDDEF\uD83C\uDDF5"},"pt-BR":{name:"Portugu\xeas (Brasil)",flag:"\uD83C\uDDE7\uD83C\uDDF7"},"pt-PT":{name:"Portugu\xeas (Portugal)",flag:"\uD83C\uDDF5\uD83C\uDDF9"},ko:{name:"한국어",flag:"\uD83C\uDDF0\uD83C\uDDF7"},es:{name:"Espa\xf1ol",flag:"\uD83C\uDDEA\uD83C\uDDF8"},de:{name:"Deutsch",flag:"\uD83C\uDDE9\uD83C\uDDEA"},fr:{name:"Fran\xe7ais",flag:"\uD83C\uDDEB\uD83C\uDDF7"},he:{name:"עברית",flag:"\uD83C\uDDEE\uD83C\uDDF1"},ar:{name:"العربية",flag:"\uD83C\uDDF8\uD83C\uDDE6"},ru:{name:"Русский",flag:"\uD83C\uDDF7\uD83C\uDDFA"},pl:{name:"Polski",flag:"\uD83C\uDDF5\uD83C\uDDF1"},cs:{name:"Čeština",flag:"\uD83C\uDDE8\uD83C\uDDFF"},nl:{name:"Nederlands",flag:"\uD83C\uDDF3\uD83C\uDDF1"},tr:{name:"T\xfcrk\xe7e",flag:"\uD83C\uDDF9\uD83C\uDDF7"},uk:{name:"Українська",flag:"\uD83C\uDDFA\uD83C\uDDE6"},tl:{name:"Tagalog",flag:"\uD83C\uDDF5\uD83C\uDDED"},id:{name:"Indonesia",flag:"\uD83C\uDDEE\uD83C\uDDE9"},th:{name:"ไทย",flag:"\uD83C\uDDF9\uD83C\uDDED"},hi:{name:"हिन्दी",flag:"\uD83C\uDDEE\uD83C\uDDF3"},bn:{name:"বাংলা",flag:"\uD83C\uDDE7\uD83C\uDDE9"},ur:{name:"اردو",flag:"\uD83C\uDDF5\uD83C\uDDF0"},ro:{name:"Rom\xe2nă",flag:"\uD83C\uDDF7\uD83C\uDDF4"},sv:{name:"Svenska",flag:"\uD83C\uDDF8\uD83C\uDDEA"},it:{name:"Italiano",flag:"\uD83C\uDDEE\uD83C\uDDF9"},el:{name:"Ελληνικά",flag:"\uD83C\uDDEC\uD83C\uDDF7"},hu:{name:"Magyar",flag:"\uD83C\uDDED\uD83C\uDDFA"},fi:{name:"Suomi",flag:"\uD83C\uDDEB\uD83C\uDDEE"},da:{name:"Dansk",flag:"\uD83C\uDDE9\uD83C\uDDF0"},no:{name:"Norsk",flag:"\uD83C\uDDF3\uD83C\uDDF4"}})[e]||{name:e,flag:"\uD83C\uDF10"};function d({className:e="",isOpen:t,onClose:s,hideTrigger:c=!1}){let[m,x]=(0,a.useState)(()=>(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${n.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,n.QC)(t)})()),[u,p]=(0,a.useState)(!1),[h,b]=(0,a.useState)(!1),f=(0,a.useRef)(null),g="boolean"==typeof t,y=g?t:h,j=(0,a.useCallback)(e=>{g?!e&&s&&s(m):b(e)},[g,s,m]),v=(0,a.useRef)(j);(0,a.useEffect)(()=>{v.current=j}),(0,a.useEffect)(()=>{function e(e){f.current&&!f.current.contains(e.target)&&v.current(!1)}if(y)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[y]),(0,a.useEffect)(()=>{if(!y)return;let e=e=>{"Escape"===e.key&&v.current(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[y]);let N=async e=>{if(e!==m&&!u){p(!0),j(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,i.wn)(),x(e)}catch(e){console.error("Failed to set locale:",e)}finally{p(!1)}}};return(0,r.jsxs)("div",{className:e,children:[!c&&(0,r.jsxs)("button",{type:"button",onClick:()=>j(!y),disabled:u,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"language"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:o(m).name}),(0,r.jsx)("span",{className:"text-lg",children:o(m).flag})]}),y&&(0,l.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-i18n-skip":"true",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:()=>j(!1),"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:f,className:"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 max-w-2xl flex flex-col max-h-[80vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-3 border-b border-black/5 dark:border-white/5",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Select Language"}),(0,r.jsx)("button",{type:"button",onClick:()=>j(!1),className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors","aria-label":"Close",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 overflow-y-auto flex-1",children:(0,r.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:n.YZ.map(e=>{let t=m===e,s=o(e);return(0,r.jsxs)("button",{type:"button",onClick:()=>N(e),disabled:u,className:`flex flex-col items-center justify-start gap-1 px-2 py-3 rounded-lg text-xs font-medium transition-colors w-full ${t?"bg-primary/15 text-primary ring-2 ring-primary":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"} ${u?"opacity-70 cursor-wait":""}`,title:s.name,children:[(0,r.jsx)("span",{className:"text-2xl",children:s.flag}),(0,r.jsx)("span",{className:"text-center leading-tight line-clamp-2 h-8 flex items-center",children:s.name}),t&&(0,r.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"})]},e)})})})]})]}),document.body)]})}},9526:(e,t,s)=>{s.d(t,{D:()=>o});var r=s(2030),a=s(3603);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}}}}]);
@@ -0,0 +1,10 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{1863:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})},3812:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var s=a(5102),l=a(3916),i=a(8140);function n({currentPage:e,pageSize:t,totalItems:a,onPageChange:r,onPageSizeChange:o,className:d}){let c=Math.ceil(a/t),m=a>0?(e-1)*t+1:0,p=Math.min(e*t,a),x=(()=>{let t=[],a=Math.max(1,e-2),s=Math.min(c,a+5-1);s-a+1<5&&(a=Math.max(1,s-5+1));for(let e=a;e<=s;e++)t.push(e);return t})();return(0,s.jsxs)("div",{className:(0,l.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",d),children:[a>0&&(0,s.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,s.jsx)("span",{className:"font-medium text-text-main",children:m})," to"," ",(0,s.jsx)("span",{className:"font-medium text-text-main",children:p})," of"," ",(0,s.jsx)("span",{className:"font-medium text-text-main",children:a})," results"]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[o&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,s.jsx)("select",{value:t,onChange:e=>o(Number(e.target.value)),className:(0,l.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]}),c>1&&(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(i.A,{variant:"outline",size:"sm",onClick:()=>r(e-1),disabled:1===e,className:"w-9 px-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),x[0]>1&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,{variant:"ghost",size:"sm",onClick:()=>r(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),x[0]>2&&(0,s.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),x.map(t=>(0,s.jsx)(i.A,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>r(t),className:(0,l.cn)("w-9 px-0",e===t?"inline-flex":"hidden sm:inline-flex"),children:t},t)),x[x.length-1]<c&&(0,s.jsxs)(s.Fragment,{children:[x[x.length-1]<c-1&&(0,s.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,s.jsx)(i.A,{variant:"ghost",size:"sm",onClick:()=>r(c),className:"w-9 px-0 hidden sm:inline-flex",children:c})]}),(0,s.jsx)(i.A,{variant:"outline",size:"sm",onClick:()=>r(e+1),disabled:e===c,className:"w-9 px-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}},5399:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>_});var s=a(5102),l=a(2030),i=a(3278),n=a(3885),r=a.n(n),o=a(7837),d=a(497),c=a(1038),m=a(5223),p=a(1577),x=a(5737),u=a(264);let h=new Map;async function f(e){if(!e?.url||!e?.type)return[];let t=h.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),a=await fetch(`/api/providers/suggested-models?${t}`);if(!a.ok)return[];let s=(await a.json()).data??[];return h.set(e.url,{data:s,expiresAt:Date.now()+6e5}),s}catch{return[]}}function g({customModels:e=[],modelAliases:t={},providerAlias:a,builtInModels:s=[],type:l="llm",includeLegacyAliases:i=!0}){let n=new Set(s.map(e=>e.id)),r=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==a)continue;let e=t?.kind||t?.type||"llm";if(l&&e!==l||n.has(t.id))continue;let s=`${a}/${t.id}`;r.has(s)||(r.add(s),o.push({id:t.id,name:t.name||t.id,fullModel:s,source:"custom",type:e}))}if(!i)return o;let d=`${a}/`;for(let[e,a]of Object.entries(t||{})){if("string"!=typeof a||!a.startsWith(d))continue;let t=a.slice(d.length);!t||n.has(t)||r.has(a)||(r.add(a),o.push({id:t,alias:e,fullModel:a,source:"legacyAlias",type:l||"llm"}))}return o}function y({model:e,fullModel:t,alias:a,copied:l,onCopy:i,testStatus:n,isCustom:r,isFree:o,onDeleteAlias:c,onTest:m,isTesting:p,onDisable:x,caps:u}){let h="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:h?{color:h}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,s.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:t}),(0,s.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,s.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,s.jsx)(d.CapacityBadges,{caps:u,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,s.jsx)("button",{onClick:()=>i(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:l===`model-${e.id}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:l===`model-${e.id}`?"Copied!":"Copy"})]}),r?(0,s.jsx)("button",{onClick:c,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):x?(0,s.jsx)("button",{onClick:x,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function b({modelId:e,fullModel:t,copied:a,onCopy:l,onDeleteAlias:i,onTest:n,testStatus:r,isTesting:o}){let d="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,s.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>l(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:n,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,s.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function v({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:a,customModels:i,copied:n,onCopy:r,onDeleteAlias:o,onAddCustomModel:c,onDeleteCustomModel:m,connections:p,isAnthropic:x}){let[u,h]=(0,l.useState)(""),[f,y]=(0,l.useState)(!1),[j,w]=(0,l.useState)(!1),[N,k]=(0,l.useState)(null),[C,S]=(0,l.useState)({}),A=async t=>{if(!N){k(t);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),s=await a.json();S(e=>({...e,[t]:s.ok?"ok":"error"}))}catch{S(e=>({...e,[t]:"error"}))}finally{k(null)}}},T=g({customModels:i,modelAliases:a,providerAlias:e,type:"llm"}),$=async()=>{if(!u.trim()||f)return;let e=u.trim();if(T.some(t=>t.id===e))return void alert("Model already exists for this provider.");y(!0);try{await c(e),h("")}catch(e){console.log("Error adding model:",e)}finally{y(!1)}},E=async()=>{if(j)return;let e=p.find(e=>!1!==e.isActive);if(e){w(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||"Failed to import models");let s=a.models||[];if(0===s.length)return void alert("No models returned from /models.");let l=0;for(let e of s){let t=e.id||e.name||e.model;t&&(T.some(e=>e.id===t)||(await c(t),l+=1))}0===l&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{w(!1)}}},I=p.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",x?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&$(),placeholder:x?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:$,disabled:!u.trim()||f,children:f?"Adding...":"Add"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"download",onClick:E,disabled:!I||j,children:j?"Importing...":"Import from /models"})]}),!I&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),T.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:T.map(({id:a,alias:l,source:i})=>(0,s.jsx)(b,{modelId:a,fullModel:`${t}/${a}`,copied:n,onCopy:r,onDeleteAlias:()=>"custom"===i?m(a):o(l),onTest:p.length>0?()=>A(a):void 0,testStatus:C[a],isTesting:N===a},`${i}-${e}/${a}`))})]})}var j=a(1863);function w({until:e}){let[t,a]=(0,l.useState)("");return((0,l.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);if(s<60)a(`${s}s`);else if(s<3600)a(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);a(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function N({connection:e,proxyPools:t,isOAuth:a,isFirst:i,isLast:n,onMoveUp:r,onMoveDown:o,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x,oneByOneStatus:u=null,autoPing:h=null}){let[f,g]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),v=(0,l.useRef)(null),k=new Map((t||[]).map(e=>[e.id,e])),C=e.providerSpecificData?.proxyPoolId||null,S=C?k.get(C):null,A=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,T=!!C||A,$=S?`Pool: ${S.name}`:C?`Pool: ${C} (inactive/missing)`:A?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",E="";if(S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=S?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);E=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{E=t}}let I=S?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";S?.isActive===!0?O="success":(C||A)&&(O="error"),(0,l.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},D=e.authType||(a?"oauth":"apikey"),_="oauth"===D,M="cookie"===D,z=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(_?"OAuth Account":M?"Cookie Account":"API Key"),U=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[B,R]=(0,l.useState)(!1),K=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,l.useEffect)(()=>{let t=()=>{R(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let a=K?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[K]);let L="unavailable"!==e.testStatus||B?e.testStatus:"active",F=()=>u?"queued"===u.state?"queued":"testing"===u.state?"testing":"success"===u.state?"success":"failed"===u.state?u.error?`failed: ${u.error}`:"failed":null:null;return(0,s.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,s.jsx)("button",{onClick:r,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:o,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:M?"cookie":_?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:z}),U&&(0,s.jsx)("p",{className:"text-xs text-text-muted truncate",children:U}),(0,s.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,s.jsx)(d.Badge,{variant:(0,j.g)(e.isActive,L),size:"sm",dot:!0,children:!1===e.isActive?"disabled":L||"Unknown"}),(0,s.jsx)(d.Badge,{variant:"default",size:"sm",children:_?"OAuth":M?"Cookie":"API Key"}),T&&(0,s.jsx)(d.Badge,{variant:O,size:"sm",children:"Proxy"}),B&&!1!==e.isActive&&(0,s.jsx)(w,{until:K}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),F()&&(0,s.jsx)(d.Badge,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:F()})]}),T&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:$,children:$}),E&&(0,s.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:E}),I&&(0,s.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:I,children:["no_proxy: ",I]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:v,children:[(0,s.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${T?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,s.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,s.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!C?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${C===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,s.jsx)(d.Tooltip,{text:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",children:(0,s.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,s.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(d.Toggle,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}let k=`name1|sk-key1
2
+ name2|sk-key2
3
+ sk-key-only-auto-named`;function C({cloudflareData:e,setCloudflareData:t}){return(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,s.jsx)(d.Input,{label:"Account ID",value:e.accountId,onChange:a=>t({...e,accountId:a.target.value}),placeholder:"abc123def456..."}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,s.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]})}function S({azureData:e,setAzureData:t}){return(0,s.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,s.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)(d.Input,{label:"Azure Endpoint",value:e.azureEndpoint,onChange:a=>t({...e,azureEndpoint:a.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,s.jsx)(d.Input,{label:"Deployment Name",value:e.deployment,onChange:a=>t({...e,deployment:a.target.value}),placeholder:"gpt-4"}),(0,s.jsx)(d.Input,{label:"API Version",value:e.apiVersion,onChange:a=>t({...e,apiVersion:a.target.value}),placeholder:"2024-10-01-preview"}),(0,s.jsx)(d.Input,{label:"Organization",value:e.organization,onChange:a=>t({...e,organization:a.target.value}),placeholder:"Organization ID"})]})]})}function A({isOpen:e,provider:t,providerName:a,isCompatible:i,isAnthropic:n,authType:r,authHint:o,website:m,proxyPools:p,error:x,onSave:u,onBulkDone:h,onClose:f}){let g="__none__",y="ollama-local"===t,b="cookie"===r,v="xai"===t&&!b,j=b?"Cookie Value":"API Key",w="azure"===t,N="cloudflare-ai"===t,T=c.Q2?.[t]?.regions||null,$=c.Q2?.[t]?.defaultRegion||T?.[0]?.id||"",[E,I]=(0,l.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:""}),[O,P]=(0,l.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[D,_]=(0,l.useState)({accountId:""}),[M,z]=(0,l.useState)($),[U,B]=(0,l.useState)(!1),[R,K]=(0,l.useState)(null),[L,F]=(0,l.useState)(!1),[J,W]=(0,l.useState)("single"),[q,V]=(0,l.useState)(""),[H,G]=(0,l.useState)(null),Q=()=>y&&E.ollamaHostUrl.trim()?{baseUrl:E.ollamaHostUrl.trim()}:w?{azureEndpoint:O.azureEndpoint,apiVersion:O.apiVersion,deployment:O.deployment,organization:O.organization}:N?{accountId:D.accountId}:T&&M?{region:M}:void 0,X=async()=>{B(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:E.apiKey,providerSpecificData:Q()})}),a=await e.json();K(a.valid?"success":"failed")}catch{K("failed")}finally{B(!1)}},Y=async()=>{if(t&&(y||E.apiKey)&&(y||E.name)&&(!i||E.defaultModel.trim())){F(!0);try{let e=!1;try{B(!0),K(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:E.apiKey,providerSpecificData:Q()})});e=!!(await a.json()).valid,K(e?"success":"failed")}catch{K("failed")}finally{B(!1)}await u({name:E.name||(y?"Ollama Local":""),apiKey:E.apiKey,defaultModel:i?E.defaultModel.trim():void 0,priority:E.priority,proxyPoolId:E.proxyPoolId===g?null:E.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:Q()})}finally{F(!1)}}},Z=async()=>{let e=q.split("\n").flatMap(e=>{let t=e.trim();return t?[t]:[]});if(!e.length)return;F(!0),G(null);let a=await Promise.all(e.map(async(e,a)=>{let s=e.split("|"),l=s.length>=2?s.slice(1).join("|").trim():s[0].trim(),i=s.length>=2?s[0].trim():"Key",n=`${i} ${a+1}`;try{let e=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:l,name:n,priority:1,testStatus:"unknown"})}),a=await e.json();return e.ok&&a.connection?.id&&fetch(`/api/providers/${a.connection.id}/test`,{method:"POST"}).catch(()=>{}),e.ok?"ok":"fail"}catch{return"fail"}})),s=a.filter(e=>"ok"===e).length,l=a.filter(e=>"fail"===e).length;F(!1),G({success:s,failed:l}),s>0&&h&&h()};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Add ${a||t} ${j}`,onClose:f,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{size:"sm",variant:"single"===J?"primary":"ghost",onClick:()=>{W("single"),G(null)},children:"Single"}),(0,s.jsx)(d.Button,{size:"sm",variant:"bulk"===J?"primary":"ghost",onClick:()=>{W("bulk"),G(null)},children:"Bulk Add"})]}),"bulk"===J&&(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,s.jsx)("code",{children:"name|apiKey"})," or just ",(0,s.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,s.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:k,value:q,onChange:e=>V(e.target.value),"aria-label":"Bulk API keys"}),H&&(0,s.jsxs)("div",{className:`text-sm font-medium ${H.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",H.success," added",H.failed>0?`, ✗ ${H.failed} failed`:""]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Z,fullWidth:!0,disabled:L||!q.trim(),children:L?"Adding...":"Add All Keys"}),(0,s.jsx)(d.Button,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===J&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Input,{label:"Name",value:E.name,onChange:e=>I({...E,name:e.target.value}),placeholder:y?"Ollama Local":"Production Key"}),y&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"Ollama Host URL",value:E.ollamaHostUrl,onChange:e=>I({...E,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:U||L,variant:"secondary",children:U?"Checking...":"Check"})})]}),!y&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:j,type:b?"text":"password",value:E.apiKey,onChange:e=>I({...E,apiKey:e.target.value}),placeholder:b?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:X,disabled:!E.apiKey||U||L,variant:"secondary",children:U?"Checking...":"Check"})})]}),v&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),b&&o&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:[o,m&&(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),T&&(0,s.jsx)(d.Select,{label:"Region",value:M,onChange:e=>z(e.target.value),options:T.map(e=>({value:e.id,label:e.label}))}),i&&(0,s.jsx)(d.Input,{label:"Default Model",value:E.defaultModel,onChange:e=>I({...E,defaultModel:e.target.value}),placeholder:n?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),y&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,s.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,s.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),R&&(0,s.jsx)(d.Badge,{variant:"success"===R?"success":"error",children:"success"===R?"Valid":"Invalid"}),x&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),i&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),N&&(0,s.jsx)(C,{cloudflareData:D,setCloudflareData:_}),w&&(0,s.jsx)(S,{azureData:O,setAzureData:P}),(0,s.jsx)(d.Input,{label:"Priority",type:"number",value:E.priority,onChange:e=>I({...E,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsx)(d.Select,{label:"Proxy Pool",value:E.proxyPoolId,onChange:e=>I({...E,proxyPoolId:e.target.value}),options:[{value:g,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:Y,fullWidth:!0,disabled:L||!y&&(!E.name||!E.apiKey)||i&&!E.defaultModel.trim()||w&&(!O.azureEndpoint||!O.deployment||!O.organization)||N&&!D.accountId,children:L?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:f,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}let T=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function $({isOpen:e,node:t,onSave:a,onClose:i,isAnthropic:n}){let[r,o]=(0,l.useState)(()=>({name:t?.name||"",prefix:t?.prefix||"",apiType:t?.apiType||"chat",baseUrl:t?.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})),[c,m]=(0,l.useState)(!1),[p,x]=(0,l.useState)(""),[u,h]=(0,l.useState)(""),[f,g]=(0,l.useState)(!1),[y,b]=(0,l.useState)(null),[v,j]=(0,l.useState)(t);t!==v&&(j(t),t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")}));let w=async()=>{if(r.name.trim()&&r.prefix.trim()&&r.baseUrl.trim()){m(!0);try{let e={name:r.name,prefix:r.prefix,baseUrl:r.baseUrl};n||(e.apiType=r.apiType),await a(e)}finally{m(!1)}}},N=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:r.baseUrl,apiKey:p,type:n?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,s.jsx)(d.Modal,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(d.Input,{label:"Name",value:r.name,onChange:e=>o({...r,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,s.jsx)(d.Input,{label:"Prefix",value:r.prefix,onChange:e=>o({...r,prefix:e.target.value}),placeholder:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(0,s.jsx)(d.Select,{label:"API Type",options:T,value:r.apiType,onChange:e=>o({...r,apiType:e.target.value})}),(0,s.jsx)(d.Input,{label:"Base URL",value:r.baseUrl,onChange:e=>o({...r,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Input,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>x(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(d.Button,{onClick:N,disabled:!p||f||!r.baseUrl.trim(),variant:"secondary",children:f?"Checking...":"Check"})})]}),(0,s.jsx)(d.Input,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),y&&(0,s.jsx)(d.Badge,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:w,fullWidth:!0,disabled:!r.name.trim()||!r.prefix.trim()||!r.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,s.jsx)(d.Button,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function E(e,t){switch(t.type){case"RESET":return{modelId:"",testStatus:null,testError:"",saving:!1};case"SET_MODEL":return{...e,modelId:t.value,testStatus:null,testError:""};case"TEST_START":return{...e,testStatus:"testing",testError:""};case"TEST_RESULT":return{...e,testStatus:t.ok?"ok":"error",testError:t.error||""};case"SAVE_START":return{...e,saving:!0};case"SAVE_DONE":return{...e,saving:!1};default:return e}}function I({isOpen:e,providerAlias:t,providerDisplayAlias:a,onSave:i,onClose:n}){let[r,o]=(0,l.useReducer)(E,{modelId:"",testStatus:null,testError:"",saving:!1}),{modelId:c,testStatus:m,testError:p,saving:x}=r,[u,h]=(0,l.useState)(!1);e&&!u?(h(!0),o({type:"RESET"})):!e&&u&&h(!1);let f=e=>{let a=`${t}/`;return e.startsWith(a)?e.slice(a.length):e},g=async()=>{let e=f(c.trim());if(e){o({type:"TEST_START"});try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),s=await a.json();o({type:"TEST_RESULT",ok:s.ok,error:s.error})}catch(e){o({type:"TEST_RESULT",ok:!1,error:e.message})}}},y=async()=>{let e=f(c.trim());if(e&&!x){o({type:"SAVE_START"});try{await i(e)}finally{o({type:"SAVE_DONE"})}}};return(0,s.jsx)(d.Modal,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"add-custom-model-id",className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{id:"add-custom-model-id",type:"text",value:c,onChange:e=>o({type:"SET_MODEL",value:e.target.value}),onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),(0,s.jsx)(d.Button,{variant:"secondary",icon:"science",loading:"testing"===m,onClick:g,disabled:!c.trim()||"testing"===m,children:"testing"===m?"Testing...":"Test"})]}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,s.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:f(c.trim())||"model-id"})]})]}),"ok"===m&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===m&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,s.jsx)("span",{children:p||"Model not reachable"})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(d.Button,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(d.Button,{onClick:y,fullWidth:!0,size:"sm",disabled:!c.trim()||x,children:x?"Adding...":"Add Model"})]})]})})}let O=`[
4
+ {
5
+ "accessToken": "eyJhbGc...",
6
+ "refreshToken": "rt_...",
7
+ "idToken": "eyJhbGc...",
8
+ "email": "user@example.com"
9
+ }
10
+ ]`;function P({isOpen:e,onClose:t,onSuccess:a}){let[i,n]=(0,l.useState)(""),[r,o]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[p,x]=(0,l.useState)(null),h=()=>{r||(n(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let s=i.trim();if(!s)return;try{t=JSON.parse(s)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let l=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!l||0===l.length)return void m((0,u.Tl)("No accounts found in input"));o(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:l})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof a&&a()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{o(!1)}},g=p?.results?.filter(e=>!e.ok)||[];return(0,s.jsx)(d.Modal,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,s.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:i,onChange:e=>n(e.target.value),disabled:r}),c&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),g.length>0&&(0,s.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,s.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(d.Button,{onClick:f,fullWidth:!0,disabled:r||!i.trim(),children:r?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,s.jsx)(d.Button,{onClick:h,variant:"ghost",fullWidth:!0,disabled:r,children:(0,u.Tl)("Close")})]})]})})}var D=a(3812);function _(){let e,t=(0,i.useParams)(),a=(0,i.useRouter)(),n=t.id,{getCaps:h}=(0,x.y)(),[b,j]=(0,l.useState)([]),[w,k]=(0,l.useState)(!0),[C,S]=(0,l.useState)(null),[T,E]=(0,l.useState)([]),[O,_]=(0,l.useState)(!1),[M,z]=(0,l.useState)(!1),[U,B]=(0,l.useState)(!1),[R,K]=(0,l.useState)(""),[L,F]=(0,l.useState)(!1),[J,W]=(0,l.useState)(!1),[q,V]=(0,l.useState)(!1),[H,G]=(0,l.useState)(!1),[Q,X]=(0,l.useState)(null),[Y,Z]=(0,l.useState)({}),[ee,et]=(0,l.useState)([]),[ea,es]=(0,l.useState)(!1),[el,ei]=(0,l.useState)({}),[en,er]=(0,l.useState)(""),[eo,ed]=(0,l.useState)(()=>new Set),[ec,em]=(0,l.useState)(!1),[ep,ex]=(0,l.useState)([]),[eu,eh]=(0,l.useState)("__none__"),[ef,eg]=(0,l.useState)(!1),[ey,eb]=(0,l.useState)(null),[ev,ej]=(0,l.useState)(""),[ew,eN]=(0,l.useState)("auto"),[ek,eC]=(0,l.useState)({enabled:!1,connections:{}}),[eS,eA]=(0,l.useState)([]),[eT,e$]=(0,l.useState)([]),[eE,eI]=(0,l.useState)([]),[eO,eP]=(0,l.useState)(null),[eD,e_]=(0,l.useState)(!1),[eM,ez]=(0,l.useState)(!1),[eU,eB]=(0,l.useState)(!1),[eR,eK]=(0,l.useState)(null),[eL,eF]=(0,l.useState)({}),[eJ,eW]=(0,l.useState)(null),eq=(0,l.useRef)(!1),[eV,eH]=(0,l.useState)(!1),[eG,eQ]=(0,l.useState)(1),{copied:eX,copy:eY}=(0,p.C)(),eZ="ag_risk_confirmed",e0=()=>{_(!0)},e1=()=>{"antigravity"===n&&"true"!==window.localStorage.getItem(eZ)?e_(!0):e8?e0():(K(""),B(!0))},e2=()=>{K(""),B(!0)},e5=()=>{e8?e1():e2()},e3=C?{id:C.id,name:C.name||("anthropic-compatible"===C.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===C.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===C.type?"AC":"OC",apiType:C.apiType,baseUrl:C.baseUrl,type:C.type}:c.zN[n]||c.fg[n]||c.IS[n]||c.nJ[n]||c.br[n],e4=e3?.authModes||[],e8=!!c.zN[n]||!!c.IS[n]||e4.includes("oauth"),e6=!!c.fg[n]||e4.includes("apikey"),e7=!!c.IS[n]?.noAuth,e9=(0,m.KC)(n),te=(0,c.wG)(n),tt=(0,c.mq)(n),ta=(0,c.gb)(n),ts=tt||ta,tl=!ts&&e8&&e6,ti="xai"===n?"Grok Build OAuth":"OAuth",tn="xai"===n?"xAI API Key":"API Key";c.Q2[n]?.thinkingConfig||c.s9.extended;let tr=ts?n:te,to=ts?C?.prefix||n:te,td=(0,l.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tr)}`,{cache:"no-store"}),t=await e.json();e.ok&&eI(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tr]),tc=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tr,ids:[e]})})).ok&&await td()}catch(e){console.log("Error disabling model:",e)}},tm=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tr)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await td()}catch(e){console.log("Error enabling model:",e)}},tp=async e=>{e.length&&eP({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eP(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tr,ids:e})})).ok&&await td()}catch(e){console.log("Error disabling all models:",e)}}})},tx=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tr)}`,{method:"DELETE"})).ok&&await td()}catch(e){console.log("Error enabling all models:",e)}},tu=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&Z(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),th=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&et(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,l.useEffect)(()=>{"kilocode"===n&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&e$(e.models)}).catch(()=>{})},[n]);let tf=(0,l.useCallback)(async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),l=await e.json(),i=await t.json(),r=await a.json(),o=s.ok?await s.json():{};if(e.ok){let e=(l.connections||[]).filter(e=>e.provider===n);j(e)}a.ok&&E(r.proxyPools||[]);let d=(o.providerStrategies||{})[n]||{};eb(d.fallbackStrategy||null),ej(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1");let c=(o.providerThinking||{})[n]||{};eN(c.mode||"auto");let m=o.claudeAutoPing||{};if(eC({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(i.nodes||[]).find(e=>e.id===n)||null;if(!e&&ts)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===n)||null))break}S(e)}}catch(e){console.log("Error fetching connections:",e)}finally{k(!1)}},[n,ts]),tg=async e=>{try{let t=await fetch(`/api/provider-nodes/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();t.ok&&(S(a.node),await tf(),V(!1))}catch(e){console.log("Error updating provider node:",e)}},ty=async(e,t)=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),s=(a.ok?await a.json():{}).providerStrategies||{},l={};e&&(l.fallbackStrategy=e),"round-robin"===e&&""!==t&&(l.stickyRoundRobinLimit=Number(t)||3);let i={...s};0===Object.keys(l).length?delete i[n]:i[n]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})})}catch(e){console.log("Error saving provider strategy:",e)}},tb=async e=>{eC(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({claudeAutoPing:e})})}catch(e){console.log("Error saving auto-ping config:",e)}};(0,l.useEffect)(()=>{tf(),tu(),th(),td()},[tf,tu,th,td]),(0,l.useEffect)(()=>{let e=(c.zN[n]||c.fg[n]||c.IS[n]||c.nJ[n])?.modelsFetcher;e&&f(e).then(eA)},[n]);let tv=async(e,t,a=te)=>{let s=`${a}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await tu();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tj=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tu()}catch(e){console.log("Error deleting alias:",e)}},tw=async(e,t="llm",a=tr)=>{try{let s=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:a,id:e,type:t})});if(s.ok)await th(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await s.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tN=async(e,t="llm",a=tr)=>{try{let s=new URLSearchParams({providerAlias:a,id:e,type:t});(await fetch(`/api/models/custom?${s}`,{method:"DELETE"})).ok&&(await th(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},tk=async()=>{if(eV)return;let e=b.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));eH(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),a=await t.json();if(!t.ok)return void alert(a.error||(0,u.Tl)("Failed to fetch models"));let s=a.models||[];if(0===s.length)return void alert((0,u.Tl)("No models returned"));let l=0;for(let e of s){let t=e.id||e.name;if(!t)continue;let a=t.replace(/^qoder\//,"");ee.some(e=>e.providerAlias===tr&&e.id===a&&"llm"===(e.kind||e.type||"llm"))||Object.values(Y).includes(`${tr}/${a}`)||(await tw(a,"llm",tr),l+=1)}0===l?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${l} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{eH(!1)}},tC=async()=>{if(eM||0===b.length)return;let e=Object.fromEntries(b.map(e=>[e.id,{state:"queued",error:null}]));eq.current=!1,ez(!0),eB(!1),eK(null),eF(e),eW({total:b.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,a=0;try{for(let e=0;e<b.length;e+=1){if(eq.current){eW({total:b.length,completed:e,passed:t,failed:a,stopped:!0});break}let s=b[e];eK(s.id),eF(e=>({...e,[s.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${s.id}/test`,{method:"POST"}),l=await e.json(),i=!!l.valid;i?t+=1:a+=1,eF(e=>({...e,[s.id]:{state:i?"success":"failed",error:i?null:l.error||null}}))}catch(e){a+=1,eF(t=>({...t,[s.id]:{state:"failed",error:e.message||"Test failed"}}))}eW({total:b.length,completed:e+1,passed:t,failed:a,stopped:!1}),e<b.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eK(null),ez(!1),eB(!1),eq.current=!1}},tS=async e=>{eP({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eP(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&j(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tA=()=>{let e=ep.length;0!==e&&eP({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eP(null);let e=0,t=[...ep];for(let a of t)try{(await fetch(`/api/providers/${a}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}j(e=>e.filter(e=>!t.includes(e.id))),ex([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},tT=()=>{tf(),_(!1)},t$=async e=>{K("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,...e})}),a=null;try{a=await t.json()}catch{a=null}if(t.ok){await tf(),B(!1);return}K(a?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),K("Failed to save connection")}},tE=async e=>{try{(await fetch(`/api/providers/${Q.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tf(),W(!1))}catch(e){console.log("Error updating connection:",e)}},tI=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&j(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("Error updating connection status:",e)}},tO=async(e,t)=>{let a=[...b];[a[e],a[t]]=[a[t],a[e]],j(a);try{await Promise.all([fetch(`/api/providers/${a[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${a[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tf()}},tP=b.filter(e=>ep.includes(e.id)),tD=b.length>0&&ep.length===b.length,t_=Math.min(Math.max(1,eG),Math.max(1,Math.ceil(b.length/10))),tM=(t_-1)*10,tz=b.slice(tM,tM+10);(0,l.useEffect)(()=>{let e=Math.max(1,Math.ceil(b.length/10));eQ(t=>t>e?e:t<1?1:t)},[b.length]),(0,l.useEffect)(()=>{eQ(1)},[n]);let tU=()=>{tD?ex([]):ex(b.map(e=>e.id))};(0,l.useEffect)(()=>{ex(e=>e.filter(e=>b.some(t=>t.id===e)))},[b]),(()=>{if(0===tP.length)return;let e=new Set(tP.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let a=T.find(e=>e.id===t);return a?.name}})();let tB=()=>{ef||G(!1)},tR=async e=>{eg(!0);try{let t=0;for(let{connectionId:a,proxyPoolId:s}of e)try{(await fetch(`/api/providers/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:s})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",a,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tf(),G(!1)}finally{eg(!1)}},tK=e=>tR(b.map(t=>({connectionId:t.id,proxyPoolId:e}))),tL=(0,s.jsxs)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:[b.length>1&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 text-xs text-text-muted",children:[(0,s.jsx)("input",{type:"checkbox",checked:tD,onChange:tU,className:"h-3.5 w-3.5 rounded border-border accent-primary"}),(0,s.jsx)("span",{children:ep.length>0?`${ep.length} selected`:"Select all"})]}),tz.map((e,t)=>{let a,l=tM+t;return(0,s.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,s.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,s.jsx)("input",{type:"checkbox",checked:(a=e.id,ep.includes(a)),onChange:()=>{var t;return t=e.id,void ex(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(N,{connection:e,proxyPools:T,isOAuth:e8,isFirst:0===l,isLast:l===b.length-1,onMoveUp:()=>tO(l,l-1),onMoveDown:()=>tO(l,l+1),onToggleActive:t=>tI(e.id,t),autoPing:"claude"===n&&"oauth"===e.authType?{on:!0===ek.connections[e.id],onToggle:t=>{var a;return a=e.id,void tb({...ek,connections:{...ek.connections,[a]:t}})}}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&j(a=>a.map(a=>a.id===e.id?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{X(e),W(!0)},onDelete:()=>tS(e.id),oneByOneStatus:eL[e.id]||null})})]},e.id)})]}),tF=T.filter(e=>!0===e.isActive),tJ=(0,s.jsx)(d.Modal,{isOpen:H,onClose:tB,title:`Apply Proxy (${b.length} connections)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("button",{onClick:()=>{let e=T.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tR(b.map((t,a)=>({connectionId:t.id,proxyPoolId:e[a%e.length].id})))},disabled:ef||0===tF.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,s.jsxs)("button",{onClick:()=>tK(null),disabled:ef,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,s.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),T.map(e=>(0,s.jsxs)("button",{onClick:()=>tK(e.id),disabled:ef||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,s.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),ef&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,s.jsx)(d.Button,{onClick:tB,variant:"ghost",fullWidth:!0,disabled:ef,children:"Cancel"})]})}),tW=async e=>{if(!eo.has(e)){ed(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tr}/${e}`})}),a=await t.json();ei(t=>({...t,[e]:a.ok?"ok":"error"})),er(a.ok?"":a.error||"Model not reachable")}catch{ei(t=>({...t,[e]:"error"})),er("Network error")}finally{ed(t=>{let a=new Set(t);return a.delete(e),a})}}};return w?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(d.CardSkeleton,{}),(0,s.jsx)(d.CardSkeleton,{})]}):e3?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)(r(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,s.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e3.color}15`},children:ea?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:e3.color},children:e3.textIcon||e3.id.slice(0,2).toUpperCase()}):(0,s.jsx)(o.default,{src:tt&&e3.apiType?"responses"===e3.apiType?"/providers/oai-r.webp":"/providers/oai-cc.webp":ta?"/providers/anthropic-m.webp":`/providers/${e3.id}.webp`,alt:e3.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>es(!0)})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e3.name}),(e3.notice?.apiKeyUrl||e3.notice?.signupUrl||e3.website)&&(0,s.jsxs)("a",{href:e3.notice?.apiKeyUrl||e3.notice?.signupUrl||e3.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e3.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,s.jsxs)("p",{className:"text-text-muted",children:[b.length," connection",1===b.length?"":"s"]})]})]})]}),e3.deprecated&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,s.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e3.deprecationNotice})]}),e3.notice?.text&&!e3.deprecated&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e3.notice.text}),e3.notice.apiKeyUrl&&(0,s.jsx)("a",{href:e3.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),ts&&C&&(0,s.jsx)(d.Card,{children:(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:ta?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[ta?"Messages API":"responses"===C.apiType?"Responses API":"Chat Completions"," \xb7 ",(C.baseUrl||"").replace(/\/$/,""),"/",ta?"messages":"responses"===C.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:()=>{K(""),B(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>V(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eP({title:"Delete Compatible Node",message:`Delete this ${ta?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eP(null);try{(await fetch(`/api/provider-nodes/${n}`,{method:"DELETE"})).ok&&a.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),e7?(0,s.jsx)(d.NoAuthProxyCard,{providerId:n}):(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[b.length>0&&T.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>G(!0),children:"Apply Proxy"}),b.length>1&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete_sweep",onClick:tA,disabled:0===ep.length,children:["Delete",ep.length>0?` (${ep.length})`:""]}),b.length>0&&(0,s.jsxs)(s.Fragment,{children:[ep.length>0&&(0,s.jsxs)(d.Button,{size:"sm",variant:"danger",icon:"delete",onClick:tA,children:["Delete Selected (",ep.length,")"]}),(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"sync",onClick:tC,disabled:eM,children:eM?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eM&&(0,s.jsx)(d.Button,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eM&&(eq.current=!0,eB(!0))},disabled:eU,children:eU?"Stopping...":"Stop"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(d.Toggle,{checked:"round-robin"===ey,onChange:e=>{let t=e?"round-robin":null,a=e?ev||"1":ev;e&&!ev&&ej("1"),eb(t),ty(t,a)}}),"round-robin"===ey&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:ev,onChange:e=>{var t;ej(t=e.target.value),ty("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===b.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e8?"lock":"key"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tl&&(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",ti," or ",tn,"."]})]})]}),(0,s.jsx)("div",{className:"flex gap-2",children:tl?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e1,children:ti}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:e2,children:tn})]}):(0,s.jsxs)(s.Fragment,{children:[!ts&&"iflow"===n&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>z(!0),children:"Cookie"}),"codex"===n&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>F(!0),children:(0,u.Tl)("Bulk Add")}),(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e5,children:ts?"Add API Key":"iflow"===n?"OAuth":"Add Connection"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[eJ&&(0,s.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{children:["Total: ",eJ.total]}),(0,s.jsxs)("span",{children:["Completed: ",eJ.completed]}),(0,s.jsxs)("span",{children:["Passed: ",eJ.passed]}),(0,s.jsxs)("span",{children:["Failed: ",eJ.failed]}),eJ.stopped&&(0,s.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eM&&eR&&(0,s.jsxs)("span",{children:["Running: ",b.find(e=>e.id===eR)?.name||eR]})]})}),b.length>0&&(0,s.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,s.jsx)("input",{type:"checkbox",checked:tD,onChange:tU,className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tL,b.length>10&&(0,s.jsx)(D.A,{currentPage:t_,pageSize:10,totalItems:b.length,onPageChange:eQ}),!ts&&(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===n&&(0,s.jsx)(d.Button,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>z(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===n&&(0,s.jsx)(d.Button,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>F(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tl?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Button,{size:"sm",icon:"lock",variant:"secondary",onClick:e1,className:"w-full sm:w-auto",children:ti}),(0,s.jsx)(d.Button,{size:"sm",icon:"key",onClick:e2,className:"w-full sm:w-auto",children:tn})]}):(0,s.jsx)(d.Button,{size:"sm",icon:"add",onClick:e5,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,s.jsxs)(d.Card,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!ts&&(e=[...e9,...eT.filter(e=>!e9.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eE.includes(e)),(0,s.jsxs)("div",{className:"flex gap-2",children:[eE.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tx,children:"Active All"}),e.length>0&&(0,s.jsx)(d.Button,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tp(e),children:"Disable All"})]}))]}),!!en&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:en}),(()=>{let e,t,a;if(ts)return(0,s.jsx)(v,{providerStorageAlias:tr,providerDisplayAlias:to,modelAliases:Y,customModels:ee,copied:eX,onCopy:eY,onSetAlias:tv,onDeleteAlias:tj,onAddCustomModel:e=>tw(e,"llm",tr),onDeleteCustomModel:e=>tN(e,"llm",tr),connections:b,isAnthropic:ta});let l=[...e9,...eT.filter(e=>!e9.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),i=new Set(eE),r=l.filter(e=>!i.has(e.id)),o=l.filter(e=>i.has(e.id)),d=g({customModels:ee,modelAliases:Y,providerAlias:tr,builtInModels:e9,type:"llm"});return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,s.jsx)(y,{model:{id:e.id,name:e.name},fullModel:`${to}/${e.id}`,alias:e.alias,copied:eX,onCopy:eY,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tN(e.id,"llm",tr):tj(e.alias)},testStatus:el[e.id],onTest:b.length>0||e7?()=>tW(e.id):void 0,isTesting:eo.has(e.id),isCustom:!0,isFree:!1,caps:h(`${n}/${e.id}`)},`${e.source}-${e.fullModel}`)),r.map(e=>{let t=`${tr}/${e.id}`,a=`${n}/${e.id}`,l=Object.entries(Y).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(y,{model:e,fullModel:`${to}/${e.id}`,alias:l,copied:eX,onCopy:eY,onSetAlias:t=>tv(e.id,t,tr),onDeleteAlias:()=>tj(l),testStatus:el[e.id],onTest:b.length>0||e7?()=>tW(e.id):void 0,isTesting:eo.has(e.id),isFree:e.isFree,onDisable:()=>tc(e.id),caps:h(`${n}/${e.id}`)},e.id)}),(0,s.jsxs)("button",{onClick:()=>em(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===n&&b.some(e=>!1!==e.isActive)&&(0,s.jsxs)("button",{onClick:tk,disabled:eV,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-blue-600 dark:text-blue-400 transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:eV?{animation:"spin 1s linear infinite"}:void 0,children:eV?"progress_activity":"download"}),eV?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eS.length>0&&(e=new Set([...Object.values(Y),...d.map(e=>e.fullModel)]),t=new Set(e9.map(e=>e.id)),0===(a=eS.filter(a=>!e.has(`${tr}/${a.id}`)&&!t.has(a.id))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>(0,s.jsxs)("button",{onClick:async()=>{await tw(e.id,"llm",tr)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,s.jsxs)("button",{onClick:()=>tm(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tJ,"kiro"===n?(0,s.jsx)(d.KiroOAuthWrapper,{isOpen:O,providerInfo:e3,onSuccess:tT,onClose:()=>_(!1)}):"cursor"===n?(0,s.jsx)(d.CursorAuthModal,{isOpen:O,onSuccess:tT,onClose:()=>_(!1)}):"gitlab"===n?(0,s.jsx)(d.GitLabAuthModal,{isOpen:O,providerInfo:e3,onSuccess:tT,onClose:()=>_(!1)}):(0,s.jsx)(d.OAuthModal,{isOpen:O,provider:n,providerInfo:e3,onSuccess:tT,onClose:()=>_(!1)}),"iflow"===n&&(0,s.jsx)(d.IFlowCookieModal,{isOpen:M,onSuccess:()=>{tf(),z(!1)},onClose:()=>z(!1)}),(0,s.jsx)(A,{isOpen:U,provider:n,providerName:e3.name,isCompatible:ts,isAnthropic:ta,authType:e3?.authType,authHint:e3?.authHint,website:e3?.website,proxyPools:T,error:R,onSave:t$,onBulkDone:tf,onClose:()=>{K(""),B(!1)}}),(0,s.jsx)(d.EditConnectionModal,{isOpen:J,connection:Q,proxyPools:T,onSave:tE,onClose:()=>W(!1)}),ts&&(0,s.jsx)($,{isOpen:q,node:C,onSave:tg,onClose:()=>V(!1),isAnthropic:ta}),!ts&&(0,s.jsx)(I,{isOpen:ec,providerAlias:tr,providerDisplayAlias:to,onSave:async e=>{await tw(e,"llm",tr),em(!1)},onClose:()=>em(!1)}),"codex"===n&&(0,s.jsx)(P,{isOpen:L,onClose:()=>F(!1),onSuccess:tf}),(0,s.jsx)(d.ConfirmModal,{isOpen:eD,onClose:()=>e_(!1),onConfirm:()=>{(window.localStorage.setItem(eZ,"true"),e_(!1),e8)?e0():e2()},title:"Risk Notice",message:e3?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,s.jsx)(d.ConfirmModal,{isOpen:!!eO,onClose:()=>eP(null),onConfirm:eO?.onConfirm,title:eO?.title||"Confirm",message:eO?.message,variant:"danger"})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(r(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},8810:(e,t,a)=>{Promise.resolve().then(a.bind(a,5399))}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,7236,5737,2147,3204,7358],()=>e(e.s=8810)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{3812:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(5102),l=s(3916),n=s(8140);function r({currentPage:e,pageSize:t,totalItems:s,onPageChange:i,onPageSizeChange:o,className:d}){let c=Math.ceil(s/t),x=s>0?(e-1)*t+1:0,m=Math.min(e*t,s),h=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(c,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",d),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:x})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:m})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[o&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>o(Number(e.target.value)),className:(0,l.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),c>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(n.A,{variant:"outline",size:"sm",onClick:()=>i(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),h[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.A,{variant:"ghost",size:"sm",onClick:()=>i(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),h[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),h.map(t=>(0,a.jsx)(n.A,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>i(t),className:(0,l.cn)("w-9 px-0",e===t?"inline-flex":"hidden sm:inline-flex"),children:t},t)),h[h.length-1]<c&&(0,a.jsxs)(a.Fragment,{children:[h[h.length-1]<c-1&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,a.jsx)(n.A,{variant:"ghost",size:"sm",onClick:()=>i(c),className:"w-9 px-0 hidden sm:inline-flex",children:c})]}),(0,a.jsx)(n.A,{variant:"outline",size:"sm",onClick:()=>i(e+1),disabled:e===c,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}},5085:(e,t,s)=>{Promise.resolve().then(s.bind(s,9153))},9153:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var a=s(5102),l=s(2030),n=s(3278),r=s(497),i=s(2758),o=s(8140),d=s(3916);let c={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};function x({isOpen:e,onClose:t,title:s,children:n,width:r="md",className:i}){let o=(0,l.useRef)(t);return((0,l.useEffect)(()=>{o.current=t}),(0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,l.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&o.current()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,d.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",c[r]||c.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:n})]})]}):null}var m=s(3812),h=s(1038);let u=null,p=null;async function f(){if(u&&p)return{providerNameCache:u,providerNodesCache:p};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(p={},t))p[e.id]=e.name;return{providerNameCache:u={...h.Q2,...p},providerNodesCache:p}}function b(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,h.zt)(e)||h.Q2[e];return a?.name||e}function j({title:e,children:t,defaultOpen:s=!1,icon:n=null}){let[r,i]=(0,l.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:n}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function g(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=e?.cached_tokens||e?.cache_read_input_tokens||0;return t<s?s:t}function v({filterProvider:e,setFilterProvider:t,filterStart:s,setFilterStart:l,filterEnd:n,setFilterEnd:r,providers:d,cn:c,handleApplyFilters:x,handleClearFilters:m}){return(0,a.jsx)(i.A,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:e,onChange:e=>t(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20 w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:s,onChange:e=>l(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:n,onChange:e=>r(e.target.value),className:c("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Actions"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.A,{onClick:x,className:"flex-1",children:"Search"}),(0,a.jsx)(o.A,{variant:"ghost",onClick:m,disabled:!e&&!s&&!n,className:"flex-1",children:"Clear"})]})]})]})})}function N({detail:e,index:t,handleViewDetail:s,providerNameCache:l}){return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:b(e.provider,l)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:g(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(o.A,{variant:"outline",size:"sm",onClick:()=>s(e),children:"Detail"})})]},`${e.id}-${t}`)}function w(){var e;let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(0),[o,c]=(0,l.useState)(0),[h,u]=(0,l.useState)(1),[p,w]=(0,l.useState)(20),[k,y]=(0,l.useState)(!1),[S,C]=(0,l.useState)(null),[A,P]=(0,l.useState)(!1),[T,D]=(0,l.useState)([]),[R,_]=(0,l.useState)(null),[E,L]=(0,l.useState)(""),[F,O]=(0,l.useState)(""),[z,q]=(0,l.useState)(""),[I,M]=(0,l.useState)(""),[$,K]=(0,l.useState)(""),[U,J]=(0,l.useState)(""),[Q,H]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>{let e=new Date;e.setDate(e.getDate()-7);let t=e.toISOString().slice(0,16);O(t),K(t),H(!0)},500);return()=>clearTimeout(e)},[]),(0,l.useEffect)(()=>{let e=new AbortController;return fetch("/api/usage/providers",{signal:e.signal}).then(e=>e.json()).then(async t=>{if(e.signal.aborted)return;D(t.providers||[]);let s=await f();e.signal.aborted||_(s.providerNameCache)}).catch(()=>{}),()=>e.abort()},[]),(0,l.useEffect)(()=>{if(!Q||!$)return;let e=new AbortController;y(!0);let t=new URLSearchParams({page:String(h),pageSize:String(p)});return I&&t.append("provider",I),t.append("startDate",$),U&&t.append("endDate",U),fetch(`/api/usage/request-details?${t}`,{signal:e.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(t=>{e.signal.aborted||(s(Array.isArray(t.details)?t.details:[]),r(t.pagination?.totalItems??0),c(t.pagination?.totalPages??0))}).catch(t=>{e.signal.aborted||console.error("request-details fetch failed:",t)}).finally(()=>{e.signal.aborted||y(!1)}),()=>e.abort()},[Q,h,p,I,$,U]);let V=e=>{C(e),P(!0),fetch(`/api/usage/request-details/${encodeURIComponent(e.id)}`).then(e=>e.ok?e.json():null).then(e=>{e?.detail&&C(e.detail)}).catch(()=>{})};return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(v,{filterProvider:E,setFilterProvider:L,filterStart:F,setFilterStart:O,filterEnd:z,setFilterEnd:q,providers:T,cn:d.cn,handleApplyFilters:()=>{u(1),M(E),K(F),J(z)},handleClearFilters:()=>{let e,t=((e=new Date).setDate(e.getDate()-7),e.toISOString().slice(0,16));L(""),O(t),q(""),u(1),M(""),K(t),J("")}}),(0,a.jsxs)(i.A,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:k||!Q?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===t.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):t.map((e,t)=>(0,a.jsx)(N,{detail:e,index:t,handleViewDetail:V,providerNameCache:R},t))})]})}),!k&&t.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(m.A,{currentPage:h,pageSize:p,totalItems:n,onPageChange:e=>u(e),onPageSizeChange:e=>{w(e),u(1)}})})]}),(0,a.jsx)(x,{isOpen:A,onClose:()=>P(!1),title:"Request Details",width:"lg",children:S&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:S.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(S.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:b(S.provider,R)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key Name:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:S.apiKeyName||"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"API Key:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.apiKeyName&&S.apiKey?(e=S.apiKey)?e.length>8?`${e.slice(0,8)}...`:e:"":"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,d.cn)("font-medium","success"===S.status?"text-green-600":"text-red-600"),children:S.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",S.latency?.ttft||0,"ms / Total ",S.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:g(S.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:S.tokens?.completion_tokens?.toLocaleString()||0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(j,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.request,null,2)})}),S.providerRequest&&(0,a.jsx)(j,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(S.providerRequest,null,2)})}),S.providerResponse&&(0,a.jsx)(j,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof S.providerResponse?JSON.stringify(S.providerResponse,null,2):S.providerResponse})}),(0,a.jsxs)(j,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[S.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:S.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:S.response?.content||"[No content]"})]})]})]})})]})}let k=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function y(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(S,{})})}function S(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),[s,i]=(0,l.useState)("today"),o=e.get("tab"),d=o&&["overview","logs","details"].includes(o)?o:"overview";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)(r.SegmentedControl,{options:[{value:"overview",label:"Overview"},{value:"details",label:"Details"}],value:d,onChange:s=>{if(s===d)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})},className:"w-full sm:w-auto"}),"overview"===d&&(0,a.jsx)(r.SegmentedControl,{options:k,value:s,onChange:i,size:"sm",className:"w-full sm:w-auto"})]}),"overview"===d&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(r.CardSkeleton,{}),children:(0,a.jsx)(r.UsageStats,{period:s,setPeriod:i,hidePeriodSelector:!0})}),"logs"===d&&(0,a.jsx)(r.RequestLogger,{}),"details"===d&&(0,a.jsx)(w,{})]})}}},e=>{e.O(0,[2554,7418,3885,9458,9814,4385,497,2147,3204,7358],()=>e(e.s=5085)),_N_E=e.O()}]);