@jheavenknows/bluerouter 5.0.88 → 5.0.90
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.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +7 -7
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/qwen-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js +2 -2
- package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +7 -7
- package/app/.next-cli-build/server/chunks/2338.js +1 -1
- package/app/.next-cli-build/server/chunks/3110.js +1 -1
- package/app/.next-cli-build/server/chunks/402.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/6328.js +1 -1
- package/app/.next-cli-build/server/chunks/6939.js +1 -1
- package/app/.next-cli-build/server/chunks/9434.js +1 -1
- package/app/.next-cli-build/server/chunks/9489.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{5263-17798e99cdafe50b.js → 5263-fe05e950a87e0772.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/analytics/page-6bd62c37019ccc73.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/page-a1f235e372a6e56d.js +1 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/analytics/page-8cf46d694d06cdaa.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/page-e3b94266bfc673d3.js +0 -1
- /package/app/.next-cli-build/static/{z8AnhbUkQv0TB7DWTtIND → 9fQAUz2AF8lTDmzwLM3mn}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{z8AnhbUkQv0TB7DWTtIND → 9fQAUz2AF8lTDmzwLM3mn}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.81-to-5.0.82-5.0.82-20260702-194133 → upgrade-5.0.85-to-5.0.87-5.0.87-20260707-115428}/data.sqlite +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.82-to-5.0.83-5.0.83-20260702-203556 → upgrade-5.0.87-to-5.0.88-5.0.88-20260707-121528}/data.sqlite +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3538],{43503:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var n=s(95155),r=s(12115),a=s(35497),l=s(57250);function i(e,t){return t.find(t=>t.id===e)?.name||e}function d(e){return String(e||"").trim().toLowerCase()}function o(e){return Array.isArray(e?.importedModels)?e.importedModels:[]}function c(){let[e,t]=(0,r.useState)(!0),[s,c]=(0,r.useState)(!1),[x,m]=(0,r.useState)(""),[h,u]=(0,r.useState)(""),[p,b]=(0,r.useState)(""),[g,j]=(0,r.useState)(!1),[f,y]=(0,r.useState)([]),[v,N]=(0,r.useState)([]),[k,w]=(0,r.useState)(null),[A,C]=(0,r.useState)(null),[I,M]=(0,r.useState)(""),[S,O]=(0,r.useState)(null),[$,T]=(0,r.useState)([]),[E,K]=(0,r.useState)(!1),[R,U]=(0,r.useState)(""),[q,P]=(0,r.useState)([]),[z,F]=(0,r.useState)(!1),[B,L]=(0,r.useState)(!1),[D,_]=(0,r.useState)({}),[G,H]=(0,r.useState)({}),[J,X]=(0,r.useState)(""),[Z,V]=(0,r.useState)({}),[W,Q]=(0,r.useState)(null),[Y,ee]=(0,r.useState)({}),[et,es]=(0,r.useState)(""),[en,er]=(0,r.useState)(""),[ea,el]=(0,r.useState)({}),[ei,ed]=(0,r.useState)({}),[eo,ec]=(0,r.useState)(""),[ex,em]=(0,r.useState)(!1),[eh,eu]=(0,r.useState)(!0),ep=(0,r.useCallback)(async()=>{t(!0),m("");try{let e=await fetch("/api/personal-cloud-providers",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được personal cloud providers");b(t.userId||""),j(!0===t.isAdmin),y(t.providers||[]),N(t.connections||[]),eu(!1!==t.globalRtkEnabled),el(t.routing||{}),ed(e=>{let s={...e};for(let[e,n]of Object.entries(t.routing||{}))s[e]={...n};return s}),X(e=>e||t.userId||"")}catch(e){m(e.message||"Kh\xf4ng tải được personal cloud providers")}finally{t(!1)}},[]),eb=(0,r.useCallback)(async()=>{if(g){L(!0);try{let e=await fetch("/api/personal-cloud-providers/permissions",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được quyền OAuth");_(t.permissions||{}),H(t.connectionsByUser||{})}catch(e){m(e.message||"Kh\xf4ng tải được quyền OAuth")}finally{L(!1)}}},[g]);(0,r.useEffect)(()=>{ep()},[ep]),(0,r.useEffect)(()=>{g&&eb()},[g,eb]),(0,r.useEffect)(()=>{let e=D[d(J)]||{},t={};for(let s of f)t[s.id]=!0===e[s.id];V(t)},[J,D,f]);let eg=(0,r.useMemo)(()=>{let e=d(S?.ownerUser||p);return e?$.filter(t=>d(t.ownerUser||t.createdByUser||p)===e):[]},[$,S,p]),ej=(0,r.useMemo)(()=>{let e=new Map;for(let t of $){let s=String(t.id||"").slice(0,8);e.set(t.id,`${t.name||"API key"}${s?` \xb7 ${s}`:""}`)}return e},[$]),ef=(0,r.useMemo)(()=>Array.from(new Set([...Object.keys(D||{}),...Object.keys(G||{})])).map(e=>{let t=D[e]||{},s=G[e]||{},n=f.filter(e=>t?.[e.id]===!0),r=f.some(e=>(s[e.id]||0)>0);return{userId:e,providerState:t,connectionsByProvider:s,enabledProviders:n,hasAnyConnection:r}}).filter(e=>e.enabledProviders.length>0||e.hasAnyConnection).sort((e,t)=>e.userId.localeCompare(t.userId)),[D,G,f]),ey=async()=>{w(null),u("OAuth account đ\xe3 được th\xeam. Model sẽ được import tự động nếu provider hỗ trợ."),await ep()},ev=async(e,t)=>{m(""),u("");try{let s=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await s.json().catch(()=>({}));if(!s.ok)throw Error(n.error||"Kh\xf4ng cập nhật được connection");await ep()}catch(e){m(e.message||"Kh\xf4ng cập nhật được connection")}},eN=async e=>{m(""),u(""),M(e.id);try{let t=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/import-models`,{method:"POST"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng import được model");N(t=>t.map(t=>t.id===e.id?{...t,availableModels:s.models||[],importedModels:s.importedModels||[],modelImport:s.modelImport||t.modelImport}:t)),Q(t=>t?.id===e.id?{...t,availableModels:s.models||[],importedModels:s.importedModels||[],modelImport:s.modelImport||t.modelImport}:t);let n=s.modelImport?.source==="provider"?"provider":"catalog fallback";u(`Đ\xe3 cập nhật ${s.models?.length||0} model từ ${n}.`)}catch(e){m(e.message||"Kh\xf4ng import được model")}finally{M("")}},ek=(0,r.useCallback)(async()=>{let e=d(p);if(e){K(!0);try{let t=`&ownerUser=${encodeURIComponent(e)}`,s=await fetch(`/api/keys?pageSize=100&status=active${t}`,{cache:"no-store"}),n=await s.json().catch(()=>({}));if(!s.ok)throw Error(n.error||"Kh\xf4ng tải được API keys");T(Array.isArray(n.keys)?n.keys:[])}catch(e){m(e.message||"Kh\xf4ng tải được API keys")}finally{K(!1)}}},[p]),ew=async e=>{K(!0);try{let t=d(e?.ownerUser||p),s=t?`&ownerUser=${encodeURIComponent(t)}`:"",n=await fetch(`/api/keys?pageSize=100&status=active${s}`,{cache:"no-store"}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error||"Kh\xf4ng tải được API keys");let a=Array.isArray(r.keys)?r.keys:[];T(a);let l=d(r.userId),i=a.find(e=>d(e.ownerUser||e.createdByUser||l)===t);U(e=>e||i?.id||"")}catch(e){m(e.message||"Kh\xf4ng tải được API keys")}finally{K(!1)}};(0,r.useEffect)(()=>{p&&ek()},[p,ek]);let eA=async e=>{let t,s;m(""),u(""),O(e),P((s=(t=o(e)).filter(e=>"llm"===(e.type||"llm")).slice(0,3).map(e=>e.routeModel).filter(Boolean)).length>0?s:t.slice(0,3).map(e=>e.routeModel).filter(Boolean)),U(""),await ew(e)},eC=async()=>{if(!S)return;if(!R)return void m("Chọn API key cần th\xeam model.");let e=Array.from(new Set((Array.isArray(q)?q:[]).map(e=>String(e||"").trim()).filter(Boolean)));if(0===e.length)return void m("Chọn \xedt nhất một model.");F(!0),m(""),u("");try{let t=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(S.id)}/api-key-models`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyId:R,models:e})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng th\xeam được model v\xe0o API key");O(null),u(`Đ\xe3 th\xeam ${s.addedModels?.length||e.length} model v\xe0o API key ${s.key?.name||""}.`)}catch(e){m(e.message||"Kh\xf4ng th\xeam được model v\xe0o API key")}finally{F(!1)}},eI=async()=>{if(A){m(""),u("");try{let e=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(A.id)}`,{method:"DELETE"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng x\xf3a được connection");C(null),await ep()}catch(e){m(e.message||"Kh\xf4ng x\xf3a được connection")}}},eM=async(e,t)=>{if(e?.id&&t?.routeModel){m(""),es(t.routeModel),ee(e=>({...e,[t.routeModel]:{...e[t.routeModel]||{},loading:!0}}));try{let s=`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/models/${t.routeModel.split("/").map(encodeURIComponent).join("/")}`,n=await fetch(s,{method:"POST"}),r=await n.json().catch(()=>({})),a={ok:r?.ok===!0,status:r?.status||n.status,text:r?.text||"",error:r?.error||(n.ok?"":"Test failed"),latencyMs:r?.latencyMs||0};ee(e=>({...e,[t.routeModel]:a}))}catch(e){ee(s=>({...s,[t.routeModel]:{ok:!1,error:e.message||"Test failed"}}))}finally{es("")}}},eS=async(e,t)=>{if(e?.id&&t?.routeModel&&window.confirm(`X\xf3a model ${t.routeModel} khỏi connection ${e.name||e.id}?`)){m(""),u(""),er(t.routeModel);try{let s=`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/models/${t.routeModel.split("/").map(encodeURIComponent).join("/")}`,n=await fetch(s,{method:"DELETE"}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.error||"Kh\xf4ng x\xf3a được model");(e=>{if(!e?.connectionId&&!e?.id)return;let t=e.connectionId||e.id;N(s=>s.map(s=>s.id===t?{...s,importedModels:Array.isArray(e.importedModels)?e.importedModels:s.importedModels,availableModels:Array.isArray(e.models)?e.models:Array.isArray(e.availableModels)?e.availableModels:s.availableModels,modelImport:e.modelImport||s.modelImport}:s)),Q(s=>s?.id===t?{...s,importedModels:Array.isArray(e.importedModels)?e.importedModels:s.importedModels,availableModels:Array.isArray(e.models)?e.models:Array.isArray(e.availableModels)?e.availableModels:s.availableModels,modelImport:e.modelImport||s.modelImport}:s)})(r),ee(e=>{let s={...e};return delete s[t.routeModel],s}),u(`Đ\xe3 x\xf3a model ${t.routeModel}.`)}catch(e){m(e.message||"Kh\xf4ng x\xf3a được model")}finally{er("")}}},eO=(e,t)=>{ed(s=>{let n={...s[e]||{},...t};for(let e of Object.keys(n))(""===n[e]||void 0===n[e])&&delete n[e];return{...s,[e]:n}})},e$=async e=>{m(""),u(""),ec(e);try{let t=ei[e]||{},s={providerId:e,override:{fallbackStrategy:t.fallbackStrategy||"",stickyRoundRobinLimit:t.stickyRoundRobinLimit,stickyScope:t.stickyScope||"",stickyTtlMinutes:t.stickyTtlMinutes,stickyFallbackToClientIp:t.stickyFallbackToClientIp,stickyRebindOnFailure:t.stickyRebindOnFailure,stickyRebindFailureThreshold:t.stickyRebindFailureThreshold}},n=await fetch("/api/personal-cloud-providers/routing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.error||"Kh\xf4ng lưu được routing");el(r.routing||{}),u(`Đ\xe3 cập nhật routing cho ${e}.`)}catch(e){m(e.message||"Kh\xf4ng lưu được routing")}finally{ec("")}},eT=async e=>{m(""),u(""),ec(e);try{let t=await fetch(`/api/personal-cloud-providers/routing?providerId=${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s?.error||"Kh\xf4ng reset được routing");el(s.routing||{}),ed(t=>{let s={...t};return delete s[e],s}),u(`Đ\xe3 reset ${e} về ch\xednh s\xe1ch mặc định.`)}catch(e){m(e.message||"Kh\xf4ng reset được routing")}finally{ec("")}},eE=async()=>{let e=d(J);if(!e)return void m("Nhập username/email cần cấp quyền.");c(!0),m(""),u("");try{let t=await fetch("/api/personal-cloud-providers/permissions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,providers:Z})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng lưu được quyền OAuth");_(s.permissions||{}),H(s.connectionsByUser||{});let n=s.user?.id||e;n!==e&&X(n),u(`Đ\xe3 lưu quyền OAuth cho ${n}.`),await ep()}catch(e){m(e.message||"Kh\xf4ng lưu được quyền OAuth")}finally{c(!1)}},eK=async e=>{let t=d(e);if(t&&window.confirm(`Thu hồi to\xe0n bộ quyền OAuth provider của ${t}? OAuth account của user n\xe0y sẽ bị X\xd3A hẳn (token, model đ\xe3 import) v\xe0 model tương ứng sẽ bị gỡ khỏi mọi API key đ\xe3 g\xe1n. H\xe0nh động n\xe0y kh\xf4ng thể ho\xe0n t\xe1c.`)){c(!0),m(""),u("");try{let e=await fetch(`/api/personal-cloud-providers/permissions?userId=${encodeURIComponent(t)}`,{method:"DELETE"}),s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Kh\xf4ng thu hồi được quyền OAuth");_(s.permissions||{}),H(s.connectionsByUser||{}),d(J)===t&&X(""),u(`Đ\xe3 thu hồi quyền v\xe0 x\xf3a OAuth account của ${t}.`),await ep()}catch(e){m(e.message||"Kh\xf4ng thu hồi được quyền OAuth")}finally{c(!1)}}},eR=k?function(e={}){return{id:e.id,name:e.name||e.id,icon:e.icon||"cloud",color:e.color||"#64748b",website:e.website||"",notice:e.notice||null,deprecationNotice:e.deprecationNotice||"",serviceKinds:e.serviceKinds||["llm"]}}(k):null,eU=g?f:f.filter(e=>e.enabled),eq=o(S),eP=S?.modelImport||{},ez=o(W);return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Personal Cloud Providers"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Kết nối OAuth c\xe1 nh\xe2n cho Claude Code, OpenAI Codex v\xe0 Antigravity. Account c\xe1 nh\xe2n chỉ owner nh\xecn thấy, chỉ API key của owner được d\xf9ng. Cột RTK cho ph\xe9p override ri\xeang từng account (Lu\xf4n ON / Lu\xf4n OFF) bất kể cấu h\xecnh RTK global ở /dashboard/endpoint đang on hay off — để trống th\xec theo global."})]}),(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface px-4 py-3 text-sm",children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Current user"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-text-main",children:p||"—"})]})]})}),x?(0,n.jsx)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:x}):null,h?(0,n.jsx)("div",{className:"rounded-2xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:h}):null,(0,n.jsx)("div",{className:"grid gap-4 lg:grid-cols-3",children:0===f.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted lg:col-span-3",children:"Admin chưa cấp quyền personal OAuth provider n\xe0o cho user n\xe0y."}):f.map(e=>(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("span",{className:"inline-flex size-10 shrink-0 items-center justify-center rounded-xl",style:{backgroundColor:`${e.color||"#64748b"}22`},children:(0,n.jsx)(l.A,{src:`/providers/${e.id}.png`,alt:e.name,size:34,className:"max-h-[34px] max-w-[34px] rounded-lg object-contain",fallbackText:e.id.slice(0,2).toUpperCase(),fallbackColor:e.color||"#64748b"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"font-semibold text-text-main",children:e.name}),e.enabled?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Enabled"}):(0,n.jsx)(a.Ex,{variant:"warning",size:"sm",children:"Locked"})]}),(0,n.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e.enabled?"Được admin cấp quyền, c\xf3 thể add OAuth account c\xe1 nh\xe2n.":"Admin chưa cấp quyền cho user n\xe0y."})]})]}),e.deprecationNotice?(0,n.jsx)("p",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:e.deprecationNotice}):null,(0,n.jsxs)(a.$n,{fullWidth:!0,disabled:!e.enabled,onClick:()=>{e.enabled&&w(e)},icon:"add_link",children:["Add ",e.name," account"]})]},e.id))}),(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"My personal accounts"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"OAuth xong sẽ tự import model nếu provider hỗ trợ. Nếu kh\xf4ng gọi được endpoint model, hệ thống d\xf9ng catalog fallback để user vẫn chọn được model."})]}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:ep,loading:e,icon:"refresh",children:"Refresh"})]}),e?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải..."}):0===v.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Chưa c\xf3 personal OAuth account n\xe0o."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Connection"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Provider"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Account"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Models"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Created"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"API key routing"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Active"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["RTK (Token Savings)",(0,n.jsxs)(a.Ex,{variant:eh?"success":"default",size:"sm",className:"normal-case",children:["Global: ",eh?"ON":"OFF"]}),(0,n.jsx)("button",{type:"button",onClick:()=>em(!0),title:"RTK l\xe0 g\xec? Bấm để xem giải th\xedch",className:"inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-border text-[10px] font-bold normal-case text-text-muted transition-colors hover:border-brand-500 hover:text-brand-600",children:"?"})]})}),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:v.map(e=>{let t=Array.isArray(e?.availableModels)?e.availableModels:[],s=e.modelImport||{};return(0,n.jsxs)("tr",{className:"align-top hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||e.id}),(0,n.jsx)("div",{className:"mt-1 font-mono text-xs text-text-muted",children:e.id})]}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.A,{src:`/providers/${e.provider}.png`,alt:e.provider,size:24,className:"max-h-[24px] max-w-[24px] rounded object-contain",fallbackText:e.provider.slice(0,2).toUpperCase()}),(0,n.jsx)("span",{children:i(e.provider,f)})]})}),(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"break-all text-text-main",children:function(e={}){let t=e.providerSpecificData&&"object"==typeof e.providerSpecificData?e.providerSpecificData:{};return e.email||t.email||t.preferredUsername||e.displayName||t.sub||t.accountId||t.claudeAccountId||t.chatgptAccountId||"—"}(e)}),(0,n.jsxs)("div",{className:"mt-1 break-all text-xs text-text-muted",children:["Owner: ",e.ownerUser||p||"—"]})]}),(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[function(e={}){return"provider"===(e.source||"catalog")?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Imported"}):(0,n.jsx)(a.Ex,{variant:"warning",size:"sm",children:"Catalog"})}(s),(0,n.jsxs)("span",{className:"text-xs text-text-muted",children:[t.length," model(s)"]})]}),s.warning?(0,n.jsx)("div",{className:"mt-1 max-w-[320px] truncate text-xs text-amber-600 dark:text-amber-300",title:s.warning,children:s.warning}):null,t.length>0?(0,n.jsxs)("div",{className:"mt-2 flex max-w-[360px] flex-wrap gap-1",children:[t.slice(0,4).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-0.5 font-mono text-[11px] text-text-muted",children:e.routeModel},e.routeModel)),t.length>4?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-0.5 text-[11px] text-text-muted",children:["+",t.length-4]}):null]}):null]}),(0,n.jsx)("td",{className:"px-4 py-4 text-xs text-text-muted",children:function(e){if(!e)return"—";try{return new Intl.DateTimeFormat("vi-VN",{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}catch{return e}}(e.createdAt)}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"min-w-[220px] space-y-1",children:[(0,n.jsxs)("select",{value:e.routeApiKeyId||"",onChange:t=>ev(e.id,{routeApiKeyId:t.target.value||null}),disabled:E||d(e.ownerUser||p)!==d(p),className:"h-9 w-full rounded-xl border border-border bg-background px-2 text-xs text-text-main outline-none focus:border-brand-500 disabled:opacity-60",children:[(0,n.jsx)("option",{value:"",children:"Shared across my API keys"}),$.filter(t=>d(t.ownerUser||t.createdByUser||p)===d(e.ownerUser||p)).map(e=>(0,n.jsx)("option",{value:e.id,children:e.name||e.id},e.id))]}),(0,n.jsx)("div",{className:"text-[11px] text-text-muted",children:e.routeApiKeyId?`Only ${ej.get(e.routeApiKeyId)||"selected API key"} can use this account.`:"Unassigned accounts remain shared fallback for your eligible API keys."})]})}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsx)(a.lM,{checked:!1!==e.isActive,onChange:t=>ev(e.id,{isActive:t})})}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("select",{value:!0===e.rtkEnabled?"on":!1===e.rtkEnabled?"off":"inherit",onChange:t=>{let s=t.target.value;ev(e.id,{rtkEnabled:"inherit"===s?null:"on"===s})},className:"h-9 w-full min-w-[140px] rounded-xl border border-border bg-background px-2 text-xs text-text-main outline-none focus:border-brand-500",children:[(0,n.jsx)("option",{value:"inherit",children:"Theo global"}),(0,n.jsx)("option",{value:"on",children:"Lu\xf4n ON"}),(0,n.jsx)("option",{value:"off",children:"Lu\xf4n OFF"})]})}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",loading:I===e.id,onClick:()=>eN(e),children:"Import models"}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",disabled:0===o(e).length,onClick:()=>{m(""),u(""),Q(e),ee({}),es(""),er("")},children:"Manage models"}),(0,n.jsx)(a.$n,{variant:"secondary",size:"sm",disabled:0===o(e).length,onClick:()=>eA(e),children:"Add to API key"}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>{let t;return t=window.prompt("T\xean connection mới",e.name||""),void(t?.trim()&&ev(e.id,{name:t.trim()}))},children:"Rename"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",onClick:()=>C(e),children:"Delete"})]})})]},e.id)})})]})})]}),(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Routing strategy"}),(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Khi bạn c\xf3 nhiều personal account cho c\xf9ng provider, đ\xe2y l\xe0 ch\xednh s\xe1ch chọn account cho từng request. Để trống = kế thừa ch\xednh s\xe1ch của admin ở ",(0,n.jsx)("span",{className:"font-mono",children:"/dashboard/providers/<provider>"}),"."]})]}),(0,n.jsx)("div",{className:"grid gap-4 lg:grid-cols-3",children:0===eU.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted lg:col-span-3",children:"Bạn chưa được cấp quyền provider n\xe0o, n\xean chưa cần thiết lập routing."}):eU.map(e=>{let t=ei[e.id]||{},s=ea[e.id]||null,r=!s,l=t.fallbackStrategy||"",i="round-robin"===l,d=eo===e.id;return(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.name}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:r?"Đang kế thừa policy global":`Override active: ${s.fallbackStrategy||"inherit"}`})]}),r?(0,n.jsx)(a.Ex,{variant:"default",size:"sm",children:"Inherit"}):(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Override"})]}),(0,n.jsxs)("label",{className:"block text-sm",children:[(0,n.jsx)("span",{className:"mb-1 block font-medium text-text-main",children:"Strategy"}),(0,n.jsxs)("select",{value:l,onChange:t=>eO(e.id,{fallbackStrategy:t.target.value}),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none focus:border-brand-500",disabled:d,children:[(0,n.jsx)("option",{value:"",children:"Inherit (use global)"}),(0,n.jsx)("option",{value:"fill-first",children:"fill-first — chạy hết account 1 mới sang account 2"}),(0,n.jsx)("option",{value:"round-robin",children:"round-robin — lu\xe2n phi\xean theo sticky limit"}),(0,n.jsx)("option",{value:"least-latency",children:"least-latency — chọn account nhanh nhất"}),(0,n.jsx)("option",{value:"p2c",children:"p2c — power-of-two-choices"})]})]}),i?(0,n.jsxs)("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/50 p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Round-robin sticky params (để trống = d\xf9ng gi\xe1 trị global)"}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky limit (số request li\xean tiếp trước khi rotate)"}),(0,n.jsx)(a.pd,{type:"number",min:1,value:t.stickyRoundRobinLimit??"",onChange:t=>eO(e.id,{stickyRoundRobinLimit:t.target.value?Number(t.target.value):void 0}),placeholder:"v\xed dụ 3",disabled:d})]}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky scope"}),(0,n.jsxs)("select",{value:t.stickyScope||"",onChange:t=>eO(e.id,{stickyScope:t.target.value}),className:"h-9 w-full rounded-xl border border-border bg-background px-3 text-xs text-text-main outline-none focus:border-brand-500",disabled:d,children:[(0,n.jsx)("option",{value:"",children:"(inherit)"}),(0,n.jsx)("option",{value:"global",children:"global — rotate cho mọi request"}),(0,n.jsx)("option",{value:"client_ip",children:"client_ip — sticky theo IP"}),(0,n.jsx)("option",{value:"client_session",children:"client_session — sticky theo CLI session"})]})]}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky TTL (ph\xfat)"}),(0,n.jsx)(a.pd,{type:"number",min:1,value:t.stickyTtlMinutes??"",onChange:t=>eO(e.id,{stickyTtlMinutes:t.target.value?Number(t.target.value):void 0}),placeholder:"v\xed dụ 120",disabled:d})]})]}):null,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:[(0,n.jsx)(a.$n,{size:"sm",loading:d,onClick:()=>e$(e.id),children:"Save"}),(0,n.jsx)(a.$n,{size:"sm",variant:"ghost",disabled:d||r,onClick:()=>eT(e.id),children:"Reset to inherit"})]})]},e.id)})})]}),g?(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Admin: OAuth provider access"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Default l\xe0 kh\xf4ng c\xf3 quyền. Nhập username/email rồi bật provider được ph\xe9p add personal account."})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-end",children:[(0,n.jsx)(a.pd,{label:"User ID / Email",value:J,onChange:e=>X(e.target.value),placeholder:"anh-tct hoặc anh-tct@fujinet.net"}),(0,n.jsx)(a.$n,{onClick:eE,loading:s,icon:"save",children:"Save permissions"})]}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-3",children:f.map(e=>(0,n.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,n.jsx)(a.lM,{checked:!0===Z[e.id],onChange:t=>V(s=>({...s,[e.id]:t})),label:e.name,description:Z[e.id]?"User được ph\xe9p add account":"User chưa được cấp quyền"})},e.id))}),(0,n.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,n.jsxs)("div",{className:"mb-3 flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-text-main",children:"Granted OAuth Access"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Danh s\xe1ch user hiện đang được cấp quyền add personal OAuth account."})]}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:eb,loading:B,icon:"refresh",children:"Refresh list"})]}),B?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải quyền..."}):0===ef.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 user n\xe0o được cấp quyền OAuth provider."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),f.map(e=>(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:e.name},e.id)),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ef.map(e=>(0,n.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"break-all font-mono text-text-main",children:e.userId}),d(J)===e.userId?(0,n.jsx)("div",{className:"mt-1 text-xs text-brand-600 dark:text-brand-300",children:"Đang edit ở form ph\xeda tr\xean"}):null]}),f.map(t=>{let s=!0===e.providerState[t.id],r=e.connectionsByProvider?.[t.id]||0,i=r>0;return(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[s?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"ON"}):(0,n.jsx)(a.Ex,{variant:"default",size:"sm",children:"OFF"}),i?(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5",title:`User đ\xe3 add ${r} ${t.name} account${r>1?"s":""}`,children:[(0,n.jsx)(l.A,{src:`/providers/${t.id}.png`,alt:t.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:t.id.slice(0,2).toUpperCase(),fallbackColor:t.color||"#64748b"}),r>1?(0,n.jsxs)("span",{className:"text-[10px] font-semibold text-text-muted",children:["\xd7",r]}):null]}):null]})},t.id)}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>(e=>{let t=d(e);X(t);let s=D[t]||{},n={};for(let e of f)n[e.id]=!0===s[e.id];V(n)})(e.userId),children:"Edit"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",loading:s,onClick:()=>eK(e.userId),children:"Revoke"})]})})]},e.userId))})]})})]})]}):null,S?(0,n.jsx)(a.aF,{isOpen:!!S,onClose:()=>O(null),title:"Add models to API key",size:"full",footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.$n,{variant:"ghost",onClick:()=>O(null),disabled:z,children:"Cancel"}),(0,n.jsx)(a.$n,{onClick:eC,loading:z,disabled:!R||0===q.length,children:"Add selected models"})]}),children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 text-sm",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:S.name||S.id}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:[i(S.provider,f)," \xb7 ",eq.length," imported model(s)"]}),eP.warning?(0,n.jsx)("div",{className:"mt-2 text-xs text-amber-600 dark:text-amber-300",children:eP.warning}):null,0===eq.length?(0,n.jsx)("div",{className:"mt-2 rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:'Chưa import được model n\xe0o từ provider. Bấm "Import models" tr\xean d\xf2ng connection trước khi g\xe1n v\xe0o API key.'}):null]}),(0,n.jsxs)("label",{className:"block text-sm",children:[(0,n.jsx)("span",{className:"mb-1 block font-medium text-text-main",children:"API key"}),(0,n.jsxs)("select",{value:R,onChange:e=>U(e.target.value),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none focus:border-brand-500",disabled:E,children:[(0,n.jsx)("option",{value:"",children:E?"Đang tải API keys...":"Chọn API key"}),eg.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name," \xb7 ",e.ownerUser||p]},e.id))]})]}),0!==eg.length||E?null:(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-300",children:"User n\xe0y chưa c\xf3 API key active để th\xeam model."}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-text-main",children:"Models"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Model được lưu v\xe0o allowedModels của API key. Request sẽ route qua personal OAuth account của owner."})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>P(eq.map(e=>e.routeModel).filter(Boolean)),children:"Select all"}),(0,n.jsx)(a.$n,{variant:"ghost",size:"sm",onClick:()=>P([]),children:"Clear"})]})]}),(0,n.jsx)("div",{className:"grid gap-2 md:grid-cols-2",children:eq.map(e=>(0,n.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border border-border bg-background p-3 hover:bg-surface",children:[(0,n.jsx)("input",{type:"checkbox",className:"mt-1",checked:q.includes(e.routeModel),onChange:()=>{var t;return t=e.routeModel,void P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block font-medium text-text-main",children:e.name||e.id}),(0,n.jsx)("span",{className:"mt-1 block break-all font-mono text-xs text-text-muted",children:e.routeModel}),e.type&&"llm"!==e.type?(0,n.jsx)("span",{className:"mt-2 inline-flex rounded-full bg-surface px-2 py-0.5 text-[11px] text-text-muted",children:e.type}):null]})]},e.routeModel))})]})}):null,W?(0,n.jsx)(a.aF,{isOpen:!!W,onClose:()=>Q(null),title:"Manage imported models",size:"full",footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.$n,{variant:"ghost",onClick:()=>Q(null),children:"Close"}),(0,n.jsx)(a.$n,{variant:"outline",loading:I===W.id,onClick:()=>eN(W),icon:"refresh",children:"Re-import from provider"})]}),children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 text-sm",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:W.name||W.id}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:[i(W.provider,f)," \xb7 ",ez.length," imported model(s)"]}),(0,n.jsx)("div",{className:"mt-2 text-xs text-text-muted",children:'Test gửi 1 prompt "Say hello in five words" qua ch\xednh OAuth account của bạn, qua đ\xfang proxy của connection. X\xf3a model sẽ bỏ n\xf3 khỏi list importable; c\xe1c API key đ\xe3 gắn model n\xe0y kh\xf4ng bị thay đổi (request đến model đ\xf3 sẽ do provider ph\xeda tr\xean quyết định chấp nhận hay kh\xf4ng).'})]}),0===ez.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:'Chưa c\xf3 model n\xe0o được import. Bấm "Re-import from provider".'}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Model"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Route ID"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Test result"}),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ez.map(e=>{let t=Y[e.routeModel],s=et===e.routeModel,r=en===e.routeModel;return(0,n.jsxs)("tr",{className:"align-top",children:[(0,n.jsxs)("td",{className:"px-4 py-3",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||e.id}),e.type&&"llm"!==e.type?(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.type}):null]}),(0,n.jsx)("td",{className:"px-4 py-3 font-mono text-xs text-text-muted break-all",children:e.routeModel}),(0,n.jsx)("td",{className:"px-4 py-3 text-xs",children:s?(0,n.jsx)("span",{className:"text-text-muted",children:"Đang test..."}):t?t.ok?(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("div",{className:"text-green-700 dark:text-green-300",children:["OK \xb7 ",t.latencyMs||0,"ms"]}),(0,n.jsx)("div",{className:"break-all text-text-muted",children:(t.text||"").slice(0,200)})]}):(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("div",{className:"text-red-700 dark:text-red-300",children:["FAIL \xb7 status ",t.status||"?"]}),(0,n.jsx)("div",{className:"break-all text-text-muted",children:(t.error||"").slice(0,200)})]}):(0,n.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,n.jsx)("td",{className:"px-4 py-3",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",loading:s,disabled:r,onClick:()=>eM(W,e),children:"Say hello"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",loading:r,disabled:s,onClick:()=>eS(W,e),children:"Delete"})]})})]},e.routeModel)})})]})})]})}):null,ex?(0,n.jsx)(a.aF,{isOpen:ex,onClose:()=>em(!1),title:"RTK (Token Savings) l\xe0 g\xec?",size:"xl",footer:(0,n.jsx)(a.$n,{onClick:()=>em(!1),children:"Đ\xe3 hiểu"}),children:(0,n.jsxs)("div",{className:"space-y-5 text-sm text-text-main",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-surface px-3 py-2",children:[(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Global RTK hiện đang:"}),(0,n.jsx)(a.Ex,{variant:eh?"success":"default",size:"sm",children:eh?"ON":"OFF"}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:'— \xe1p dụng cho mọi account chọn "Theo global"'})]}),(0,n.jsx)("p",{className:"text-text-muted",children:"RTK l\xe0 bộ lọc n\xe9n output của tool (Bash, Grep, Glob, Read...) ngay trong request trước khi gửi l\xean model, gi\xfap giảm số token phải gửi m\xe0 kh\xf4ng l\xe0m mất th\xf4ng tin quan trọng — chỉ t\xe1c động tới phần tool output, kh\xf4ng đụng v\xe0o nội dung chat."}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Hoạt động ra sao với CLI tool"}),(0,n.jsx)("p",{className:"text-text-muted",children:"Mỗi khi Claude Code / Codex CLI / OpenCode... gọi tool v\xe0 nhận lại output, RTK tự nhận diện định dạng quen thuộc rồi r\xfat gọn theo đ\xfang cấu tr\xfac của n\xf3:"}),(0,n.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-text-muted",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git diff"})," — giữ v\xe0i d\xf2ng context quanh thay đổi, cắt phần hunk qu\xe1 d\xe0i"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git status"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git log"})," — gom gọn danh s\xe1ch file thay đổi, danh s\xe1ch commit"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"grep"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"find"})," — giới hạn số match hiển thị mỗi file/thư mục"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"ls -la"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"tree"})," — t\xf3m tắt theo loại file, cắt c\xe2y thư mục qu\xe1 s\xe2u"]}),(0,n.jsx)("li",{children:"Build log (npm/yarn/cargo...) — chỉ giữ d\xf2ng quan trọng (lỗi, kết quả build)"}),(0,n.jsx)("li",{children:"Output d\xe0i chung kh\xf4ng r\xf5 định dạng — fallback dedup d\xf2ng lặp hoặc smart-truncate (giữ đầu + cuối)"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Hiệu quả thực tế"}),(0,n.jsx)("div",{className:"overflow-x-auto rounded-xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full text-xs",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Loại output"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Trước"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Sau"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Tiết kiệm"})]})}),(0,n.jsxs)("tbody",{className:"divide-y divide-border",children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"git diff"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"7384B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"3894B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"47.3%"})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"grep -n"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"3723B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"1447B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"61.1%"})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"find"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"729B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"264B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"63.8%"})]})]})]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Khi n\xe0o KH\xd4NG bị n\xe9n"}),(0,n.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-text-muted",children:[(0,n.jsx)("li",{children:"Chat thường kh\xf4ng gọi tool — kh\xf4ng c\xf3 g\xec để n\xe9n"}),(0,n.jsx)("li",{children:"Output nhỏ hơn 500B — kh\xf4ng đ\xe1ng n\xe9n"}),(0,n.jsxs)("li",{children:["Output b\xe1o lỗi (",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"is_error"}),") — lu\xf4n giữ nguy\xean để debug"]}),(0,n.jsx)("li",{children:"Output lớn hơn 10MB — bỏ qua để tr\xe1nh tốn CPU xử l\xfd"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Global vs từng account"}),(0,n.jsxs)("p",{className:"text-text-muted",children:["Dropdown RTK ở bảng tr\xean cho ph\xe9p override ri\xeang từng account:",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Theo global"})," (mặc định, d\xf9ng đ\xfang setting global),",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Lu\xf4n ON"})," hoặc",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Lu\xf4n OFF"})," — override lu\xf4n thắng global theo cả 2 chiều, n\xean c\xf3 thể để global OFF v\xe0 chỉ bật cho account d\xf9ng CLI tool, hoặc ngược lại."]})]})]})}):null,eR?(0,n.jsx)(a.LF,{isOpen:!!k,provider:k.id,providerInfo:eR,connectionScope:"personal",onSuccess:ey,onClose:()=>w(null)}):null,A?(0,n.jsx)(a.uo,{isOpen:!!A,onClose:()=>C(null),onConfirm:eI,title:"Delete personal account",message:`X\xf3a connection ${A.name||A.id}?`,confirmText:"Delete",cancelText:"Cancel",variant:"danger"}):null]})}},47584:(e,t,s)=>{Promise.resolve().then(s.bind(s,43503))}},e=>{e.O(0,[2574,3862,246,4546,5564,5263,5497,8441,3794,7358],()=>e(e.s=47584)),_N_E=e.O()}]);
|
|
Binary file
|
|
Binary file
|
package/app/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8978],{14051:(e,t,s)=>{e.exports=s(34701)()},34701:(e,t,s)=>{"use strict";var n=s(82114);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,s,r,l,a){if(a!==n){var i=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return s.PropTypes=s,s}},39944:(e,t,s)=>{Promise.resolve().then(s.bind(s,70959))},70959:(e,t,s)=>{"use strict";s.d(t,{default:()=>J});var n=s(95155),r=s(12115),l=s(94027);let a=[{value:"today",label:"H\xf4m nay"},{value:"todayWorking",label:"H\xf4m nay (Working time)"},{value:"yesterday",label:"H\xf4m qua"},{value:"yesterdayWorking",label:"H\xf4m qua (Working time)"},{value:"24h",label:"24 giờ"},{value:"thisWeek",label:"Tuần n\xe0y"},{value:"lastWeek",label:"Tuần trước"},{value:"7d",label:"7 ng\xe0y"},{value:"thisMonth",label:"Th\xe1ng n\xe0y"},{value:"lastMonth",label:"Th\xe1ng trước"},{value:"30d",label:"30 ng\xe0y"},{value:"60d",label:"60 ng\xe0y"},{value:"all",label:"Tất cả"},{value:"custom",label:"T\xf9y chọn"}],i=[{value:"overview",label:"Tổng quan",icon:"dashboard"},{value:"apiKeys",label:"API keys",icon:"vpn_key"},{value:"clients",label:"Client/User",icon:"groups"},{value:"sources",label:"Source IP / Tool",icon:"hub"},{value:"providers",label:"Provider / Model",icon:"dns"},{value:"experience",label:"Trải nghiệm",icon:"speed"},{value:"errors",label:"Lỗi & bất thường",icon:"warning"},{value:"raw",label:"Raw usage",icon:"table"}];function o(e,t=0){return Number(e||0).toLocaleString("vi-VN",{maximumFractionDigits:t})}function d(e){let t=Number(e||0);return Intl.NumberFormat("vi-VN",{notation:"compact",maximumFractionDigits:1}).format(t)}function c(e){let t=100*Number(e||0);return`${t.toLocaleString("vi-VN",{maximumFractionDigits:1})}%`}function x(e){let t=Number(e||0);return t?`$${t.toLocaleString("vi-VN",{minimumFractionDigits:4,maximumFractionDigits:6})}`:"$0"}function m(e){if(null==e||Number.isNaN(Number(e)))return"-";let t=Number(e);return t>=1e3?`${(t/1e3).toLocaleString("vi-VN",{maximumFractionDigits:2})}s`:`${t.toLocaleString("vi-VN",{maximumFractionDigits:0})}ms`}function u(e,t="/s"){if(null==e||Number.isNaN(Number(e)))return"-";let s=Number(e);return`${s.toLocaleString("vi-VN",{maximumFractionDigits:s>=10?1:2})}${t}`}function h(e){return null==e||Number.isNaN(Number(e))?"-":`${Number(e).toLocaleString("vi-VN",{maximumFractionDigits:0})}/100`}function p(e){if(!e)return null;let t=String(e).trim();return new Date(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)?$/.test(t)?`${t.replace(" ","T")}Z`:t)}function b(e){if(!e)return"-";try{let t=p(e);if(!t||Number.isNaN(t.getTime()))return String(e);return t.toLocaleString("vi-VN",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return String(e)}}function g(e){if(!e)return"";try{let t=p(e);if(!t||Number.isNaN(t.getTime()))return String(e);return t.toLocaleString("vi-VN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return String(e)}}function j(...e){return e.filter(Boolean).join(" ")}function v(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function k(e,t={}){let s=new URLSearchParams;return Object.entries({...e,...t}).forEach(([e,t])=>{let n=String(t??"").trim();n&&s.set(e,n)}),s.toString()}function y({children:e,className:t=""}){return(0,n.jsx)("div",{className:j("min-w-0 rounded-2xl border border-border bg-surface p-5 shadow-sm",t),children:e})}function f({icon:e,label:t,value:s,hint:r,help:l,tone:a="blue"}){return(0,n.jsx)(y,{className:"min-h-[126px]",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-medium text-text-muted",children:t}),(0,n.jsx)("div",{className:"mt-2 text-2xl font-semibold text-text-main",children:s}),r?(0,n.jsx)("div",{className:"mt-2 text-xs text-text-muted",children:r}):null,l?(0,n.jsx)("div",{className:"mt-1 text-[11px] leading-4 text-text-muted/70",children:l}):null]}),(0,n.jsx)("div",{className:j("flex h-10 w-10 items-center justify-center rounded-xl",{blue:"bg-blue-500/10 text-blue-600 dark:text-blue-300",green:"bg-green-500/10 text-green-600 dark:text-green-300",red:"bg-red-500/10 text-red-600 dark:text-red-300",amber:"bg-amber-500/10 text-amber-600 dark:text-amber-300",purple:"bg-purple-500/10 text-purple-600 dark:text-purple-300",slate:"bg-slate-500/10 text-slate-600 dark:text-slate-300"}[a]||"bg-blue-500/10 text-blue-600 dark:text-blue-300"),children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:e})})]})})}function N({label:e,children:t}){return(0,n.jsxs)("label",{className:"space-y-1.5 text-xs font-medium text-text-muted",children:[(0,n.jsx)("span",{children:e}),t]})}function T({value:e,onChange:t,children:s}){return(0,n.jsx)("select",{value:e||"",onChange:e=>t(e.target.value),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none transition focus:border-primary/60 focus:ring-2 focus:ring-primary/20",children:s})}function w({value:e,onChange:t,placeholder:s="",type:r="text"}){return(0,n.jsx)("input",{value:e||"",type:r,onChange:e=>t(e.target.value),placeholder:s,className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none transition placeholder:text-text-muted/60 focus:border-primary/60 focus:ring-2 focus:ring-primary/20"})}function q(){return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:Array.from({length:8}).map((e,t)=>(0,n.jsx)("div",{className:"h-32 animate-pulse rounded-2xl border border-border bg-surface"},t))}),(0,n.jsx)("div",{className:"h-80 animate-pulse rounded-2xl border border-border bg-surface"})]})}function P({title:e="Kh\xf4ng c\xf3 dữ liệu",description:t="Kh\xf4ng t\xecm thấy dữ liệu theo bộ lọc hiện tại."}){return(0,n.jsxs)("div",{className:"flex min-h-[180px] flex-col items-center justify-center rounded-2xl border border-dashed border-border bg-surface/60 p-8 text-center",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-4xl text-text-muted",children:"database_off"}),(0,n.jsx)("div",{className:"mt-3 text-sm font-semibold text-text-main",children:e}),(0,n.jsx)("div",{className:"mt-1 max-w-xl text-sm text-text-muted",children:t})]})}function R({data:e=[],valueKey:t="totalTokens",secondaryKey:s="requests",height:r=220}){let l=e||[],a=Math.max(...l.map(e=>Number(e[t]||0)),1),i=Math.max(...l.map(e=>Number(e[s]||0)),1);return 0===l.length?(0,n.jsx)(P,{description:"Chưa c\xf3 time-series trong khoảng thời gian n\xe0y."}):(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("div",{className:"min-w-[720px]",children:[(0,n.jsx)("div",{className:"flex items-end gap-1",style:{height:r},children:l.map((e,l)=>{let d=Math.max(2,Number(e[t]||0)/a*(r-42)),c=Math.max(2,Number(e[s]||0)/i*(r-42));return(0,n.jsx)("div",{className:"group flex flex-1 flex-col items-center justify-end gap-1",children:(0,n.jsxs)("div",{className:"relative flex h-full w-full max-w-[34px] items-end justify-center gap-0.5",children:[(0,n.jsx)("div",{className:"w-2 rounded-t bg-primary/70",style:{height:d}}),(0,n.jsx)("div",{className:"w-2 rounded-t bg-amber-500/70",style:{height:c}}),(0,n.jsxs)("div",{className:"pointer-events-none absolute bottom-full left-1/2 z-20 hidden w-56 -translate-x-1/2 rounded-xl border border-border bg-surface p-3 text-left text-xs shadow-xl group-hover:block",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:g(e.label)}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:["Request: ",o(e.requests)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Input token: ",o(e.promptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Output token: ",o(e.completionTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Tổng token: ",o(e.totalTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Lỗi: ",o(e.errors)]})]})]})},`${e.label}-${l}`)})}),(0,n.jsxs)("div",{className:"mt-3 flex justify-between gap-2 text-[11px] text-text-muted",children:[(0,n.jsx)("span",{children:g(l[0]?.label)}),(0,n.jsx)("span",{children:g(l[Math.floor(l.length/2)]?.label)}),(0,n.jsx)("span",{children:g(l[l.length-1]?.label)})]})]})})}function S(){return(0,n.jsxs)("div",{className:"flex flex-wrap gap-3 text-xs text-text-muted",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"h-2.5 w-2.5 rounded-sm bg-primary/70"}),"Token"]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"h-2.5 w-2.5 rounded-sm bg-amber-500/70"}),"Request"]})]})}function I({columns:e,rows:t,empty:s="Kh\xf4ng c\xf3 dữ liệu"}){return t&&0!==t.length?(0,n.jsx)("div",{className:"overflow-x-auto overflow-y-auto rounded-2xl border border-border",style:{maxHeight:"500px"},children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-background/70",children:(0,n.jsx)("tr",{children:e.map(e=>(0,n.jsx)("th",{className:j("whitespace-nowrap px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",e.className),children:e.label},e.key))})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-surface",children:t.map((t,s)=>(0,n.jsx)("tr",{className:"hover:bg-background/60",children:e.map(e=>(0,n.jsx)("td",{className:j("whitespace-nowrap px-4 py-3 align-top text-text-main",e.className),children:e.render?e.render(t,s):t[e.key]??"-"},e.key))},t.key||t.id||`${t.label}-${s}`))})]})}):(0,n.jsx)(P,{title:s})}function L({items:e=[]}){return e&&0!==e.length?(0,n.jsx)("div",{className:"flex max-w-[360px] flex-wrap gap-1.5",children:e.slice(0,3).map(e=>(0,n.jsxs)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:[e.label||e.key," \xb7 ",o(e.count??e.requests??e.totalTokens??0)]},e.key))}):(0,n.jsx)("span",{className:"text-text-muted",children:"-"})}function M({row:e}){return(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{className:"font-semibold text-text-main",children:[d(e.totalTokens)," token"]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["In ",d(e.promptTokens)," / Out ",d(e.completionTokens)]})]})}function C({leaderboard:e={}}){let t=e.rows||[],s=e.status||"warming";if("scoped"===s)return null;let r="ready"===s?`${e.periodLabel||"H\xf4m nay"} \xb7 cập nhật ${b(e.generatedAt)} \xb7 refresh nền mỗi ${Math.round((e.refreshEveryMs||9e5)/6e4)} ph\xfat`:"error"===s?"Leaderboard đang chờ job nền tổng hợp lại dữ liệu.":"Leaderboard đang được job nền khởi tạo.";return(0,n.jsxs)(y,{className:"border-amber-500/20 bg-amber-500/[0.03]",children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-2xl text-amber-500",children:"crown"}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top 5 vinh danh token"})]}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp hạng theo API key owner d\xf9ng nhiều input + output token nhất."})]}),(0,n.jsx)("span",{className:"rounded-full bg-amber-500/10 px-3 py-1 text-xs font-semibold text-amber-700 dark:text-amber-300",children:r})]}),(0,n.jsx)(I,{rows:t,empty:"Chưa c\xf3 snapshot leaderboard từ job nền.",columns:[{key:"rank",label:"Hạng",render:e=>(0,n.jsxs)("div",{className:"flex min-w-[170px] items-center gap-3",children:[(0,n.jsx)("div",{className:j("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl",1===e.rank?"bg-amber-500/15 text-amber-600":"bg-primary/10 text-primary"),children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"crown"})}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"font-semibold text-text-main",children:["#",e.rank," \xb7 ",e.title]}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[c(e.tokenShare||0)," tổng token"]})]})]})},{key:"owner",label:"Owner",render:e=>(0,n.jsxs)("div",{className:"min-w-[210px]",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.ownerUser||e.label}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[e.apiKeyName||"API key",e.apiKeyFingerprint?` \xb7 ${e.apiKeyFingerprint}`:""]})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"scope",label:"Phạm vi",render:e=>(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[(0,n.jsxs)("div",{children:["API key ",o(e.apiKeyCount)," \xb7 IP ",o(e.sourceIpCount)]}),(0,n.jsxs)("div",{children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})}function A({value:e}){let t=Number(e||0);return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",t>=.2?"bg-red-500/10 text-red-600 dark:text-red-300":t>=.05?"bg-amber-500/10 text-amber-600 dark:text-amber-300":"bg-green-500/10 text-green-600 dark:text-green-300"),children:c(t)})}function $({level:e,label:t}){let s=String(e||"none");return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",{fast:"bg-green-500/10 text-green-700 dark:text-green-300",ok:"bg-blue-500/10 text-blue-700 dark:text-blue-300",slow:"bg-amber-500/10 text-amber-700 dark:text-amber-300",very_slow:"bg-red-500/10 text-red-700 dark:text-red-300",low_sample:"bg-amber-500/10 text-amber-700 dark:text-amber-300",none:"bg-slate-500/10 text-slate-700 dark:text-slate-300"}[s]||"bg-slate-500/10 text-slate-700 dark:text-slate-300"),children:t||"-"})}function K({level:e,label:t}){let s=String(e||"normal");return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",{critical:"bg-red-500/10 text-red-700 dark:text-red-300",high:"bg-amber-500/10 text-amber-700 dark:text-amber-300",medium:"bg-blue-500/10 text-blue-700 dark:text-blue-300",normal:"bg-green-500/10 text-green-700 dark:text-green-300",none:"bg-slate-500/10 text-slate-700 dark:text-slate-300"}[s]||"bg-slate-500/10 text-slate-700 dark:text-slate-300"),children:t||"-"})}function O({value:e}){let t=String(e||"unknown"),s={gateway:{label:"Gateway",cls:"bg-purple-500/10 text-purple-700 dark:text-purple-300"},upstream:{label:"Upstream",cls:"bg-red-500/10 text-red-700 dark:text-red-300"},client:{label:"Client",cls:"bg-slate-500/10 text-slate-700 dark:text-slate-300"},rate_limit:{label:"Rate limit",cls:"bg-amber-500/10 text-amber-700 dark:text-amber-300"},unknown:{label:"Unknown",cls:"bg-zinc-500/10 text-zinc-700 dark:text-zinc-300"}}[t]||{label:t,cls:"bg-zinc-500/10 text-zinc-700 dark:text-zinc-300"};return(0,n.jsx)("span",{className:j("rounded-full px-2 py-1 text-xs font-semibold",s.cls),children:s.label})}function F({row:e}){let t=e.sampleMessage||e.errorMessageShort||"";return t?(0,n.jsx)("span",{className:"block max-w-[360px] truncate text-xs text-text-muted",title:t,children:t}):(0,n.jsx)("span",{className:"text-text-muted",children:"-"})}function E({icon:e,label:t,value:s,hint:r,tone:l="slate"}){return(0,n.jsx)("div",{className:j("rounded-2xl border p-4 shadow-sm",{red:"border-red-500/20 bg-red-500/10 text-red-700 dark:text-red-300",amber:"border-amber-500/20 bg-amber-500/10 text-amber-700 dark:text-amber-300",purple:"border-purple-500/20 bg-purple-500/10 text-purple-700 dark:text-purple-300",slate:"border-border bg-surface text-text-main",green:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-300"}[l]||"border-border bg-surface text-text-main"),children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide opacity-75",children:t}),(0,n.jsx)("div",{className:"mt-2 text-2xl font-bold",children:o(s)}),r?(0,n.jsx)("div",{className:"mt-1 text-xs opacity-80",children:r}):null]}),(0,n.jsx)("span",{className:"material-symbols-outlined text-[24px] opacity-80",children:e})]})})}function _({anomaly:e}){let t="danger"===e.level?"border-red-500/30 bg-red-500/10 text-red-700 dark:text-red-300":"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300",s="danger"===e.level?"error":"warning";return(0,n.jsx)("div",{className:j("rounded-2xl border p-4",t),children:(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:s}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.title}),(0,n.jsx)("div",{className:"mt-1 text-sm opacity-90",children:e.detail})]})]})})}function U({notes:e=[]}){return e.length?(0,n.jsx)("div",{className:"space-y-2 rounded-2xl border border-blue-500/20 bg-blue-500/10 p-4 text-sm text-blue-700 dark:text-blue-300",children:e.map((e,t)=>(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"info"}),(0,n.jsx)("span",{children:e})]},t))}):null}function V(e){let t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}function H({filters:e,setFilters:t,options:s,onRefresh:r,onExportCsv:l,loading:i,showProviderFilters:o=!0}){let d=(e,s)=>{let n=null;t(t=>{if("period"===e&&"custom"===s){let e,r;return n={...t,period:s,...((r=new Date(e=new Date)).setHours(8,0,0,0),{dateFrom:V(r),dateTo:V(e)})}}return{...t,[e]:s}}),n&&r?.(n)};return(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-6",children:[(0,n.jsx)(N,{label:"Khoảng thời gian",children:(0,n.jsx)(T,{value:e.period,onChange:e=>d("period",e),children:a.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,n.jsx)(N,{label:"Từ ng\xe0y",children:(0,n.jsx)(w,{type:"datetime-local",value:e.dateFrom,onChange:e=>d("dateFrom",e)})}),(0,n.jsx)(N,{label:"Đến ng\xe0y",children:(0,n.jsx)(w,{type:"datetime-local",value:e.dateTo,onChange:e=>d("dateTo",e)})}),o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N,{label:"Provider",children:(0,n.jsxs)(T,{value:e.provider,onChange:e=>d("provider",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả provider"}),(s.providers||[]).map(e=>{let t="string"==typeof e?e:e.value,s="string"==typeof e?e:e.label||e.value;return(0,n.jsx)("option",{value:t,children:s},t)})]})}),(0,n.jsx)(N,{label:"Model",children:(0,n.jsxs)(T,{value:e.model,onChange:e=>d("model",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả model"}),(s.models||[]).map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})}),(0,n.jsx)(N,{label:"Provider account",children:(0,n.jsxs)(T,{value:e.connectionId,onChange:e=>d("connectionId",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả account"}),(s.connections||[]).map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]})})]}):null,(0,n.jsx)(N,{label:"API key",children:(0,n.jsxs)(T,{value:e.apiKey,onChange:e=>d("apiKey",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả API key"}),(s.apiKeys||[]).map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]})}),(0,n.jsx)(N,{label:"Source IP",children:(0,n.jsx)(w,{value:e.clientIp,onChange:e=>d("clientIp",e),placeholder:"172.16.253.1"})}),(0,n.jsx)(N,{label:"Source tool",children:(0,n.jsx)(w,{value:e.sourceTool,onChange:e=>d("sourceTool",e),placeholder:"copilot, antigravity..."})}),(0,n.jsx)(N,{label:"Endpoint",children:(0,n.jsxs)(T,{value:e.endpoint,onChange:e=>d("endpoint",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả endpoint"}),(s.endpoints||[]).map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})}),(0,n.jsx)(N,{label:"Status",children:(0,n.jsxs)(T,{value:e.status,onChange:e=>d("status",e),children:[(0,n.jsx)("option",{value:"",children:"Tất cả status"}),(s.statuses||[]).map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})}),(0,n.jsx)(N,{label:"Session / keyword",children:(0,n.jsx)(w,{value:e.sessionId||e.keyword,onChange:e=>d("keyword",e),placeholder:"session, prompt, error..."})})]}),(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Token/cost lấy từ UsageHistory. Source IP/tool/session lấy từ Prompt Logs."}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)("button",{onClick:()=>t({period:"today",dateFrom:"",dateTo:"",provider:"",model:"",connectionId:"",status:"",endpoint:"",apiKey:"",clientIp:"",sourceTool:"",sessionId:"",keyword:""}),className:"rounded-xl border border-border px-3 py-2 text-sm font-medium text-text-main hover:bg-background",children:"Reset"}),(0,n.jsxs)("button",{onClick:l,className:"rounded-xl border border-border px-3 py-2 text-sm font-medium text-text-main hover:bg-background",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-1 align-[-4px] text-[18px]",children:"download"}),"Export CSV"]}),(0,n.jsxs)("button",{onClick:()=>r?.(),disabled:i,className:"rounded-xl bg-primary px-4 py-2 text-sm font-semibold text-white shadow-sm disabled:opacity-60",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-1 align-[-4px] text-[18px]",children:"refresh"}),i?"Đang tải...":"Refresh"]})]})]})]})}function D({data:e}){let t=e.overview||{},s=e.latency||{},r=e.experience||{};return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsx)(C,{leaderboard:e.tokenLeaderboard}),(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,n.jsx)(f,{icon:"call_made",label:"Tổng request",value:o(t.requests),hint:`${o(t.requestsPerMinute,2)} request/ph\xfat`,help:"Số request khớp bộ lọc hiện tại."}),(0,n.jsx)(f,{icon:"check_circle",label:"Th\xe0nh c\xf4ng",value:o(t.success),hint:`Tỷ lệ lỗi ${c(t.errorRate)}`,help:"Request trả về th\xe0nh c\xf4ng v\xe0 c\xf3 trạng th\xe1i OK.",tone:"green"}),(0,n.jsx)(f,{icon:"dns",label:"Lỗi server/provider",value:o(t.serverErrorEvents),hint:`Server-impacting ${c(t.serverErrorRate)} \xb7 client ${o(t.clientErrorEvents)}`,help:"Lỗi từ gateway, provider hoặc model server; t\xe1ch ri\xeang lỗi client.",tone:t.serverErrorEvents?"red":"green"}),(0,n.jsx)(f,{icon:"speed",label:"Trải nghiệm",value:h(r.score),hint:`${r.label||"-"} \xb7 ${o(r.samples)} mẫu`,help:"Điểm tổng hợp từ latency, TTFT, lỗi v\xe0 tốc độ phản hồi.",tone:r.tone||"purple"}),(0,n.jsx)(f,{icon:"timer",label:"Latency P95",value:m(r.p95LatencyMs||s.p95Ms),hint:`AVG ${m(r.avgLatencyMs||s.avgMs)} \xb7 P50 ${m(r.p50LatencyMs||s.p50Ms)}`,help:"95% request ho\xe0n tất nhanh hơn gi\xe1 trị n\xe0y.",tone:"purple"}),(0,n.jsx)(f,{icon:"bolt",label:"TTFT P95",value:m(r.p95TtftMs),hint:"Thời gian chờ token đầu ti\xean",help:"95% request nhận token đầu ti\xean nhanh hơn gi\xe1 trị n\xe0y.",tone:r.slowTtftRate>=.2?"amber":"blue"}),(0,n.jsx)(f,{icon:"input",label:"Input P95",value:d(r.p95PromptTokens||0),hint:`Avg ${d(r.avgPromptTokens||t.avgPromptTokens)} \xb7 >=30k ${c(r.longInputRate)}`,help:"95% request c\xf3 k\xedch thước input nhỏ hơn gi\xe1 trị n\xe0y."}),(0,n.jsx)(f,{icon:"psychology_alt",label:"Auto-off thinking",value:c(e.thinkingAnalytics?.autoOffRate),hint:`${o(e.thinkingAnalytics?.autoOffRequests||0)} request bị tắt theo policy`,help:"Tỷ lệ request bị tắt thinking do vượt ngưỡng hoặc policy.",tone:(e.thinkingAnalytics?.autoOffRate||0)>=.3?"amber":"slate"}),(0,n.jsx)(f,{icon:"data_object",label:"Large context >=50k",value:c(e.largeContextAnalytics?.gte50kRate),hint:`>=100k ${c(e.largeContextAnalytics?.gte100kRate)}`,help:"Tỷ lệ request c\xf3 context rất lớn, dễ l\xe0m tăng TTFT/latency.",tone:(e.largeContextAnalytics?.gte50kRate||0)>=.3?"amber":"slate"}),(0,n.jsx)(f,{icon:"person_alert",label:"Top user nặng",value:t.topHeavyUser||"-",hint:`Chiếm ${c(t.topHeavyUserTokenShare)} tổng token`,help:"User/API key ti\xeau thụ nhiều token nhất trong bộ lọc.",tone:t.topHeavyUserTokenShare>=.35?"amber":"slate"}),(0,n.jsx)(f,{icon:"running_with_errors",label:"Request chậm",value:c(r.slowRequestRate),hint:`>= ${m(r.thresholds?.slowLatencyMs||45e3)} \xb7 max ${m(r.maxLatencyMs)}`,help:"Tỷ lệ request vượt ngưỡng chậm đ\xe3 cấu h\xecnh.",tone:r.slowRequestRate>=.2?"amber":"green"}),(0,n.jsx)(f,{icon:"output",label:"Output tokens",value:d(t.completionTokens),hint:`Avg ${o(t.avgCompletionTokens,1)} / request`,help:"Tổng token model sinh ra."}),(0,n.jsx)(f,{icon:"token",label:"Tổng tokens",value:d(t.totalTokens),hint:`${d(t.tokensPerMinute)} token/ph\xfat`,help:"Tổng input + output token.",tone:"amber"}),(0,n.jsx)(f,{icon:"speed",label:"Output speed",value:u(r.decodeTokensPerSecond," tok/s"),hint:`Latency/10k input ${m(r.latencyMsPer10kInputTokens)}`,help:"Tốc độ sinh token trung b\xecnh sau khi model bắt đầu trả lời.",tone:"slate"}),(0,n.jsx)(f,{icon:"payments",label:"Cost ước t\xednh",value:x(t.cost),hint:"Dựa tr\xean pricing đ\xe3 cấu h\xecnh",help:"Chi ph\xed suy ra từ token usage v\xe0 bảng gi\xe1 hiện tại.",tone:"green"})]}),(0,n.jsxs)("div",{className:"grid min-w-0 gap-5 xl:grid-cols-[2fr_1fr]",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Tần suất request & token theo thời gian"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Cột xanh l\xe0 token, cột v\xe0ng l\xe0 số request trong từng bucket thời gian."})]}),(0,n.jsx)(S,{})]}),(0,n.jsx)(R,{data:e.timeSeries||[]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"T\xf3m tắt active"}),(0,n.jsx)("div",{className:"mt-4 space-y-3",children:[["API key đang d\xf9ng",t.activeApiKeys],["Provider active",t.activeProviders],["Model active",t.activeModels],["Endpoint active",t.activeEndpoints],["Cached tokens",t.cachedTokens],["Reasoning tokens",t.reasoningTokens],["Latency AVG",m(r.avgLatencyMs||s.avgMs)],["Latency P50",m(r.p50LatencyMs||s.p50Ms)],["Latency P99",m(r.p99LatencyMs||s.p99Ms)],["TTFT P95",m(r.p95TtftMs)],["Input P95",d(r.p95PromptTokens||0)],["Long input >=30k",c(r.longInputRate)]].map(([e,t])=>(0,n.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-background px-3 py-2",children:[(0,n.jsx)("span",{className:"text-sm text-text-muted",children:e}),(0,n.jsx)("span",{className:"font-semibold text-text-main",children:"number"==typeof t?o(t):t})]},e))})]})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Top API key d\xf9ng nhiều token"}),(0,n.jsx)(I,{rows:(e.clientRequests?.topApiKeysByTokens||e.groups?.apiKeys||[]).slice(0,8),columns:[{key:"name",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.name||e.label}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[e.fingerprint||e.apiKeyFingerprint,e.ownerUser||e.apiKeyOwner?` \xb7 ${e.ownerUser||e.apiKeyOwner}`:""]})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"P95/Max input",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:d(e.p95PromptTokens||0)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",d(e.maxPromptTokens||0)]})]})}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Top Source IP d\xf9ng nhiều token"}),(0,n.jsx)(I,{rows:(e.clientRequests?.topSourceIpsByTokens||[]).slice(0,8),columns:[{key:"label",label:"Source IP",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"heavy",label:"Nặng",render:e=>(0,n.jsxs)("span",{className:"text-xs text-text-muted",children:[o(e.heavyRequests||0)," req"]})}],empty:"Kh\xf4ng c\xf3 Source IP c\xf3 token trong khoảng lọc."})]})]})]})}function B({data:e}){let t=e.clientRequests||{},s=t.summary||{},r=t.topHeavyUsers||[],l=t.topProblemClients||[],a=t.topApiKeysByTokens||[],i=t.topSourceIpsByTokens||[];t.topSourceIpsByHeavyRequests;let x=t.inputBuckets||[],u=e=>(0,n.jsxs)("div",{className:"min-w-[220px]",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.label}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.ownerUser?`Owner ${e.ownerUser}`:e.apiKeyName||"Kh\xf4ng c\xf3 owner"}),(0,n.jsx)("div",{className:"font-mono text-[11px] text-text-muted",children:e.apiKeyFingerprint||e.primaryClientIp||e.key})]}),h=e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["Nặng ",o(e.heavyRequests)," \xb7 ",c(e.heavyRequestRate)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["P95 input ",d(e.p95PromptTokens)," \xb7 Max ",d(e.maxPromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=70k ",o(e.extremeInputRequests)," \xb7 ",c(e.extremeInputRate)]})]});return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,n.jsx)(f,{icon:"person_alert",label:"Top user nặng nhất",value:s.topUserLabel||"-",hint:`${d(s.topUserTokens)} token \xb7 ${c(s.topUserTokenShare)} tổng token`,tone:s.topUserTokenShare>=.35?"amber":"slate"}),(0,n.jsx)(f,{icon:"vpn_key",label:"Top API key nhiều token",value:s.topApiKeyLabel||"-",hint:`${d(s.topApiKeyTokens)} token \xb7 ${c(s.topApiKeyTokenShare)} tổng token`,tone:s.topApiKeyTokenShare>=.35?"amber":"blue"}),(0,n.jsx)(f,{icon:"lan",label:"Top IP nhiều token",value:s.topSourceIpLabel||"-",hint:`${d(s.topSourceIpTokens)} token \xb7 ${c(s.topSourceIpTokenShare)} tổng token`,tone:s.topSourceIpTokenShare>=.35?"amber":"purple"}),(0,n.jsx)(f,{icon:"input",label:"Input d\xe0i >=30k",value:c(s.longInputBucketShare||0),hint:`>=70k ${c(s.extremeInputShare||0)}`,tone:(s.extremeInputShare||0)>=.1?"amber":"green"}),(0,n.jsx)(f,{icon:"groups",label:"User/API key được theo d\xf5i",value:o(s.trackedUsers||0),hint:"Theo owner/API key fingerprint/source IP",tone:"blue"}),(0,n.jsx)(f,{icon:"network_check",label:"Top IP request nặng",value:s.topSourceIpHeavyLabel||"-",hint:`${o(s.topSourceIpHeavyRequests||0)} request >=30k input/total`,tone:s.topSourceIpHeavyRequests?"amber":"slate"}),(0,n.jsx)(f,{icon:"report",label:"Client lỗi nhiều",value:o(s.problemClients||0),hint:"Nh\xf3m user/API key c\xf3 error rows",tone:s.problemClients?"amber":"green"})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top user/API key gửi request nặng nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp theo tổng input/output token của request th\xe0nh c\xf4ng c\xf3 token. D\xf9ng để ph\xe1t hiện user VS Code/agent đang tạo tải long-context lớn."})]}),(0,n.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-xs font-semibold text-primary",children:"Kh\xf4ng hiển thị full bearer token"})]}),(0,n.jsx)(I,{rows:r,columns:[{key:"user",label:"User/API key",render:u},{key:"quality",label:"\xc1p lực",render:e=>(0,n.jsx)(K,{level:e.level,label:e.pressureLabel})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"Input pressure",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["Avg ",d(e.avgPromptTokens)," \xb7 P95 ",d(e.p95PromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["Max ",d(e.maxPromptTokens)," \xb7 >=30k ",c(e.longInputRate)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=50k ",c(e.hugeInputRate)," \xb7 >=70k ",c(e.extremeInputRate)]})]})},{key:"latency",label:"Latency / TTFT",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["P95 ",m(e.p95LatencyMs)," \xb7 Max ",m(e.maxLatencyMs)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT P95 ",m(e.p95TtftMs)," \xb7 Slow ",c(e.slowRequestRate)]})]})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"topIps",label:"IP / Tool",render:e=>(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)(L,{items:e.topIps}),(0,n.jsx)(L,{items:e.topTools})]})},{key:"meta",label:"Meta",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs text-text-muted",children:[(0,n.jsxs)("div",{children:["Key ",o(e.apiKeyCount)," \xb7 IP ",o(e.sourceIpCount)," \xb7 Tool ",o(e.sourceToolCount)]}),(0,n.jsxs)("div",{children:["Session ",o(e.sessionCount)," \xb7 Last ",b(e.lastSeen)]})]})}],empty:"Kh\xf4ng c\xf3 request th\xe0nh c\xf4ng c\xf3 token trong khoảng lọc."})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top API key d\xf9ng nhiều token nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp theo tổng input + output token từ UsageHistory, kh\xf4ng lộ full bearer token."})]}),(0,n.jsx)(I,{rows:a,columns:[{key:"apiKey",label:"API key",render:e=>(0,n.jsxs)("div",{className:"min-w-[220px]",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.label}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.apiKeyOwner?`Owner ${e.apiKeyOwner}`:e.apiKeyName||e.primarySourceTool||"-"}),(0,n.jsx)("div",{className:"font-mono text-[11px] text-text-muted",children:e.apiKeyFingerprint||e.primaryClientIp||e.key})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"Input nặng",render:h},{key:"meta",label:"Nguồn",render:e=>(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[(0,n.jsxs)("div",{children:["IP ",o(e.sourceIpCount)," \xb7 Tool ",o(e.sourceToolCount)]}),(0,n.jsxs)("div",{children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 API key c\xf3 token trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top Source IP d\xf9ng nhiều token nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Dựa tr\xean UsageHistory n\xean c\xf3 input/output token, kh\xe1c với bảng Source IP từ Prompt Logs chỉ đếm log."})]}),(0,n.jsx)(I,{rows:i,columns:[{key:"ip",label:"Source IP",render:e=>(0,n.jsxs)("div",{className:"min-w-[180px]",children:[(0,n.jsx)("div",{className:"font-mono text-sm font-semibold text-text-main",children:e.label}),(0,n.jsxs)("div",{className:"mt-1 text-xs text-text-muted",children:["Tool ",o(e.sourceToolCount)," \xb7 API key ",o(e.apiKeyCount)]}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"input",label:"Input nặng",render:h},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 Source IP c\xf3 token trong khoảng lọc."})]})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Ph\xe2n bố request theo k\xedch thước input"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Gi\xfap admin biết workload đang l\xe0 chat ngắn hay long-context VS Code/agent."})]}),(0,n.jsx)(I,{rows:x,columns:[{key:"label",label:"Input bucket",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"share",label:"Tỷ trọng",render:e=>c(e.share)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"latency",label:"Latency P95/MAX",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:[m(e.p95LatencyMs)," / ",m(e.maxLatencyMs)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT P95 ",m(e.p95TtftMs)]})]})}],empty:"Kh\xf4ng c\xf3 dữ liệu bucket input."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Client/API key lỗi nhiều"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"D\xf9ng để ph\xe1t hiện sai endpoint/model/auth/policy hoặc client tool cấu h\xecnh sai."})]}),(0,n.jsx)(I,{rows:l,columns:[{key:"user",label:"Client",render:u},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"source",label:"IP/Tool",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{className:"font-mono",children:e.primaryClientIp||"-"}),(0,n.jsx)("div",{className:"text-text-muted",children:e.primarySourceTool||"-"})]})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 client lỗi theo bộ lọc hiện tại."})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"G\xf3c nh\xecn monitor client n\xean d\xf9ng"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"C\xe1c chỉ số n\xe0y bổ sung cho latency/model để admin ph\xe2n biệt server chậm hay client gửi request qu\xe1 nặng."})]}),(0,n.jsx)("div",{className:"grid gap-3 text-sm md:grid-cols-2 xl:grid-cols-3",children:[["Token/user","X\xe1c định user/API key tạo tải lớn nhất, hữu \xedch cho quota v\xe0 hướng dẫn workflow VS Code."],["Input bucket","Nếu phần lớn request nằm ở 30k-70k+, P95/P99 cao chủ yếu do prompt eval/context d\xe0i."],["TTFT theo user","TTFT cao cho một user thường l\xe0 input d\xe0i hoặc chờ slot, kh\xf4ng nhất thiết provider lỗi."],["Error theo client","T\xe1ch lỗi sai endpoint/model/API key khỏi lỗi server/provider để kh\xf4ng cảnh b\xe1o nhầm."],["Source IP/tool","Ph\xe1t hiện m\xe1y/tool gửi request nhiều hoặc cấu h\xecnh sai."],["Top request nặng","D\xf9ng Raw usage để drill-down request cụ thể khi một user k\xe9o tải hệ thống."]].map(([e,t])=>(0,n.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:t})]},e))})]})]})}function G({data:e}){return(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Thống k\xea theo API key"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Kh\xf4ng hiển thị full bearer token. Dashboard chỉ d\xf9ng fingerprint/masked key."})]}),(0,n.jsx)(I,{rows:e.groups?.apiKeys||[],columns:[{key:"name",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.name}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:[e.fingerprint,e.ownerUser?` \xb7 Owner: ${e.ownerUser}`:""]})]})},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"success",label:"OK/Lỗi",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{className:"text-green-600",children:["OK ",o(e.success)]}),(0,n.jsxs)("div",{className:"text-red-600",children:["Lỗi ",o(e.errors)]})]})},{key:"tokens",label:"In/Out token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"topProviders",label:"Top provider",render:e=>(0,n.jsx)(L,{items:e.topProviders})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})}function z({data:e}){let t=e.clientRequests?.topSourceIpsByTokens||[],s=e.clientRequests?.topSourceIpsByHeavyRequests||[],r=e=>(0,n.jsxs)("div",{className:"min-w-[180px]",children:[(0,n.jsx)("div",{className:"font-mono text-sm font-semibold text-text-main",children:e.label}),(0,n.jsxs)("div",{className:"mt-1 text-xs text-text-muted",children:["API key ",o(e.apiKeyCount)," \xb7 Tool ",o(e.sourceToolCount)]}),(0,n.jsxs)("div",{className:"text-xs text-text-muted",children:["Model ",o(e.modelCount)," \xb7 Provider ",o(e.providerCount)]})]});return(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top IP d\xf9ng nhiều token nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Aggregate từ UsageHistory, xếp theo tổng input + output token."})]}),(0,n.jsx)(I,{rows:t,columns:[{key:"ip",label:"Source IP",render:r},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 Source IP c\xf3 token trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Top IP gửi request nặng nhất"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Xếp theo số request input/total token từ 30k trở l\xean, sau đ\xf3 theo max/P95 input."})]}),(0,n.jsx)(I,{rows:s,columns:[{key:"ip",label:"Source IP",render:r},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"heavy",label:"Request nặng",render:e=>(0,n.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,n.jsxs)("div",{children:["Nặng ",o(e.heavyRequests)," \xb7 ",c(e.heavyRequestRate)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["P95 input ",d(e.p95PromptTokens)," \xb7 Max ",d(e.maxPromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=70k ",o(e.extremeInputRequests)," \xb7 ",c(e.extremeInputRate)]})]})},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 Source IP gửi request nặng trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Source IP từ Prompt Logs"}),(0,n.jsx)(I,{rows:e.promptLogs?.topClientIps||[],columns:[{key:"label",label:"IP",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Logs",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topTools",label:"Tools",render:e=>(0,n.jsx)(L,{items:e.topTools})},{key:"topModels",label:"Models",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Source tool"}),(0,n.jsx)(I,{rows:e.promptLogs?.topSourceTools||[],columns:[{key:"label",label:"Tool",render:e=>(0,n.jsx)("span",{className:"font-semibold",children:e.label})},{key:"requests",label:"Logs",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topIps",label:"Top IP",render:e=>(0,n.jsx)(L,{items:e.topIps})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)(y,{className:"xl:col-span-2",children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Session nhiều hoạt động"}),(0,n.jsx)(I,{rows:e.promptLogs?.topSessions||[],columns:[{key:"label",label:"Session",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Logs",render:e=>o(e.requests)},{key:"errors",label:"Lỗi",render:e=>o(e.errors)},{key:"topIps",label:"IP",render:e=>(0,n.jsx)(L,{items:e.topIps})},{key:"topTools",label:"Tool",render:e=>(0,n.jsx)(L,{items:e.topTools})},{key:"topModels",label:"Model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})]})}function W({data:e}){return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Provider"}),(0,n.jsx)(I,{rows:e.groups?.providers||[],columns:[{key:"label",label:"Provider",render:e=>(0,n.jsx)("span",{className:"font-semibold",children:e.label})},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"topModels",label:"Top model",render:e=>(0,n.jsx)(L,{items:e.topModels})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Model"}),(0,n.jsx)(I,{rows:e.groups?.models||[],columns:[{key:"label",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"errorRate",label:"Lỗi",render:e=>(0,n.jsx)(A,{value:e.errorRate})}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Provider account / connection"}),(0,n.jsx)(I,{rows:e.groups?.providerAccounts||[],columns:[{key:"label",label:"Account",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.label}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider||e.connectionId})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"errorRate",label:"Lỗi",render:e=>(0,n.jsx)(A,{value:e.errorRate})}]})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Endpoint"}),(0,n.jsx)(I,{rows:e.groups?.endpoints||[],columns:[{key:"label",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.label})},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]})]})}function X({data:e}){let t=e.experience||{},s=t.thresholds||{},r=e.thinkingAnalytics||{},l=e.largeContextAnalytics||{},a=t.byModel||[],i=t.slowestRequests||[];return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[(0,n.jsx)(f,{icon:"verified",label:"Đ\xe1nh gi\xe1 tổng",value:h(t.score),hint:`${t.label||"-"} \xb7 ${o(t.samples)} mẫu success c\xf3 token`,help:"Điểm chất lượng trải nghiệm tổng hợp từ c\xe1c request th\xe0nh c\xf4ng c\xf3 token.",tone:t.tone||"slate"}),(0,n.jsx)(f,{icon:"timer",label:"Latency AVG / P95",value:`${m(t.avgLatencyMs)} / ${m(t.p95LatencyMs)}`,hint:`P50 ${m(t.p50LatencyMs)} \xb7 P99 ${m(t.p99LatencyMs)}`,help:"AVG l\xe0 trung b\xecnh; P95 thể hiện nh\xf3m 5% request chậm nhất.",tone:"purple"}),(0,n.jsx)(f,{icon:"bolt",label:"TTFT AVG / P95",value:`${m(t.avgTtftMs)} / ${m(t.p95TtftMs)}`,hint:"TTFT cao thường l\xe0 queue/prompt eval/input d\xe0i",help:"Thời gian từ l\xfac gửi request đến token đầu ti\xean.",tone:t.slowTtftRate>=.2?"amber":"blue"}),(0,n.jsx)(f,{icon:"keyboard_double_arrow_up",label:"Input AVG / P95",value:`${d(t.avgPromptTokens)} / ${d(t.p95PromptTokens)}`,hint:`>=30k ${c(t.longInputRate)} \xb7 >=50k ${c(t.hugeInputRate)}`,help:"Input c\xe0ng lớn th\xec prompt eval v\xe0 TTFT thường c\xe0ng cao."}),(0,n.jsx)(f,{icon:"running_with_errors",label:"Slow request",value:c(t.slowRequestRate),hint:`Latency >= ${m(s.slowLatencyMs||45e3)} \xb7 rất chậm ${c(t.verySlowRequestRate)}`,help:"Tỷ lệ request ho\xe0n tất chậm hơn ngưỡng vận h\xe0nh.",tone:t.slowRequestRate>=.2?"amber":"green"}),(0,n.jsx)(f,{icon:"pending_actions",label:"Slow TTFT",value:c(t.slowTtftRate),hint:`TTFT >= ${m(s.slowTtftMs||2e4)}`,help:"Tỷ lệ request chờ token đầu ti\xean qu\xe1 l\xe2u.",tone:t.slowTtftRate>=.2?"amber":"green"}),(0,n.jsx)(f,{icon:"speed",label:"Output tốc độ",value:u(t.decodeTokensPerSecond," tok/s"),hint:`Output/latency ${u(t.outputTokensPerSecond," tok/s")}`,tone:"slate"}),(0,n.jsx)(f,{icon:"data_usage",label:"Latency / 10k input",value:m(t.latencyMsPer10kInputTokens),hint:"Hữu \xedch khi VS Code gửi 30k–70k token",help:"Chuẩn h\xf3a latency theo k\xedch thước input để so s\xe1nh c\xf4ng bằng hơn.",tone:"slate"}),(0,n.jsx)(f,{icon:"psychology_alt",label:"Thinking auto-off",value:c(r.autoOffRate),hint:`${o(r.autoOffRequests||0)} / ${o(r.totalRequests||0)} request`,help:"Request bị tắt thinking tự động do vượt ngưỡng prompt chars.",tone:(r.autoOffRate||0)>=.3?"amber":"green"}),(0,n.jsx)(f,{icon:"toggle_off",label:"Thinking OFF",value:c(r.thinkingOffRate),hint:`ON ${c(r.thinkingOnRate)} \xb7 unknown ${c(r.unknownRate)}`,help:"Tỷ lệ request cuối c\xf9ng chạy ở chế độ kh\xf4ng thinking.",tone:(r.thinkingOffRate||0)>=.5?"blue":"slate"}),(0,n.jsx)(f,{icon:"data_object",label:"Large context",value:c(l.gte50kRate),hint:`>=30k ${c(l.gte30kRate)} \xb7 >=100k ${c(l.gte100kRate)}`,help:"Tỷ lệ request c\xf3 context lớn; thường l\xe0 nguy\xean nh\xe2n l\xe0m P95/P99 tăng.",tone:(l.gte50kRate||0)>=.3?"amber":"slate"})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Thinking Analytics"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Theo d\xf5i request bật/tắt thinking v\xe0 tỷ lệ auto-off do vượt ngưỡng prompt chars."})]}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:[["Thinking ON",o(r.thinkingOnRequests||0),c(r.thinkingOnRate)],["Thinking OFF",o(r.thinkingOffRequests||0),c(r.thinkingOffRate)],["Auto-off hit",o(r.autoOffRequests||0),c(r.autoOffRate)],["C\xf3 ngưỡng auto-off",o(r.thresholdConfiguredRequests||0),`hit ${c(r.autoOffEligibleHitRate)}`]].map(([e,t,s])=>(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:e}),(0,n.jsx)("div",{className:"mt-2 text-xl font-semibold text-text-main",children:t}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:s})]},e))}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(I,{rows:r.byModel||[],empty:"Chưa c\xf3 dữ liệu thinking trong khoảng lọc.",columns:[{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.provider})]})},{key:"requests",label:"Req",render:e=>o(e.requests)},{key:"autoOff",label:"Auto-off",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:o(e.autoOffRequests)}),(0,n.jsx)("div",{className:"text-text-muted",children:c(e.autoOffRate)})]})},{key:"thinking",label:"ON/OFF",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:["ON ",o(e.thinkingOnRequests)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["OFF ",o(e.thinkingOffRequests)]})]})},{key:"chars",label:"Chars avg/max",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:d(e.avgPromptChars)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",d(e.maxPromptChars)]})]})}]})})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Large Context Analytics"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Bucket theo request size, ưu ti\xean prompt chars; nếu chưa c\xf3 chars th\xec fallback prompt tokens."})]}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-3",children:[[">=30k",l.gte30kRequests,l.gte30kRate],[">=50k",l.gte50kRequests,l.gte50kRate],[">=100k",l.gte100kRequests,l.gte100kRate]].map(([e,t,s])=>(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:e}),(0,n.jsx)("div",{className:"mt-2 text-xl font-semibold text-text-main",children:o(t||0)}),(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:c(s)})]},e))}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(I,{rows:l.buckets||[],empty:"Chưa c\xf3 large context buckets trong khoảng lọc.",columns:[{key:"label",label:"Bucket",render:e=>(0,n.jsx)("span",{className:"font-semibold",children:e.label})},{key:"requests",label:"Req",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:o(e.requests)}),(0,n.jsx)("div",{className:"text-text-muted",children:c(e.share)})]})},{key:"chars",label:"Size avg/max",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:d(e.avgRequestSize)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",d(e.maxRequestSize)]})]})},{key:"latency",label:"Latency/TTFT",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:m(e.avgLatencyMs)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT ",m(e.avgTtftMs)]})]})},{key:"autoOff",label:"Auto-off",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:o(e.autoOffRequests)}),(0,n.jsx)("div",{className:"text-text-muted",children:c(e.autoOffRate)})]})}]})})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"C\xe1ch đọc trải nghiệm user"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Nh\xf3m n\xe0y chỉ t\xednh request th\xe0nh c\xf4ng c\xf3 token v\xe0 latency > 0. Error/pending/success 0-token kh\xf4ng trộn v\xe0o tốc độ model. TTFT l\xe0 thời gian tới token đầu ti\xean; với VS Code input 30k–70k, TTFT cao thường phản \xe1nh chờ slot hoặc prompt eval d\xe0i."})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Nhanh/chậm thực tế"}),(0,n.jsx)("div",{className:"mt-2 text-sm text-text-main",children:"Latency AVG/P50/P95/MAX cho biết user phải chờ bao l\xe2u để request ho\xe0n tất."})]}),(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Queue hoặc prompt eval"}),(0,n.jsx)("div",{className:"mt-2 text-sm text-text-main",children:"TTFT cao + input P95 cao l\xe0 t\xedn hiệu request d\xe0i, hết slot hoặc upstream đang queue."})]}),(0,n.jsxs)("div",{className:"rounded-2xl bg-background p-4",children:[(0,n.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-text-muted",children:"VS Code / agent"}),(0,n.jsx)("div",{className:"mt-2 text-sm text-text-main",children:"Theo d\xf5i tỷ lệ input >=30k/50k/70k để biết P95/P99 cao c\xf3 phải do context cực d\xe0i hay kh\xf4ng."})]})]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Chất lượng phản hồi theo provider/model"}),(0,n.jsx)(I,{rows:a,empty:"Chưa c\xf3 mẫu latency cho model trong khoảng lọc.",columns:[{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"quality",label:"Đ\xe1nh gi\xe1",render:e=>(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)($,{level:e.level,label:e.labelQuality}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:h(e.score)})]})},{key:"samples",label:"Mẫu",render:e=>o(e.samples)},{key:"latency",label:"Latency P50/P95/MAX",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:[m(e.p50LatencyMs)," / ",m(e.p95LatencyMs)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:["max ",m(e.maxLatencyMs)]})]})},{key:"ttft",label:"TTFT P95",render:e=>m(e.p95TtftMs)},{key:"input",label:"Input avg/P95",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsxs)("div",{children:[d(e.avgPromptTokens)," / ",d(e.p95PromptTokens)]}),(0,n.jsxs)("div",{className:"text-text-muted",children:[">=30k ",c(e.longInputRate)]})]})},{key:"slow",label:"Chậm",render:e=>(0,n.jsx)(A,{value:e.slowRequestRate})},{key:"speed",label:"Output tok/s",render:e=>u(e.outputTokensPerSecond," tok/s")}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Request chậm nhất"}),(0,n.jsx)(I,{rows:i,empty:"Kh\xf4ng c\xf3 request chậm trong khoảng lọc.",columns:[{key:"timestamp",label:"Time",render:e=>b(e.timestamp)},{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"latency",label:"Latency / TTFT",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{className:"font-semibold",children:m(e.latencyMs)}),(0,n.jsxs)("div",{className:"text-text-muted",children:["TTFT ",m(e.ttftMs)]})]})},{key:"tokens",label:"In / Out",render:e=>(0,n.jsx)(M,{row:e})},{key:"apiKeyName",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:e.apiKeyName}),(0,n.jsx)("div",{className:"font-mono text-xs text-text-muted",children:e.apiKeyFingerprint})]})},{key:"sourceTool",label:"Tool/IP",render:e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{children:e.sourceTool||"-"}),(0,n.jsx)("div",{className:"font-mono text-text-muted",children:e.clientIp||"-"})]})},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint||"-"})}]})]})]})}function Z({data:e}){let t=e.requestErrors||{},s=t.summary||{},r=e.overview||{},l=Number(r.serverErrorRate||0),a=Number(r.clientErrorRate||0),i=Number(r.rateLimitErrorRate||0),d=[{key:"faultOwner",label:"Loại",render:e=>(0,n.jsx)(O,{value:e.faultOwner})},{key:"status",label:"Status",render:e=>(0,n.jsx)("span",{className:"rounded-full bg-red-500/10 px-2 py-1 text-xs font-semibold text-red-600 dark:text-red-300",children:e.status})},{key:"provider",label:"Provider",render:e=>e.providerLabel||e.provider},{key:"model",label:"Model"},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint})},{key:"requests",label:"Lỗi",render:e=>o(e.errors||e.requests)},{key:"errorType",label:"Type",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.errorType||e.errorCode||"-"})},{key:"sampleMessage",label:"Sample",render:e=>(0,n.jsx)(F,{row:e})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}];return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[(0,n.jsx)(E,{icon:"dns",label:"Server/provider",value:s.serverImpacting||0,hint:`${c(l)} tr\xean tổng request`,tone:s.serverImpacting?"red":"green"}),(0,n.jsx)(E,{icon:"cloud_off",label:"Upstream",value:s.upstream||0,hint:"Provider/model server, timeout, network, 5xx",tone:s.upstream?"red":"green"}),(0,n.jsx)(E,{icon:"router",label:"Gateway",value:s.gateway||0,hint:"Lỗi nội bộ BlueRouter/gateway",tone:s.gateway?"purple":"green"}),(0,n.jsx)(E,{icon:"integration_instructions",label:"Client/request",value:s.client||0,hint:`${c(a)} do endpoint/model/body/auth`,tone:s.client?"slate":"green"}),(0,n.jsx)(E,{icon:"speed",label:"Rate/quota",value:s.rateLimit||0,hint:`${c(i)} rate-limit/quota`,tone:s.rateLimit?"amber":"green"})]}),(0,n.jsx)("div",{className:"rounded-2xl border border-blue-500/20 bg-blue-500/10 p-4 text-sm text-blue-700 dark:text-blue-300",children:(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"rule_settings"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:"Ph\xe2n loại lỗi đ\xe3 t\xe1ch client khỏi server/provider"}),(0,n.jsxs)("div",{className:"mt-1 opacity-90",children:["Cảnh b\xe1o vận h\xe0nh n\xean ưu ti\xean nh\xf3m ",(0,n.jsx)("b",{children:"Server/provider"})," gồm gateway, upstream, timeout, network v\xe0 5xx. Nh\xf3m ",(0,n.jsx)("b",{children:"Client/request"})," vẫn được log đầy đủ nhưng thường l\xe0 sai endpoint, model, auth, JSON/body hoặc context."]})]})]})}),e.anomalies?.length?(0,n.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:e.anomalies.map((e,t)=>(0,n.jsx)(_,{anomaly:e},t))}):(0,n.jsxs)("div",{className:"rounded-2xl border border-green-500/20 bg-green-500/10 p-4 text-sm text-green-700 dark:text-green-300",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-2 align-[-5px]",children:"check_circle"}),"Chưa ph\xe1t hiện bất thường server/provider r\xf5 r\xe0ng theo bộ lọc hiện tại."]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Lỗi server/provider cần xử l\xfd"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Chỉ gồm gateway/upstream/server-impacting errors. Đ\xe2y l\xe0 bảng quan trọng nhất cho vận h\xe0nh."})]}),(0,n.jsxs)("span",{className:"rounded-full bg-red-500/10 px-3 py-1 text-xs font-semibold text-red-600 dark:text-red-300",children:[o(s.serverImpacting||0)," lỗi"]})]}),(0,n.jsx)(I,{rows:t.topServerErrors||[],columns:d,empty:"Kh\xf4ng c\xf3 lỗi server/provider trong khoảng lọc."})]}),(0,n.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Lỗi client/request sai"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Sai endpoint, model, auth, JSON/body, context length. D\xf9ng để hướng dẫn client sửa request."})]}),(0,n.jsx)(I,{rows:t.topClientErrors||[],columns:d.filter(e=>!["sampleMessage"].includes(e.key)),empty:"Kh\xf4ng c\xf3 lỗi client/request trong khoảng lọc."})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Ph\xe2n bố loại lỗi"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"T\xe1ch nguồn chịu tr\xe1ch nhiệm để kh\xf4ng nhầm lỗi client th\xe0nh lỗi server."})]}),(0,n.jsx)(I,{rows:t.byFaultOwner||[],columns:[{key:"faultOwner",label:"Loại",render:e=>(0,n.jsx)(O,{value:e.faultOwner||e.key})},{key:"requests",label:"Số lỗi",render:e=>o(e.requests)},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}],empty:"Kh\xf4ng c\xf3 lỗi để ph\xe2n loại."})]})]}),t.topRateLimitErrors?.length?(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Rate limit / quota"}),(0,n.jsx)(I,{rows:t.topRateLimitErrors||[],columns:d})]}):null,(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Tất cả lỗi raw theo status/provider/model/endpoint"}),(0,n.jsx)(I,{rows:[...e.groups?.errors||[]].sort((e,t)=>new Date(p(t.lastSeen)||0)-new Date(p(e.lastSeen)||0)||Number(t.errors||t.requests||0)-Number(e.errors||e.requests||0)),columns:[{key:"faultOwner",label:"Loại",render:e=>(0,n.jsx)(O,{value:e.faultOwner})},{key:"status",label:"Status",render:e=>(0,n.jsx)("span",{className:"rounded-full bg-red-500/10 px-2 py-1 text-xs font-semibold text-red-600 dark:text-red-300",children:e.status})},{key:"provider",label:"Provider",render:e=>e.providerLabel||e.provider},{key:"model",label:"Model"},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint})},{key:"requests",label:"Lỗi",render:e=>o(e.errors||e.requests)},{key:"apiKey",label:"API key",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.apiKey})},{key:"lastSeen",label:"Last seen",render:e=>b(e.lastSeen)}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Status distribution"}),(0,n.jsx)(I,{rows:e.groups?.statuses||[],columns:[{key:"label",label:"Status"},{key:"requests",label:"Requests",render:e=>o(e.requests)},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"errorRate",label:"Error %",render:e=>(0,n.jsx)(A,{value:e.errorRate})}]})]})]})}function Y({data:e}){return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Top request nặng token"}),(0,n.jsx)(I,{rows:e.heavyRequests||[],columns:[{key:"timestamp",label:"Time",render:e=>b(e.timestamp)},{key:"model",label:"Model",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.model}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:e.providerLabel||e.provider})]})},{key:"apiKeyName",label:"API key",render:e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:e.apiKeyName}),(0,n.jsx)("div",{className:"font-mono text-xs text-text-muted",children:e.apiKeyFingerprint})]})},{key:"accountName",label:"Account"},{key:"endpoint",label:"Endpoint",render:e=>(0,n.jsx)("span",{className:"font-mono text-xs",children:e.endpoint})},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"status",label:"Status"}]})]}),(0,n.jsxs)(y,{children:[(0,n.jsx)("h2",{className:"mb-4 text-lg font-semibold text-text-main",children:"Recent usage"}),(0,n.jsx)(I,{rows:e.recentUsage||[],columns:[{key:"timestamp",label:"Time",render:e=>b(e.timestamp)},{key:"provider",label:"Provider",render:e=>e.providerLabel||e.provider},{key:"model",label:"Model"},{key:"apiKeyName",label:"API key"},{key:"tokens",label:"Token",render:e=>(0,n.jsx)(M,{row:e})},{key:"cost",label:"Cost",render:e=>x(e.cost)},{key:"status",label:"Status"}]})]})]})}function J(){let{isAdmin:e,isMonitorAdmin:t,isAiGatewaysMonitor:s}=(0,l.s)(),[a,o]=(0,r.useState)({period:"today",dateFrom:"",dateTo:"",provider:"",model:"",connectionId:"",status:"",endpoint:"",apiKey:"",clientIp:"",sourceTool:"",sessionId:"",keyword:""}),[d,c]=(0,r.useState)(null),[x,m]=(0,r.useState)(!0),[u,h]=(0,r.useState)(""),[p,g]=(0,r.useState)("overview"),[y,f]=(0,r.useState)(!1),N=function(e,t=450){let[s,n]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let s=setTimeout(()=>n(e),t);return()=>clearTimeout(s)},[e,t]),s}(a,450),T=(0,r.useRef)(0),w=(0,r.useCallback)(async({clear:e=!1,filtersOverride:t=null}={})=>{let s=T.current+1;T.current=s,e&&c(null),m(!0),h("");try{let e=t||N,n=k(e,{timeZone:v()}),r=await fetch(`/api/dashboard/analytics?${n}`,{cache:"no-store"}),l=await r.json().catch(()=>({}));if(s!==T.current)return;if(!r.ok)throw Error(l.error||"Kh\xf4ng tải được dữ liệu analytics");c(l)}catch(e){if(s!==T.current)return;h(e.message||"Kh\xf4ng tải được dữ liệu analytics")}finally{s===T.current&&m(!1)}},[N]);(0,r.useEffect)(()=>{w({clear:!0})},[w]),(0,r.useEffect)(()=>{if(!y)return;let e=setInterval(()=>w(),1e4);return()=>clearInterval(e)},[y,w]);let R=d?.options||{},S=(0,r.useMemo)(()=>d?.generatedAt?b(d.generatedAt):"-",[d]);return(0,n.jsxs)("div",{className:"space-y-5 p-4 md:p-6",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-primary",children:[(0,n.jsx)("span",{className:"material-symbols-outlined",children:"monitoring"}),(0,n.jsx)("span",{className:"text-sm font-semibold uppercase tracking-wide",children:"BlueRouter Analytics"})]}),(0,n.jsx)("h1",{className:"mt-2 text-2xl font-bold text-text-main",children:"Thống k\xea sử dụng Gateway"}),(0,n.jsx)("p",{className:"mt-1 max-w-3xl text-sm text-text-muted",children:"Theo d\xf5i tần suất request, input/output token, API key, provider, model, endpoint, Source IP, source tool v\xe0 lỗi vận h\xe0nh."})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-surface px-4 py-3 text-sm text-text-muted",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"schedule"}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{children:["Generated: ",S]}),(0,n.jsxs)("label",{className:"mt-1 flex cursor-pointer items-center gap-2 text-xs",children:[(0,n.jsx)("input",{type:"checkbox",checked:y,onChange:e=>f(e.target.checked)}),"Auto refresh 10s"]})]})]})]}),(0,n.jsx)(H,{filters:a,setFilters:o,options:R,onRefresh:e=>w({filtersOverride:e||a}),onExportCsv:()=>{let e=k(a,{format:"csv",timeZone:v()});window.open(`/api/dashboard/analytics?${e}`,"_blank","noopener,noreferrer")},loading:x,showProviderFilters:e||t||s}),u?(0,n.jsxs)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 p-4 text-sm text-red-700 dark:text-red-300",children:[(0,n.jsx)("span",{className:"material-symbols-outlined mr-2 align-[-5px]",children:"error"}),u]}):null,d?.qualityNotes?.length?(0,n.jsx)(U,{notes:d.qualityNotes}):null,(0,n.jsx)("div",{className:"flex flex-wrap gap-2 rounded-2xl border border-border bg-surface p-2",children:i.map(e=>(0,n.jsxs)("button",{onClick:()=>g(e.value),className:j("flex items-center gap-2 rounded-xl px-3 py-2 text-sm font-medium transition",p===e.value?"bg-primary text-white shadow-sm":"text-text-muted hover:bg-background hover:text-text-main"),children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e.icon}),e.label]},e.value))}),x&&!d?(0,n.jsx)(q,{}):null,!x&&d&&d.overview?.requests===0&&0===(d.promptLogs?.total||0)?(0,n.jsx)(P,{title:"Chưa c\xf3 dữ liệu analytics",description:"Kh\xf4ng c\xf3 UsageHistory hoặc Prompt Logs theo bộ lọc hiện tại."}):null,d?(0,n.jsxs)(n.Fragment,{children:["overview"===p?(0,n.jsx)(D,{data:d}):null,"apiKeys"===p?(0,n.jsx)(G,{data:d}):null,"clients"===p?(0,n.jsx)(B,{data:d}):null,"sources"===p?(0,n.jsx)(z,{data:d}):null,"providers"===p?(0,n.jsx)(W,{data:d}):null,"experience"===p?(0,n.jsx)(X,{data:d}):null,"errors"===p?(0,n.jsx)(Z,{data:d}):null,"raw"===p?(0,n.jsx)(Y,{data:d}):null]}):null]})}},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},94027:(e,t,s)=>{"use strict";s.d(t,{Y:()=>o,s:()=>d});var n=s(95155),r=s(12115),l=s(14051),a=s.n(l);let i=(0,r.createContext)(null);function o({children:e}){let[t,s]=(0,r.useState)(null),[l,a]=(0,r.useState)(!0),[d,c]=(0,r.useState)(""),x=(0,r.useCallback)(async()=>{a(!0),c("");try{let e=await fetch("/api/auth/status",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t?.error||"Kh\xf4ng tải được trạng th\xe1i đăng nhập");return s(t||{}),t||{}}catch(e){return c(e?.message||"Kh\xf4ng tải được trạng th\xe1i đăng nhập"),s({}),{}}finally{a(!1)}},[]);(0,r.useEffect)(()=>{let e=!1;return(async()=>{a(!0),c("");try{let t=await fetch("/api/auth/status",{cache:"no-store"}),n=await t.json().catch(()=>({}));if(e)return;if(!t.ok)throw Error(n?.error||"Kh\xf4ng tải được trạng th\xe1i đăng nhập");s(n||{})}catch(t){e||(c(t?.message||"Kh\xf4ng tải được trạng th\xe1i đăng nhập"),s({}))}finally{e||a(!1)}})(),()=>{e=!0}},[]);let m=(0,r.useMemo)(()=>{let e,s,n,r,l;return s=(e=t&&"object"==typeof t?t:{}).displayName||e.oidcName||e.oidcEmail||e.userId||"",n=!0===e.isAdmin,r=!0===e.isMonitorAdmin,l=!0===e.isAiGatewaysMonitor,{status:e,displayName:s,userId:e.userId||"",loginMethod:e.loginMethod||"",role:e.role||"guest",isAdmin:n,isMonitorAdmin:r,isAiGatewaysMonitor:l,canManageApiKeys:!0===e.canManageApiKeys||n||r,canUseMonitorAdminTabs:!0===e.canUseMonitorAdminTabs||n||r,canViewAllAnalytics:!0===e.canViewAllAnalytics||n||r||l}},[t]),u=(0,r.useMemo)(()=>({...m,loading:l,error:d,reload:x}),[m,l,d,x]);return(0,n.jsx)(i.Provider,{value:u,children:e})}function d(){let e=(0,r.useContext)(i);return e||{status:{},displayName:"",userId:"",loginMethod:"",role:"admin",isAdmin:!0,isMonitorAdmin:!1,isAiGatewaysMonitor:!1,canManageApiKeys:!0,canUseMonitorAdminTabs:!0,canViewAllAnalytics:!0,loading:!1,error:"",reload:async()=>({})}}o.propTypes={children:a().node}}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=39944)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3538],{43503:(e,t,s)=>{"use strict";s.d(t,{default:()=>c});var n=s(95155),r=s(12115),a=s(35497),l=s(57250);function i(e,t){return t.find(t=>t.id===e)?.name||e}function d(e){return String(e||"").trim().toLowerCase()}function o(e){return Array.isArray(e?.importedModels)?e.importedModels:[]}function c(){let[e,t]=(0,r.useState)(!0),[s,c]=(0,r.useState)(!1),[x,m]=(0,r.useState)(""),[h,u]=(0,r.useState)(""),[p,b]=(0,r.useState)(""),[g,j]=(0,r.useState)(!1),[f,y]=(0,r.useState)([]),[v,N]=(0,r.useState)([]),[k,w]=(0,r.useState)(null),[C,A]=(0,r.useState)(null),[I,M]=(0,r.useState)(""),[S,O]=(0,r.useState)(null),[$,T]=(0,r.useState)([]),[E,R]=(0,r.useState)(!1),[K,q]=(0,r.useState)(""),[z,U]=(0,r.useState)([]),[P,F]=(0,r.useState)(!1),[B,L]=(0,r.useState)(!1),[D,_]=(0,r.useState)({}),[G,H]=(0,r.useState)({}),[J,X]=(0,r.useState)(""),[Z,V]=(0,r.useState)({}),[W,Q]=(0,r.useState)(null),[Y,ee]=(0,r.useState)({}),[et,es]=(0,r.useState)(""),[en,er]=(0,r.useState)(""),[ea,el]=(0,r.useState)({}),[ei,ed]=(0,r.useState)({}),[eo,ec]=(0,r.useState)(""),[ex,em]=(0,r.useState)(!1),[eh,eu]=(0,r.useState)(!0),ep=(0,r.useCallback)(async()=>{t(!0),m("");try{let e=await fetch("/api/personal-cloud-providers",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được personal cloud providers");b(t.userId||""),j(!0===t.isAdmin),y(t.providers||[]),N(t.connections||[]),eu(!1!==t.globalRtkEnabled),el(t.routing||{}),ed(e=>{let s={...e};for(let[e,n]of Object.entries(t.routing||{}))s[e]={...n};return s}),X(e=>e||t.userId||"")}catch(e){m(e.message||"Kh\xf4ng tải được personal cloud providers")}finally{t(!1)}},[]),eb=(0,r.useCallback)(async()=>{if(g){L(!0);try{let e=await fetch("/api/personal-cloud-providers/permissions",{cache:"no-store"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được quyền OAuth");_(t.permissions||{}),H(t.connectionsByUser||{})}catch(e){m(e.message||"Kh\xf4ng tải được quyền OAuth")}finally{L(!1)}}},[g]);(0,r.useEffect)(()=>{ep()},[ep]),(0,r.useEffect)(()=>{g&&eb()},[g,eb]),(0,r.useEffect)(()=>{let e=D[d(J)]||{},t={};for(let s of f)t[s.id]=!0===e[s.id];V(t)},[J,D,f]);let eg=(0,r.useMemo)(()=>{let e=d(S?.ownerUser||p);return e?$.filter(t=>d(t.ownerUser||t.createdByUser||p)===e):[]},[$,S,p]),ej=(0,r.useMemo)(()=>Array.from(new Set([...Object.keys(D||{}),...Object.keys(G||{})])).map(e=>{let t=D[e]||{},s=G[e]||{},n=f.filter(e=>t?.[e.id]===!0),r=f.some(e=>(s[e.id]||0)>0);return{userId:e,providerState:t,connectionsByProvider:s,enabledProviders:n,hasAnyConnection:r}}).filter(e=>e.enabledProviders.length>0||e.hasAnyConnection).sort((e,t)=>e.userId.localeCompare(t.userId)),[D,G,f]),ef=async()=>{w(null),u("OAuth account đ\xe3 được th\xeam. Model sẽ được import tự động nếu provider hỗ trợ."),await ep()},ey=async(e,t)=>{m(""),u("");try{let s=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await s.json().catch(()=>({}));if(!s.ok)throw Error(n.error||"Kh\xf4ng cập nhật được connection");await ep()}catch(e){m(e.message||"Kh\xf4ng cập nhật được connection")}},ev=async e=>{m(""),u(""),M(e.id);try{let t=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/import-models`,{method:"POST"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng import được model");N(t=>t.map(t=>t.id===e.id?{...t,availableModels:s.models||[],importedModels:s.importedModels||[],modelImport:s.modelImport||t.modelImport}:t)),Q(t=>t?.id===e.id?{...t,availableModels:s.models||[],importedModels:s.importedModels||[],modelImport:s.modelImport||t.modelImport}:t);let n=s.modelImport?.source==="provider"?"provider":"catalog fallback";u(`Đ\xe3 cập nhật ${s.models?.length||0} model từ ${n}.`)}catch(e){m(e.message||"Kh\xf4ng import được model")}finally{M("")}},eN=async e=>{R(!0);try{let t=d(e?.ownerUser||p),s=t?`&ownerUser=${encodeURIComponent(t)}`:"",n=await fetch(`/api/keys?pageSize=100&status=active${s}`,{cache:"no-store"}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error||"Kh\xf4ng tải được API keys");let a=Array.isArray(r.keys)?r.keys:[];T(a);let l=d(r.userId),i=a.find(e=>d(e.ownerUser||e.createdByUser||l)===t);q(e=>e||i?.id||"")}catch(e){m(e.message||"Kh\xf4ng tải được API keys")}finally{R(!1)}},ek=async e=>{let t,s;m(""),u(""),O(e),U((s=(t=o(e)).filter(e=>"llm"===(e.type||"llm")).slice(0,3).map(e=>e.routeModel).filter(Boolean)).length>0?s:t.slice(0,3).map(e=>e.routeModel).filter(Boolean)),q(""),await eN(e)},ew=async()=>{if(!S)return;if(!K)return void m("Chọn API key cần th\xeam model.");let e=Array.from(new Set((Array.isArray(z)?z:[]).map(e=>String(e||"").trim()).filter(Boolean)));if(0===e.length)return void m("Chọn \xedt nhất một model.");F(!0),m(""),u("");try{let t=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(S.id)}/api-key-models`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKeyId:K,models:e})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng th\xeam được model v\xe0o API key");O(null),u(`Đ\xe3 th\xeam ${s.addedModels?.length||e.length} model v\xe0o API key ${s.key?.name||""}.`)}catch(e){m(e.message||"Kh\xf4ng th\xeam được model v\xe0o API key")}finally{F(!1)}},eC=async()=>{if(C){m(""),u("");try{let e=await fetch(`/api/personal-cloud-providers/${encodeURIComponent(C.id)}`,{method:"DELETE"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng x\xf3a được connection");A(null),await ep()}catch(e){m(e.message||"Kh\xf4ng x\xf3a được connection")}}},eA=async(e,t)=>{if(e?.id&&t?.routeModel){m(""),es(t.routeModel),ee(e=>({...e,[t.routeModel]:{...e[t.routeModel]||{},loading:!0}}));try{let s=`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/models/${t.routeModel.split("/").map(encodeURIComponent).join("/")}`,n=await fetch(s,{method:"POST"}),r=await n.json().catch(()=>({})),a={ok:r?.ok===!0,status:r?.status||n.status,text:r?.text||"",error:r?.error||(n.ok?"":"Test failed"),latencyMs:r?.latencyMs||0};ee(e=>({...e,[t.routeModel]:a}))}catch(e){ee(s=>({...s,[t.routeModel]:{ok:!1,error:e.message||"Test failed"}}))}finally{es("")}}},eI=async(e,t)=>{if(e?.id&&t?.routeModel&&window.confirm(`X\xf3a model ${t.routeModel} khỏi connection ${e.name||e.id}?`)){m(""),u(""),er(t.routeModel);try{let s=`/api/personal-cloud-providers/${encodeURIComponent(e.id)}/models/${t.routeModel.split("/").map(encodeURIComponent).join("/")}`,n=await fetch(s,{method:"DELETE"}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.error||"Kh\xf4ng x\xf3a được model");(e=>{if(!e?.connectionId&&!e?.id)return;let t=e.connectionId||e.id;N(s=>s.map(s=>s.id===t?{...s,importedModels:Array.isArray(e.importedModels)?e.importedModels:s.importedModels,availableModels:Array.isArray(e.models)?e.models:Array.isArray(e.availableModels)?e.availableModels:s.availableModels,modelImport:e.modelImport||s.modelImport}:s)),Q(s=>s?.id===t?{...s,importedModels:Array.isArray(e.importedModels)?e.importedModels:s.importedModels,availableModels:Array.isArray(e.models)?e.models:Array.isArray(e.availableModels)?e.availableModels:s.availableModels,modelImport:e.modelImport||s.modelImport}:s)})(r),ee(e=>{let s={...e};return delete s[t.routeModel],s}),u(`Đ\xe3 x\xf3a model ${t.routeModel}.`)}catch(e){m(e.message||"Kh\xf4ng x\xf3a được model")}finally{er("")}}},eM=(e,t)=>{ed(s=>{let n={...s[e]||{},...t};for(let e of Object.keys(n))(""===n[e]||void 0===n[e])&&delete n[e];return{...s,[e]:n}})},eS=async e=>{m(""),u(""),ec(e);try{let t=ei[e]||{},s={providerId:e,override:{fallbackStrategy:t.fallbackStrategy||"",stickyRoundRobinLimit:t.stickyRoundRobinLimit,stickyScope:t.stickyScope||"",stickyTtlMinutes:t.stickyTtlMinutes,stickyFallbackToClientIp:t.stickyFallbackToClientIp,stickyRebindOnFailure:t.stickyRebindOnFailure,stickyRebindFailureThreshold:t.stickyRebindFailureThreshold}},n=await fetch("/api/personal-cloud-providers/routing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.error||"Kh\xf4ng lưu được routing");el(r.routing||{}),u(`Đ\xe3 cập nhật routing cho ${e}.`)}catch(e){m(e.message||"Kh\xf4ng lưu được routing")}finally{ec("")}},eO=async e=>{m(""),u(""),ec(e);try{let t=await fetch(`/api/personal-cloud-providers/routing?providerId=${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s?.error||"Kh\xf4ng reset được routing");el(s.routing||{}),ed(t=>{let s={...t};return delete s[e],s}),u(`Đ\xe3 reset ${e} về ch\xednh s\xe1ch mặc định.`)}catch(e){m(e.message||"Kh\xf4ng reset được routing")}finally{ec("")}},e$=async()=>{let e=d(J);if(!e)return void m("Nhập username/email cần cấp quyền.");c(!0),m(""),u("");try{let t=await fetch("/api/personal-cloud-providers/permissions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,providers:Z})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||"Kh\xf4ng lưu được quyền OAuth");_(s.permissions||{}),H(s.connectionsByUser||{});let n=s.user?.id||e;n!==e&&X(n),u(`Đ\xe3 lưu quyền OAuth cho ${n}.`),await ep()}catch(e){m(e.message||"Kh\xf4ng lưu được quyền OAuth")}finally{c(!1)}},eT=async e=>{let t=d(e);if(t&&window.confirm(`Thu hồi to\xe0n bộ quyền OAuth provider của ${t}? OAuth account của user n\xe0y sẽ bị X\xd3A hẳn (token, model đ\xe3 import) v\xe0 model tương ứng sẽ bị gỡ khỏi mọi API key đ\xe3 g\xe1n. H\xe0nh động n\xe0y kh\xf4ng thể ho\xe0n t\xe1c.`)){c(!0),m(""),u("");try{let e=await fetch(`/api/personal-cloud-providers/permissions?userId=${encodeURIComponent(t)}`,{method:"DELETE"}),s=await e.json().catch(()=>({}));if(!e.ok)throw Error(s.error||"Kh\xf4ng thu hồi được quyền OAuth");_(s.permissions||{}),H(s.connectionsByUser||{}),d(J)===t&&X(""),u(`Đ\xe3 thu hồi quyền v\xe0 x\xf3a OAuth account của ${t}.`),await ep()}catch(e){m(e.message||"Kh\xf4ng thu hồi được quyền OAuth")}finally{c(!1)}}},eE=k?function(e={}){return{id:e.id,name:e.name||e.id,icon:e.icon||"cloud",color:e.color||"#64748b",website:e.website||"",notice:e.notice||null,deprecationNotice:e.deprecationNotice||"",serviceKinds:e.serviceKinds||["llm"]}}(k):null,eR=g?f:f.filter(e=>e.enabled),eK=o(S),eq=S?.modelImport||{},ez=o(W);return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Personal Cloud Providers"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Kết nối OAuth c\xe1 nh\xe2n cho Claude Code, OpenAI Codex v\xe0 Antigravity. Account c\xe1 nh\xe2n chỉ owner nh\xecn thấy, chỉ API key của owner được d\xf9ng. Cột RTK cho ph\xe9p override ri\xeang từng account (Lu\xf4n ON / Lu\xf4n OFF) bất kể cấu h\xecnh RTK global ở /dashboard/endpoint đang on hay off — để trống th\xec theo global."})]}),(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface px-4 py-3 text-sm",children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Current user"}),(0,n.jsx)("div",{className:"mt-1 break-all font-mono text-text-main",children:p||"—"})]})]})}),x?(0,n.jsx)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:x}):null,h?(0,n.jsx)("div",{className:"rounded-2xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:h}):null,(0,n.jsx)("div",{className:"grid gap-4 lg:grid-cols-3",children:0===f.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted lg:col-span-3",children:"Admin chưa cấp quyền personal OAuth provider n\xe0o cho user n\xe0y."}):f.map(e=>(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("span",{className:"inline-flex size-10 shrink-0 items-center justify-center rounded-xl",style:{backgroundColor:`${e.color||"#64748b"}22`},children:(0,n.jsx)(l.A,{src:`/providers/${e.id}.png`,alt:e.name,size:34,className:"max-h-[34px] max-w-[34px] rounded-lg object-contain",fallbackText:e.id.slice(0,2).toUpperCase(),fallbackColor:e.color||"#64748b"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"font-semibold text-text-main",children:e.name}),e.enabled?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Enabled"}):(0,n.jsx)(a.Ex,{variant:"warning",size:"sm",children:"Locked"})]}),(0,n.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e.enabled?"Được admin cấp quyền, c\xf3 thể add OAuth account c\xe1 nh\xe2n.":"Admin chưa cấp quyền cho user n\xe0y."})]})]}),e.deprecationNotice?(0,n.jsx)("p",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:e.deprecationNotice}):null,(0,n.jsxs)(a.$n,{fullWidth:!0,disabled:!e.enabled,onClick:()=>{e.enabled&&w(e)},icon:"add_link",children:["Add ",e.name," account"]})]},e.id))}),(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"My personal accounts"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"OAuth xong sẽ tự import model nếu provider hỗ trợ. Nếu kh\xf4ng gọi được endpoint model, hệ thống d\xf9ng catalog fallback để user vẫn chọn được model."})]}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:ep,loading:e,icon:"refresh",children:"Refresh"})]}),e?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải..."}):0===v.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Chưa c\xf3 personal OAuth account n\xe0o."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Connection"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Provider"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Account"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Models"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Created"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Active"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["RTK (Token Savings)",(0,n.jsxs)(a.Ex,{variant:eh?"success":"default",size:"sm",className:"normal-case",children:["Global: ",eh?"ON":"OFF"]}),(0,n.jsx)("button",{type:"button",onClick:()=>em(!0),title:"RTK l\xe0 g\xec? Bấm để xem giải th\xedch",className:"inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-border text-[10px] font-bold normal-case text-text-muted transition-colors hover:border-brand-500 hover:text-brand-600",children:"?"})]})}),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:v.map(e=>{let t=Array.isArray(e?.availableModels)?e.availableModels:[],s=e.modelImport||{};return(0,n.jsxs)("tr",{className:"align-top hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||e.id}),(0,n.jsx)("div",{className:"mt-1 font-mono text-xs text-text-muted",children:e.id})]}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.A,{src:`/providers/${e.provider}.png`,alt:e.provider,size:24,className:"max-h-[24px] max-w-[24px] rounded object-contain",fallbackText:e.provider.slice(0,2).toUpperCase()}),(0,n.jsx)("span",{children:i(e.provider,f)})]})}),(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"break-all text-text-main",children:function(e={}){let t=e.providerSpecificData&&"object"==typeof e.providerSpecificData?e.providerSpecificData:{};return e.email||t.email||t.preferredUsername||e.displayName||t.sub||t.accountId||t.claudeAccountId||t.chatgptAccountId||"—"}(e)}),(0,n.jsxs)("div",{className:"mt-1 break-all text-xs text-text-muted",children:["Owner: ",e.ownerUser||p||"—"]})]}),(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[function(e={}){return"provider"===(e.source||"catalog")?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Imported"}):(0,n.jsx)(a.Ex,{variant:"warning",size:"sm",children:"Catalog"})}(s),(0,n.jsxs)("span",{className:"text-xs text-text-muted",children:[t.length," model(s)"]})]}),s.warning?(0,n.jsx)("div",{className:"mt-1 max-w-[320px] truncate text-xs text-amber-600 dark:text-amber-300",title:s.warning,children:s.warning}):null,t.length>0?(0,n.jsxs)("div",{className:"mt-2 flex max-w-[360px] flex-wrap gap-1",children:[t.slice(0,4).map(e=>(0,n.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-0.5 font-mono text-[11px] text-text-muted",children:e.routeModel},e.routeModel)),t.length>4?(0,n.jsxs)("span",{className:"rounded-full border border-border bg-surface px-2 py-0.5 text-[11px] text-text-muted",children:["+",t.length-4]}):null]}):null]}),(0,n.jsx)("td",{className:"px-4 py-4 text-xs text-text-muted",children:function(e){if(!e)return"—";try{return new Intl.DateTimeFormat("vi-VN",{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}catch{return e}}(e.createdAt)}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsx)(a.lM,{checked:!1!==e.isActive,onChange:t=>ey(e.id,{isActive:t})})}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("select",{value:!0===e.rtkEnabled?"on":!1===e.rtkEnabled?"off":"inherit",onChange:t=>{let s=t.target.value;ey(e.id,{rtkEnabled:"inherit"===s?null:"on"===s})},className:"h-9 w-full min-w-[140px] rounded-xl border border-border bg-background px-2 text-xs text-text-main outline-none focus:border-brand-500",children:[(0,n.jsx)("option",{value:"inherit",children:"Theo global"}),(0,n.jsx)("option",{value:"on",children:"Lu\xf4n ON"}),(0,n.jsx)("option",{value:"off",children:"Lu\xf4n OFF"})]})}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",loading:I===e.id,onClick:()=>ev(e),children:"Import models"}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",disabled:0===o(e).length,onClick:()=>{m(""),u(""),Q(e),ee({}),es(""),er("")},children:"Manage models"}),(0,n.jsx)(a.$n,{variant:"secondary",size:"sm",disabled:0===o(e).length,onClick:()=>ek(e),children:"Add to API key"}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>{let t;return t=window.prompt("T\xean connection mới",e.name||""),void(t?.trim()&&ey(e.id,{name:t.trim()}))},children:"Rename"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",onClick:()=>A(e),children:"Delete"})]})})]},e.id)})})]})})]}),(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Routing strategy"}),(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["Khi bạn c\xf3 nhiều personal account cho c\xf9ng provider, đ\xe2y l\xe0 ch\xednh s\xe1ch chọn account cho từng request. Để trống = kế thừa ch\xednh s\xe1ch của admin ở ",(0,n.jsx)("span",{className:"font-mono",children:"/dashboard/providers/<provider>"}),"."]})]}),(0,n.jsx)("div",{className:"grid gap-4 lg:grid-cols-3",children:0===eR.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted lg:col-span-3",children:"Bạn chưa được cấp quyền provider n\xe0o, n\xean chưa cần thiết lập routing."}):eR.map(e=>{let t=ei[e.id]||{},s=ea[e.id]||null,r=!s,l=t.fallbackStrategy||"",i="round-robin"===l,d=eo===e.id;return(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:e.name}),(0,n.jsx)("div",{className:"text-xs text-text-muted",children:r?"Đang kế thừa policy global":`Override active: ${s.fallbackStrategy||"inherit"}`})]}),r?(0,n.jsx)(a.Ex,{variant:"default",size:"sm",children:"Inherit"}):(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"Override"})]}),(0,n.jsxs)("label",{className:"block text-sm",children:[(0,n.jsx)("span",{className:"mb-1 block font-medium text-text-main",children:"Strategy"}),(0,n.jsxs)("select",{value:l,onChange:t=>eM(e.id,{fallbackStrategy:t.target.value}),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none focus:border-brand-500",disabled:d,children:[(0,n.jsx)("option",{value:"",children:"Inherit (use global)"}),(0,n.jsx)("option",{value:"fill-first",children:"fill-first — chạy hết account 1 mới sang account 2"}),(0,n.jsx)("option",{value:"round-robin",children:"round-robin — lu\xe2n phi\xean theo sticky limit"}),(0,n.jsx)("option",{value:"least-latency",children:"least-latency — chọn account nhanh nhất"}),(0,n.jsx)("option",{value:"p2c",children:"p2c — power-of-two-choices"})]})]}),i?(0,n.jsxs)("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/50 p-3",children:[(0,n.jsx)("div",{className:"text-xs text-text-muted",children:"Round-robin sticky params (để trống = d\xf9ng gi\xe1 trị global)"}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky limit (số request li\xean tiếp trước khi rotate)"}),(0,n.jsx)(a.pd,{type:"number",min:1,value:t.stickyRoundRobinLimit??"",onChange:t=>eM(e.id,{stickyRoundRobinLimit:t.target.value?Number(t.target.value):void 0}),placeholder:"v\xed dụ 3",disabled:d})]}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky scope"}),(0,n.jsxs)("select",{value:t.stickyScope||"",onChange:t=>eM(e.id,{stickyScope:t.target.value}),className:"h-9 w-full rounded-xl border border-border bg-background px-3 text-xs text-text-main outline-none focus:border-brand-500",disabled:d,children:[(0,n.jsx)("option",{value:"",children:"(inherit)"}),(0,n.jsx)("option",{value:"global",children:"global — rotate cho mọi request"}),(0,n.jsx)("option",{value:"client_ip",children:"client_ip — sticky theo IP"}),(0,n.jsx)("option",{value:"client_session",children:"client_session — sticky theo CLI session"})]})]}),(0,n.jsxs)("label",{className:"block text-xs",children:[(0,n.jsx)("span",{className:"mb-1 block text-text-muted",children:"Sticky TTL (ph\xfat)"}),(0,n.jsx)(a.pd,{type:"number",min:1,value:t.stickyTtlMinutes??"",onChange:t=>eM(e.id,{stickyTtlMinutes:t.target.value?Number(t.target.value):void 0}),placeholder:"v\xed dụ 120",disabled:d})]})]}):null,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:[(0,n.jsx)(a.$n,{size:"sm",loading:d,onClick:()=>eS(e.id),children:"Save"}),(0,n.jsx)(a.$n,{size:"sm",variant:"ghost",disabled:d||r,onClick:()=>eO(e.id),children:"Reset to inherit"})]})]},e.id)})})]}),g?(0,n.jsxs)(a.Zp,{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Admin: OAuth provider access"}),(0,n.jsx)("p",{className:"text-sm text-text-muted",children:"Default l\xe0 kh\xf4ng c\xf3 quyền. Nhập username/email rồi bật provider được ph\xe9p add personal account."})]}),(0,n.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_auto] md:items-end",children:[(0,n.jsx)(a.pd,{label:"User ID / Email",value:J,onChange:e=>X(e.target.value),placeholder:"anh-tct hoặc anh-tct@fujinet.net"}),(0,n.jsx)(a.$n,{onClick:e$,loading:s,icon:"save",children:"Save permissions"})]}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-3",children:f.map(e=>(0,n.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,n.jsx)(a.lM,{checked:!0===Z[e.id],onChange:t=>V(s=>({...s,[e.id]:t})),label:e.name,description:Z[e.id]?"User được ph\xe9p add account":"User chưa được cấp quyền"})},e.id))}),(0,n.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,n.jsxs)("div",{className:"mb-3 flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-text-main",children:"Granted OAuth Access"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Danh s\xe1ch user hiện đang được cấp quyền add personal OAuth account."})]}),(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:eb,loading:B,icon:"refresh",children:"Refresh list"})]}),B?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải quyền..."}):0===ej.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 user n\xe0o được cấp quyền OAuth provider."}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),f.map(e=>(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:e.name},e.id)),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ej.map(e=>(0,n.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,n.jsxs)("td",{className:"px-4 py-4",children:[(0,n.jsx)("div",{className:"break-all font-mono text-text-main",children:e.userId}),d(J)===e.userId?(0,n.jsx)("div",{className:"mt-1 text-xs text-brand-600 dark:text-brand-300",children:"Đang edit ở form ph\xeda tr\xean"}):null]}),f.map(t=>{let s=!0===e.providerState[t.id],r=e.connectionsByProvider?.[t.id]||0,i=r>0;return(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[s?(0,n.jsx)(a.Ex,{variant:"success",size:"sm",children:"ON"}):(0,n.jsx)(a.Ex,{variant:"default",size:"sm",children:"OFF"}),i?(0,n.jsxs)("span",{className:"inline-flex items-center gap-0.5",title:`User đ\xe3 add ${r} ${t.name} account${r>1?"s":""}`,children:[(0,n.jsx)(l.A,{src:`/providers/${t.id}.png`,alt:t.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:t.id.slice(0,2).toUpperCase(),fallbackColor:t.color||"#64748b"}),r>1?(0,n.jsxs)("span",{className:"text-[10px] font-semibold text-text-muted",children:["\xd7",r]}):null]}):null]})},t.id)}),(0,n.jsx)("td",{className:"px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>(e=>{let t=d(e);X(t);let s=D[t]||{},n={};for(let e of f)n[e.id]=!0===s[e.id];V(n)})(e.userId),children:"Edit"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",loading:s,onClick:()=>eT(e.userId),children:"Revoke"})]})})]},e.userId))})]})})]})]}):null,S?(0,n.jsx)(a.aF,{isOpen:!!S,onClose:()=>O(null),title:"Add models to API key",size:"full",footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.$n,{variant:"ghost",onClick:()=>O(null),disabled:P,children:"Cancel"}),(0,n.jsx)(a.$n,{onClick:ew,loading:P,disabled:!K||0===z.length,children:"Add selected models"})]}),children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 text-sm",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:S.name||S.id}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:[i(S.provider,f)," \xb7 ",eK.length," imported model(s)"]}),eq.warning?(0,n.jsx)("div",{className:"mt-2 text-xs text-amber-600 dark:text-amber-300",children:eq.warning}):null,0===eK.length?(0,n.jsx)("div",{className:"mt-2 rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:'Chưa import được model n\xe0o từ provider. Bấm "Import models" tr\xean d\xf2ng connection trước khi g\xe1n v\xe0o API key.'}):null]}),(0,n.jsxs)("label",{className:"block text-sm",children:[(0,n.jsx)("span",{className:"mb-1 block font-medium text-text-main",children:"API key"}),(0,n.jsxs)("select",{value:K,onChange:e=>q(e.target.value),className:"h-10 w-full rounded-xl border border-border bg-background px-3 text-sm text-text-main outline-none focus:border-brand-500",disabled:E,children:[(0,n.jsx)("option",{value:"",children:E?"Đang tải API keys...":"Chọn API key"}),eg.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name," \xb7 ",e.ownerUser||p]},e.id))]})]}),0!==eg.length||E?null:(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-300",children:"User n\xe0y chưa c\xf3 API key active để th\xeam model."}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-semibold text-text-main",children:"Models"}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Model được lưu v\xe0o allowedModels của API key. Request sẽ route qua personal OAuth account của owner."})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",onClick:()=>U(eK.map(e=>e.routeModel).filter(Boolean)),children:"Select all"}),(0,n.jsx)(a.$n,{variant:"ghost",size:"sm",onClick:()=>U([]),children:"Clear"})]})]}),(0,n.jsx)("div",{className:"grid gap-2 md:grid-cols-2",children:eK.map(e=>(0,n.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border border-border bg-background p-3 hover:bg-surface",children:[(0,n.jsx)("input",{type:"checkbox",className:"mt-1",checked:z.includes(e.routeModel),onChange:()=>{var t;return t=e.routeModel,void U(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block font-medium text-text-main",children:e.name||e.id}),(0,n.jsx)("span",{className:"mt-1 block break-all font-mono text-xs text-text-muted",children:e.routeModel}),e.type&&"llm"!==e.type?(0,n.jsx)("span",{className:"mt-2 inline-flex rounded-full bg-surface px-2 py-0.5 text-[11px] text-text-muted",children:e.type}):null]})]},e.routeModel))})]})}):null,W?(0,n.jsx)(a.aF,{isOpen:!!W,onClose:()=>Q(null),title:"Manage imported models",size:"full",footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.$n,{variant:"ghost",onClick:()=>Q(null),children:"Close"}),(0,n.jsx)(a.$n,{variant:"outline",loading:I===W.id,onClick:()=>ev(W),icon:"refresh",children:"Re-import from provider"})]}),children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4 text-sm",children:[(0,n.jsx)("div",{className:"font-semibold text-text-main",children:W.name||W.id}),(0,n.jsxs)("div",{className:"mt-1 text-text-muted",children:[i(W.provider,f)," \xb7 ",ez.length," imported model(s)"]}),(0,n.jsx)("div",{className:"mt-2 text-xs text-text-muted",children:'Test gửi 1 prompt "Say hello in five words" qua ch\xednh OAuth account của bạn, qua đ\xfang proxy của connection. X\xf3a model sẽ bỏ n\xf3 khỏi list importable; c\xe1c API key đ\xe3 gắn model n\xe0y kh\xf4ng bị thay đổi (request đến model đ\xf3 sẽ do provider ph\xeda tr\xean quyết định chấp nhận hay kh\xf4ng).'})]}),0===ez.length?(0,n.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:'Chưa c\xf3 model n\xe0o được import. Bấm "Re-import from provider".'}):(0,n.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Model"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Route ID"}),(0,n.jsx)("th",{className:"px-4 py-3 font-medium",children:"Test result"}),(0,n.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ez.map(e=>{let t=Y[e.routeModel],s=et===e.routeModel,r=en===e.routeModel;return(0,n.jsxs)("tr",{className:"align-top",children:[(0,n.jsxs)("td",{className:"px-4 py-3",children:[(0,n.jsx)("div",{className:"font-medium text-text-main",children:e.name||e.id}),e.type&&"llm"!==e.type?(0,n.jsx)("div",{className:"mt-1 text-xs text-text-muted",children:e.type}):null]}),(0,n.jsx)("td",{className:"px-4 py-3 font-mono text-xs text-text-muted break-all",children:e.routeModel}),(0,n.jsx)("td",{className:"px-4 py-3 text-xs",children:s?(0,n.jsx)("span",{className:"text-text-muted",children:"Đang test..."}):t?t.ok?(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("div",{className:"text-green-700 dark:text-green-300",children:["OK \xb7 ",t.latencyMs||0,"ms"]}),(0,n.jsx)("div",{className:"break-all text-text-muted",children:(t.text||"").slice(0,200)})]}):(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("div",{className:"text-red-700 dark:text-red-300",children:["FAIL \xb7 status ",t.status||"?"]}),(0,n.jsx)("div",{className:"break-all text-text-muted",children:(t.error||"").slice(0,200)})]}):(0,n.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,n.jsx)("td",{className:"px-4 py-3",children:(0,n.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,n.jsx)(a.$n,{variant:"outline",size:"sm",loading:s,disabled:r,onClick:()=>eA(W,e),children:"Say hello"}),(0,n.jsx)(a.$n,{variant:"danger",size:"sm",loading:r,disabled:s,onClick:()=>eI(W,e),children:"Delete"})]})})]},e.routeModel)})})]})})]})}):null,ex?(0,n.jsx)(a.aF,{isOpen:ex,onClose:()=>em(!1),title:"RTK (Token Savings) l\xe0 g\xec?",size:"xl",footer:(0,n.jsx)(a.$n,{onClick:()=>em(!1),children:"Đ\xe3 hiểu"}),children:(0,n.jsxs)("div",{className:"space-y-5 text-sm text-text-main",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-surface px-3 py-2",children:[(0,n.jsx)("span",{className:"text-xs text-text-muted",children:"Global RTK hiện đang:"}),(0,n.jsx)(a.Ex,{variant:eh?"success":"default",size:"sm",children:eh?"ON":"OFF"}),(0,n.jsx)("span",{className:"text-xs text-text-muted",children:'— \xe1p dụng cho mọi account chọn "Theo global"'})]}),(0,n.jsx)("p",{className:"text-text-muted",children:"RTK l\xe0 bộ lọc n\xe9n output của tool (Bash, Grep, Glob, Read...) ngay trong request trước khi gửi l\xean model, gi\xfap giảm số token phải gửi m\xe0 kh\xf4ng l\xe0m mất th\xf4ng tin quan trọng — chỉ t\xe1c động tới phần tool output, kh\xf4ng đụng v\xe0o nội dung chat."}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Hoạt động ra sao với CLI tool"}),(0,n.jsx)("p",{className:"text-text-muted",children:"Mỗi khi Claude Code / Codex CLI / OpenCode... gọi tool v\xe0 nhận lại output, RTK tự nhận diện định dạng quen thuộc rồi r\xfat gọn theo đ\xfang cấu tr\xfac của n\xf3:"}),(0,n.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-text-muted",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git diff"})," — giữ v\xe0i d\xf2ng context quanh thay đổi, cắt phần hunk qu\xe1 d\xe0i"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git status"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"git log"})," — gom gọn danh s\xe1ch file thay đổi, danh s\xe1ch commit"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"grep"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"find"})," — giới hạn số match hiển thị mỗi file/thư mục"]}),(0,n.jsxs)("li",{children:[(0,n.jsx)("span",{className:"font-mono text-text-main",children:"ls -la"})," / ",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"tree"})," — t\xf3m tắt theo loại file, cắt c\xe2y thư mục qu\xe1 s\xe2u"]}),(0,n.jsx)("li",{children:"Build log (npm/yarn/cargo...) — chỉ giữ d\xf2ng quan trọng (lỗi, kết quả build)"}),(0,n.jsx)("li",{children:"Output d\xe0i chung kh\xf4ng r\xf5 định dạng — fallback dedup d\xf2ng lặp hoặc smart-truncate (giữ đầu + cuối)"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Hiệu quả thực tế"}),(0,n.jsx)("div",{className:"overflow-x-auto rounded-xl border border-border",children:(0,n.jsxs)("table",{className:"min-w-full text-xs",children:[(0,n.jsx)("thead",{className:"bg-surface/80 text-left uppercase tracking-wide text-text-muted",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Loại output"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Trước"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Sau"}),(0,n.jsx)("th",{className:"px-3 py-2 font-medium",children:"Tiết kiệm"})]})}),(0,n.jsxs)("tbody",{className:"divide-y divide-border",children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"git diff"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"7384B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"3894B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"47.3%"})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"grep -n"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"3723B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"1447B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"61.1%"})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"px-3 py-2 font-mono",children:"find"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"729B"}),(0,n.jsx)("td",{className:"px-3 py-2",children:"264B"}),(0,n.jsx)("td",{className:"px-3 py-2 text-green-600 dark:text-green-400",children:"63.8%"})]})]})]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Khi n\xe0o KH\xd4NG bị n\xe9n"}),(0,n.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-text-muted",children:[(0,n.jsx)("li",{children:"Chat thường kh\xf4ng gọi tool — kh\xf4ng c\xf3 g\xec để n\xe9n"}),(0,n.jsx)("li",{children:"Output nhỏ hơn 500B — kh\xf4ng đ\xe1ng n\xe9n"}),(0,n.jsxs)("li",{children:["Output b\xe1o lỗi (",(0,n.jsx)("span",{className:"font-mono text-text-main",children:"is_error"}),") — lu\xf4n giữ nguy\xean để debug"]}),(0,n.jsx)("li",{children:"Output lớn hơn 10MB — bỏ qua để tr\xe1nh tốn CPU xử l\xfd"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"mb-2 font-semibold text-text-main",children:"Global vs từng account"}),(0,n.jsxs)("p",{className:"text-text-muted",children:["Dropdown RTK ở bảng tr\xean cho ph\xe9p override ri\xeang từng account:",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Theo global"})," (mặc định, d\xf9ng đ\xfang setting global),",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Lu\xf4n ON"})," hoặc",(0,n.jsx)("span",{className:"font-semibold text-text-main",children:" Lu\xf4n OFF"})," — override lu\xf4n thắng global theo cả 2 chiều, n\xean c\xf3 thể để global OFF v\xe0 chỉ bật cho account d\xf9ng CLI tool, hoặc ngược lại."]})]})]})}):null,eE?(0,n.jsx)(a.LF,{isOpen:!!k,provider:k.id,providerInfo:eE,connectionScope:"personal",onSuccess:ef,onClose:()=>w(null)}):null,C?(0,n.jsx)(a.uo,{isOpen:!!C,onClose:()=>A(null),onConfirm:eC,title:"Delete personal account",message:`X\xf3a connection ${C.name||C.id}?`,confirmText:"Delete",cancelText:"Cancel",variant:"danger"}):null]})}},47584:(e,t,s)=>{Promise.resolve().then(s.bind(s,43503))}},e=>{e.O(0,[2574,3862,246,4546,5564,5263,5497,8441,3794,7358],()=>e(e.s=47584)),_N_E=e.O()}]);
|
|
File without changes
|
/package/app/.next-cli-build/static/{z8AnhbUkQv0TB7DWTtIND → 9fQAUz2AF8lTDmzwLM3mn}/_ssgManifest.js
RENAMED
|
File without changes
|
|
File without changes
|