@jheavenknows/bluerouter 5.3.67 → 5.3.69

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 (422) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +8 -8
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/ai-power-index/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/model-profiles/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cluster/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/local-ai-report/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/console/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +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/personal/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-topology/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  53. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  54. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  55. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  56. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  57. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  59. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  60. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  61. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  62. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  63. package/app/.next-cli-build/server/app/api/audit-proxy/ca/route.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/api/audit-proxy/route.js +7 -7
  65. package/app/.next-cli-build/server/app/api/audit-proxy/route.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/auth/view-mode/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/cli-model-profiles/cloud-models/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/cli-model-profiles/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/cluster/config/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/cluster/heartbeat/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/cluster/peers/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/cluster/snapshot/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/cluster/sync/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cluster/test/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/dashboard/ai-power-index/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/dashboard/analytics/ai-models/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/dashboard/analytics/analyze/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/dashboard/local-ai-report/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/dashboard/routing-topology/config/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/dashboard/routing-topology/live/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/dashboard/routing-topology/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/keys/[id]/caveman-test/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/oauth/grok-cli/device-code/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/oauth/grok-cli/poll/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/move/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/personal-cloud-providers/shares/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/personal-cloud-providers/visibility/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/pricing/catalog/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/provider-nodes/openai-compatible/manage/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/resource-monitor/[id]/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/resource-monitor/analyze/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/resource-monitor/history/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/resource-monitor/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/v1/images/generations/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/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  227. package/app/.next-cli-build/server/app/callback.html +1 -1
  228. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  229. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  230. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  231. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  232. package/app/.next-cli-build/server/app/dashboard/ai-power-index.html +1 -1
  233. package/app/.next-cli-build/server/app/dashboard/ai-power-index.rsc +6 -6
  234. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index/__PAGE__.segment.rsc +6 -6
  235. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_full.segment.rsc +6 -6
  236. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_tree.segment.rsc +1 -1
  237. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  238. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +9 -9
  239. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +9 -9
  240. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +9 -9
  241. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  243. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  244. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +7 -7
  245. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  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/model-profiles.html +1 -1
  248. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.rsc +7 -7
  249. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles/__PAGE__.segment.rsc +7 -7
  250. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_full.segment.rsc +7 -7
  251. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_tree.segment.rsc +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  253. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  254. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
  255. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  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/cluster.html +1 -1
  258. package/app/.next-cli-build/server/app/dashboard/cluster.rsc +6 -6
  259. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster/__PAGE__.segment.rsc +6 -6
  260. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_full.segment.rsc +6 -6
  261. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_tree.segment.rsc +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  263. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  264. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
  265. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  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 +7 -7
  269. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
  270. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  271. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/local-ai-report.html +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/local-ai-report.rsc +6 -6
  274. package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/!KGRhc2hib2FyZCk/dashboard/local-ai-report/__PAGE__.segment.rsc +6 -6
  275. package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/_full.segment.rsc +6 -6
  276. package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/_tree.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/logs.html +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/logs.rsc +6 -6
  279. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs/__PAGE__.segment.rsc +6 -6
  280. package/app/.next-cli-build/server/app/dashboard/logs.segments/_full.segment.rsc +6 -6
  281. package/app/.next-cli-build/server/app/dashboard/logs.segments/_tree.segment.rsc +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  284. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +7 -7
  285. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  286. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  289. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +7 -7
  290. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  291. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/personal.html +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/personal.rsc +7 -7
  294. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard/personal/__PAGE__.segment.rsc +7 -7
  295. package/app/.next-cli-build/server/app/dashboard/personal.segments/_full.segment.rsc +7 -7
  296. package/app/.next-cli-build/server/app/dashboard/personal.segments/_tree.segment.rsc +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  299. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
  300. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  301. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +6 -6
  304. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +6 -6
  305. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +6 -6
  306. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +6 -6
  309. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +6 -6
  310. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +6 -6
  311. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  314. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
  315. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  316. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/providers/stt.html +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/providers/stt.rsc +7 -7
  319. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers/stt/__PAGE__.segment.rsc +7 -7
  320. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_full.segment.rsc +7 -7
  321. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_tree.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/providers/tts.html +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/providers/tts.rsc +7 -7
  324. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers/tts/__PAGE__.segment.rsc +7 -7
  325. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_full.segment.rsc +7 -7
  326. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_tree.segment.rsc +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  329. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
  330. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  331. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  333. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  334. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
  335. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  336. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  339. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
  340. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  341. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/resource-monitor.html +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/resource-monitor.rsc +6 -6
  344. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor/__PAGE__.segment.rsc +6 -6
  345. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_full.segment.rsc +6 -6
  346. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_tree.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/routing-topology.html +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/routing-topology.rsc +6 -6
  349. package/app/.next-cli-build/server/app/dashboard/routing-topology.segments/!KGRhc2hib2FyZCk/dashboard/routing-topology/__PAGE__.segment.rsc +6 -6
  350. package/app/.next-cli-build/server/app/dashboard/routing-topology.segments/_full.segment.rsc +6 -6
  351. package/app/.next-cli-build/server/app/dashboard/routing-topology.segments/_tree.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  354. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
  355. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  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/skills.html +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  359. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +7 -7
  360. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  361. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  364. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  365. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  366. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  369. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +7 -7
  370. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  371. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  373. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  374. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
  375. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  376. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  378. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  379. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
  380. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  381. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  382. package/app/.next-cli-build/server/app/index.html +1 -1
  383. package/app/.next-cli-build/server/app/index.rsc +5 -5
  384. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  385. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  386. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  388. package/app/.next-cli-build/server/app/landing.html +1 -1
  389. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  390. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  391. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  392. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  393. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  394. package/app/.next-cli-build/server/app/login.html +1 -1
  395. package/app/.next-cli-build/server/app/login.rsc +6 -6
  396. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  397. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
  399. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  400. package/app/.next-cli-build/server/app-paths-manifest.json +8 -8
  401. package/app/.next-cli-build/server/chunks/3958.js +7 -7
  402. package/app/.next-cli-build/server/chunks/402.js +5 -2
  403. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  404. package/app/.next-cli-build/server/chunks/6328.js +1 -1
  405. package/app/.next-cli-build/server/chunks/6811.js +1 -1
  406. package/app/.next-cli-build/server/chunks/6992.js +1 -1
  407. package/app/.next-cli-build/server/chunks/7639.js +1 -1
  408. package/app/.next-cli-build/server/chunks/8640.js +6 -6
  409. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  410. package/app/.next-cli-build/server/pages/404.html +1 -1
  411. package/app/.next-cli-build/server/pages/500.html +1 -1
  412. package/app/.next-cli-build/static/chunks/{5263-5b4c74f04af4fa0d.js → 5263-489eb8a9d0eff86a.js} +1 -1
  413. package/app/.next-cli-build/static/chunks/5497-ba85afce54af9f8f.js +15 -0
  414. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.3.61-to-5.3.62-5.3.62-20260823-101004 → upgrade-5.3.66-to-5.3.67-5.3.67-20260823-124458}/data.sqlite +0 -0
  415. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.3.62-to-5.3.63-5.3.63-20260823-105132 → upgrade-5.3.66-to-5.3.67-5.3.67-20260823-124459}/data.sqlite +0 -0
  416. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.3.63-to-5.3.64-5.3.64-20260823-110953 → upgrade-5.3.67-to-5.3.68-5.3.68-20260823-125625}/data.sqlite +0 -0
  417. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite +0 -0
  418. package/app/package.json +1 -1
  419. package/package.json +1 -1
  420. package/app/.next-cli-build/static/chunks/5497-2dc4edc91d3952bc.js +0 -15
  421. /package/app/.next-cli-build/static/{WG3mGLsoLrg1NnPZ3XNsf → Vn8se_autf8L0-9JevHrZ}/_buildManifest.js +0 -0
  422. /package/app/.next-cli-build/static/{WG3mGLsoLrg1NnPZ3XNsf → Vn8se_autf8L0-9JevHrZ}/_ssgManifest.js +0 -0
@@ -7,9 +7,9 @@ exports.id=8640,exports.ids=[8640],exports.modules={267:(a,b,c)=>{"use strict";c
7
7
  `,title:a.internalName&&a.internalName!==b?`Internal: ${a.internalName}`:b,children:[e&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),(0,d.jsx)("span",{children:c})]},`${a.pickerSource||"combo"}-${a.id||b}`)})})]}),Object.entries(K).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 z-10 bg-white py-1 dark:bg-zinc-950",children:[(0,d.jsx)(h.A,{src:(0,j.mq)(a)||(0,j.gb)(a)?null:`/providers/${a}.png`,alt:b.name,size:14,fallbackText:(b.name||a).slice(0,2).toUpperCase(),fallbackColor:b.color}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=g===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>L(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
8
8
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
9
9
  ${c?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":b?"bg-primary text-white border-primary":r.includes(a.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
10
- `,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[r.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name]})},a.value)})})]},a)),0===Object.keys(K).length&&0===J.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})]})}):null}m.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,onDeselect:g().func,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object,kindFilter:g().string,addedModelValues:g().arrayOf(g().string),closeOnSelect:g().bool,personalOnly:g().bool,extraModels:g().arrayOf(g().string)}},83552:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,type:b="text",placeholder:c,value:g,onChange:h,error:i,hint:j,icon:k,disabled:l=!1,required:m=!1,className:n,inputClassName:o,...p}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",n),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,m&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[k&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:k})}),(0,d.jsx)("input",{type:b,placeholder:c,value:g,onChange:h,disabled:l,className:(0,e.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",k&&"pl-10",i&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",o),...p})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Select.js","default")},86209:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onMethodSelect:b,onClose:c}){let[f,g]=(0,e.useState)(null),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)("us-east-1"),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),x=a=>{g(a),q(null)},y=()=>{g(null),q(null)},z=async()=>{if(!n.trim())return void q("Please enter a refresh token");s(!0),q(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Import failed");b("import")}catch(a){q(a.message)}finally{s(!1)}},A=a=>{b("social",{provider:a})};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Kiro",onClose:c,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!f&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,d.jsx)(h.pd,{value:l,onChange:a=>m(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),p&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{j.trim()?b("idc",{startUrl:j.trim(),region:l}):q("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[t&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!t&&(0,d.jsxs)(d.Fragment,{children:[v&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!p&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:n,onChange:a=>o(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),p&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,disabled:r||!n.trim(),children:r?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onMethodSelect:g().func.isRequired,onClose:g().func.isRequired}},86739:(a,b,c)=>{"use strict";c.d(b,{default:()=>r});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(49885),j=c.n(i),k=c(3236),l=c(53845),m=c(20151),n=c(37365),o=c(12020),p=c(96919),q=c(99258);function r({onMenuClick:a,showMenuButton:b=!0}){let c=(0,f.usePathname)(),g=(0,f.useRouter)(),{displayName:i,loginMethod:j}=(0,m.s)(),{title:n,description:t,icon:u,breadcrumbs:v}=(0,e.useMemo)(()=>(a=>{if(!a)return{title:"",description:"",breadcrumbs:[]};let b=a.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(b){let a=b[1],c=b[2],d=p.rj.find(b=>b.id===a),e=p.Q2[c];return{title:e?.name||c,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${a}`},{label:d?.label||a,href:`/dashboard/media-providers/${a}`},{label:e?.name||c,image:`/providers/${c}.png`}]}}let c=a.match(/\/media-providers\/([^/]+)$/);if(c){let a=c[1],b=p.rj.find(b=>b.id===a);return{title:b?.label||a,description:`Manage your ${b?.label||a} providers`,icon:b?.icon||"perm_media",breadcrumbs:[]}}let d=a.match(/\/providers\/([^/]+)$/);if(d){let a=d[1],b=o.zN[a]||o.fg[a];if(b)return{title:b.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:b.name,image:`/providers/${b.id}.png`}]}}return a.includes("/providers")&&!a.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:a.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:a.includes("/token-saver")?{title:"Token Saver Analytics",description:"Theo d\xf5i hiệu quả RTK token saving theo source tool, provider, model v\xe0 filter",icon:"compress",breadcrumbs:[]}:a.includes("/analytics")?{title:"Analytics",description:"Thống k\xea request, token, API key, Source IP, provider, model v\xe0 lỗi vận h\xe0nh",icon:"monitoring",breadcrumbs:[]}:a.includes("/resource-monitor")?{title:"Linux Resources",description:"Realtime resource monitoring for remote Linux servers",icon:"monitor_heart",breadcrumbs:[]}:a.includes("/cluster")?{title:"Cluster Nodes",description:"Synchronize Master backups to Standby BlueRouter nodes",icon:"hub",breadcrumbs:[]}:a.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:a.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:a.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:a.includes("/mitm")?{title:"AI Traffic Proxy",description:"Intercept CLI tool traffic and route through this router gateway",icon:"security",breadcrumbs:[]}:a.includes("/prompt-logs")?{title:"Prompt Logs",description:"Search Copilot/MITM prompts across the prompt log database",icon:"manage_search",breadcrumbs:[]}:a.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:a.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:a.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use this Router — no install needed",icon:"extension",breadcrumbs:[]}:a.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:a.includes("/api-keys")?{title:"API Keys",description:"Manage API keys and model access",icon:"vpn_key",breadcrumbs:[]}:a.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:a.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:a.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===a?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(c),[c]),w=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(g.push("/login"),g.refresh())}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur",children:(0,d.jsxs)("div",{className:"flex min-h-[72px] items-center justify-between gap-4 px-4 md:px-6",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[b?(0,d.jsx)("button",{type:"button",onClick:a,className:"rounded-xl border border-border p-2 text-text-muted hover:bg-surface hover:text-text-main lg:hidden","aria-label":"Open menu",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})}):null,(0,d.jsx)("div",{className:"min-w-0",children:v.length>0?(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-sm text-text-muted",children:v.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[b>0?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"}):null,a.href?(0,d.jsx)(h(),{href:a.href,className:"hover:text-primary",children:(0,q.Tl)(a.label)}):(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.image?(0,d.jsx)("img",{src:a.image,alt:"",className:"h-5 w-5 rounded"}):null,(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:(0,q.Tl)(a.label)})]})]},`${a.label}-${b}`))}):n?(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[u?(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:u}):null,(0,d.jsx)("h1",{className:"truncate text-xl font-semibold text-text-main",children:(0,q.Tl)(n)})]}),t?(0,d.jsx)("p",{className:"mt-1 truncate text-sm text-text-muted",children:(0,q.Tl)(t)}):null]}):null})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,d.jsx)(s,{}),i&&"OIDC"===j?(0,d.jsxs)("div",{className:"hidden items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-text-muted md:flex",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"person"}),(0,d.jsx)("span",{children:i}),(0,d.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:"OIDC"})]}):null,(0,d.jsx)(l.default,{}),(0,d.jsx)(k.default,{onLogout:w})]})]})})}function s(){let a=(0,n.C)(a=>a.visible),b=(0,n.C)(a=>a.query),c=(0,n.C)(a=>a.placeholder),e=(0,n.C)(a=>a.setQuery);return a?(0,d.jsxs)("div",{className:"relative hidden w-72 md:block",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[18px] text-text-muted",children:"search"}),(0,d.jsx)("input",{value:b,onChange:a=>e(a.target.value),placeholder:c,className:"h-9 w-full rounded-lg border border-border bg-surface/60 pl-8 pr-8 text-sm text-text-main outline-none transition-colors placeholder:text-text-muted focus:border-primary/50"}),b?(0,d.jsx)("button",{type:"button",onClick:()=>e(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:text-text-main","aria-label":"Clear search",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})}):null]}):null}r.propTypes={onMenuClick:j().func,showMenuButton:j().bool}},87226:(a,b,c)=>{"use strict";c.d(b,{default:()=>ao});var d=c(48249),e=c(67484),f=c(19099),g=c(96919),h=c(20151),i=c(75171),j=c(17660),k=c(2116),l=c.n(k),m=c(49885),n=c.n(m);let o=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},p=a=>new Intl.NumberFormat().format(o(a)),q=a=>`$${o(a).toFixed(2)}`,r=(a,b)=>{let c=o(b);return c<=0?0:Math.round(o(a)/c*100)};function s({label:a,dotClass:b,requests:c,promptTokens:e,completionTokens:f,cost:g,showCost:h}){return(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${b}`}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:a})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(o(e)+o(f)),h&&(0,d.jsx)("span",{className:"ml-1.5 text-warning",children:q(g)}),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[p(c)," req"]})]})]})}s.propTypes={label:n().string.isRequired,dotClass:n().string.isRequired,requests:n().number,promptTokens:n().number,completionTokens:n().number,cost:n().number,showCost:n().bool};let t=[{name:"Anthropic (Claude)",dot:"bg-warning",mode:"Thủ c\xf4ng",modeNote:"BlueRouter chỉ \xe1p dụng cache write 5 ph\xfat",write:"1,25x gi\xe1 input",read:"0,1x gi\xe1 input",ttl:"5 ph\xfat; TTL d\xe0i hơn vẫn d\xf9ng c\xf9ng mức gi\xe1",fields:"cache_creation_input_tokens + cache_read_input_tokens",note:"Kh\xf4ng lưu cache 1 giờ. Mọi cache creation được t\xednh bằng rate 5 ph\xfat của model."},{name:"OpenAI",dot:"bg-success",mode:"Tự động",modeNote:"d\xf9ng Standard / short-context rate",write:"GPT-5.6 theo cache-write rate; model kh\xe1c fallback về input",read:"Theo cached rate của từng model",ttl:"Kh\xf4ng t\xe1ch TTL trong BlueRouter",fields:"prompt_tokens_details.cached_tokens + cache creation fields khi c\xf3",note:"Request tr\xean 272K hoặc cache d\xe0i hơn vẫn d\xf9ng đ\xfang rate short-context/cache 5 ph\xfat đ\xe3 cấu h\xecnh."},{name:"Google Gemini",dot:"bg-primary",mode:"Hai chế độ",modeNote:"implicit tự động, explicit do người d\xf9ng tạo",write:"Miễn ph\xed (implicit) / ph\xed lưu trữ theo giờ (explicit)",read:"giảm gi\xe1 đ\xe1ng kể so với input",ttl:"Implicit ngắn hạn; explicit theo TTL tự đặt",fields:"cachedContentTokenCount",note:"Explicit caching t\xednh tiền theo thời gian lưu, kh\xe1c hẳn m\xf4 h\xecnh của Anthropic v\xe0 OpenAI."},{name:"Local (vLLM, llama.cpp, Ollama)",dot:"bg-text-muted",mode:"Tự động",modeNote:"prefix caching / KV cache reuse",write:"Miễn ph\xed",read:"Miễn ph\xed — chỉ tiết kiệm compute v\xe0 giảm TTFT",ttl:"Tuỳ cấu h\xecnh v\xe0 dung lượng KV cache",fields:"Thường kh\xf4ng t\xe1ch ri\xeang trong usage",note:"Tiết kiệm thời gian chứ kh\xf4ng tiết kiệm tiền, v\xe0 phần lớn gộp v\xe0o “New input” ở tr\xean."}];function u(){let[a,b]=(0,e.useState)(!1);return(0,d.jsxs)(j.default,{className:"min-w-0 px-4 py-3",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>b(a=>!a),className:"flex w-full min-w-0 items-center justify-between gap-2 text-left",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"help"}),(0,d.jsx)("span",{className:"truncate text-sm font-semibold uppercase text-text-muted",children:"Cache read / creation hoạt động thế n\xe0o"})]}),(0,d.jsx)("span",{className:`material-symbols-outlined shrink-0 text-[20px] text-text-muted transition-transform duration-200 ${a?"rotate-180":""}`,children:"expand_more"})]}),a&&(0,d.jsxs)("div",{className:"mt-3 flex min-w-0 flex-col gap-3 border-t border-border-subtle pt-3",children:[(0,d.jsxs)("p",{className:"text-xs leading-relaxed text-text-muted",children:[(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache creation"})," l\xe0 lần đầu một đoạn context được lưu lại. ",(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache read"})," l\xe0 những lần sau t\xe1i sử dụng đoạn đ\xf3 thay v\xec xử l\xfd lại. Cơ chế v\xe0 c\xe1ch t\xednh tiền kh\xe1c nhau tuỳ provider — gi\xe1 dưới đ\xe2y l\xe0 bội số so với gi\xe1 input thường của ch\xednh model đ\xf3."]}),(0,d.jsx)("div",{className:"grid min-w-0 grid-cols-1 gap-2 xl:grid-cols-2",children:t.map(a=>(0,d.jsxs)("div",{className:"min-w-0 rounded-[10px] bg-bg px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${a.dot}`}),(0,d.jsx)("span",{className:"truncate text-xs font-semibold",children:a.name})]}),(0,d.jsx)("span",{className:"shrink-0 rounded-full bg-surface px-2 py-0.5 text-[10px] text-text-muted",children:a.mode})]}),(0,d.jsxs)("dl",{className:"mt-2 flex min-w-0 flex-col gap-1 text-[11px]",children:[(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Ghi cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium",children:a.write})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Đọc cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium text-success",children:a.read})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Thời hạn"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.ttl})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"K\xedch hoạt"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.modeNote})]})]}),(0,d.jsx)("p",{className:"mt-1.5 border-t border-border-subtle pt-1.5 text-[10px] leading-relaxed text-text-muted",children:a.note}),(0,d.jsx)("p",{className:"mt-1 font-mono text-[9px] leading-relaxed text-text-muted opacity-70",children:a.fields})]},a.name))}),(0,d.jsx)("p",{className:"text-[10px] leading-relaxed text-text-muted",children:"Gi\xe1 v\xe0 thời hạn do provider c\xf4ng bố v\xe0 c\xf3 thể thay đổi — h\xe3y đối chiếu bảng gi\xe1 ch\xednh thức trước khi d\xf9ng cho mục đ\xedch t\xednh chi ph\xed."})]})]})}function v({stats:a}){let{isAdmin:b}=(0,h.s)(),c=o(a.totalPromptTokens),e=o(a.totalCachedInputTokens),f=o(a.totalCacheCreationInputTokens),g=null!=a.totalNewInputTokens?o(a.totalNewInputTokens):Math.max(0,c-e-f),i=a.cloudVsLocal||{},k=i.cloud||{},m=i.local||{},n=i.unknown||{},t=o(k.requests)>0||o(m.requests)>0||o(n.requests)>0,w=o(k.promptTokens)+o(k.completionTokens),x=o(m.promptTokens)+o(m.completionTokens),y=o(n.promptTokens)+o(n.completionTokens),z=w+x+y,A=r(w,z),B=r(x,z),C=Math.max(0,100-A-B);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:gap-4",children:[(0,d.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,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold",children:p(a.totalRequests)})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:p(c)}),c>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[r(e,c),"% cached"]})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:p(a.totalCompletionTokens)})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[b?(0,d.jsxs)(l(),{href:"/dashboard/settings/pricing",className:"group flex min-w-0 items-center gap-1 text-text-muted text-sm uppercase font-semibold transition-colors hover:text-primary",title:"Chỉnh bảng gi\xe1 d\xf9ng để t\xednh cost",children:[(0,d.jsx)("span",{className:"truncate",children:"Est. Cost"}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px] opacity-0 transition-opacity group-hover:opacity-100",children:"edit"})]}):(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",q(a.totalCost)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 lg:grid-cols-2 sm:gap-4",children:[(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Input Token Breakdown"}),c>0&&(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-primary",style:{width:`${r(g,c)}%`}}),(0,d.jsx)("div",{className:"bg-success",style:{width:`${r(e,c)}%`}}),(0,d.jsx)("div",{className:"bg-warning",style:{width:`${r(f,c)}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-primary"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"New input"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(g),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(g,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-success"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cached read"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(e),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(e,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-warning"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cache creation"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(f),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(f,c),"%"]})]})]})]})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Cloud vs Local"}),t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-warning",style:{width:`${A}%`}}),(0,d.jsx)("div",{className:"bg-primary",style:{width:`${B}%`}}),y>0&&(0,d.jsx)("div",{className:"bg-text-muted",style:{width:`${C}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsx)(s,{label:"Cloud / External",dotClass:"bg-warning",requests:o(k.requests),promptTokens:o(k.promptTokens),completionTokens:o(k.completionTokens),cost:o(k.cost),showCost:!0}),(0,d.jsx)(s,{label:"Local / Self-hosted",dotClass:"bg-primary",requests:o(m.requests),promptTokens:o(m.promptTokens),completionTokens:o(m.completionTokens),cost:o(m.cost),showCost:o(m.cost)>0}),o(n.requests)>0&&(0,d.jsx)(s,{label:"Unknown / chưa ph\xe2n loại",dotClass:"bg-text-muted",requests:o(n.requests),promptTokens:o(n.promptTokens),completionTokens:o(n.completionTokens),cost:o(n.cost),showCost:o(n.cost)>0})]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Ph\xe2n loại theo Deployment của provider. OpenAI/Anthropic Compatible chỉ l\xe0 protocol v\xe0 c\xf3 thể l\xe0 Local hoặc Cloud."})]}):(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No usage in this period."})]})]}),(0,d.jsx)(u,{})]})}v.propTypes={stats:n().object.isRequired};let w=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},x=a=>new Intl.NumberFormat().format(w(a)),y=a=>`$${w(a).toFixed(2)}`;function z(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function A({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function B({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":x(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":x(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:x(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":y(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":y(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:y(a.totalCost||a.cost)})]})}function C({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:h,onToggleSort:i,viewMode:k,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[p,q]=(0,e.useState)(new Set),r=(0,e.useCallback)(a=>{q(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),s=(0,e.useMemo)(()=>"tokens"===k?[{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"}],[k]),t=b.length+s.length;return(0,d.jsxs)(j.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(A,{field:a.field,currentSort:g,currentOrder:h})]},a.field)),s.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(A,{field:a.field,currentSort:g,currentOrder:h})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>r(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${p.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(B,{item:a.summary,viewMode:k,isSummary:!0})]}),p.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(B,{item:a,viewMode:k})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:t,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}A.propTypes={field:n().string.isRequired,currentSort:n().string.isRequired,currentOrder:n().string.isRequired},B.propTypes={item:n().object.isRequired,viewMode:n().string.isRequired,isSummary:n().bool},C.propTypes={title:n().string.isRequired,columns:n().arrayOf(n().shape({field:n().string.isRequired,label:n().string.isRequired,align:n().string})).isRequired,groupedData:n().array.isRequired,tableType:n().string.isRequired,sortBy:n().string.isRequired,sortOrder:n().string.isRequired,onToggleSort:n().func.isRequired,viewMode:n().string.isRequired,storageKey:n().string.isRequired,renderDetailCells:n().func.isRequired,renderSummaryCells:n().func.isRequired,emptyMessage:n().string.isRequired};var D=c(96103),E=c(22805);function F(a){return"string"==typeof a&&a.startsWith(g.JH)}function G(a){return"string"==typeof a&&a.startsWith(g.DI)}function H(a={}){return String(a.apiType||a.providerSpecificData?.apiType||a.provider_specific_data?.apiType||"chat").toLowerCase()}function I({data:a}){let{label:b,color:c,imageUrl:f,textIcon:g,active:h}=a,[i,j]=(0,e.useState)(!1);return(0,d.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:h?c:"var(--color-border)",boxShadow:h?`0 0 16px ${c}40`:"none",minWidth:"150px"},children:[(0,d.jsx)(D.h7,{type:"target",position:E.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${c}15`},children:f&&!i?(0,d.jsx)("img",{src:f,alt:b,className:"w-6 h-6 rounded-sm object-contain",onError:()=>j(!0)}):(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:c},children:g})}),(0,d.jsx)("span",{className:"text-base font-medium truncate",style:{color:h?c:"var(--color-text)"},children:b}),h&&(0,d.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,d.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:c}}),(0,d.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:c}})]})]})}function J({data:a}){return(0,d.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,d.jsx)(D.h7,{type:"source",position:E.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("img",{src:"/favicon.svg",alt:"Bluerouter",className:"w-6 h-6 mr-2"}),(0,d.jsx)("span",{className:"text-sm font-bold text-primary",children:"Blue Router"}),a.activeCount>0&&(0,d.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:a.activeCount})]})}c(71763),I.propTypes={data:n().object.isRequired},J.propTypes={data:n().object.isRequired};let K={provider:I,router:J};function L({providers:a=[],activeRequests:b=[],lastProvider:c="",errorProvider:f=""}){let h=(0,e.useMemo)(()=>b.map(a=>a.provider?.toLowerCase()).filter(Boolean).sort().join(","),[b]),i=c?.toLowerCase()||"",j=f?.toLowerCase()||"",k=(0,e.useMemo)(()=>new Set(h?h.split(","):[]),[h]),l=(0,e.useMemo)(()=>new Set(i?[i]:[]),[i]),m=(0,e.useMemo)(()=>new Set(j?[j]:[]),[j]),n=(0,e.useRef)({}),[o,p]=(0,e.useState)(0),q=(0,e.useMemo)(()=>{let a=Date.now(),b=new Set;for(let c of k){let d=n.current[c];(!d||a-d<6e4)&&b.add(c)}return b},[k,o]),{nodes:r,edges:s}=(0,e.useMemo)(()=>(function(a,b,c,d){let e=a.length,f=Math.max(320,204*e/(2*Math.PI)),h=Math.max(200,.55*f);if(0===e)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let i=[],j=[];return i.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:b.size},draggable:!1}),a.forEach((a,k)=>{let l,m,n=function(a,b={}){if(g.Q2[a])return g.Q2[a];if(F(a)){let a=H(b);return{color:"#10A37F",name:b.name||("responses"===a?"OpenAI Compatible Responses":"OpenAI Compatible Chat"),textIcon:"responses"===a?"OR":"OC"}}return G(a)?{color:"#D97757",name:b.name||"Anthropic Compatible",textIcon:"AC"}:{color:"#6b7280",name:b.name||a,textIcon:(a||"?").slice(0,2).toUpperCase()}}(a.provider,a),o=b.has(a.provider?.toLowerCase()),p=!o&&c.has(a.provider?.toLowerCase()),q=!o&&d.has(a.provider?.toLowerCase()),r=`provider-${a.provider}`,s={label:(n.name!==a.provider?n.name:null)||a.name||a.provider,color:n.color||"#6b7280",imageUrl:function(a={}){let b=a.provider||a.id||"";return b?F(b)?"responses"===H(a)?"/providers/oai-r.png":"/providers/oai-cc.png":G(b)?"/providers/anthropic-m.png":`/providers/${b}.png`:null}(a),textIcon:n.textIcon||(a.provider||"?").slice(0,2).toUpperCase(),active:o},t=-Math.PI/2+2*Math.PI*k/e,u=f*Math.cos(t),v=h*Math.sin(t);Math.abs(t+Math.PI/2)<Math.PI/4||Math.abs(t-3*Math.PI/2)<Math.PI/4?(l="top",m="bottom"):Math.abs(t-Math.PI/2)<Math.PI/4?(l="bottom",m="top"):u>0?(l="right",m="left"):(l="left",m="right"),i.push({id:r,type:"provider",position:{x:u-90,y:v-15},data:s,draggable:!1}),j.push({id:`e-${r}`,source:"router",sourceHandle:l,target:r,targetHandle:m,animated:o,style:(n.color,q?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:o?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:p?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:i,edges:j}})(a,q,l,m),[a,q,i,j]),t=(0,e.useMemo)(()=>a.map(a=>a.provider).sort().join(","),[a]),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w={padding:.2,duration:200},x=(0,e.useCallback)(a=>{u.current=a,setTimeout(()=>a.fitView(w),50)},[]);return(0,d.jsx)("div",{ref:v,className:"h-[320px] w-full min-w-0 rounded-lg border border-border bg-bg-subtle/30 sm:h-[480px]",children:0===a.length?(0,d.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,d.jsx)(D.Gc,{nodes:r,edges:s,nodeTypes:K,fitView:!0,fitViewOptions:w,minZoom:.1,maxZoom:2,onInit:x,proOptions:{hideAttribution:!0},panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:(0,d.jsx)(D.H2,{showInteractive:!1,className:"react-flow-controls-custom"})},t)})}L.propTypes={providers:n().arrayOf(n().shape({id:n().string,provider:n().string,name:n().string})),activeRequests:n().arrayOf(n().shape({provider:n().string,model:n().string,account:n().string})),lastProvider:n().string,errorProvider:n().string};var M=c(48679),N=c(21621),O=c(5277),P=c(22393),Q=c(54206),R=c(79751),S=c(53330);let T=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},U=a=>{let b=T(a);return b>=1e6?`${(b/1e6).toFixed(1)}M`:b>=1e3?`${(b/1e3).toFixed(1)}K`:String(b)},V=a=>`$${T(a).toFixed(4)}`;function W({period:a="7d"}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{g(!0);try{let b=await fetch(`/api/usage/chart?period=${a}`);if(b.ok){let a=await b.json();c(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{g(!1)}},[a]);let k=b.map(a=>({...a,tokens:T(a.tokens),cost:T(a.cost)})),l=k.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-3 p-3 sm:p-4",children:[(0,d.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,d.jsx)("button",{onClick:()=>i("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>i("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),f?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):l?(0,d.jsx)(M.u,{width:"100%",height:220,children:(0,d.jsxs)(N.Q,{data:k,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(O.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(P.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(Q.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===h?U:V,width:50}),(0,d.jsx)(R.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[U(a),"Tokens"]:[V(a),"Cost"]}),"tokens"===h?(0,d.jsx)(S.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(S.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}function X(a){let b=String(a||"").trim();if(!b)return"";try{return new URL(b).hostname||""}catch{return b.replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/:\d+$/,"")}}function Y(a){let b=String(a||"").trim();return/^openai-compatible-chat-[0-9a-f-]{20,}$/i.test(b)||/^openai-compatible-[0-9a-f-]{20,}$/i.test(b)}function Z(a){return String(a||"").trim()}function $(a=[]){let b={},c={};for(let d of a||[]){let a=function(a={}){let b=Z(a.provider||a.providerId||a.provider_id||a.id),c=Z(a.accountName||a.account_name||a.email||a.displayName||a.display_name||a.name||a.label||a.connectionName||a.connection_name),d=X(a.endpoint)||X(a.baseUrl)||X(a.baseURL)||X(a.base_url)||X(a.providerUrl)||X(a.provider_url)||X(a.url),e=Z(a.email);return{providerId:b,accountName:c,displayName:Z(a.displayName||a.display_name),email:e,endpointHost:d,ownerUser:Z(a.ownerUser||a.owner_user),isPersonal:"personal"===a.scope||"private"===a.visibility||!!(a.ownerUser||a.owner_user)}}(d);for(let c of[d.id,d.connectionId,d.connection_id].map(Z).filter(Boolean))b[c]||(b[c]=a);a.accountName&&!c[a.accountName]&&(c[a.accountName]=a)}return{byConnectionId:b,byAccount:c}}function _(a={},b={}){let c=a.model||a.rawModel||a.raw_model||"-",d=function(a={},b={}){let c=function(a={},b={}){for(let c of[a.connectionId,a.connection_id].map(Z).filter(Boolean))if(b.byConnectionId?.[c])return b.byConnectionId[c];let c=Z(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return c&&b.byAccount?.[c]?b.byAccount[c]:null}(a,b),d=function(a={},b=null){let c=Z(a.provider||a.providerId||a.provider_id).toLowerCase();if(!(!0===a.isPersonalOAuth||!0===a.is_personal_oauth||"personal"===a.connectionScope||"personal"===a.connection_scope||"private"===a.visibility||b?.isPersonal)||!c)return"";let d=Z(a.ownerUser||a.owner_user||a.apiKeyOwner||a.api_key_owner||b?.ownerUser),e=Z(a.accountEmail||a.account_email||a.email||b?.email),f=Z(a.accountDisplayName||a.account_display_name||a.accountName||a.account_name||a.connectionName||a.connection_name||b?.accountName||b?.displayName),g=[];return(d&&g.push(d),e&&e!==d?g.push(e):f&&f!==d&&g.push(f),g.length)?(g.push(c),g.join("/")):""}(a,c);if(d)return d;if(c){let a=c.providerId,b=c.accountName,d=c.endpointHost;if(a&&!Y(a)){if(c.isPersonal&&c.ownerUser){let d=[c.ownerUser];return c.email&&c.email!==c.ownerUser?d.push(c.email):b&&b!==c.ownerUser&&d.push(b),d.push(a),d.join("/")}return b&&b!==a?`${a}/${b}`:a}if(b)return b;if(d)return d}let e=X(a.endpoint)||X(a.providerUrl)||X(a.provider_url)||X(a.baseUrl)||X(a.baseURL)||X(a.base_url)||X(a.url);if(e)return e;let f=Z(a.provider||a.providerId||a.provider_id),g=Z(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return f&&!Y(f)?g&&g!==f?`${f}/${g}`:f:g||""}(a,b),e=Z(a.provider||a.providerId||a.provider_id);return!d||"-"===c||String(c).startsWith(`${d}/`)?c:e&&String(c).startsWith(`${e}/`)&&(d.startsWith(`${e}/`)||d.endsWith(`/${e}`))?`${d}/${String(c).slice(e.length+1)}`:`${d}/${c}`}function aa({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}W.propTypes={period:n().string};let ab=new Set(["ok","success","succeeded","complete","completed","done","200 ok"]),ac=new Set(["pending","running","queued","in_progress","in-progress"]);function ad(a={}){let b,c=String(a.status||a.statusText||a.status_text||"").trim().toLowerCase(),d=(b=String(c||"").match(/\b([1-5]\d{2})\b/))?Number(b[1]):null,e=function(...a){for(let b of a){if(null==b||""===b)continue;let a=Number(b);if(Number.isFinite(a))return a}return null}(a.statusCode,a.status_code,a.gatewayStatusCode,a.gateway_status_code,a.upstreamStatusCode,a.upstream_status_code,d),f=Z(a.errorCode||a.error_code),g=Z(a.errorType||a.error_type),h=Z(a.errorMessageShort||a.error_message_short||a.message||a.error);if(ac.has(c))return{kind:"pending",label:"PENDING",title:"Request is still pending/running.",dotClass:"bg-amber-500",rowClass:"hover:bg-amber-50/60",badgeClass:"bg-amber-100 text-amber-700 border border-amber-200"};if(/\b(error|fail|failed|failure|timeout|cancelled|canceled)\b/i.test(c)||null!==e&&e>=400||f||g||h){let b=null!==e?`ERR ${e}`:c?c.toUpperCase():"ERROR",d=[`Status: ${b}`,f?`Code: ${f}`:"",g?`Type: ${g}`:"",h?`Message: ${h}`:"",a.endpoint?`Endpoint: ${a.endpoint}`:""].filter(Boolean);return{kind:"error",label:b,title:d.join("\n"),dotClass:"bg-error",rowClass:"hover:bg-error/5",badgeClass:"bg-error/10 text-error border border-error/20"}}return null!==e&&e>=200&&e<300||!c||ab.has(c)?{kind:"success",label:e?`OK ${e}`:"OK",title:"Request completed successfully.",dotClass:"bg-success",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-success/10 text-success border border-success/20"}:{kind:"unknown",label:c?c.toUpperCase():"UNKNOWN",title:c?`Status: ${c}`:"Unknown request status.",dotClass:"bg-text-muted",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-bg-subtle text-text-muted border border-border"}}function ae({request:a}){let{cachedTokens:b,cacheCreationTokens:c,totalTokens:e,totalInputTokens:f,newInputTokens:g,reasoningTokens:h,outputTokens:i}=function(a={}){let b=Number(a.promptTokens??a.prompt_tokens??0)||0,c=Number(a.cachedTokens??a.cached_tokens??a.cache_read_input_tokens??0)||0,d=Number(a.cacheCreationTokens??a.cache_creation_input_tokens??0)||0,e=Number(a.completionTokens??a.completion_tokens??0)||0,f=Number(a.totalTokens??a.total_tokens??b+e)||0,g=Number(a.displayTotalInputTokens??a.display_total_input_tokens??b)||0,h=Number(a.displayNewInputTokens??a.display_new_input_tokens??Math.max(0,g-c-d))||0,i=Number(a.displayCachedInputTokens??a.display_cached_input_tokens??c)||0,j=Number(a.displayCacheCreationInputTokens??a.display_cache_creation_input_tokens??d)||0,k=Number(a.displayReasoningTokens??a.display_reasoning_tokens??a.reasoningTokens??a.reasoning_tokens??0)||0,l=Number(a.displayOutputTokens??a.display_output_tokens??e)||0;return{promptTokens:b,cachedTokens:i,cacheCreationTokens:j,completionTokens:e,totalTokens:f,totalInputTokens:g,newInputTokens:h,reasoningTokens:k,outputTokens:l}}(a),j=ad(a),k=f>0?Math.min(100,Math.max(0,Math.round(b/f*100))):0,l=`Total Input: ${x(f)}
11
- New Input: ${x(g)}
12
- Cached: ${x(b)}
13
- Cache Create: ${x(c)}
14
- Reasoning: ${x(h)}
15
- Output: ${x(i)}`;return"success"===j.kind&&e>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 whitespace-nowrap leading-tight",title:l,children:[(0,d.jsxs)("span",{className:"text-primary",children:[x(f),b>0&&(0,d.jsxs)("span",{className:"ml-1 text-[10px] text-success",children:["(",k,"% cached)"]}),"↑"]}),(0,d.jsx)("span",{className:"text-text-muted",children:"/"}),(0,d.jsxs)("span",{className:"text-success",children:[x(i),"↓"]})]}):"success"===j.kind?(0,d.jsx)("div",{className:"flex items-center justify-end",title:"Request completed, but no token usage was reported.",children:(0,d.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-bg-subtle px-2 py-0.5 text-[10px] font-semibold leading-4 text-text-muted",children:"NO USAGE"})}):(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1.5",title:j.title,children:[(0,d.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-semibold leading-4 ${j.badgeClass}`,children:j.label}),e>0&&(0,d.jsxs)("span",{className:"text-[11px] text-text-muted whitespace-nowrap",children:[x(f),"↑ ",x(i),"↓"]})]})}function af({requests:a=[],providers:b=[]}){let c=(0,e.useMemo)(()=>$(b),[b]),f=(0,e.useMemo)(()=>Array.isArray(a)?a.filter(a=>"success"===ad(a).kind):[],[a]),g=Math.max(0,(Array.isArray(a)?a.length:0)-f.length);return(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 py-2 border-b border-border shrink-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"}),(0,d.jsx)("span",{className:"inline-flex items-center rounded-full border border-success/20 bg-success/10 px-2 py-0.5 text-[10px] font-semibold uppercase leading-4 text-success",children:"Success only"})]}),g>0&&(0,d.jsxs)("span",{className:"shrink-0 text-[11px] text-text-muted",title:"Error, pending and failed requests are intentionally hidden here. Use the Errors/Analytics views for troubleshooting.",children:[x(g)," hidden"]})]}),f.length?(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,d.jsxs)("table",{className:"w-full min-w-[300px] border-collapse text-xs",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:f.map((a,b)=>{let e=_(a,c);return(0,d.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,d.jsx)("td",{className:"py-1.5",children:(0,d.jsx)("span",{className:"block w-1.5 h-1.5 rounded-full bg-success"})}),(0,d.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[240px]",title:e,children:e}),(0,d.jsx)("td",{className:"py-1.5 text-right whitespace-nowrap",children:(0,d.jsx)(ae,{request:a})}),(0,d.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,d.jsx)(aa,{timestamp:a.timestamp})})]},a.requestId||a.id||`${a.timestamp||"request"}-${b}`)})})]})}):(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-1 px-4 text-center text-sm",children:[(0,d.jsx)("div",{className:"font-medium text-text-main",children:"No successful requests yet."}),g>0&&(0,d.jsxs)("div",{className:"max-w-[260px] text-xs text-text-muted",children:[x(g)," non-success request",1===g?"":"s"," hidden from this usage-focused list."]})]})]})}function ag(a,b={},c,d){return Object.entries(a||{}).map(([a,c])=>{let d=(c.promptTokens||0)+(c.completionTokens||0),e=c.cost||0,f=d>0?(c.promptTokens||0)*(e/d):0,g=d>0?(c.completionTokens||0)*(e/d):0;return{...c,key:a,totalTokens:d,totalCost:e,inputCost:f,outputCost:g,pending:b[a]||0}}).sort((a,b)=>{let e=a[c],f=b[c];return("string"==typeof e&&(e=e.toLowerCase()),"string"==typeof f&&(f=f.toLowerCase()),e<f)?"asc"===d?-1:1:e>f?"asc"===d?1:-1:0})}function ah(a,b){if(!Array.isArray(a))return[];let c={};return a.forEach(a=>{let d=function(a,b){switch(b){case"rawModel":return a.rawModel||"Unknown Model";case"accountName":return a.accountName||`Account ${a.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return a.keyName||"Unknown Key";case"endpoint":return a.endpoint||"Unknown Endpoint";default:return a[b]||"Unknown"}}(a,b);c[d]||(c[d]={groupKey:d,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let e=c[d].summary;e.requests+=a.requests||0,e.promptTokens+=a.promptTokens||0,e.completionTokens+=a.completionTokens||0,e.totalTokens+=a.totalTokens||0,e.cost+=a.cost||0,e.inputCost+=a.inputCost||0,e.outputCost+=a.outputCost||0,e.pending+=a.pending||0,a.lastUsed&&(!e.lastUsed||new Date(a.lastUsed)>new Date(e.lastUsed))&&(e.lastUsed=a.lastUsed),c[d].items.push(a)}),Object.values(c)}let ai=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],aj=[{field:"accountName",label:"Account"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],ak=[{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"}],al=[{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"}],am=[{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"}],an=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function ao({period:a,setPeriod:b,hidePeriodSelector:c=!1}={}){let g=(0,f.useRouter)(),j=(0,f.useSearchParams)(),{isAdmin:k}=(0,h.s)(),l=j.get("sortBy")||"rawModel",m=j.get("sortOrder")||"asc",[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!0),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)("model"),[w,y]=(0,e.useState)("costs"),[A,B]=(0,e.useState)([]),[D,E]=(0,e.useState)("today"),F=(0,e.useRef)(!0),G=(0,e.useRef)(!1),H=a??D,I=b??E,J=(0,e.useMemo)(()=>$(A),[A]);(0,e.useCallback)(({silent:a=!1}={})=>G.current?Promise.resolve():(G.current=!0,F.current?(F.current=!1,q(!0)):a||s(!0),fetch(`/api/usage/stats?period=${H}`).then(a=>a.ok?a.json():null).then(a=>{a&&o(b=>({...b,...a}))}).catch(()=>{}).finally(()=>{G.current=!1,q(!1),a||s(!1)})),[H]);let K=(0,e.useCallback)((a,b)=>{let c=new URLSearchParams(j.toString());c.get("sortBy")===b?c.set("sortOrder","asc"===c.get("sortOrder")?"desc":"asc"):(c.set("sortBy",b),c.set("sortOrder","asc")),g.replace(`?${c.toString()}`,{scroll:!1})},[j,g]),M=(0,e.useMemo)(()=>{if(!n)return null;switch(t){case"model":{let a=n.pending?.byModel||{};return{columns:ai,groupedData:ah(ag(n.byModel,a,l,m),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,title:_(a,J),children:_(a,J)}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.lastUsed)})]})}}case"account":{let a={};return n?.pending?.byAccount&&Object.entries(n.byAccount||{}).forEach(([b,c])=>{let d=n.pending.byAccount[c.connectionId];if(d){let e=c.provider?`${c.rawModel} (${c.provider})`:c.rawModel;a[b]=d[e]||0}}),{columns:aj,groupedData:ah(ag(n.byAccount,a,l,m),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.accountName||`Account ${a.connectionId?.slice(0,8)}...`}),(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,title:a.rawModel,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.lastUsed)})]})}}case"apiKey":return{columns:ak,groupedData:ah(ag(n.byApiKey,{},l,m),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium",children:a.keyName}),(0,d.jsx)("td",{className:"px-6 py-3",title:_(a,J),children:_(a,J)}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.lastUsed)})]})};default:return{columns:al,groupedData:ah(ag(n.byEndpoint,{},l,m),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:a.endpoint}),(0,d.jsx)("td",{className:"px-6 py-3",title:_(a,J),children:_(a,J)}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:x(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:z(a.lastUsed)})]})}}},[n,t,l,m,J]);if(!n&&!p)return(0,d.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let N=(0,d.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[!c&&(0,d.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto sm:self-end",children:[(0,d.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:an.map(a=>(0,d.jsx)("button",{onClick:()=>I(a.value),disabled:r,className:`rounded-md px-3 py-1 text-sm font-medium transition-colors ${H===a.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-bg-hover hover:text-text"}`,children:a.label},a.value))}),r&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),p?N:(0,d.jsx)(v,{stats:n}),p?N:k?(0,d.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,d.jsx)(L,{providers:A,activeRequests:n.activeRequests||[],lastProvider:n.recentRequests?.[0]?.provider||"",errorProvider:n.errorProvider||""}),(0,d.jsx)(af,{requests:n.recentRequests||[],providers:A})]}):(0,d.jsx)(af,{requests:n.recentRequests||[],providers:A}),p?N:(0,d.jsx)(W,{period:H}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("select",{value:t,onChange:a=>u(a.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:am.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))}),(0,d.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,d.jsx)("button",{onClick:()=>y("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===w?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"}),(0,d.jsx)("button",{onClick:()=>y("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===w?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"})]})]}),p?N:M&&(0,d.jsx)(C,{title:"",columns:M.columns,groupedData:M.groupedData,tableType:t,sortBy:l,sortOrder:m,onToggleSort:K,viewMode:w,storageKey:M.storageKey,renderSummaryCells:M.renderSummaryCells,renderDetailCells:M.renderDetailCells,emptyMessage:M.emptyMessage})]})]})}},87228:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\KiroSocialOAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\KiroSocialOAuthModal.js","default")},87369:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\OAuthModalRouter.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\OAuthModalRouter.js","default")},88119:(a,b,c)=>{"use strict";c.d(b,{Fv:()=>d,SI:()=>e,VC:()=>h}),Object.freeze({ADMIN:"admin",MONITOR_ADMIN:"monitor_admin",AI_GATEWAYS_MONITOR:"ai_gateways_monitor",USER:"user",GUEST:"guest"});let d="/dashboard/endpoint",e=Object.freeze([{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/analytics",label:"Analytics",icon:"monitoring"},{href:"/dashboard/ai-power-index",label:"AI Power Index",icon:"electric_bolt"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"}]),f=Object.freeze(["/dashboard","/dashboard/endpoint","/dashboard/api-keys","/dashboard/usage","/dashboard/analytics","/dashboard/ai-power-index","/dashboard/quota"]);function g(a=""){return String(a||"").split("?")[0].replace(/\/+$/,"")||"/"}function h(a=""){let b=g(a);return"/dashboard"===b||f.filter(a=>"/dashboard"!==a).some(a=>{let c,d;return c=g(b),c===(d=g(a))||c.startsWith(`${d}/`)})}},88137:a=>{a.exports={dashboardShell:"DashboardLayout_dashboardShell__AtdSy",dark:"DashboardLayout_dark__abQ2l"}},88712:(a,b,c)=>{Promise.resolve().then(c.bind(c,67738)),Promise.resolve().then(c.bind(c,82970)),Promise.resolve().then(c.bind(c,40738)),Promise.resolve().then(c.bind(c,25919)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,45407)),Promise.resolve().then(c.bind(c,34716)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,11229)),Promise.resolve().then(c.bind(c,62727)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,51585)),Promise.resolve().then(c.bind(c,48781)),Promise.resolve().then(c.bind(c,43182)),Promise.resolve().then(c.bind(c,86739)),Promise.resolve().then(c.bind(c,3236)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,86209)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,54004)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,20084)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,83352)),Promise.resolve().then(c.bind(c,23048)),Promise.resolve().then(c.bind(c,50585)),Promise.resolve().then(c.bind(c,23525)),Promise.resolve().then(c.bind(c,21150)),Promise.resolve().then(c.bind(c,11633)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,32971)),Promise.resolve().then(c.bind(c,87226))},91099:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({options:a=[],value:b,onChange:c,size:g="md",className:h}){let i={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,d.jsx)("div",{className:(0,e.cn)("inline-flex items-center p-1 rounded-[10px] overflow-x-auto","bg-surface-2",h),children:a.map(a=>(0,d.jsxs)("button",{onClick:()=>c(a.value),className:(0,e.cn)("shrink-0 px-4 rounded-[8px] font-medium transition-all",i[g],b===a.value?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[a.icon&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:a.icon}),a.label]},a.value))})}},91809:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(17660);function g(){let[a,b]=(0,e.useState)([]),[c,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)(!0);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("span",{children:"Auto Refresh (3s)"}),(0,d.jsx)("div",{onClick:()=>i(!h),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${h?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,d.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${h?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,d.jsx)(f.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,d.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:c&&0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,d.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,d.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=a.split(" | ");if(c.length<7)return null;let e=c[6],f=e.includes("PENDING"),g=e.includes("FAILED"),h=e.includes("OK");return(0,d.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${f?"bg-primary/5":""}`,children:[(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:c[0]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:c[1]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:c[2]})}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:c[3],children:c[3]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:c[4]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:c[5]}),(0,d.jsx)("td",{className:`px-3 py-1.5 font-bold ${h?"text-success":g?"text-error":"text-primary animate-pulse"}`,children:e})]},b)})})]})})}),(0,d.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are loaded from the request history database."})]})}},92082:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>h,PageLoading:()=>f,Skeleton:()=>g,Spinner:()=>e,default:()=>i});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Spinner() from the server but Spinner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","Spinner"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLoading() from the server but PageLoading is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","PageLoading"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call Skeleton() from the server but Skeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","Skeleton"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CardSkeleton() from the server but CardSkeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","CardSkeleton"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Loading.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","default")},92669:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Header.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Header.js","default")},94582:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ModelSelectModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ModelSelectModal.js","default")},95145:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>l,default:()=>k});var d=c(48249),e=c(67484),f=c(71404),g=c(99070),h=c(32971),i=c(7806);function j(a,b){return!!a&&Object.prototype.hasOwnProperty.call(a,b)}function k({isOpen:a,onClose:b,title:c,children:g,footer:l,size:m="md",closeOnOverlay:n=!0,showTrafficLights:o=!0,busy:p=!1,className:q}){let r=(0,e.useRef)({onClose:b,busy:p}),s=(0,i.t)(),t=s?.({title:c,children:g,footer:l,size:m,className:q})||null,u=j(t,"children")?t.children:g,v=j(t,"footer")?t.footer:l,w=t?.size||m,x=(0,f.cn)(q,t?.className);r.current.onClose=b,r.current.busy=p;let y={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"};return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:n&&!p?b:void 0}),(0,d.jsxs)("div",{className:(0,f.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",y[w]||y.md,x),children:[(c||o)&&(0,d.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center",children:[o&&(0,d.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,d.jsx)(h.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,d.jsx)("button",{onClick:b,disabled:p,"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 disabled:cursor-not-allowed disabled:opacity-50",children:(0,d.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),c&&(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:c})]}),(0,d.jsx)("button",{onClick:b,disabled:p,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:u}),v&&(0,d.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:v})]})]}):null}function l({isOpen:a,onClose:b,onConfirm:c,title:e="Confirm",message:f,confirmText:h="Confirm",cancelText:i="Cancel",variant:j="danger",loading:m=!1}){return(0,d.jsx)(k,{isOpen:a,onClose:b,title:e,size:"sm",busy:m,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.default,{variant:"ghost",onClick:b,disabled:m,children:i}),(0,d.jsx)(g.default,{variant:j,onClick:c,loading:m,children:h})]}),children:(0,d.jsx)("p",{className:"text-text-muted",children:f})})}},95514:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({checked:a=!1,onChange:b,label:c,description:g,disabled:h=!1,size:i="md",className:j}){let k={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,d.jsxs)("div",{className:(0,e.cn)("flex items-center gap-3",h&&"opacity-50 cursor-not-allowed",j),children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:h,onClick:()=>{!h&&b&&b(!a)},className:(0,e.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",a?"bg-brand-500":"bg-surface-3",k[i].track,h&&"cursor-not-allowed"),children:(0,d.jsx)("span",{className:(0,e.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",a?k[i].translate:"translate-x-0.5",k[i].thumb,"mt-0.5")})}),(c||g)&&(0,d.jsxs)("div",{className:"flex flex-col",children:[c&&(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:c}),g&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:g})]})]})}},97564:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249);c(67484);var e=c(74429);let f=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"cast",label:"Desktop",desc:"Screen sharing"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],g=[{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 h({isOpen:a,onClose:b}){return a?(0,e.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:b}),(0,d.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,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center bg-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),(0,d.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-mono",children:"9Remote"})]}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"close"})})]}),(0,d.jsxs)("div",{className:"px-7 py-7 pb-9 flex flex-col gap-6",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[(0,d.jsx)("div",{className:"w-14 h-14 rounded-[14px] flex items-center justify-center mb-1 bg-primary shadow-[var(--shadow-warm)]",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-[30px]",children:"terminal"})}),(0,d.jsx)("h1",{className:"text-lg font-bold text-text-main tracking-tight",children:"9Remote"}),(0,d.jsx)("p",{className:"text-xs text-text-muted leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),(0,d.jsx)("div",{className:"flex gap-2 w-full",children:f.map(({icon:a,label:b,desc:c})=>(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:a}),(0,d.jsx)("p",{className:"text-xs font-semibold text-text-main",children:b}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted text-center leading-4",children:c})]},b))}),(0,d.jsx)("div",{className:"flex flex-col gap-3 w-full",children:g.map(({icon:a,text:b})=>(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex-shrink-0 text-primary text-[16px]",children:a}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b})]},a))}),(0,d.jsxs)("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,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"open_in_new"}),"Get 9Remote"]})]})]})]}),document.body):null}},99070:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={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"},g={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 h({children:a,variant:b="primary",size:c="md",icon:i,iconRight:j,disabled:k=!1,loading:l=!1,fullWidth:m=!1,className:n,...o}){return(0,d.jsxs)("button",{className:(0,e.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",f[b],g[c],m&&"w-full",n),disabled:k||l,...o,children:[l?(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):i?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i}):null,a,j&&!l&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j})]})}}};
10
+ `,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[r.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name]})},a.value)})})]},a)),0===Object.keys(K).length&&0===J.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})]})}):null}m.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,onDeselect:g().func,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object,kindFilter:g().string,addedModelValues:g().arrayOf(g().string),closeOnSelect:g().bool,personalOnly:g().bool,extraModels:g().arrayOf(g().string)}},83552:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,type:b="text",placeholder:c,value:g,onChange:h,error:i,hint:j,icon:k,disabled:l=!1,required:m=!1,className:n,inputClassName:o,...p}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",n),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,m&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[k&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:k})}),(0,d.jsx)("input",{type:b,placeholder:c,value:g,onChange:h,disabled:l,className:(0,e.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",k&&"pl-10",i&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",o),...p})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Select.js","default")},86209:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onMethodSelect:b,onClose:c}){let[f,g]=(0,e.useState)(null),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)("us-east-1"),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),x=a=>{g(a),q(null)},y=()=>{g(null),q(null)},z=async()=>{if(!n.trim())return void q("Please enter a refresh token");s(!0),q(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Import failed");b("import")}catch(a){q(a.message)}finally{s(!1)}},A=a=>{b("social",{provider:a})};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Kiro",onClose:c,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!f&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,d.jsx)(h.pd,{value:l,onChange:a=>m(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),p&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{j.trim()?b("idc",{startUrl:j.trim(),region:l}):q("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[t&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!t&&(0,d.jsxs)(d.Fragment,{children:[v&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!p&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:n,onChange:a=>o(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),p&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,disabled:r||!n.trim(),children:r?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onMethodSelect:g().func.isRequired,onClose:g().func.isRequired}},86739:(a,b,c)=>{"use strict";c.d(b,{default:()=>r});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(49885),j=c.n(i),k=c(3236),l=c(53845),m=c(20151),n=c(37365),o=c(12020),p=c(96919),q=c(99258);function r({onMenuClick:a,showMenuButton:b=!0}){let c=(0,f.usePathname)(),g=(0,f.useRouter)(),{displayName:i,loginMethod:j}=(0,m.s)(),{title:n,description:t,icon:u,breadcrumbs:v}=(0,e.useMemo)(()=>(a=>{if(!a)return{title:"",description:"",breadcrumbs:[]};let b=a.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(b){let a=b[1],c=b[2],d=p.rj.find(b=>b.id===a),e=p.Q2[c];return{title:e?.name||c,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${a}`},{label:d?.label||a,href:`/dashboard/media-providers/${a}`},{label:e?.name||c,image:`/providers/${c}.png`}]}}let c=a.match(/\/media-providers\/([^/]+)$/);if(c){let a=c[1],b=p.rj.find(b=>b.id===a);return{title:b?.label||a,description:`Manage your ${b?.label||a} providers`,icon:b?.icon||"perm_media",breadcrumbs:[]}}let d=a.match(/\/providers\/([^/]+)$/);if(d){let a=d[1],b=o.zN[a]||o.fg[a];if(b)return{title:b.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:b.name,image:`/providers/${b.id}.png`}]}}return a.includes("/providers")&&!a.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:a.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:a.includes("/token-saver")?{title:"Token Saver Analytics",description:"Theo d\xf5i hiệu quả RTK token saving theo source tool, provider, model v\xe0 filter",icon:"compress",breadcrumbs:[]}:a.includes("/analytics")?{title:"Analytics",description:"Thống k\xea request, token, API key, Source IP, provider, model v\xe0 lỗi vận h\xe0nh",icon:"monitoring",breadcrumbs:[]}:a.includes("/resource-monitor")?{title:"Linux Resources",description:"Realtime resource monitoring for remote Linux servers",icon:"monitor_heart",breadcrumbs:[]}:a.includes("/cluster")?{title:"Cluster Nodes",description:"Synchronize Master backups to Standby BlueRouter nodes",icon:"hub",breadcrumbs:[]}:a.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:a.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:a.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:a.includes("/mitm")?{title:"AI Traffic Proxy",description:"Intercept CLI tool traffic and route through this router gateway",icon:"security",breadcrumbs:[]}:a.includes("/prompt-logs")?{title:"Prompt Logs",description:"Search Copilot/MITM prompts across the prompt log database",icon:"manage_search",breadcrumbs:[]}:a.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:a.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:a.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use this Router — no install needed",icon:"extension",breadcrumbs:[]}:a.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:a.includes("/api-keys")?{title:"API Keys",description:"Manage API keys and model access",icon:"vpn_key",breadcrumbs:[]}:a.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:a.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:a.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===a?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(c),[c]),w=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(g.push("/login"),g.refresh())}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur",children:(0,d.jsxs)("div",{className:"flex min-h-[72px] items-center justify-between gap-4 px-4 md:px-6",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[b?(0,d.jsx)("button",{type:"button",onClick:a,className:"rounded-xl border border-border p-2 text-text-muted hover:bg-surface hover:text-text-main lg:hidden","aria-label":"Open menu",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})}):null,(0,d.jsx)("div",{className:"min-w-0",children:v.length>0?(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-sm text-text-muted",children:v.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[b>0?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"}):null,a.href?(0,d.jsx)(h(),{href:a.href,className:"hover:text-primary",children:(0,q.Tl)(a.label)}):(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.image?(0,d.jsx)("img",{src:a.image,alt:"",className:"h-5 w-5 rounded"}):null,(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:(0,q.Tl)(a.label)})]})]},`${a.label}-${b}`))}):n?(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[u?(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:u}):null,(0,d.jsx)("h1",{className:"truncate text-xl font-semibold text-text-main",children:(0,q.Tl)(n)})]}),t?(0,d.jsx)("p",{className:"mt-1 truncate text-sm text-text-muted",children:(0,q.Tl)(t)}):null]}):null})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,d.jsx)(s,{}),i&&"OIDC"===j?(0,d.jsxs)("div",{className:"hidden items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-text-muted md:flex",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"person"}),(0,d.jsx)("span",{children:i}),(0,d.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:"OIDC"})]}):null,(0,d.jsx)(l.default,{}),(0,d.jsx)(k.default,{onLogout:w})]})]})})}function s(){let a=(0,n.C)(a=>a.visible),b=(0,n.C)(a=>a.query),c=(0,n.C)(a=>a.placeholder),e=(0,n.C)(a=>a.setQuery);return a?(0,d.jsxs)("div",{className:"relative hidden w-72 md:block",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[18px] text-text-muted",children:"search"}),(0,d.jsx)("input",{value:b,onChange:a=>e(a.target.value),placeholder:c,className:"h-9 w-full rounded-lg border border-border bg-surface/60 pl-8 pr-8 text-sm text-text-main outline-none transition-colors placeholder:text-text-muted focus:border-primary/50"}),b?(0,d.jsx)("button",{type:"button",onClick:()=>e(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:text-text-main","aria-label":"Clear search",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})}):null]}):null}r.propTypes={onMenuClick:j().func,showMenuButton:j().bool}},87226:(a,b,c)=>{"use strict";c.d(b,{default:()=>ap});var d=c(48249),e=c(67484),f=c(19099),g=c(96919),h=c(20151),i=c(75171),j=c(17660),k=c(2116),l=c.n(k),m=c(49885),n=c.n(m);let o=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},p=a=>new Intl.NumberFormat().format(o(a)),q=a=>`$${o(a).toFixed(2)}`,r=(a,b)=>{let c=o(b);return c<=0?0:Math.round(o(a)/c*100)};function s({audit:a,isAdmin:b}){let c=o(a?.requests);if(c<=0)return null;let e=o(a.promptTokens),f=o(a.cachedInputTokens),g=o(a.cacheCreationInputTokens),h=null!=a.newInputTokens?o(a.newInputTokens):Math.max(0,e-f-g),i=Object.entries(a.byTool||{}).map(([a,b])=>({key:a,label:b.label||a,requests:o(b.requests)})).sort((a,b)=>b.requests-a.requests).slice(0,4);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2.5 py-0.5 text-[11px] font-semibold text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"policy"}),"AI Audit Proxy"]}),(0,d.jsx)("span",{className:"text-[11px] text-text-muted",children:"Observed by the MITM proxy, not routed through the gateway. Already included in the totals above."}),i.length>0&&(0,d.jsx)("span",{className:"flex flex-wrap items-center gap-1",children:i.map(a=>(0,d.jsxs)("span",{className:"rounded-md bg-background px-1.5 py-0.5 text-[10px] font-medium text-text-muted",children:[a.label," \xb7 ",p(a.requests)]},a.key))})]}),(0,d.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,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 border-dashed px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Audited Requests"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold",children:p(c)})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 border-dashed px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Audited Input Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:p(e)}),e>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[r(f,e),"% cached \xb7 ",p(h)," new"]})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 border-dashed px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Audited Output Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:p(a.completionTokens)})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 border-dashed px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Audited Est. Cost"}),(0,d.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",q(a.cost)]}),b&&(0,d.jsx)(l(),{href:"/dashboard/audit-proxy",className:"text-[10px] text-text-muted transition-colors hover:text-primary",children:"Open Audit Proxy →"})]})]})]})}function t({label:a,dotClass:b,requests:c,promptTokens:e,completionTokens:f,cost:g,showCost:h}){return(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${b}`}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:a})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(o(e)+o(f)),h&&(0,d.jsx)("span",{className:"ml-1.5 text-warning",children:q(g)}),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[p(c)," req"]})]})]})}s.propTypes={audit:n().object,isAdmin:n().bool},t.propTypes={label:n().string.isRequired,dotClass:n().string.isRequired,requests:n().number,promptTokens:n().number,completionTokens:n().number,cost:n().number,showCost:n().bool};let u=[{name:"Anthropic (Claude)",dot:"bg-warning",mode:"Thủ c\xf4ng",modeNote:"BlueRouter chỉ \xe1p dụng cache write 5 ph\xfat",write:"1,25x gi\xe1 input",read:"0,1x gi\xe1 input",ttl:"5 ph\xfat; TTL d\xe0i hơn vẫn d\xf9ng c\xf9ng mức gi\xe1",fields:"cache_creation_input_tokens + cache_read_input_tokens",note:"Kh\xf4ng lưu cache 1 giờ. Mọi cache creation được t\xednh bằng rate 5 ph\xfat của model."},{name:"OpenAI",dot:"bg-success",mode:"Tự động",modeNote:"d\xf9ng Standard / short-context rate",write:"GPT-5.6 theo cache-write rate; model kh\xe1c fallback về input",read:"Theo cached rate của từng model",ttl:"Kh\xf4ng t\xe1ch TTL trong BlueRouter",fields:"prompt_tokens_details.cached_tokens + cache creation fields khi c\xf3",note:"Request tr\xean 272K hoặc cache d\xe0i hơn vẫn d\xf9ng đ\xfang rate short-context/cache 5 ph\xfat đ\xe3 cấu h\xecnh."},{name:"Google Gemini",dot:"bg-primary",mode:"Hai chế độ",modeNote:"implicit tự động, explicit do người d\xf9ng tạo",write:"Miễn ph\xed (implicit) / ph\xed lưu trữ theo giờ (explicit)",read:"giảm gi\xe1 đ\xe1ng kể so với input",ttl:"Implicit ngắn hạn; explicit theo TTL tự đặt",fields:"cachedContentTokenCount",note:"Explicit caching t\xednh tiền theo thời gian lưu, kh\xe1c hẳn m\xf4 h\xecnh của Anthropic v\xe0 OpenAI."},{name:"Local (vLLM, llama.cpp, Ollama)",dot:"bg-text-muted",mode:"Tự động",modeNote:"prefix caching / KV cache reuse",write:"Miễn ph\xed",read:"Miễn ph\xed — chỉ tiết kiệm compute v\xe0 giảm TTFT",ttl:"Tuỳ cấu h\xecnh v\xe0 dung lượng KV cache",fields:"Thường kh\xf4ng t\xe1ch ri\xeang trong usage",note:"Tiết kiệm thời gian chứ kh\xf4ng tiết kiệm tiền, v\xe0 phần lớn gộp v\xe0o “New input” ở tr\xean."}];function v(){let[a,b]=(0,e.useState)(!1);return(0,d.jsxs)(j.default,{className:"min-w-0 px-4 py-3",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>b(a=>!a),className:"flex w-full min-w-0 items-center justify-between gap-2 text-left",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"help"}),(0,d.jsx)("span",{className:"truncate text-sm font-semibold uppercase text-text-muted",children:"Cache read / creation hoạt động thế n\xe0o"})]}),(0,d.jsx)("span",{className:`material-symbols-outlined shrink-0 text-[20px] text-text-muted transition-transform duration-200 ${a?"rotate-180":""}`,children:"expand_more"})]}),a&&(0,d.jsxs)("div",{className:"mt-3 flex min-w-0 flex-col gap-3 border-t border-border-subtle pt-3",children:[(0,d.jsxs)("p",{className:"text-xs leading-relaxed text-text-muted",children:[(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache creation"})," l\xe0 lần đầu một đoạn context được lưu lại. ",(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache read"})," l\xe0 những lần sau t\xe1i sử dụng đoạn đ\xf3 thay v\xec xử l\xfd lại. Cơ chế v\xe0 c\xe1ch t\xednh tiền kh\xe1c nhau tuỳ provider — gi\xe1 dưới đ\xe2y l\xe0 bội số so với gi\xe1 input thường của ch\xednh model đ\xf3."]}),(0,d.jsx)("div",{className:"grid min-w-0 grid-cols-1 gap-2 xl:grid-cols-2",children:u.map(a=>(0,d.jsxs)("div",{className:"min-w-0 rounded-[10px] bg-bg px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${a.dot}`}),(0,d.jsx)("span",{className:"truncate text-xs font-semibold",children:a.name})]}),(0,d.jsx)("span",{className:"shrink-0 rounded-full bg-surface px-2 py-0.5 text-[10px] text-text-muted",children:a.mode})]}),(0,d.jsxs)("dl",{className:"mt-2 flex min-w-0 flex-col gap-1 text-[11px]",children:[(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Ghi cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium",children:a.write})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Đọc cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium text-success",children:a.read})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Thời hạn"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.ttl})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"K\xedch hoạt"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.modeNote})]})]}),(0,d.jsx)("p",{className:"mt-1.5 border-t border-border-subtle pt-1.5 text-[10px] leading-relaxed text-text-muted",children:a.note}),(0,d.jsx)("p",{className:"mt-1 font-mono text-[9px] leading-relaxed text-text-muted opacity-70",children:a.fields})]},a.name))}),(0,d.jsx)("p",{className:"text-[10px] leading-relaxed text-text-muted",children:"Gi\xe1 v\xe0 thời hạn do provider c\xf4ng bố v\xe0 c\xf3 thể thay đổi — h\xe3y đối chiếu bảng gi\xe1 ch\xednh thức trước khi d\xf9ng cho mục đ\xedch t\xednh chi ph\xed."})]})]})}function w({stats:a}){let{isAdmin:b}=(0,h.s)(),c=o(a.totalPromptTokens),e=o(a.totalCachedInputTokens),f=o(a.totalCacheCreationInputTokens),g=null!=a.totalNewInputTokens?o(a.totalNewInputTokens):Math.max(0,c-e-f),i=a.cloudVsLocal||{},k=i.cloud||{},m=i.local||{},n=i.unknown||{},u=o(k.requests)>0||o(m.requests)>0||o(n.requests)>0,x=o(k.promptTokens)+o(k.completionTokens),y=o(m.promptTokens)+o(m.completionTokens),z=o(n.promptTokens)+o(n.completionTokens),A=x+y+z,B=r(x,A),C=r(y,A),D=Math.max(0,100-B-C);return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:gap-4",children:[(0,d.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,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold",children:p(a.totalRequests)})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:p(c)}),c>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[r(e,c),"% cached"]})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:p(a.totalCompletionTokens)})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[b?(0,d.jsxs)(l(),{href:"/dashboard/settings/pricing",className:"group flex min-w-0 items-center gap-1 text-text-muted text-sm uppercase font-semibold transition-colors hover:text-primary",title:"Chỉnh bảng gi\xe1 d\xf9ng để t\xednh cost",children:[(0,d.jsx)("span",{className:"truncate",children:"Est. Cost"}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px] opacity-0 transition-opacity group-hover:opacity-100",children:"edit"})]}):(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",q(a.totalCost)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]}),(0,d.jsx)(s,{audit:a.auditProxy,isAdmin:b}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 lg:grid-cols-2 sm:gap-4",children:[(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Input Token Breakdown"}),c>0&&(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-primary",style:{width:`${r(g,c)}%`}}),(0,d.jsx)("div",{className:"bg-success",style:{width:`${r(e,c)}%`}}),(0,d.jsx)("div",{className:"bg-warning",style:{width:`${r(f,c)}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-primary"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"New input"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(g),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(g,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-success"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cached read"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(e),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(e,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-warning"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cache creation"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(f),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(f,c),"%"]})]})]})]})]}),(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Cloud vs Local"}),u?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-warning",style:{width:`${B}%`}}),(0,d.jsx)("div",{className:"bg-primary",style:{width:`${C}%`}}),z>0&&(0,d.jsx)("div",{className:"bg-text-muted",style:{width:`${D}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsx)(t,{label:"Cloud / External",dotClass:"bg-warning",requests:o(k.requests),promptTokens:o(k.promptTokens),completionTokens:o(k.completionTokens),cost:o(k.cost),showCost:!0}),(0,d.jsx)(t,{label:"Local / Self-hosted",dotClass:"bg-primary",requests:o(m.requests),promptTokens:o(m.promptTokens),completionTokens:o(m.completionTokens),cost:o(m.cost),showCost:o(m.cost)>0}),o(n.requests)>0&&(0,d.jsx)(t,{label:"Unknown / chưa ph\xe2n loại",dotClass:"bg-text-muted",requests:o(n.requests),promptTokens:o(n.promptTokens),completionTokens:o(n.completionTokens),cost:o(n.cost),showCost:o(n.cost)>0})]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Ph\xe2n loại theo Deployment của provider. OpenAI/Anthropic Compatible chỉ l\xe0 protocol v\xe0 c\xf3 thể l\xe0 Local hoặc Cloud."})]}):(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No usage in this period."})]})]}),(0,d.jsx)(v,{})]})}w.propTypes={stats:n().object.isRequired};let x=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},y=a=>new Intl.NumberFormat().format(x(a)),z=a=>`$${x(a).toFixed(2)}`;function A(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function B({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function C({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":y(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":y(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:y(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":z(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":z(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:z(a.totalCost||a.cost)})]})}function D({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:h,onToggleSort:i,viewMode:k,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[p,q]=(0,e.useState)(new Set),r=(0,e.useCallback)(a=>{q(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),s=(0,e.useMemo)(()=>"tokens"===k?[{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"}],[k]),t=b.length+s.length;return(0,d.jsxs)(j.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(B,{field:a.field,currentSort:g,currentOrder:h})]},a.field)),s.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>i(f,a.field),children:[a.label," ",(0,d.jsx)(B,{field:a.field,currentSort:g,currentOrder:h})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>r(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${p.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(C,{item:a.summary,viewMode:k,isSummary:!0})]}),p.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(C,{item:a,viewMode:k})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:t,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}B.propTypes={field:n().string.isRequired,currentSort:n().string.isRequired,currentOrder:n().string.isRequired},C.propTypes={item:n().object.isRequired,viewMode:n().string.isRequired,isSummary:n().bool},D.propTypes={title:n().string.isRequired,columns:n().arrayOf(n().shape({field:n().string.isRequired,label:n().string.isRequired,align:n().string})).isRequired,groupedData:n().array.isRequired,tableType:n().string.isRequired,sortBy:n().string.isRequired,sortOrder:n().string.isRequired,onToggleSort:n().func.isRequired,viewMode:n().string.isRequired,storageKey:n().string.isRequired,renderDetailCells:n().func.isRequired,renderSummaryCells:n().func.isRequired,emptyMessage:n().string.isRequired};var E=c(96103),F=c(22805);function G(a){return"string"==typeof a&&a.startsWith(g.JH)}function H(a){return"string"==typeof a&&a.startsWith(g.DI)}function I(a={}){return String(a.apiType||a.providerSpecificData?.apiType||a.provider_specific_data?.apiType||"chat").toLowerCase()}function J({data:a}){let{label:b,color:c,imageUrl:f,textIcon:g,active:h}=a,[i,j]=(0,e.useState)(!1);return(0,d.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:h?c:"var(--color-border)",boxShadow:h?`0 0 16px ${c}40`:"none",minWidth:"150px"},children:[(0,d.jsx)(E.h7,{type:"target",position:F.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(E.h7,{type:"target",position:F.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(E.h7,{type:"target",position:F.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(E.h7,{type:"target",position:F.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${c}15`},children:f&&!i?(0,d.jsx)("img",{src:f,alt:b,className:"w-6 h-6 rounded-sm object-contain",onError:()=>j(!0)}):(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:c},children:g})}),(0,d.jsx)("span",{className:"text-base font-medium truncate",style:{color:h?c:"var(--color-text)"},children:b}),h&&(0,d.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,d.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:c}}),(0,d.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:c}})]})]})}function K({data:a}){return(0,d.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,d.jsx)(E.h7,{type:"source",position:F.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(E.h7,{type:"source",position:F.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(E.h7,{type:"source",position:F.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(E.h7,{type:"source",position:F.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("img",{src:"/favicon.svg",alt:"Bluerouter",className:"w-6 h-6 mr-2"}),(0,d.jsx)("span",{className:"text-sm font-bold text-primary",children:"Blue Router"}),a.activeCount>0&&(0,d.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:a.activeCount})]})}c(71763),J.propTypes={data:n().object.isRequired},K.propTypes={data:n().object.isRequired};let L={provider:J,router:K};function M({providers:a=[],activeRequests:b=[],lastProvider:c="",errorProvider:f=""}){let h=(0,e.useMemo)(()=>b.map(a=>a.provider?.toLowerCase()).filter(Boolean).sort().join(","),[b]),i=c?.toLowerCase()||"",j=f?.toLowerCase()||"",k=(0,e.useMemo)(()=>new Set(h?h.split(","):[]),[h]),l=(0,e.useMemo)(()=>new Set(i?[i]:[]),[i]),m=(0,e.useMemo)(()=>new Set(j?[j]:[]),[j]),n=(0,e.useRef)({}),[o,p]=(0,e.useState)(0),q=(0,e.useMemo)(()=>{let a=Date.now(),b=new Set;for(let c of k){let d=n.current[c];(!d||a-d<6e4)&&b.add(c)}return b},[k,o]),{nodes:r,edges:s}=(0,e.useMemo)(()=>(function(a,b,c,d){let e=a.length,f=Math.max(320,204*e/(2*Math.PI)),h=Math.max(200,.55*f);if(0===e)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let i=[],j=[];return i.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:b.size},draggable:!1}),a.forEach((a,k)=>{let l,m,n=function(a,b={}){if(g.Q2[a])return g.Q2[a];if(G(a)){let a=I(b);return{color:"#10A37F",name:b.name||("responses"===a?"OpenAI Compatible Responses":"OpenAI Compatible Chat"),textIcon:"responses"===a?"OR":"OC"}}return H(a)?{color:"#D97757",name:b.name||"Anthropic Compatible",textIcon:"AC"}:{color:"#6b7280",name:b.name||a,textIcon:(a||"?").slice(0,2).toUpperCase()}}(a.provider,a),o=b.has(a.provider?.toLowerCase()),p=!o&&c.has(a.provider?.toLowerCase()),q=!o&&d.has(a.provider?.toLowerCase()),r=`provider-${a.provider}`,s={label:(n.name!==a.provider?n.name:null)||a.name||a.provider,color:n.color||"#6b7280",imageUrl:function(a={}){let b=a.provider||a.id||"";return b?G(b)?"responses"===I(a)?"/providers/oai-r.png":"/providers/oai-cc.png":H(b)?"/providers/anthropic-m.png":`/providers/${b}.png`:null}(a),textIcon:n.textIcon||(a.provider||"?").slice(0,2).toUpperCase(),active:o},t=-Math.PI/2+2*Math.PI*k/e,u=f*Math.cos(t),v=h*Math.sin(t);Math.abs(t+Math.PI/2)<Math.PI/4||Math.abs(t-3*Math.PI/2)<Math.PI/4?(l="top",m="bottom"):Math.abs(t-Math.PI/2)<Math.PI/4?(l="bottom",m="top"):u>0?(l="right",m="left"):(l="left",m="right"),i.push({id:r,type:"provider",position:{x:u-90,y:v-15},data:s,draggable:!1}),j.push({id:`e-${r}`,source:"router",sourceHandle:l,target:r,targetHandle:m,animated:o,style:(n.color,q?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:o?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:p?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:i,edges:j}})(a,q,l,m),[a,q,i,j]),t=(0,e.useMemo)(()=>a.map(a=>a.provider).sort().join(","),[a]),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w={padding:.2,duration:200},x=(0,e.useCallback)(a=>{u.current=a,setTimeout(()=>a.fitView(w),50)},[]);return(0,d.jsx)("div",{ref:v,className:"h-[320px] w-full min-w-0 rounded-lg border border-border bg-bg-subtle/30 sm:h-[480px]",children:0===a.length?(0,d.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,d.jsx)(E.Gc,{nodes:r,edges:s,nodeTypes:L,fitView:!0,fitViewOptions:w,minZoom:.1,maxZoom:2,onInit:x,proOptions:{hideAttribution:!0},panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:(0,d.jsx)(E.H2,{showInteractive:!1,className:"react-flow-controls-custom"})},t)})}M.propTypes={providers:n().arrayOf(n().shape({id:n().string,provider:n().string,name:n().string})),activeRequests:n().arrayOf(n().shape({provider:n().string,model:n().string,account:n().string})),lastProvider:n().string,errorProvider:n().string};var N=c(48679),O=c(21621),P=c(5277),Q=c(22393),R=c(54206),S=c(79751),T=c(53330);let U=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},V=a=>{let b=U(a);return b>=1e6?`${(b/1e6).toFixed(1)}M`:b>=1e3?`${(b/1e3).toFixed(1)}K`:String(b)},W=a=>`$${U(a).toFixed(4)}`;function X({period:a="7d"}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{g(!0);try{let b=await fetch(`/api/usage/chart?period=${a}`);if(b.ok){let a=await b.json();c(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{g(!1)}},[a]);let k=b.map(a=>({...a,tokens:U(a.tokens),cost:U(a.cost)})),l=k.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col gap-3 p-3 sm:p-4",children:[(0,d.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,d.jsx)("button",{onClick:()=>i("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>i("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),f?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):l?(0,d.jsx)(N.u,{width:"100%",height:220,children:(0,d.jsxs)(O.Q,{data:k,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(P.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(Q.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(R.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===h?V:W,width:50}),(0,d.jsx)(S.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[V(a),"Tokens"]:[W(a),"Cost"]}),"tokens"===h?(0,d.jsx)(T.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(T.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}function Y(a){let b=String(a||"").trim();if(!b)return"";try{return new URL(b).hostname||""}catch{return b.replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/:\d+$/,"")}}function Z(a){let b=String(a||"").trim();return/^openai-compatible-chat-[0-9a-f-]{20,}$/i.test(b)||/^openai-compatible-[0-9a-f-]{20,}$/i.test(b)}function $(a){return String(a||"").trim()}function _(a=[]){let b={},c={};for(let d of a||[]){let a=function(a={}){let b=$(a.provider||a.providerId||a.provider_id||a.id),c=$(a.accountName||a.account_name||a.email||a.displayName||a.display_name||a.name||a.label||a.connectionName||a.connection_name),d=Y(a.endpoint)||Y(a.baseUrl)||Y(a.baseURL)||Y(a.base_url)||Y(a.providerUrl)||Y(a.provider_url)||Y(a.url),e=$(a.email);return{providerId:b,accountName:c,displayName:$(a.displayName||a.display_name),email:e,endpointHost:d,ownerUser:$(a.ownerUser||a.owner_user),isPersonal:"personal"===a.scope||"private"===a.visibility||!!(a.ownerUser||a.owner_user)}}(d);for(let c of[d.id,d.connectionId,d.connection_id].map($).filter(Boolean))b[c]||(b[c]=a);a.accountName&&!c[a.accountName]&&(c[a.accountName]=a)}return{byConnectionId:b,byAccount:c}}function aa(a={},b={}){let c=a.model||a.rawModel||a.raw_model||"-",d=function(a={},b={}){let c=function(a={},b={}){for(let c of[a.connectionId,a.connection_id].map($).filter(Boolean))if(b.byConnectionId?.[c])return b.byConnectionId[c];let c=$(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return c&&b.byAccount?.[c]?b.byAccount[c]:null}(a,b),d=function(a={},b=null){let c=$(a.provider||a.providerId||a.provider_id).toLowerCase();if(!(!0===a.isPersonalOAuth||!0===a.is_personal_oauth||"personal"===a.connectionScope||"personal"===a.connection_scope||"private"===a.visibility||b?.isPersonal)||!c)return"";let d=$(a.ownerUser||a.owner_user||a.apiKeyOwner||a.api_key_owner||b?.ownerUser),e=$(a.accountEmail||a.account_email||a.email||b?.email),f=$(a.accountDisplayName||a.account_display_name||a.accountName||a.account_name||a.connectionName||a.connection_name||b?.accountName||b?.displayName),g=[];return(d&&g.push(d),e&&e!==d?g.push(e):f&&f!==d&&g.push(f),g.length)?(g.push(c),g.join("/")):""}(a,c);if(d)return d;if(c){let a=c.providerId,b=c.accountName,d=c.endpointHost;if(a&&!Z(a)){if(c.isPersonal&&c.ownerUser){let d=[c.ownerUser];return c.email&&c.email!==c.ownerUser?d.push(c.email):b&&b!==c.ownerUser&&d.push(b),d.push(a),d.join("/")}return b&&b!==a?`${a}/${b}`:a}if(b)return b;if(d)return d}let e=Y(a.endpoint)||Y(a.providerUrl)||Y(a.provider_url)||Y(a.baseUrl)||Y(a.baseURL)||Y(a.base_url)||Y(a.url);if(e)return e;let f=$(a.provider||a.providerId||a.provider_id),g=$(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return f&&!Z(f)?g&&g!==f?`${f}/${g}`:f:g||""}(a,b),e=$(a.provider||a.providerId||a.provider_id);return!d||"-"===c||String(c).startsWith(`${d}/`)?c:e&&String(c).startsWith(`${e}/`)&&(d.startsWith(`${e}/`)||d.endsWith(`/${e}`))?`${d}/${String(c).slice(e.length+1)}`:`${d}/${c}`}function ab({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}X.propTypes={period:n().string};let ac=new Set(["ok","success","succeeded","complete","completed","done","200 ok"]),ad=new Set(["pending","running","queued","in_progress","in-progress"]);function ae(a={}){let b,c=String(a.status||a.statusText||a.status_text||"").trim().toLowerCase(),d=(b=String(c||"").match(/\b([1-5]\d{2})\b/))?Number(b[1]):null,e=function(...a){for(let b of a){if(null==b||""===b)continue;let a=Number(b);if(Number.isFinite(a))return a}return null}(a.statusCode,a.status_code,a.gatewayStatusCode,a.gateway_status_code,a.upstreamStatusCode,a.upstream_status_code,d),f=$(a.errorCode||a.error_code),g=$(a.errorType||a.error_type),h=$(a.errorMessageShort||a.error_message_short||a.message||a.error);if(ad.has(c))return{kind:"pending",label:"PENDING",title:"Request is still pending/running.",dotClass:"bg-amber-500",rowClass:"hover:bg-amber-50/60",badgeClass:"bg-amber-100 text-amber-700 border border-amber-200"};if(/\b(error|fail|failed|failure|timeout|cancelled|canceled)\b/i.test(c)||null!==e&&e>=400||f||g||h){let b=null!==e?`ERR ${e}`:c?c.toUpperCase():"ERROR",d=[`Status: ${b}`,f?`Code: ${f}`:"",g?`Type: ${g}`:"",h?`Message: ${h}`:"",a.endpoint?`Endpoint: ${a.endpoint}`:""].filter(Boolean);return{kind:"error",label:b,title:d.join("\n"),dotClass:"bg-error",rowClass:"hover:bg-error/5",badgeClass:"bg-error/10 text-error border border-error/20"}}return null!==e&&e>=200&&e<300||!c||ac.has(c)?{kind:"success",label:e?`OK ${e}`:"OK",title:"Request completed successfully.",dotClass:"bg-success",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-success/10 text-success border border-success/20"}:{kind:"unknown",label:c?c.toUpperCase():"UNKNOWN",title:c?`Status: ${c}`:"Unknown request status.",dotClass:"bg-text-muted",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-bg-subtle text-text-muted border border-border"}}function af({request:a}){let{cachedTokens:b,cacheCreationTokens:c,totalTokens:e,totalInputTokens:f,newInputTokens:g,reasoningTokens:h,outputTokens:i}=function(a={}){let b=Number(a.promptTokens??a.prompt_tokens??0)||0,c=Number(a.cachedTokens??a.cached_tokens??a.cache_read_input_tokens??0)||0,d=Number(a.cacheCreationTokens??a.cache_creation_input_tokens??0)||0,e=Number(a.completionTokens??a.completion_tokens??0)||0,f=Number(a.totalTokens??a.total_tokens??b+e)||0,g=Number(a.displayTotalInputTokens??a.display_total_input_tokens??b)||0,h=Number(a.displayNewInputTokens??a.display_new_input_tokens??Math.max(0,g-c-d))||0,i=Number(a.displayCachedInputTokens??a.display_cached_input_tokens??c)||0,j=Number(a.displayCacheCreationInputTokens??a.display_cache_creation_input_tokens??d)||0,k=Number(a.displayReasoningTokens??a.display_reasoning_tokens??a.reasoningTokens??a.reasoning_tokens??0)||0,l=Number(a.displayOutputTokens??a.display_output_tokens??e)||0;return{promptTokens:b,cachedTokens:i,cacheCreationTokens:j,completionTokens:e,totalTokens:f,totalInputTokens:g,newInputTokens:h,reasoningTokens:k,outputTokens:l}}(a),j=ae(a),k=f>0?Math.min(100,Math.max(0,Math.round(b/f*100))):0,l=`Total Input: ${y(f)}
11
+ New Input: ${y(g)}
12
+ Cached: ${y(b)}
13
+ Cache Create: ${y(c)}
14
+ Reasoning: ${y(h)}
15
+ Output: ${y(i)}`;return"success"===j.kind&&e>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 whitespace-nowrap leading-tight",title:l,children:[(0,d.jsxs)("span",{className:"text-primary",children:[y(f),b>0&&(0,d.jsxs)("span",{className:"ml-1 text-[10px] text-success",children:["(",k,"% cached)"]}),"↑"]}),(0,d.jsx)("span",{className:"text-text-muted",children:"/"}),(0,d.jsxs)("span",{className:"text-success",children:[y(i),"↓"]})]}):"success"===j.kind?(0,d.jsx)("div",{className:"flex items-center justify-end",title:"Request completed, but no token usage was reported.",children:(0,d.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-bg-subtle px-2 py-0.5 text-[10px] font-semibold leading-4 text-text-muted",children:"NO USAGE"})}):(0,d.jsxs)("div",{className:"flex items-center justify-end gap-1.5",title:j.title,children:[(0,d.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-semibold leading-4 ${j.badgeClass}`,children:j.label}),e>0&&(0,d.jsxs)("span",{className:"text-[11px] text-text-muted whitespace-nowrap",children:[y(f),"↑ ",y(i),"↓"]})]})}function ag({requests:a=[],providers:b=[]}){let c=(0,e.useMemo)(()=>_(b),[b]),f=(0,e.useMemo)(()=>Array.isArray(a)?a.filter(a=>"success"===ae(a).kind):[],[a]),g=Math.max(0,(Array.isArray(a)?a.length:0)-f.length);return(0,d.jsxs)(j.default,{className:"flex min-w-0 flex-col overflow-hidden",padding:"sm",style:{height:480},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 py-2 border-b border-border shrink-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Recent Requests"}),(0,d.jsx)("span",{className:"inline-flex items-center rounded-full border border-success/20 bg-success/10 px-2 py-0.5 text-[10px] font-semibold uppercase leading-4 text-success",children:"Success only"})]}),g>0&&(0,d.jsxs)("span",{className:"shrink-0 text-[11px] text-text-muted",title:"Error, pending and failed requests are intentionally hidden here. Use the Errors/Analytics views for troubleshooting.",children:[y(g)," hidden"]})]}),f.length?(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,d.jsxs)("table",{className:"w-full min-w-[300px] border-collapse text-xs",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg z-10",children:(0,d.jsxs)("tr",{className:"border-b border-border",children:[(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted w-2"}),(0,d.jsx)("th",{className:"py-1.5 text-left font-semibold text-text-muted",children:"Model"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted whitespace-nowrap",children:"In / Out"}),(0,d.jsx)("th",{className:"py-1.5 text-right font-semibold text-text-muted",children:"When"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:f.map((a,b)=>{let e=aa(a,c);return(0,d.jsxs)("tr",{className:"hover:bg-bg-subtle transition-colors",children:[(0,d.jsx)("td",{className:"py-1.5",children:(0,d.jsx)("span",{className:"block w-1.5 h-1.5 rounded-full bg-success"})}),(0,d.jsx)("td",{className:"py-1.5 font-mono truncate max-w-[240px]",title:e,children:e}),(0,d.jsx)("td",{className:"py-1.5 text-right whitespace-nowrap",children:(0,d.jsx)(af,{request:a})}),(0,d.jsx)("td",{className:"py-1.5 text-right text-text-muted whitespace-nowrap",children:(0,d.jsx)(ab,{timestamp:a.timestamp})})]},a.requestId||a.id||`${a.timestamp||"request"}-${b}`)})})]})}):(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-1 px-4 text-center text-sm",children:[(0,d.jsx)("div",{className:"font-medium text-text-main",children:"No successful requests yet."}),g>0&&(0,d.jsxs)("div",{className:"max-w-[260px] text-xs text-text-muted",children:[y(g)," non-success request",1===g?"":"s"," hidden from this usage-focused list."]})]})]})}function ah(a,b={},c,d){return Object.entries(a||{}).map(([a,c])=>{let d=(c.promptTokens||0)+(c.completionTokens||0),e=c.cost||0,f=d>0?(c.promptTokens||0)*(e/d):0,g=d>0?(c.completionTokens||0)*(e/d):0;return{...c,key:a,totalTokens:d,totalCost:e,inputCost:f,outputCost:g,pending:b[a]||0}}).sort((a,b)=>{let e=a[c],f=b[c];return("string"==typeof e&&(e=e.toLowerCase()),"string"==typeof f&&(f=f.toLowerCase()),e<f)?"asc"===d?-1:1:e>f?"asc"===d?1:-1:0})}function ai(a,b){if(!Array.isArray(a))return[];let c={};return a.forEach(a=>{let d=function(a,b){switch(b){case"rawModel":return a.rawModel||"Unknown Model";case"accountName":return a.accountName||`Account ${a.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return a.keyName||"Unknown Key";case"endpoint":return a.endpoint||"Unknown Endpoint";default:return a[b]||"Unknown"}}(a,b);c[d]||(c[d]={groupKey:d,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let e=c[d].summary;e.requests+=a.requests||0,e.promptTokens+=a.promptTokens||0,e.completionTokens+=a.completionTokens||0,e.totalTokens+=a.totalTokens||0,e.cost+=a.cost||0,e.inputCost+=a.inputCost||0,e.outputCost+=a.outputCost||0,e.pending+=a.pending||0,a.lastUsed&&(!e.lastUsed||new Date(a.lastUsed)>new Date(e.lastUsed))&&(e.lastUsed=a.lastUsed),c[d].items.push(a)}),Object.values(c)}let aj=[{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],ak=[{field:"accountName",label:"Account"},{field:"rawModel",label:"Model"},{field:"provider",label:"Provider"},{field:"requests",label:"Requests",align:"right"},{field:"lastUsed",label:"Last Used",align:"right"}],al=[{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"}],am=[{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"}],an=[{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"}],ao=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"}];function ap({period:a,setPeriod:b,hidePeriodSelector:c=!1}={}){let g=(0,f.useRouter)(),j=(0,f.useSearchParams)(),{isAdmin:k}=(0,h.s)(),l=j.get("sortBy")||"rawModel",m=j.get("sortOrder")||"asc",[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!0),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)("model"),[v,x]=(0,e.useState)("costs"),[z,B]=(0,e.useState)([]),[C,E]=(0,e.useState)("today"),F=(0,e.useRef)(!0),G=(0,e.useRef)(!1),H=a??C,I=b??E,J=(0,e.useMemo)(()=>_(z),[z]);(0,e.useCallback)(({silent:a=!1}={})=>G.current?Promise.resolve():(G.current=!0,F.current?(F.current=!1,q(!0)):a||s(!0),fetch(`/api/usage/stats?period=${H}`).then(a=>a.ok?a.json():null).then(a=>{a&&o(b=>({...b,...a}))}).catch(()=>{}).finally(()=>{G.current=!1,q(!1),a||s(!1)})),[H]);let K=(0,e.useCallback)((a,b)=>{let c=new URLSearchParams(j.toString());c.get("sortBy")===b?c.set("sortOrder","asc"===c.get("sortOrder")?"desc":"asc"):(c.set("sortBy",b),c.set("sortOrder","asc")),g.replace(`?${c.toString()}`,{scroll:!1})},[j,g]),L=(0,e.useMemo)(()=>{if(!n)return null;switch(t){case"model":{let a=n.pending?.byModel||{};return{columns:aj,groupedData:ai(ah(n.byModel,a,l,m),"rawModel"),storageKey:"usage-stats:expanded-models",emptyMessage:"No usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,title:aa(a,J),children:aa(a,J)}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.lastUsed)})]})}}case"account":{let a={};return n?.pending?.byAccount&&Object.entries(n.byAccount||{}).forEach(([b,c])=>{let d=n.pending.byAccount[c.connectionId];if(d){let e=c.provider?`${c.rawModel} (${c.provider})`:c.rawModel;a[b]=d[e]||0}}),{columns:ak,groupedData:ai(ah(n.byAccount,a,l,m),"accountName"),storageKey:"usage-stats:expanded-accounts",emptyMessage:"No account-specific usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,children:a.accountName||`Account ${a.connectionId?.slice(0,8)}...`}),(0,d.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${a.pending>0?"text-primary":""}`,title:a.rawModel,children:a.rawModel}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:a.pending>0?"primary":"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.lastUsed)})]})}}case"apiKey":return{columns:al,groupedData:ai(ah(n.byApiKey,{},l,m),"keyName"),storageKey:"usage-stats:expanded-apikeys",emptyMessage:"No API key usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium",children:a.keyName}),(0,d.jsx)("td",{className:"px-6 py-3",title:aa(a,J),children:aa(a,J)}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.lastUsed)})]})};default:return{columns:am,groupedData:ai(ah(n.byEndpoint,{},l,m),"endpoint"),storageKey:"usage-stats:expanded-endpoints",emptyMessage:"No endpoint usage recorded yet.",renderSummaryCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.summary.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.summary.lastUsed)})]}),renderDetailCells:a=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 font-medium font-mono text-sm",children:a.endpoint}),(0,d.jsx)("td",{className:"px-6 py-3",title:aa(a,J),children:aa(a,J)}),(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsx)(i.default,{variant:"neutral",size:"sm",children:a.provider})}),(0,d.jsx)("td",{className:"px-6 py-3 text-right",children:y(a.requests)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:A(a.lastUsed)})]})}}},[n,t,l,m,J]);if(!n&&!p)return(0,d.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let N=(0,d.jsx)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})});return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[!c&&(0,d.jsxs)("div",{className:"flex w-full items-center gap-2 sm:w-auto sm:self-end",children:[(0,d.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:ao.map(a=>(0,d.jsx)("button",{onClick:()=>I(a.value),disabled:r,className:`rounded-md px-3 py-1 text-sm font-medium transition-colors ${H===a.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-bg-hover hover:text-text"}`,children:a.label},a.value))}),r&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted animate-spin",children:"progress_activity"})]}),p?N:(0,d.jsx)(w,{stats:n}),p?N:k?(0,d.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,d.jsx)(M,{providers:z,activeRequests:n.activeRequests||[],lastProvider:n.recentRequests?.[0]?.provider||"",errorProvider:n.errorProvider||""}),(0,d.jsx)(ag,{requests:n.recentRequests||[],providers:z})]}):(0,d.jsx)(ag,{requests:n.recentRequests||[],providers:z}),p?N:(0,d.jsx)(X,{period:H}),(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsx)("select",{value:t,onChange:a=>u(a.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:an.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))}),(0,d.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,d.jsx)("button",{onClick:()=>x("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===v?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"}),(0,d.jsx)("button",{onClick:()=>x("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===v?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"})]})]}),p?N:L&&(0,d.jsx)(D,{title:"",columns:L.columns,groupedData:L.groupedData,tableType:t,sortBy:l,sortOrder:m,onToggleSort:K,viewMode:v,storageKey:L.storageKey,renderSummaryCells:L.renderSummaryCells,renderDetailCells:L.renderDetailCells,emptyMessage:L.emptyMessage})]})]})}},87228:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\KiroSocialOAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\KiroSocialOAuthModal.js","default")},87369:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\OAuthModalRouter.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\OAuthModalRouter.js","default")},88119:(a,b,c)=>{"use strict";c.d(b,{Fv:()=>d,SI:()=>e,VC:()=>h}),Object.freeze({ADMIN:"admin",MONITOR_ADMIN:"monitor_admin",AI_GATEWAYS_MONITOR:"ai_gateways_monitor",USER:"user",GUEST:"guest"});let d="/dashboard/endpoint",e=Object.freeze([{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/analytics",label:"Analytics",icon:"monitoring"},{href:"/dashboard/ai-power-index",label:"AI Power Index",icon:"electric_bolt"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"}]),f=Object.freeze(["/dashboard","/dashboard/endpoint","/dashboard/api-keys","/dashboard/usage","/dashboard/analytics","/dashboard/ai-power-index","/dashboard/quota"]);function g(a=""){return String(a||"").split("?")[0].replace(/\/+$/,"")||"/"}function h(a=""){let b=g(a);return"/dashboard"===b||f.filter(a=>"/dashboard"!==a).some(a=>{let c,d;return c=g(b),c===(d=g(a))||c.startsWith(`${d}/`)})}},88137:a=>{a.exports={dashboardShell:"DashboardLayout_dashboardShell__AtdSy",dark:"DashboardLayout_dark__abQ2l"}},88712:(a,b,c)=>{Promise.resolve().then(c.bind(c,67738)),Promise.resolve().then(c.bind(c,82970)),Promise.resolve().then(c.bind(c,40738)),Promise.resolve().then(c.bind(c,25919)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,45407)),Promise.resolve().then(c.bind(c,34716)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,11229)),Promise.resolve().then(c.bind(c,62727)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,51585)),Promise.resolve().then(c.bind(c,48781)),Promise.resolve().then(c.bind(c,43182)),Promise.resolve().then(c.bind(c,86739)),Promise.resolve().then(c.bind(c,3236)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,86209)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,54004)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,20084)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,83352)),Promise.resolve().then(c.bind(c,23048)),Promise.resolve().then(c.bind(c,50585)),Promise.resolve().then(c.bind(c,23525)),Promise.resolve().then(c.bind(c,21150)),Promise.resolve().then(c.bind(c,11633)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,32971)),Promise.resolve().then(c.bind(c,87226))},91099:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({options:a=[],value:b,onChange:c,size:g="md",className:h}){let i={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,d.jsx)("div",{className:(0,e.cn)("inline-flex items-center p-1 rounded-[10px] overflow-x-auto","bg-surface-2",h),children:a.map(a=>(0,d.jsxs)("button",{onClick:()=>c(a.value),className:(0,e.cn)("shrink-0 px-4 rounded-[8px] font-medium transition-all",i[g],b===a.value?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[a.icon&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:a.icon}),a.label]},a.value))})}},91809:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(48249),e=c(67484),f=c(17660);function g(){let[a,b]=(0,e.useState)([]),[c,g]=(0,e.useState)(!0),[h,i]=(0,e.useState)(!0);return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("span",{children:"Auto Refresh (3s)"}),(0,d.jsx)("div",{onClick:()=>i(!h),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${h?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,d.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${h?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,d.jsx)(f.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,d.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:c&&0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===a.length?(0,d.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,d.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,d.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,d.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,d.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border/50",children:a.map((a,b)=>{let c=a.split(" | ");if(c.length<7)return null;let e=c[6],f=e.includes("PENDING"),g=e.includes("FAILED"),h=e.includes("OK");return(0,d.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${f?"bg-primary/5":""}`,children:[(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:c[0]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:c[1]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,d.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:c[2]})}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:c[3],children:c[3]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:c[4]}),(0,d.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:c[5]}),(0,d.jsx)("td",{className:`px-3 py-1.5 font-bold ${h?"text-success":g?"text-error":"text-primary animate-pulse"}`,children:e})]},b)})})]})})}),(0,d.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are loaded from the request history database."})]})}},92082:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>h,PageLoading:()=>f,Skeleton:()=>g,Spinner:()=>e,default:()=>i});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Spinner() from the server but Spinner is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","Spinner"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLoading() from the server but PageLoading is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","PageLoading"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call Skeleton() from the server but Skeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","Skeleton"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CardSkeleton() from the server but CardSkeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","CardSkeleton"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Loading.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Loading.js","default")},92669:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Header.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Header.js","default")},94582:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\ModelSelectModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\ModelSelectModal.js","default")},95145:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>l,default:()=>k});var d=c(48249),e=c(67484),f=c(71404),g=c(99070),h=c(32971),i=c(7806);function j(a,b){return!!a&&Object.prototype.hasOwnProperty.call(a,b)}function k({isOpen:a,onClose:b,title:c,children:g,footer:l,size:m="md",closeOnOverlay:n=!0,showTrafficLights:o=!0,busy:p=!1,className:q}){let r=(0,e.useRef)({onClose:b,busy:p}),s=(0,i.t)(),t=s?.({title:c,children:g,footer:l,size:m,className:q})||null,u=j(t,"children")?t.children:g,v=j(t,"footer")?t.footer:l,w=t?.size||m,x=(0,f.cn)(q,t?.className);r.current.onClose=b,r.current.busy=p;let y={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"};return a?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:n&&!p?b:void 0}),(0,d.jsxs)("div",{className:(0,f.cn)("relative w-full bg-surface","border border-border-subtle","rounded-[14px] shadow-[var(--shadow-elev)]","fade-in",y[w]||y.md,x),children:[(c||o)&&(0,d.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center",children:[o&&(0,d.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,d.jsx)(h.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,d.jsx)("button",{onClick:b,disabled:p,"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 disabled:cursor-not-allowed disabled:opacity-50",children:(0,d.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,d.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),c&&(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:c})]}),(0,d.jsx)("button",{onClick:b,disabled:p,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,d.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:u}),v&&(0,d.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:v})]})]}):null}function l({isOpen:a,onClose:b,onConfirm:c,title:e="Confirm",message:f,confirmText:h="Confirm",cancelText:i="Cancel",variant:j="danger",loading:m=!1}){return(0,d.jsx)(k,{isOpen:a,onClose:b,title:e,size:"sm",busy:m,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.default,{variant:"ghost",onClick:b,disabled:m,children:i}),(0,d.jsx)(g.default,{variant:j,onClick:c,loading:m,children:h})]}),children:(0,d.jsx)("p",{className:"text-text-muted",children:f})})}},95514:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({checked:a=!1,onChange:b,label:c,description:g,disabled:h=!1,size:i="md",className:j}){let k={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,d.jsxs)("div",{className:(0,e.cn)("flex items-center gap-3",h&&"opacity-50 cursor-not-allowed",j),children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:h,onClick:()=>{!h&&b&&b(!a)},className:(0,e.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",a?"bg-brand-500":"bg-surface-3",k[i].track,h&&"cursor-not-allowed"),children:(0,d.jsx)("span",{className:(0,e.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",a?k[i].translate:"translate-x-0.5",k[i].thumb,"mt-0.5")})}),(c||g)&&(0,d.jsxs)("div",{className:"flex flex-col",children:[c&&(0,d.jsx)("span",{className:"text-sm font-medium text-text-main",children:c}),g&&(0,d.jsx)("span",{className:"text-xs text-text-muted",children:g})]})]})}},97564:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249);c(67484);var e=c(74429);let f=[{icon:"terminal",label:"Terminal",desc:"Full shell access"},{icon:"cast",label:"Desktop",desc:"Screen sharing"},{icon:"folder_open",label:"Files",desc:"Browse & edit files"}],g=[{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 h({isOpen:a,onClose:b}){return a?(0,e.createPortal)((0,d.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:b}),(0,d.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,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center bg-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-base",children:"terminal"})}),(0,d.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-mono",children:"9Remote"})]}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"close"})})]}),(0,d.jsxs)("div",{className:"px-7 py-7 pb-9 flex flex-col gap-6",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center mt-2",children:[(0,d.jsx)("div",{className:"w-14 h-14 rounded-[14px] flex items-center justify-center mb-1 bg-primary shadow-[var(--shadow-warm)]",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-white text-[30px]",children:"terminal"})}),(0,d.jsx)("h1",{className:"text-lg font-bold text-text-main tracking-tight",children:"9Remote"}),(0,d.jsx)("p",{className:"text-xs text-text-muted leading-5 max-w-[220px]",children:"Access your terminal, desktop & files from anywhere"})]}),(0,d.jsx)("div",{className:"flex gap-2 w-full",children:f.map(({icon:a,label:b,desc:c})=>(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[22px]",children:a}),(0,d.jsx)("p",{className:"text-xs font-semibold text-text-main",children:b}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted text-center leading-4",children:c})]},b))}),(0,d.jsx)("div",{className:"flex flex-col gap-3 w-full",children:g.map(({icon:a,text:b})=>(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined flex-shrink-0 text-primary text-[16px]",children:a}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:b})]},a))}),(0,d.jsxs)("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,d.jsx)("span",{className:"material-symbols-outlined text-base",children:"open_in_new"}),"Get 9Remote"]})]})]})]}),document.body):null}},99070:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(71404);let f={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"},g={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 h({children:a,variant:b="primary",size:c="md",icon:i,iconRight:j,disabled:k=!1,loading:l=!1,fullWidth:m=!1,className:n,...o}){return(0,d.jsxs)("button",{className:(0,e.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",f[b],g[c],m&&"w-full",n),disabled:k||l,...o,children:[l?(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):i?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i}):null,a,j&&!l&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:j})]})}}};
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/WG3mGLsoLrg1NnPZ3XNsf/_buildManifest.js","static/WG3mGLsoLrg1NnPZ3XNsf/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-7223ab98c3aee1a6.js","static/chunks/4bd1b696-8a4ab4fdf0ae305a.js","static/chunks/3794-d7cddff008311ab3.js","static/chunks/main-app-eacc433ef218cf40.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/Vn8se_autf8L0-9JevHrZ/_buildManifest.js","static/Vn8se_autf8L0-9JevHrZ/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-7223ab98c3aee1a6.js","static/chunks/4bd1b696-8a4ab4fdf0ae305a.js","static/chunks/3794-d7cddff008311ab3.js","static/chunks/main-app-eacc433ef218cf40.js"],rootMainFilesTree:{},pages:{"/_app":[]}};