@jheavenknows/bluerouter 5.2.30 → 5.2.32
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 +18 -18
- package/app/.next-cli-build/build-manifest.json +2 -2
- 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/cluster/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/local-ai-report/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_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/resource-monitor/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/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.nft.json +1 -1
- 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/copilot-settings/route.js.nft.json +1 -1
- 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/cluster/config/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/heartbeat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/peers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/snapshot/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cluster/test/route.js.nft.json +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/ai-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/analytics/analyze/route.js.nft.json +1 -1
- 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/local-ai-report/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]/caveman-test/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.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/catalog/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/catalog/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/resource-monitor/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/analyze/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/resource-monitor/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.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.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.nft.json +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.nft.json +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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +1 -1
- 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 +6 -6
- 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/cluster.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cluster.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cluster.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cluster.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/local-ai-report.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/!KGRhc2hib2FyZCk/dashboard/local-ai-report/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/!KGRhc2hib2FyZCk/dashboard/local-ai-report.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/local-ai-report.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- 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 +7 -7
- 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/resource-monitor.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_tree.segment.rsc +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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +7 -7
- 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/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 +18 -18
- package/app/.next-cli-build/server/chunks/1340.js +1 -1
- package/app/.next-cli-build/server/chunks/2650.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/4404.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/6108.js +1 -1
- package/app/.next-cli-build/server/chunks/6328.js +1 -1
- package/app/.next-cli-build/server/chunks/6759.js +1 -1
- package/app/.next-cli-build/server/chunks/6811.js +1 -1
- package/app/.next-cli-build/server/chunks/689.js +1 -1
- package/app/.next-cli-build/server/chunks/6936.js +1 -1
- package/app/.next-cli-build/server/chunks/7016.js +1 -1
- package/app/.next-cli-build/server/chunks/7341.js +1 -1
- package/app/.next-cli-build/server/chunks/7464.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.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/static/chunks/{4525-2a06c28627ca4fa9.js → 4525-1bb06a1fc87cd507.js} +6 -6
- package/app/.next-cli-build/static/chunks/{5263-0de8f5d0c9d73bae.js → 5263-2b0a1031f391030f.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-6a03b79691097f3c.js → 5497-ed106851c7a9289d.js} +1 -1
- package/app/.next-cli-build/static/chunks/5564-a5fefe0b88cd5724.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-5e51dfdfdc7eca07.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/app/src/mitm/server.js +1 -1
- package/package.json +1 -1
- package/src/cli/menus/providers.js +4 -0
- package/app/.next-cli-build/static/chunks/5564-d23eb555fbd06dda.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-6c83bcac76e31968.js +0 -1
- /package/app/.next-cli-build/static/{Mz3kUglmPQGIt583Sd6NW → wojLan0AF5JjXAI5Z90mh}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{Mz3kUglmPQGIt583Sd6NW → wojLan0AF5JjXAI5Z90mh}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.2.16-to-5.2.23-5.2.23-20260724-092014 → upgrade-5.2.29-to-5.2.30-5.2.30-20260724-103243}/data.sqlite +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.2.23-to-5.2.24-5.2.24-20260724-093205 → upgrade-5.2.30-to-5.2.31-5.2.31-20260724-115227}/data.sqlite +0 -0
|
@@ -7,7 +7,7 @@ exports.id=1340,exports.ids=[1340],exports.modules={267:(a,b,c)=>{"use strict";c
|
|
|
7
7
|
`,title:a.internalName&&a.internalName!==b?`Internal: ${a.internalName}`:b,children:[e&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),(0,d.jsx)("span",{children:c})]},`${a.pickerSource||"combo"}-${a.id||b}`)})})]}),Object.entries(K).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 z-10 bg-white py-1 dark:bg-zinc-950",children:[(0,d.jsx)(h.A,{src:(0,j.mq)(a)||(0,j.gb)(a)?null:`/providers/${a}.png`,alt:b.name,size:14,fallbackText:(b.name||a).slice(0,2).toUpperCase(),fallbackColor:b.color}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=g===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>L(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|
|
8
8
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
9
9
|
${c?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":b?"bg-primary text-white border-primary":r.includes(a.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
10
|
-
`,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[r.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name]})},a.value)})})]},a)),0===Object.keys(K).length&&0===J.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})]})}):null}m.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,onDeselect:g().func,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object,kindFilter:g().string,addedModelValues:g().arrayOf(g().string),closeOnSelect:g().bool,personalOnly:g().bool,extraModels:g().arrayOf(g().string)}},83552:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,type:b="text",placeholder:c,value:g,onChange:h,error:i,hint:j,icon:k,disabled:l=!1,required:m=!1,className:n,inputClassName:o,...p}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",n),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,m&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[k&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:k})}),(0,d.jsx)("input",{type:b,placeholder:c,value:g,onChange:h,disabled:l,className:(0,e.cn)("w-full py-2.5 px-3 text-sm text-text-main bg-surface-2 rounded-[10px]","border border-transparent placeholder-text-muted/70","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",k&&"pl-10",i&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",o),...p})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Select.js","default")},86209:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onMethodSelect:b,onClose:c}){let[f,g]=(0,e.useState)(null),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)("us-east-1"),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),x=a=>{g(a),q(null)},y=()=>{g(null),q(null)},z=async()=>{if(!n.trim())return void q("Please enter a refresh token");s(!0),q(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Import failed");b("import")}catch(a){q(a.message)}finally{s(!1)}},A=a=>{b("social",{provider:a})};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Kiro",onClose:c,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!f&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,d.jsx)(h.pd,{value:l,onChange:a=>m(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),p&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{j.trim()?b("idc",{startUrl:j.trim(),region:l}):q("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[t&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!t&&(0,d.jsxs)(d.Fragment,{children:[v&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!p&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:n,onChange:a=>o(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),p&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,disabled:r||!n.trim(),children:r?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onMethodSelect:g().func.isRequired,onClose:g().func.isRequired}},86739:(a,b,c)=>{"use strict";c.d(b,{default:()=>r});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(49885),j=c.n(i),k=c(3236),l=c(53845),m=c(20151),n=c(37365),o=c(12020),p=c(96919),q=c(99258);function r({onMenuClick:a,showMenuButton:b=!0}){let c=(0,f.usePathname)(),g=(0,f.useRouter)(),{displayName:i,loginMethod:j}=(0,m.s)(),{title:n,description:t,icon:u,breadcrumbs:v}=(0,e.useMemo)(()=>(a=>{if(!a)return{title:"",description:"",breadcrumbs:[]};let b=a.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(b){let a=b[1],c=b[2],d=p.rj.find(b=>b.id===a),e=p.Q2[c];return{title:e?.name||c,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${a}`},{label:d?.label||a,href:`/dashboard/media-providers/${a}`},{label:e?.name||c,image:`/providers/${c}.png`}]}}let c=a.match(/\/media-providers\/([^/]+)$/);if(c){let a=c[1],b=p.rj.find(b=>b.id===a);return{title:b?.label||a,description:`Manage your ${b?.label||a} providers`,icon:b?.icon||"perm_media",breadcrumbs:[]}}let d=a.match(/\/providers\/([^/]+)$/);if(d){let a=d[1],b=o.zN[a]||o.fg[a];if(b)return{title:b.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:b.name,image:`/providers/${b.id}.png`}]}}return a.includes("/providers")&&!a.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:a.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:a.includes("/token-saver")?{title:"Token Saver Analytics",description:"Theo d\xf5i hiệu quả RTK token saving theo source tool, provider, model v\xe0 filter",icon:"compress",breadcrumbs:[]}:a.includes("/analytics")?{title:"Analytics",description:"Thống k\xea request, token, API key, Source IP, provider, model v\xe0 lỗi vận h\xe0nh",icon:"monitoring",breadcrumbs:[]}:a.includes("/resource-monitor")?{title:"Linux Resources",description:"Realtime resource monitoring for remote Linux servers",icon:"monitor_heart",breadcrumbs:[]}:a.includes("/cluster")?{title:"Cluster Nodes",description:"Synchronize Master backups to Standby BlueRouter nodes",icon:"hub",breadcrumbs:[]}:a.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:a.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:a.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:a.includes("/mitm")?{title:"AI Traffic Proxy",description:"Intercept CLI tool traffic and route through this router gateway",icon:"security",breadcrumbs:[]}:a.includes("/prompt-logs")?{title:"Prompt Logs",description:"Search Copilot/MITM prompts across the prompt log database",icon:"manage_search",breadcrumbs:[]}:a.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:a.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:a.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use this Router — no install needed",icon:"extension",breadcrumbs:[]}:a.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:a.includes("/api-keys")?{title:"API Keys",description:"Manage API keys and model access",icon:"vpn_key",breadcrumbs:[]}:a.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:a.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:a.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===a?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(c),[c]),w=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(g.push("/login"),g.refresh())}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur",children:(0,d.jsxs)("div",{className:"flex min-h-[72px] items-center justify-between gap-4 px-4 md:px-6",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[b?(0,d.jsx)("button",{type:"button",onClick:a,className:"rounded-xl border border-border p-2 text-text-muted hover:bg-surface hover:text-text-main lg:hidden","aria-label":"Open menu",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})}):null,(0,d.jsx)("div",{className:"min-w-0",children:v.length>0?(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-sm text-text-muted",children:v.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[b>0?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"}):null,a.href?(0,d.jsx)(h(),{href:a.href,className:"hover:text-primary",children:(0,q.Tl)(a.label)}):(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.image?(0,d.jsx)("img",{src:a.image,alt:"",className:"h-5 w-5 rounded"}):null,(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:(0,q.Tl)(a.label)})]})]},`${a.label}-${b}`))}):n?(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[u?(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:u}):null,(0,d.jsx)("h1",{className:"truncate text-xl font-semibold text-text-main",children:(0,q.Tl)(n)})]}),t?(0,d.jsx)("p",{className:"mt-1 truncate text-sm text-text-muted",children:(0,q.Tl)(t)}):null]}):null})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,d.jsx)(s,{}),i&&"OIDC"===j?(0,d.jsxs)("div",{className:"hidden items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-text-muted md:flex",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"person"}),(0,d.jsx)("span",{children:i}),(0,d.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:"OIDC"})]}):null,(0,d.jsx)(l.default,{}),(0,d.jsx)(k.default,{onLogout:w})]})]})})}function s(){let a=(0,n.C)(a=>a.visible),b=(0,n.C)(a=>a.query),c=(0,n.C)(a=>a.placeholder),e=(0,n.C)(a=>a.setQuery);return a?(0,d.jsxs)("div",{className:"relative hidden w-72 md:block",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[18px] text-text-muted",children:"search"}),(0,d.jsx)("input",{value:b,onChange:a=>e(a.target.value),placeholder:c,className:"h-9 w-full rounded-lg border border-border bg-surface/60 pl-8 pr-8 text-sm text-text-main outline-none transition-colors placeholder:text-text-muted focus:border-primary/50"}),b?(0,d.jsx)("button",{type:"button",onClick:()=>e(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:text-text-main","aria-label":"Clear search",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})}):null]}):null}r.propTypes={onMenuClick:j().func,showMenuButton:j().bool}},87226:(a,b,c)=>{"use strict";c.d(b,{default:()=>ao});var d=c(48249),e=c(67484),f=c(19099),g=c(96919),h=c(75171),i=c(17660),j=c(2116),k=c.n(j),l=c(49885),m=c.n(l),n=c(20151);let o=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},p=a=>new Intl.NumberFormat().format(o(a)),q=a=>`$${o(a).toFixed(2)}`,r=(a,b)=>{let c=o(b);return c<=0?0:Math.round(o(a)/c*100)};function s({label:a,dotClass:b,requests:c,promptTokens:e,completionTokens:f,cost:g,showCost:h}){return(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${b}`}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:a})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(o(e)+o(f)),h&&(0,d.jsx)("span",{className:"ml-1.5 text-warning",children:q(g)}),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[p(c)," req"]})]})]})}s.propTypes={label:m().string.isRequired,dotClass:m().string.isRequired,requests:m().number,promptTokens:m().number,completionTokens:m().number,cost:m().number,showCost:m().bool};let t=[{name:"Anthropic (Claude)",dot:"bg-warning",mode:"Thủ c\xf4ng",modeNote:"phải đ\xe1nh dấu cache_control trong request",write:"1,25x gi\xe1 input",read:"0,1x gi\xe1 input",ttl:"5 ph\xfat, gia hạn mỗi lần đọc (tuỳ chọn 1 giờ)",fields:"cache_creation_input_tokens + cache_read_input_tokens",note:"Provider duy nhất t\xednh ph\xed ri\xeang cho việc ghi cache, n\xean l\xe0 nguồn duy nhất của \xf4 “Cache creation” ở tr\xean."},{name:"OpenAI",dot:"bg-success",mode:"Tự động",modeNote:"prompt từ 1024 token trở l\xean, khớp phần đầu",write:"Miễn ph\xed",read:"khoảng 0,5x gi\xe1 input",ttl:"5–10 ph\xfat kh\xf4ng hoạt động",fields:"prompt_tokens_details.cached_tokens",note:"Kh\xf4ng c\xf3 kh\xe1i niệm “cache creation”. prompt_tokens đ\xe3 bao gồm phần cached."},{name:"Google Gemini",dot:"bg-primary",mode:"Hai chế độ",modeNote:"implicit tự động, explicit do người d\xf9ng tạo",write:"Miễn ph\xed (implicit) / ph\xed lưu trữ theo giờ (explicit)",read:"giảm gi\xe1 đ\xe1ng kể so với input",ttl:"Implicit ngắn hạn; explicit theo TTL tự đặt",fields:"cachedContentTokenCount",note:"Explicit caching t\xednh tiền theo thời gian lưu, kh\xe1c hẳn m\xf4 h\xecnh của Anthropic v\xe0 OpenAI."},{name:"Local (vLLM, llama.cpp, Ollama)",dot:"bg-text-muted",mode:"Tự động",modeNote:"prefix caching / KV cache reuse",write:"Miễn ph\xed",read:"Miễn ph\xed — chỉ tiết kiệm compute v\xe0 giảm TTFT",ttl:"Tuỳ cấu h\xecnh v\xe0 dung lượng KV cache",fields:"Thường kh\xf4ng t\xe1ch ri\xeang trong usage",note:"Tiết kiệm thời gian chứ kh\xf4ng tiết kiệm tiền, v\xe0 phần lớn gộp v\xe0o “New input” ở tr\xean."}];function u(){let[a,b]=(0,e.useState)(!1);return(0,d.jsxs)(i.default,{className:"min-w-0 px-4 py-3",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>b(a=>!a),className:"flex w-full min-w-0 items-center justify-between gap-2 text-left",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"help"}),(0,d.jsx)("span",{className:"truncate text-sm font-semibold uppercase text-text-muted",children:"Cache read / creation hoạt động thế n\xe0o"})]}),(0,d.jsx)("span",{className:`material-symbols-outlined shrink-0 text-[20px] text-text-muted transition-transform duration-200 ${a?"rotate-180":""}`,children:"expand_more"})]}),a&&(0,d.jsxs)("div",{className:"mt-3 flex min-w-0 flex-col gap-3 border-t border-border-subtle pt-3",children:[(0,d.jsxs)("p",{className:"text-xs leading-relaxed text-text-muted",children:[(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache creation"})," l\xe0 lần đầu một đoạn context được lưu lại. ",(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache read"})," l\xe0 những lần sau t\xe1i sử dụng đoạn đ\xf3 thay v\xec xử l\xfd lại. Cơ chế v\xe0 c\xe1ch t\xednh tiền kh\xe1c nhau tuỳ provider — gi\xe1 dưới đ\xe2y l\xe0 bội số so với gi\xe1 input thường của ch\xednh model đ\xf3."]}),(0,d.jsx)("div",{className:"grid min-w-0 grid-cols-1 gap-2 xl:grid-cols-2",children:t.map(a=>(0,d.jsxs)("div",{className:"min-w-0 rounded-[10px] bg-bg px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${a.dot}`}),(0,d.jsx)("span",{className:"truncate text-xs font-semibold",children:a.name})]}),(0,d.jsx)("span",{className:"shrink-0 rounded-full bg-surface px-2 py-0.5 text-[10px] text-text-muted",children:a.mode})]}),(0,d.jsxs)("dl",{className:"mt-2 flex min-w-0 flex-col gap-1 text-[11px]",children:[(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Ghi cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium",children:a.write})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Đọc cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium text-success",children:a.read})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Thời hạn"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.ttl})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"K\xedch hoạt"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.modeNote})]})]}),(0,d.jsx)("p",{className:"mt-1.5 border-t border-border-subtle pt-1.5 text-[10px] leading-relaxed text-text-muted",children:a.note}),(0,d.jsx)("p",{className:"mt-1 font-mono text-[9px] leading-relaxed text-text-muted opacity-70",children:a.fields})]},a.name))}),(0,d.jsx)("p",{className:"text-[10px] leading-relaxed text-text-muted",children:"Gi\xe1 v\xe0 thời hạn do provider c\xf4ng bố v\xe0 c\xf3 thể thay đổi — h\xe3y đối chiếu bảng gi\xe1 ch\xednh thức trước khi d\xf9ng cho mục đ\xedch t\xednh chi ph\xed."})]})]})}function v({stats:a}){let{isAdmin:b}=(0,n.s)(),c=o(a.totalPromptTokens),e=o(a.totalCachedInputTokens),f=o(a.totalCacheCreationInputTokens),g=null!=a.totalNewInputTokens?o(a.totalNewInputTokens):Math.max(0,c-e-f),h=a.cloudVsLocal||{},j=h.cloud||{},l=h.local||{},m=o(j.requests)>0||o(l.requests)>0,t=o(j.promptTokens)+o(j.completionTokens),w=r(t,t+(o(l.promptTokens)+o(l.completionTokens)));return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:gap-4",children:[(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 sm:gap-4",children:[(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold",children:p(a.totalRequests)})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:p(c)}),c>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[r(e,c),"% cached"]})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:p(a.totalCompletionTokens)})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[b?(0,d.jsxs)(k(),{href:"/dashboard/settings/pricing",className:"group flex min-w-0 items-center gap-1 text-text-muted text-sm uppercase font-semibold transition-colors hover:text-primary",title:"Chỉnh bảng gi\xe1 d\xf9ng để t\xednh cost",children:[(0,d.jsx)("span",{className:"truncate",children:"Est. Cost"}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px] opacity-0 transition-opacity group-hover:opacity-100",children:"edit"})]}):(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",q(a.totalCost)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 lg:grid-cols-2 sm:gap-4",children:[(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Input Token Breakdown"}),c>0&&(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-primary",style:{width:`${r(g,c)}%`}}),(0,d.jsx)("div",{className:"bg-success",style:{width:`${r(e,c)}%`}}),(0,d.jsx)("div",{className:"bg-warning",style:{width:`${r(f,c)}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-primary"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"New input"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(g),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(g,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-success"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cached read"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(e),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(e,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-warning"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cache creation"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(f),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(f,c),"%"]})]})]})]})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Cloud vs Local"}),m?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-warning",style:{width:`${w}%`}}),(0,d.jsx)("div",{className:"bg-primary",style:{width:`${100-w}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsx)(s,{label:"Cloud providers",dotClass:"bg-warning",requests:o(j.requests),promptTokens:o(j.promptTokens),completionTokens:o(j.completionTokens),cost:o(j.cost),showCost:!0}),(0,d.jsx)(s,{label:"Local (self-hosted)",dotClass:"bg-primary",requests:o(l.requests),promptTokens:o(l.promptTokens),completionTokens:o(l.completionTokens),cost:o(l.cost),showCost:o(l.cost)>0})]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Local = custom OpenAI/Anthropic-compatible providers. Token counts include input + output."})]}):(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No usage in this period."})]})]}),(0,d.jsx)(u,{})]})}v.propTypes={stats:m().object.isRequired};let w=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},x=a=>new Intl.NumberFormat().format(w(a)),y=a=>`$${w(a).toFixed(2)}`;function z(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function A({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function B({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":x(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":x(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:x(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":y(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":y(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:y(a.totalCost||a.cost)})]})}function C({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:h,onToggleSort:j,viewMode:k,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[p,q]=(0,e.useState)(new Set),r=(0,e.useCallback)(a=>{q(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),s=(0,e.useMemo)(()=>"tokens"===k?[{field:"promptTokens",label:"Input Tokens"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[k]),t=b.length+s.length;return(0,d.jsxs)(i.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(A,{field:a.field,currentSort:g,currentOrder:h})]},a.field)),s.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(A,{field:a.field,currentSort:g,currentOrder:h})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>r(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${p.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(B,{item:a.summary,viewMode:k,isSummary:!0})]}),p.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(B,{item:a,viewMode:k})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:t,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}A.propTypes={field:m().string.isRequired,currentSort:m().string.isRequired,currentOrder:m().string.isRequired},B.propTypes={item:m().object.isRequired,viewMode:m().string.isRequired,isSummary:m().bool},C.propTypes={title:m().string.isRequired,columns:m().arrayOf(m().shape({field:m().string.isRequired,label:m().string.isRequired,align:m().string})).isRequired,groupedData:m().array.isRequired,tableType:m().string.isRequired,sortBy:m().string.isRequired,sortOrder:m().string.isRequired,onToggleSort:m().func.isRequired,viewMode:m().string.isRequired,storageKey:m().string.isRequired,renderDetailCells:m().func.isRequired,renderSummaryCells:m().func.isRequired,emptyMessage:m().string.isRequired};var D=c(96103),E=c(22805);function F(a){return"string"==typeof a&&a.startsWith(g.JH)}function G(a){return"string"==typeof a&&a.startsWith(g.DI)}function H(a={}){return String(a.apiType||a.providerSpecificData?.apiType||a.provider_specific_data?.apiType||"chat").toLowerCase()}function I({data:a}){let{label:b,color:c,imageUrl:f,textIcon:g,active:h}=a,[i,j]=(0,e.useState)(!1);return(0,d.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:h?c:"var(--color-border)",boxShadow:h?`0 0 16px ${c}40`:"none",minWidth:"150px"},children:[(0,d.jsx)(D.h7,{type:"target",position:E.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${c}15`},children:f&&!i?(0,d.jsx)("img",{src:f,alt:b,className:"w-6 h-6 rounded-sm object-contain",onError:()=>j(!0)}):(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:c},children:g})}),(0,d.jsx)("span",{className:"text-base font-medium truncate",style:{color:h?c:"var(--color-text)"},children:b}),h&&(0,d.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,d.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:c}}),(0,d.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:c}})]})]})}function J({data:a}){return(0,d.jsxs)("div",{className:"flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]",children:[(0,d.jsx)(D.h7,{type:"source",position:E.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("img",{src:"/favicon.svg",alt:"Bluerouter",className:"w-6 h-6 mr-2"}),(0,d.jsx)("span",{className:"text-sm font-bold text-primary",children:"Blue Router"}),a.activeCount>0&&(0,d.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:a.activeCount})]})}c(71763),I.propTypes={data:m().object.isRequired},J.propTypes={data:m().object.isRequired};let K={provider:I,router:J};function L({providers:a=[],activeRequests:b=[],lastProvider:c="",errorProvider:f=""}){let h=(0,e.useMemo)(()=>b.map(a=>a.provider?.toLowerCase()).filter(Boolean).sort().join(","),[b]),i=c?.toLowerCase()||"",j=f?.toLowerCase()||"",k=(0,e.useMemo)(()=>new Set(h?h.split(","):[]),[h]),l=(0,e.useMemo)(()=>new Set(i?[i]:[]),[i]),m=(0,e.useMemo)(()=>new Set(j?[j]:[]),[j]),n=(0,e.useRef)({}),[o,p]=(0,e.useState)(0),q=(0,e.useMemo)(()=>{let a=Date.now(),b=new Set;for(let c of k){let d=n.current[c];(!d||a-d<6e4)&&b.add(c)}return b},[k,o]),{nodes:r,edges:s}=(0,e.useMemo)(()=>(function(a,b,c,d){let e=a.length,f=Math.max(320,204*e/(2*Math.PI)),h=Math.max(200,.55*f);if(0===e)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let i=[],j=[];return i.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:b.size},draggable:!1}),a.forEach((a,k)=>{let l,m,n=function(a,b={}){if(g.Q2[a])return g.Q2[a];if(F(a)){let a=H(b);return{color:"#10A37F",name:b.name||("responses"===a?"OpenAI Compatible Responses":"OpenAI Compatible Chat"),textIcon:"responses"===a?"OR":"OC"}}return G(a)?{color:"#D97757",name:b.name||"Anthropic Compatible",textIcon:"AC"}:{color:"#6b7280",name:b.name||a,textIcon:(a||"?").slice(0,2).toUpperCase()}}(a.provider,a),o=b.has(a.provider?.toLowerCase()),p=!o&&c.has(a.provider?.toLowerCase()),q=!o&&d.has(a.provider?.toLowerCase()),r=`provider-${a.provider}`,s={label:(n.name!==a.provider?n.name:null)||a.name||a.provider,color:n.color||"#6b7280",imageUrl:function(a={}){let b=a.provider||a.id||"";return b?F(b)?"responses"===H(a)?"/providers/oai-r.png":"/providers/oai-cc.png":G(b)?"/providers/anthropic-m.png":`/providers/${b}.png`:null}(a),textIcon:n.textIcon||(a.provider||"?").slice(0,2).toUpperCase(),active:o},t=-Math.PI/2+2*Math.PI*k/e,u=f*Math.cos(t),v=h*Math.sin(t);Math.abs(t+Math.PI/2)<Math.PI/4||Math.abs(t-3*Math.PI/2)<Math.PI/4?(l="top",m="bottom"):Math.abs(t-Math.PI/2)<Math.PI/4?(l="bottom",m="top"):u>0?(l="right",m="left"):(l="left",m="right"),i.push({id:r,type:"provider",position:{x:u-90,y:v-15},data:s,draggable:!1}),j.push({id:`e-${r}`,source:"router",sourceHandle:l,target:r,targetHandle:m,animated:o,style:(n.color,q?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:o?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:p?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:i,edges:j}})(a,q,l,m),[a,q,i,j]),t=(0,e.useMemo)(()=>a.map(a=>a.provider).sort().join(","),[a]),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w={padding:.2,duration:200},x=(0,e.useCallback)(a=>{u.current=a,setTimeout(()=>a.fitView(w),50)},[]);return(0,d.jsx)("div",{ref:v,className:"h-[320px] w-full min-w-0 rounded-lg border border-border bg-bg-subtle/30 sm:h-[480px]",children:0===a.length?(0,d.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,d.jsx)(D.Gc,{nodes:r,edges:s,nodeTypes:K,fitView:!0,fitViewOptions:w,minZoom:.1,maxZoom:2,onInit:x,proOptions:{hideAttribution:!0},panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:(0,d.jsx)(D.H2,{showInteractive:!1,className:"react-flow-controls-custom"})},t)})}L.propTypes={providers:m().arrayOf(m().shape({id:m().string,provider:m().string,name:m().string})),activeRequests:m().arrayOf(m().shape({provider:m().string,model:m().string,account:m().string})),lastProvider:m().string,errorProvider:m().string};var M=c(80322),N=c(21621),O=c(28946),P=c(22393),Q=c(54206),R=c(63691),S=c(53707);let T=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},U=a=>{let b=T(a);return b>=1e6?`${(b/1e6).toFixed(1)}M`:b>=1e3?`${(b/1e3).toFixed(1)}K`:String(b)},V=a=>`$${T(a).toFixed(4)}`;function W({period:a="7d"}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[h,j]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{g(!0);try{let b=await fetch(`/api/usage/chart?period=${a}`);if(b.ok){let a=await b.json();c(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{g(!1)}},[a]);let k=b.map(a=>({...a,tokens:T(a.tokens),cost:T(a.cost)})),l=k.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-3 p-3 sm:p-4",children:[(0,d.jsxs)("div",{className:"grid w-full grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:w-auto sm:self-start",children:[(0,d.jsx)("button",{onClick:()=>j("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>j("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),f?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):l?(0,d.jsx)(M.u,{width:"100%",height:220,children:(0,d.jsxs)(N.Q,{data:k,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(O.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(P.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(Q.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===h?U:V,width:50}),(0,d.jsx)(R.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[U(a),"Tokens"]:[V(a),"Cost"]}),"tokens"===h?(0,d.jsx)(S.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(S.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}function X(a){let b=String(a||"").trim();if(!b)return"";try{return new URL(b).hostname||""}catch{return b.replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/:\d+$/,"")}}function Y(a){let b=String(a||"").trim();return/^openai-compatible-chat-[0-9a-f-]{20,}$/i.test(b)||/^openai-compatible-[0-9a-f-]{20,}$/i.test(b)}function Z(a){return String(a||"").trim()}function $(a=[]){let b={},c={};for(let d of a||[]){let a=function(a={}){let b=Z(a.provider||a.providerId||a.provider_id||a.id),c=Z(a.accountName||a.account_name||a.email||a.displayName||a.display_name||a.name||a.label||a.connectionName||a.connection_name),d=X(a.endpoint)||X(a.baseUrl)||X(a.baseURL)||X(a.base_url)||X(a.providerUrl)||X(a.provider_url)||X(a.url),e=Z(a.email);return{providerId:b,accountName:c,displayName:Z(a.displayName||a.display_name),email:e,endpointHost:d,ownerUser:Z(a.ownerUser||a.owner_user),isPersonal:"personal"===a.scope||"private"===a.visibility||!!(a.ownerUser||a.owner_user)}}(d);for(let c of[d.id,d.connectionId,d.connection_id].map(Z).filter(Boolean))b[c]||(b[c]=a);a.accountName&&!c[a.accountName]&&(c[a.accountName]=a)}return{byConnectionId:b,byAccount:c}}function _(a={},b={}){let c=a.model||a.rawModel||a.raw_model||"-",d=function(a={},b={}){let c=function(a={},b={}){for(let c of[a.connectionId,a.connection_id].map(Z).filter(Boolean))if(b.byConnectionId?.[c])return b.byConnectionId[c];let c=Z(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return c&&b.byAccount?.[c]?b.byAccount[c]:null}(a,b),d=function(a={},b=null){let c=Z(a.provider||a.providerId||a.provider_id).toLowerCase();if(!(!0===a.isPersonalOAuth||!0===a.is_personal_oauth||"personal"===a.connectionScope||"personal"===a.connection_scope||"private"===a.visibility||b?.isPersonal)||!c)return"";let d=Z(a.ownerUser||a.owner_user||a.apiKeyOwner||a.api_key_owner||b?.ownerUser),e=Z(a.accountEmail||a.account_email||a.email||b?.email),f=Z(a.accountDisplayName||a.account_display_name||a.accountName||a.account_name||a.connectionName||a.connection_name||b?.accountName||b?.displayName),g=[];return(d&&g.push(d),e&&e!==d?g.push(e):f&&f!==d&&g.push(f),g.length)?(g.push(c),g.join("/")):""}(a,c);if(d)return d;if(c){let a=c.providerId,b=c.accountName,d=c.endpointHost;if(a&&!Y(a)){if(c.isPersonal&&c.ownerUser){let d=[c.ownerUser];return c.email&&c.email!==c.ownerUser?d.push(c.email):b&&b!==c.ownerUser&&d.push(b),d.push(a),d.join("/")}return b&&b!==a?`${a}/${b}`:a}if(b)return b;if(d)return d}let e=X(a.endpoint)||X(a.providerUrl)||X(a.provider_url)||X(a.baseUrl)||X(a.baseURL)||X(a.base_url)||X(a.url);if(e)return e;let f=Z(a.provider||a.providerId||a.provider_id),g=Z(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return f&&!Y(f)?g&&g!==f?`${f}/${g}`:f:g||""}(a,b),e=Z(a.provider||a.providerId||a.provider_id);return!d||"-"===c||String(c).startsWith(`${d}/`)?c:e&&String(c).startsWith(`${e}/`)&&(d.startsWith(`${e}/`)||d.endsWith(`/${e}`))?`${d}/${String(c).slice(e.length+1)}`:`${d}/${c}`}function aa({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}W.propTypes={period:m().string};let ab=new Set(["ok","success","succeeded","complete","completed","done","200 ok"]),ac=new Set(["pending","running","queued","in_progress","in-progress"]);function ad(a={}){let b,c=String(a.status||a.statusText||a.status_text||"").trim().toLowerCase(),d=(b=String(c||"").match(/\b([1-5]\d{2})\b/))?Number(b[1]):null,e=function(...a){for(let b of a){if(null==b||""===b)continue;let a=Number(b);if(Number.isFinite(a))return a}return null}(a.statusCode,a.status_code,a.gatewayStatusCode,a.gateway_status_code,a.upstreamStatusCode,a.upstream_status_code,d),f=Z(a.errorCode||a.error_code),g=Z(a.errorType||a.error_type),h=Z(a.errorMessageShort||a.error_message_short||a.message||a.error);if(ac.has(c))return{kind:"pending",label:"PENDING",title:"Request is still pending/running.",dotClass:"bg-amber-500",rowClass:"hover:bg-amber-50/60",badgeClass:"bg-amber-100 text-amber-700 border border-amber-200"};if(/\b(error|fail|failed|failure|timeout|cancelled|canceled)\b/i.test(c)||null!==e&&e>=400||f||g||h){let b=null!==e?`ERR ${e}`:c?c.toUpperCase():"ERROR",d=[`Status: ${b}`,f?`Code: ${f}`:"",g?`Type: ${g}`:"",h?`Message: ${h}`:"",a.endpoint?`Endpoint: ${a.endpoint}`:""].filter(Boolean);return{kind:"error",label:b,title:d.join("\n"),dotClass:"bg-error",rowClass:"hover:bg-error/5",badgeClass:"bg-error/10 text-error border border-error/20"}}return null!==e&&e>=200&&e<300||!c||ab.has(c)?{kind:"success",label:e?`OK ${e}`:"OK",title:"Request completed successfully.",dotClass:"bg-success",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-success/10 text-success border border-success/20"}:{kind:"unknown",label:c?c.toUpperCase():"UNKNOWN",title:c?`Status: ${c}`:"Unknown request status.",dotClass:"bg-text-muted",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-bg-subtle text-text-muted border border-border"}}function ae({request:a}){let{cachedTokens:b,cacheCreationTokens:c,totalTokens:e,totalInputTokens:f,newInputTokens:g,reasoningTokens:h,outputTokens:i}=function(a={}){let b=Number(a.promptTokens??a.prompt_tokens??0)||0,c=Number(a.cachedTokens??a.cached_tokens??a.cache_read_input_tokens??0)||0,d=Number(a.cacheCreationTokens??a.cache_creation_input_tokens??0)||0,e=Number(a.completionTokens??a.completion_tokens??0)||0,f=Number(a.totalTokens??a.total_tokens??b+e)||0,g=Number(a.displayTotalInputTokens??a.display_total_input_tokens??b)||0,h=Number(a.displayNewInputTokens??a.display_new_input_tokens??Math.max(0,g-c-d))||0,i=Number(a.displayCachedInputTokens??a.display_cached_input_tokens??c)||0,j=Number(a.displayCacheCreationInputTokens??a.display_cache_creation_input_tokens??d)||0,k=Number(a.displayReasoningTokens??a.display_reasoning_tokens??a.reasoningTokens??a.reasoning_tokens??0)||0,l=Number(a.displayOutputTokens??a.display_output_tokens??e)||0;return{promptTokens:b,cachedTokens:i,cacheCreationTokens:j,completionTokens:e,totalTokens:f,totalInputTokens:g,newInputTokens:h,reasoningTokens:k,outputTokens:l}}(a),j=ad(a),k=f>0?Math.min(100,Math.max(0,Math.round(b/f*100))):0,l=`Total Input: ${x(f)}
|
|
10
|
+
`,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[r.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"})]}):a.name]})},a.value)})})]},a)),0===Object.keys(K).length&&0===J.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})]})}):null}m.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSelect:g().func.isRequired,onDeselect:g().func,selectedModel:g().string,activeProviders:g().arrayOf(g().shape({provider:g().string.isRequired})),title:g().string,modelAliases:g().object,kindFilter:g().string,addedModelValues:g().arrayOf(g().string),closeOnSelect:g().bool,personalOnly:g().bool,extraModels:g().arrayOf(g().string)}},83552:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(71404);function f({label:a,type:b="text",placeholder:c,value:g,onChange:h,error:i,hint:j,icon:k,disabled:l=!1,required:m=!1,className:n,inputClassName:o,...p}){return(0,d.jsxs)("div",{className:(0,e.cn)("flex flex-col gap-1.5",n),children:[a&&(0,d.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[a,m&&(0,d.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,d.jsxs)("div",{className:"relative",children:[k&&(0,d.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:k})}),(0,d.jsx)("input",{type:b,placeholder:c,value:g,onChange:h,disabled:l,className:(0,e.cn)("w-full py-2.5 px-3 text-sm text-text-main bg-surface-2 rounded-[10px]","border border-transparent placeholder-text-muted/70","focus:outline-none focus:ring-2 focus:ring-brand-500/30 focus:border-brand-500/40","transition-all duration-150 ease-out disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",k&&"pl-10",i&&"ring-1 ring-red-500 focus:ring-2 focus:ring-red-500/40 border-red-500/40",o),...p})]}),i&&(0,d.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),j&&!i&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:j})]})}},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\shared\\\\components\\\\Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\shared\\components\\Select.js","default")},86209:(a,b,c)=>{"use strict";c.d(b,{default:()=>i});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412);function i({isOpen:a,onMethodSelect:b,onClose:c}){let[f,g]=(0,e.useState)(null),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)("us-east-1"),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),x=a=>{g(a),q(null)},y=()=>{g(null),q(null)},z=async()=>{if(!n.trim())return void q("Please enter a refresh token");s(!0),q(null);try{let a=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n.trim()})}),c=await a.json();if(!a.ok)throw Error(c.error||"Import failed");b("import")}catch(a){q(a.message)}finally{s(!1)}},A=a=>{b("social",{provider:a})};return(0,d.jsx)(h.aF,{isOpen:a,title:"Connect Kiro",onClose:c,size:"lg",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[!f&&(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,d.jsx)("button",{onClick:()=>b("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("idc"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,d.jsx)("button",{onClick:()=>x("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:j,onChange:a=>k(a.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,d.jsx)(h.pd,{value:l,onChange:a=>m(a.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),p&&(0,d.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>{j.trim()?b("idc",{startUrl:j.trim(),region:l}):q("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("google"),fullWidth:!0,children:"Continue with Google"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,d.jsxs)("div",{className:"flex-1 text-sm",children:[(0,d.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,d.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>A("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===f&&(0,d.jsxs)("div",{className:"space-y-4",children:[t&&(0,d.jsxs)("div",{className:"text-center py-6",children:[(0,d.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!t&&(0,d.jsxs)(d.Fragment,{children:[v&&(0,d.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,d.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!p&&(0,d.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,d.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)(h.pd,{value:n,onChange:a=>o(a.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),p&&(0,d.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:p})}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:z,fullWidth:!0,disabled:r||!n.trim(),children:r?"Importing...":"Import Token"}),(0,d.jsx)(h.$n,{onClick:y,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}i.propTypes={isOpen:g().bool.isRequired,onMethodSelect:g().func.isRequired,onClose:g().func.isRequired}},86739:(a,b,c)=>{"use strict";c.d(b,{default:()=>r});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(49885),j=c.n(i),k=c(3236),l=c(53845),m=c(20151),n=c(37365),o=c(12020),p=c(96919),q=c(99258);function r({onMenuClick:a,showMenuButton:b=!0}){let c=(0,f.usePathname)(),g=(0,f.useRouter)(),{displayName:i,loginMethod:j}=(0,m.s)(),{title:n,description:t,icon:u,breadcrumbs:v}=(0,e.useMemo)(()=>(a=>{if(!a)return{title:"",description:"",breadcrumbs:[]};let b=a.match(/\/media-providers\/([^/]+)\/([^/]+)$/);if(b){let a=b[1],c=b[2],d=p.rj.find(b=>b.id===a),e=p.Q2[c];return{title:e?.name||c,description:"",breadcrumbs:[{label:"Media Providers",href:`/dashboard/media-providers/${a}`},{label:d?.label||a,href:`/dashboard/media-providers/${a}`},{label:e?.name||c,image:`/providers/${c}.png`}]}}let c=a.match(/\/media-providers\/([^/]+)$/);if(c){let a=c[1],b=p.rj.find(b=>b.id===a);return{title:b?.label||a,description:`Manage your ${b?.label||a} providers`,icon:b?.icon||"perm_media",breadcrumbs:[]}}let d=a.match(/\/providers\/([^/]+)$/);if(d){let a=d[1],b=o.zN[a]||o.fg[a];if(b)return{title:b.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:b.name,image:`/providers/${b.id}.png`}]}}return a.includes("/providers")&&!a.includes("/media-providers")?{title:"Providers",description:"Manage your AI provider connections",icon:"dns",breadcrumbs:[]}:a.includes("/combos")?{title:"Combos",description:"Model combos with fallback",icon:"layers",breadcrumbs:[]}:a.includes("/token-saver")?{title:"Token Saver Analytics",description:"Theo d\xf5i hiệu quả RTK token saving theo source tool, provider, model v\xe0 filter",icon:"compress",breadcrumbs:[]}:a.includes("/analytics")?{title:"Analytics",description:"Thống k\xea request, token, API key, Source IP, provider, model v\xe0 lỗi vận h\xe0nh",icon:"monitoring",breadcrumbs:[]}:a.includes("/resource-monitor")?{title:"Linux Resources",description:"Realtime resource monitoring for remote Linux servers",icon:"monitor_heart",breadcrumbs:[]}:a.includes("/cluster")?{title:"Cluster Nodes",description:"Synchronize Master backups to Standby BlueRouter nodes",icon:"hub",breadcrumbs:[]}:a.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",icon:"bar_chart",breadcrumbs:[]}:a.includes("/auth-files")?{title:"Auth Files",description:"Map provider credentials stored in the local database",icon:"vpn_key",breadcrumbs:[]}:a.includes("/quota")?{title:"Quota Tracker",description:"Track and manage your API quota limits",icon:"data_usage",breadcrumbs:[]}:a.includes("/mitm")?{title:"AI Traffic Proxy",description:"Intercept CLI tool traffic and route through this router gateway",icon:"security",breadcrumbs:[]}:a.includes("/prompt-logs")?{title:"Prompt Logs",description:"Search Copilot/MITM prompts across the prompt log database",icon:"manage_search",breadcrumbs:[]}:a.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",icon:"terminal",breadcrumbs:[]}:a.includes("/proxy-pools")?{title:"Proxy Pools",description:"Manage your proxy pool configurations",icon:"lan",breadcrumbs:[]}:a.includes("/skills")?{title:"Agent Skills",description:"Copy a link and paste to your AI to use this Router — no install needed",icon:"extension",breadcrumbs:[]}:a.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:a.includes("/api-keys")?{title:"API Keys",description:"Manage API keys and model access",icon:"vpn_key",breadcrumbs:[]}:a.includes("/profile")?{title:"Settings",description:"Manage your preferences",icon:"settings",breadcrumbs:[]}:a.includes("/translator")?{title:"Translator",description:"Debug translation flow between formats",icon:"translate",breadcrumbs:[]}:a.includes("/console-log")?{title:"Console Log",description:"Live server console output",icon:"monitor",breadcrumbs:[]}:"/dashboard"===a?{title:"Endpoint",description:"API endpoint configuration",icon:"api",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(c),[c]),w=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(g.push("/login"),g.refresh())}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur",children:(0,d.jsxs)("div",{className:"flex min-h-[72px] items-center justify-between gap-4 px-4 md:px-6",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[b?(0,d.jsx)("button",{type:"button",onClick:a,className:"rounded-xl border border-border p-2 text-text-muted hover:bg-surface hover:text-text-main lg:hidden","aria-label":"Open menu",children:(0,d.jsx)("span",{className:"material-symbols-outlined",children:"menu"})}):null,(0,d.jsx)("div",{className:"min-w-0",children:v.length>0?(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-sm text-text-muted",children:v.map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[b>0?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"}):null,a.href?(0,d.jsx)(h(),{href:a.href,className:"hover:text-primary",children:(0,q.Tl)(a.label)}):(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.image?(0,d.jsx)("img",{src:a.image,alt:"",className:"h-5 w-5 rounded"}):null,(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:(0,q.Tl)(a.label)})]})]},`${a.label}-${b}`))}):n?(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[u?(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:u}):null,(0,d.jsx)("h1",{className:"truncate text-xl font-semibold text-text-main",children:(0,q.Tl)(n)})]}),t?(0,d.jsx)("p",{className:"mt-1 truncate text-sm text-text-muted",children:(0,q.Tl)(t)}):null]}):null})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,d.jsx)(s,{}),i&&"OIDC"===j?(0,d.jsxs)("div",{className:"hidden items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-text-muted md:flex",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"person"}),(0,d.jsx)("span",{children:i}),(0,d.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:"OIDC"})]}):null,(0,d.jsx)(l.default,{}),(0,d.jsx)(k.default,{onLogout:w})]})]})})}function s(){let a=(0,n.C)(a=>a.visible),b=(0,n.C)(a=>a.query),c=(0,n.C)(a=>a.placeholder),e=(0,n.C)(a=>a.setQuery);return a?(0,d.jsxs)("div",{className:"relative hidden w-72 md:block",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[18px] text-text-muted",children:"search"}),(0,d.jsx)("input",{value:b,onChange:a=>e(a.target.value),placeholder:c,className:"h-9 w-full rounded-lg border border-border bg-surface/60 pl-8 pr-8 text-sm text-text-main outline-none transition-colors placeholder:text-text-muted focus:border-primary/50"}),b?(0,d.jsx)("button",{type:"button",onClick:()=>e(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:text-text-main","aria-label":"Clear search",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})}):null]}):null}r.propTypes={onMenuClick:j().func,showMenuButton:j().bool}},87226:(a,b,c)=>{"use strict";c.d(b,{default:()=>ao});var d=c(48249),e=c(67484),f=c(19099),g=c(96919),h=c(75171),i=c(17660),j=c(2116),k=c.n(j),l=c(49885),m=c.n(l),n=c(20151);let o=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},p=a=>new Intl.NumberFormat().format(o(a)),q=a=>`$${o(a).toFixed(2)}`,r=(a,b)=>{let c=o(b);return c<=0?0:Math.round(o(a)/c*100)};function s({label:a,dotClass:b,requests:c,promptTokens:e,completionTokens:f,cost:g,showCost:h}){return(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${b}`}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:a})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(o(e)+o(f)),h&&(0,d.jsx)("span",{className:"ml-1.5 text-warning",children:q(g)}),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[p(c)," req"]})]})]})}s.propTypes={label:m().string.isRequired,dotClass:m().string.isRequired,requests:m().number,promptTokens:m().number,completionTokens:m().number,cost:m().number,showCost:m().bool};let t=[{name:"Anthropic (Claude)",dot:"bg-warning",mode:"Thủ c\xf4ng",modeNote:"BlueRouter chỉ \xe1p dụng cache write 5 ph\xfat",write:"1,25x gi\xe1 input",read:"0,1x gi\xe1 input",ttl:"5 ph\xfat; TTL d\xe0i hơn vẫn d\xf9ng c\xf9ng mức gi\xe1",fields:"cache_creation_input_tokens + cache_read_input_tokens",note:"Kh\xf4ng lưu cache 1 giờ. Mọi cache creation được t\xednh bằng rate 5 ph\xfat của model."},{name:"OpenAI",dot:"bg-success",mode:"Tự động",modeNote:"d\xf9ng Standard / short-context rate",write:"GPT-5.6 theo cache-write rate; model kh\xe1c fallback về input",read:"Theo cached rate của từng model",ttl:"Kh\xf4ng t\xe1ch TTL trong BlueRouter",fields:"prompt_tokens_details.cached_tokens + cache creation fields khi c\xf3",note:"Request tr\xean 272K hoặc cache d\xe0i hơn vẫn d\xf9ng đ\xfang rate short-context/cache 5 ph\xfat đ\xe3 cấu h\xecnh."},{name:"Google Gemini",dot:"bg-primary",mode:"Hai chế độ",modeNote:"implicit tự động, explicit do người d\xf9ng tạo",write:"Miễn ph\xed (implicit) / ph\xed lưu trữ theo giờ (explicit)",read:"giảm gi\xe1 đ\xe1ng kể so với input",ttl:"Implicit ngắn hạn; explicit theo TTL tự đặt",fields:"cachedContentTokenCount",note:"Explicit caching t\xednh tiền theo thời gian lưu, kh\xe1c hẳn m\xf4 h\xecnh của Anthropic v\xe0 OpenAI."},{name:"Local (vLLM, llama.cpp, Ollama)",dot:"bg-text-muted",mode:"Tự động",modeNote:"prefix caching / KV cache reuse",write:"Miễn ph\xed",read:"Miễn ph\xed — chỉ tiết kiệm compute v\xe0 giảm TTFT",ttl:"Tuỳ cấu h\xecnh v\xe0 dung lượng KV cache",fields:"Thường kh\xf4ng t\xe1ch ri\xeang trong usage",note:"Tiết kiệm thời gian chứ kh\xf4ng tiết kiệm tiền, v\xe0 phần lớn gộp v\xe0o “New input” ở tr\xean."}];function u(){let[a,b]=(0,e.useState)(!1);return(0,d.jsxs)(i.default,{className:"min-w-0 px-4 py-3",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>b(a=>!a),className:"flex w-full min-w-0 items-center justify-between gap-2 text-left",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"help"}),(0,d.jsx)("span",{className:"truncate text-sm font-semibold uppercase text-text-muted",children:"Cache read / creation hoạt động thế n\xe0o"})]}),(0,d.jsx)("span",{className:`material-symbols-outlined shrink-0 text-[20px] text-text-muted transition-transform duration-200 ${a?"rotate-180":""}`,children:"expand_more"})]}),a&&(0,d.jsxs)("div",{className:"mt-3 flex min-w-0 flex-col gap-3 border-t border-border-subtle pt-3",children:[(0,d.jsxs)("p",{className:"text-xs leading-relaxed text-text-muted",children:[(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache creation"})," l\xe0 lần đầu một đoạn context được lưu lại. ",(0,d.jsx)("span",{className:"font-semibold text-text",children:"Cache read"})," l\xe0 những lần sau t\xe1i sử dụng đoạn đ\xf3 thay v\xec xử l\xfd lại. Cơ chế v\xe0 c\xe1ch t\xednh tiền kh\xe1c nhau tuỳ provider — gi\xe1 dưới đ\xe2y l\xe0 bội số so với gi\xe1 input thường của ch\xednh model đ\xf3."]}),(0,d.jsx)("div",{className:"grid min-w-0 grid-cols-1 gap-2 xl:grid-cols-2",children:t.map(a=>(0,d.jsxs)("div",{className:"min-w-0 rounded-[10px] bg-bg px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${a.dot}`}),(0,d.jsx)("span",{className:"truncate text-xs font-semibold",children:a.name})]}),(0,d.jsx)("span",{className:"shrink-0 rounded-full bg-surface px-2 py-0.5 text-[10px] text-text-muted",children:a.mode})]}),(0,d.jsxs)("dl",{className:"mt-2 flex min-w-0 flex-col gap-1 text-[11px]",children:[(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Ghi cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium",children:a.write})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Đọc cache"}),(0,d.jsx)("dd",{className:"truncate text-right font-medium text-success",children:a.read})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"Thời hạn"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.ttl})]}),(0,d.jsxs)("div",{className:"flex min-w-0 justify-between gap-2",children:[(0,d.jsx)("dt",{className:"shrink-0 text-text-muted",children:"K\xedch hoạt"}),(0,d.jsx)("dd",{className:"truncate text-right",children:a.modeNote})]})]}),(0,d.jsx)("p",{className:"mt-1.5 border-t border-border-subtle pt-1.5 text-[10px] leading-relaxed text-text-muted",children:a.note}),(0,d.jsx)("p",{className:"mt-1 font-mono text-[9px] leading-relaxed text-text-muted opacity-70",children:a.fields})]},a.name))}),(0,d.jsx)("p",{className:"text-[10px] leading-relaxed text-text-muted",children:"Gi\xe1 v\xe0 thời hạn do provider c\xf4ng bố v\xe0 c\xf3 thể thay đổi — h\xe3y đối chiếu bảng gi\xe1 ch\xednh thức trước khi d\xf9ng cho mục đ\xedch t\xednh chi ph\xed."})]})]})}function v({stats:a}){let{isAdmin:b}=(0,n.s)(),c=o(a.totalPromptTokens),e=o(a.totalCachedInputTokens),f=o(a.totalCacheCreationInputTokens),g=null!=a.totalNewInputTokens?o(a.totalNewInputTokens):Math.max(0,c-e-f),h=a.cloudVsLocal||{},j=h.cloud||{},l=h.local||{},m=o(j.requests)>0||o(l.requests)>0,t=o(j.promptTokens)+o(j.completionTokens),w=r(t,t+(o(l.promptTokens)+o(l.completionTokens)));return(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 sm:gap-4",children:[(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 sm:gap-4",children:[(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold",children:p(a.totalRequests)})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-primary",children:p(c)}),c>0&&(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:[r(e,c),"% cached"]})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,d.jsx)("span",{className:"truncate text-2xl font-bold text-success",children:p(a.totalCompletionTokens)})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-1 px-4 py-3",children:[b?(0,d.jsxs)(k(),{href:"/dashboard/settings/pricing",className:"group flex min-w-0 items-center gap-1 text-text-muted text-sm uppercase font-semibold transition-colors hover:text-primary",title:"Chỉnh bảng gi\xe1 d\xf9ng để t\xednh cost",children:[(0,d.jsx)("span",{className:"truncate",children:"Est. Cost"}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px] opacity-0 transition-opacity group-hover:opacity-100",children:"edit"})]}):(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Est. Cost"}),(0,d.jsxs)("span",{className:"truncate text-2xl font-bold text-warning",children:["~",q(a.totalCost)]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Estimated, not actual billing"})]})]}),(0,d.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-3 lg:grid-cols-2 sm:gap-4",children:[(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Input Token Breakdown"}),c>0&&(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-primary",style:{width:`${r(g,c)}%`}}),(0,d.jsx)("div",{className:"bg-success",style:{width:`${r(e,c)}%`}}),(0,d.jsx)("div",{className:"bg-warning",style:{width:`${r(f,c)}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-primary"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"New input"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(g),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(g,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-success"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cached read"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(e),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(e,c),"%"]})]})]}),(0,d.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full bg-warning"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-muted",children:"Cache creation"})]}),(0,d.jsxs)("span",{className:"shrink-0 text-xs font-semibold tabular-nums",children:[p(f),(0,d.jsxs)("span",{className:"ml-1.5 font-normal text-text-muted",children:[r(f,c),"%"]})]})]})]})]}),(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-2 px-4 py-3",children:[(0,d.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Cloud vs Local"}),m?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex h-1.5 w-full overflow-hidden rounded-full bg-bg",children:[(0,d.jsx)("div",{className:"bg-warning",style:{width:`${w}%`}}),(0,d.jsx)("div",{className:"bg-primary",style:{width:`${100-w}%`}})]}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,d.jsx)(s,{label:"Cloud providers",dotClass:"bg-warning",requests:o(j.requests),promptTokens:o(j.promptTokens),completionTokens:o(j.completionTokens),cost:o(j.cost),showCost:!0}),(0,d.jsx)(s,{label:"Local (self-hosted)",dotClass:"bg-primary",requests:o(l.requests),promptTokens:o(l.promptTokens),completionTokens:o(l.completionTokens),cost:o(l.cost),showCost:o(l.cost)>0})]}),(0,d.jsx)("span",{className:"text-[10px] text-text-muted",children:"Local = custom OpenAI/Anthropic-compatible providers. Token counts include input + output."})]}):(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No usage in this period."})]})]}),(0,d.jsx)(u,{})]})}v.propTypes={stats:m().object.isRequired};let w=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},x=a=>new Intl.NumberFormat().format(w(a)),y=a=>`$${w(a).toFixed(2)}`;function z(a){if(!a)return"Never";let b=Math.floor((Date.now()-new Date(a))/6e4);return b<1?"Just now":b<60?`${b}m ago`:b<1440?`${Math.floor(b/60)}h ago`:new Date(a).toLocaleDateString()}function A({field:a,currentSort:b,currentOrder:c}){return b!==a?(0,d.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,d.jsx)("span",{className:"ml-1",children:"asc"===c?"↑":"↓"})}function B({item:a,viewMode:b,isSummary:c=!1}){return"tokens"===b?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.promptTokens?"—":x(a.promptTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.completionTokens?"—":x(a.completionTokens)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:x(a.totalTokens)})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.inputCost?"—":y(a.inputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:c&&void 0===a.outputCost?"—":y(a.outputCost)}),(0,d.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:y(a.totalCost||a.cost)})]})}function C({title:a,columns:b,groupedData:c,tableType:f,sortBy:g,sortOrder:h,onToggleSort:j,viewMode:k,storageKey:l,renderDetailCells:m,renderSummaryCells:n,emptyMessage:o}){let[p,q]=(0,e.useState)(new Set),r=(0,e.useCallback)(a=>{q(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),s=(0,e.useMemo)(()=>"tokens"===k?[{field:"promptTokens",label:"Input Tokens"},{field:"completionTokens",label:"Output Tokens"},{field:"totalTokens",label:"Total Tokens"}]:[{field:"promptTokens",label:"Input Cost"},{field:"completionTokens",label:"Output Cost"},{field:"cost",label:"Total Cost"}],[k]),t=b.length+s.length;return(0,d.jsxs)(i.default,{className:"overflow-hidden",children:[(0,d.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,d.jsx)("h3",{className:"font-semibold",children:a})}),(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,d.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,d.jsxs)("tr",{children:[b.map(a=>(0,d.jsxs)("th",{className:`px-6 py-3 cursor-pointer hover:bg-bg-subtle/50 ${"right"===a.align?"text-right":""}`,onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(A,{field:a.field,currentSort:g,currentOrder:h})]},a.field)),s.map(a=>(0,d.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>j(f,a.field),children:[a.label," ",(0,d.jsx)(A,{field:a.field,currentSort:g,currentOrder:h})]},a.field))]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border",children:[c.map(a=>(0,d.jsxs)(e.Fragment,{children:[(0,d.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>r(a.groupKey),children:[(0,d.jsx)("td",{className:"px-6 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${p.has(a.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:`font-medium transition-colors ${a.summary.pending>0?"text-primary":""}`,children:a.groupKey})]})}),n(a),(0,d.jsx)(B,{item:a.summary,viewMode:k,isSummary:!0})]}),p.has(a.groupKey)&&a.items.map(a=>(0,d.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[m(a),(0,d.jsx)(B,{item:a,viewMode:k})]},`detail-${a.key}`))]},a.groupKey)),0===c.length&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:t,className:"px-6 py-8 text-center text-text-muted",children:o})})]})]})})]})}A.propTypes={field:m().string.isRequired,currentSort:m().string.isRequired,currentOrder:m().string.isRequired},B.propTypes={item:m().object.isRequired,viewMode:m().string.isRequired,isSummary:m().bool},C.propTypes={title:m().string.isRequired,columns:m().arrayOf(m().shape({field:m().string.isRequired,label:m().string.isRequired,align:m().string})).isRequired,groupedData:m().array.isRequired,tableType:m().string.isRequired,sortBy:m().string.isRequired,sortOrder:m().string.isRequired,onToggleSort:m().func.isRequired,viewMode:m().string.isRequired,storageKey:m().string.isRequired,renderDetailCells:m().func.isRequired,renderSummaryCells:m().func.isRequired,emptyMessage:m().string.isRequired};var D=c(96103),E=c(22805);function F(a){return"string"==typeof a&&a.startsWith(g.JH)}function G(a){return"string"==typeof a&&a.startsWith(g.DI)}function H(a={}){return String(a.apiType||a.providerSpecificData?.apiType||a.provider_specific_data?.apiType||"chat").toLowerCase()}function I({data:a}){let{label:b,color:c,imageUrl:f,textIcon:g,active:h}=a,[i,j]=(0,e.useState)(!1);return(0,d.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg",style:{borderColor:h?c:"var(--color-border)",boxShadow:h?`0 0 16px ${c}40`:"none",minWidth:"150px"},children:[(0,d.jsx)(D.h7,{type:"target",position:E.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"target",position:E.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("div",{className:"w-8 h-8 rounded-md flex items-center justify-center shrink-0",style:{backgroundColor:`${c}15`},children:f&&!i?(0,d.jsx)("img",{src:f,alt:b,className:"w-6 h-6 rounded-sm object-contain",onError:()=>j(!0)}):(0,d.jsx)("span",{className:"text-sm font-bold",style:{color:c},children:g})}),(0,d.jsx)("span",{className:"text-base font-medium truncate",style:{color:h?c:"var(--color-text)"},children:b}),h&&(0,d.jsxs)("span",{className:"relative flex h-2 w-2 shrink-0",children:[(0,d.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:c}}),(0,d.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2",style:{backgroundColor:c}})]})]})}function J({data:a}){return(0,d.jsxs)("div",{className:"flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]",children:[(0,d.jsx)(D.h7,{type:"source",position:E.yX.Top,id:"top",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Bottom,id:"bottom",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Left,id:"left",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)(D.h7,{type:"source",position:E.yX.Right,id:"right",className:"!bg-transparent !border-0 !w-0 !h-0"}),(0,d.jsx)("img",{src:"/favicon.svg",alt:"Bluerouter",className:"w-6 h-6 mr-2"}),(0,d.jsx)("span",{className:"text-sm font-bold text-primary",children:"Blue Router"}),a.activeCount>0&&(0,d.jsx)("span",{className:"ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold",children:a.activeCount})]})}c(71763),I.propTypes={data:m().object.isRequired},J.propTypes={data:m().object.isRequired};let K={provider:I,router:J};function L({providers:a=[],activeRequests:b=[],lastProvider:c="",errorProvider:f=""}){let h=(0,e.useMemo)(()=>b.map(a=>a.provider?.toLowerCase()).filter(Boolean).sort().join(","),[b]),i=c?.toLowerCase()||"",j=f?.toLowerCase()||"",k=(0,e.useMemo)(()=>new Set(h?h.split(","):[]),[h]),l=(0,e.useMemo)(()=>new Set(i?[i]:[]),[i]),m=(0,e.useMemo)(()=>new Set(j?[j]:[]),[j]),n=(0,e.useRef)({}),[o,p]=(0,e.useState)(0),q=(0,e.useMemo)(()=>{let a=Date.now(),b=new Set;for(let c of k){let d=n.current[c];(!d||a-d<6e4)&&b.add(c)}return b},[k,o]),{nodes:r,edges:s}=(0,e.useMemo)(()=>(function(a,b,c,d){let e=a.length,f=Math.max(320,204*e/(2*Math.PI)),h=Math.max(200,.55*f);if(0===e)return{nodes:[{id:"router",type:"router",position:{x:0,y:0},data:{activeCount:0},draggable:!1}],edges:[]};let i=[],j=[];return i.push({id:"router",type:"router",position:{x:-60,y:-22},data:{activeCount:b.size},draggable:!1}),a.forEach((a,k)=>{let l,m,n=function(a,b={}){if(g.Q2[a])return g.Q2[a];if(F(a)){let a=H(b);return{color:"#10A37F",name:b.name||("responses"===a?"OpenAI Compatible Responses":"OpenAI Compatible Chat"),textIcon:"responses"===a?"OR":"OC"}}return G(a)?{color:"#D97757",name:b.name||"Anthropic Compatible",textIcon:"AC"}:{color:"#6b7280",name:b.name||a,textIcon:(a||"?").slice(0,2).toUpperCase()}}(a.provider,a),o=b.has(a.provider?.toLowerCase()),p=!o&&c.has(a.provider?.toLowerCase()),q=!o&&d.has(a.provider?.toLowerCase()),r=`provider-${a.provider}`,s={label:(n.name!==a.provider?n.name:null)||a.name||a.provider,color:n.color||"#6b7280",imageUrl:function(a={}){let b=a.provider||a.id||"";return b?F(b)?"responses"===H(a)?"/providers/oai-r.png":"/providers/oai-cc.png":G(b)?"/providers/anthropic-m.png":`/providers/${b}.png`:null}(a),textIcon:n.textIcon||(a.provider||"?").slice(0,2).toUpperCase(),active:o},t=-Math.PI/2+2*Math.PI*k/e,u=f*Math.cos(t),v=h*Math.sin(t);Math.abs(t+Math.PI/2)<Math.PI/4||Math.abs(t-3*Math.PI/2)<Math.PI/4?(l="top",m="bottom"):Math.abs(t-Math.PI/2)<Math.PI/4?(l="bottom",m="top"):u>0?(l="right",m="left"):(l="left",m="right"),i.push({id:r,type:"provider",position:{x:u-90,y:v-15},data:s,draggable:!1}),j.push({id:`e-${r}`,source:"router",sourceHandle:l,target:r,targetHandle:m,animated:o,style:(n.color,q?{stroke:"#ef4444",strokeWidth:2.5,opacity:.9}:o?{stroke:"#22c55e",strokeWidth:2.5,opacity:.9}:p?{stroke:"#f59e0b",strokeWidth:2,opacity:.7}:{stroke:"var(--color-border)",strokeWidth:1,opacity:.3})})}),{nodes:i,edges:j}})(a,q,l,m),[a,q,i,j]),t=(0,e.useMemo)(()=>a.map(a=>a.provider).sort().join(","),[a]),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w={padding:.2,duration:200},x=(0,e.useCallback)(a=>{u.current=a,setTimeout(()=>a.fitView(w),50)},[]);return(0,d.jsx)("div",{ref:v,className:"h-[320px] w-full min-w-0 rounded-lg border border-border bg-bg-subtle/30 sm:h-[480px]",children:0===a.length?(0,d.jsx)("div",{className:"h-full flex items-center justify-center text-text-muted text-sm",children:"No providers connected"}):(0,d.jsx)(D.Gc,{nodes:r,edges:s,nodeTypes:K,fitView:!0,fitViewOptions:w,minZoom:.1,maxZoom:2,onInit:x,proOptions:{hideAttribution:!0},panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,preventScrolling:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:(0,d.jsx)(D.H2,{showInteractive:!1,className:"react-flow-controls-custom"})},t)})}L.propTypes={providers:m().arrayOf(m().shape({id:m().string,provider:m().string,name:m().string})),activeRequests:m().arrayOf(m().shape({provider:m().string,model:m().string,account:m().string})),lastProvider:m().string,errorProvider:m().string};var M=c(80322),N=c(21621),O=c(28946),P=c(22393),Q=c(54206),R=c(63691),S=c(53707);let T=(a,b=0)=>{let c=Number(a);return Number.isFinite(c)?c:b},U=a=>{let b=T(a);return b>=1e6?`${(b/1e6).toFixed(1)}M`:b>=1e3?`${(b/1e3).toFixed(1)}K`:String(b)},V=a=>`$${T(a).toFixed(4)}`;function W({period:a="7d"}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[h,j]=(0,e.useState)("tokens");(0,e.useCallback)(async()=>{g(!0);try{let b=await fetch(`/api/usage/chart?period=${a}`);if(b.ok){let a=await b.json();c(a)}}catch(a){console.error("Failed to fetch chart data:",a)}finally{g(!1)}},[a]);let k=b.map(a=>({...a,tokens:T(a.tokens),cost:T(a.cost)})),l=k.some(a=>a.tokens>0||a.cost>0);return(0,d.jsxs)(i.default,{className:"flex min-w-0 flex-col gap-3 p-3 sm:p-4",children:[(0,d.jsxs)("div",{className:"grid w-full grid-cols-2 items-center gap-1 rounded-lg border border-border bg-bg-subtle p-1 sm:w-auto sm:self-start",children:[(0,d.jsx)("button",{onClick:()=>j("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,d.jsx)("button",{onClick:()=>j("cost"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"cost"===h?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Cost"})]}),f?(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"Loading..."}):l?(0,d.jsx)(M.u,{width:"100%",height:220,children:(0,d.jsxs)(N.Q,{data:k,margin:{top:4,right:8,left:0,bottom:0},children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:"gradTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]}),(0,d.jsxs)("linearGradient",{id:"gradCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,d.jsx)("stop",{offset:"5%",stopColor:"#f59e0b",stopOpacity:.25}),(0,d.jsx)("stop",{offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]})]}),(0,d.jsx)(O.d,{strokeDasharray:"3 3",strokeOpacity:.1}),(0,d.jsx)(P.W,{dataKey:"label",tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,interval:"preserveStartEnd"}),(0,d.jsx)(Q.h,{tick:{fontSize:10,fill:"currentColor",fillOpacity:.5},tickLine:!1,axisLine:!1,tickFormatter:"tokens"===h?U:V,width:50}),(0,d.jsx)(R.m,{contentStyle:{backgroundColor:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:"8px",fontSize:"12px"},formatter:(a,b)=>"tokens"===b?[U(a),"Tokens"]:[V(a),"Cost"]}),"tokens"===h?(0,d.jsx)(S.Gk,{type:"monotone",dataKey:"tokens",stroke:"#6366f1",strokeWidth:2,fill:"url(#gradTokens)",dot:!1,activeDot:{r:4}}):(0,d.jsx)(S.Gk,{type:"monotone",dataKey:"cost",stroke:"#f59e0b",strokeWidth:2,fill:"url(#gradCost)",dot:!1,activeDot:{r:4}})]})}):(0,d.jsx)("div",{className:"h-48 flex items-center justify-center text-text-muted text-sm",children:"No data for this period"})]})}function X(a){let b=String(a||"").trim();if(!b)return"";try{return new URL(b).hostname||""}catch{return b.replace(/^https?:\/\//,"").replace(/\/.*$/,"").replace(/:\d+$/,"")}}function Y(a){let b=String(a||"").trim();return/^openai-compatible-chat-[0-9a-f-]{20,}$/i.test(b)||/^openai-compatible-[0-9a-f-]{20,}$/i.test(b)}function Z(a){return String(a||"").trim()}function $(a=[]){let b={},c={};for(let d of a||[]){let a=function(a={}){let b=Z(a.provider||a.providerId||a.provider_id||a.id),c=Z(a.accountName||a.account_name||a.email||a.displayName||a.display_name||a.name||a.label||a.connectionName||a.connection_name),d=X(a.endpoint)||X(a.baseUrl)||X(a.baseURL)||X(a.base_url)||X(a.providerUrl)||X(a.provider_url)||X(a.url),e=Z(a.email);return{providerId:b,accountName:c,displayName:Z(a.displayName||a.display_name),email:e,endpointHost:d,ownerUser:Z(a.ownerUser||a.owner_user),isPersonal:"personal"===a.scope||"private"===a.visibility||!!(a.ownerUser||a.owner_user)}}(d);for(let c of[d.id,d.connectionId,d.connection_id].map(Z).filter(Boolean))b[c]||(b[c]=a);a.accountName&&!c[a.accountName]&&(c[a.accountName]=a)}return{byConnectionId:b,byAccount:c}}function _(a={},b={}){let c=a.model||a.rawModel||a.raw_model||"-",d=function(a={},b={}){let c=function(a={},b={}){for(let c of[a.connectionId,a.connection_id].map(Z).filter(Boolean))if(b.byConnectionId?.[c])return b.byConnectionId[c];let c=Z(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return c&&b.byAccount?.[c]?b.byAccount[c]:null}(a,b),d=function(a={},b=null){let c=Z(a.provider||a.providerId||a.provider_id).toLowerCase();if(!(!0===a.isPersonalOAuth||!0===a.is_personal_oauth||"personal"===a.connectionScope||"personal"===a.connection_scope||"private"===a.visibility||b?.isPersonal)||!c)return"";let d=Z(a.ownerUser||a.owner_user||a.apiKeyOwner||a.api_key_owner||b?.ownerUser),e=Z(a.accountEmail||a.account_email||a.email||b?.email),f=Z(a.accountDisplayName||a.account_display_name||a.accountName||a.account_name||a.connectionName||a.connection_name||b?.accountName||b?.displayName),g=[];return(d&&g.push(d),e&&e!==d?g.push(e):f&&f!==d&&g.push(f),g.length)?(g.push(c),g.join("/")):""}(a,c);if(d)return d;if(c){let a=c.providerId,b=c.accountName,d=c.endpointHost;if(a&&!Y(a)){if(c.isPersonal&&c.ownerUser){let d=[c.ownerUser];return c.email&&c.email!==c.ownerUser?d.push(c.email):b&&b!==c.ownerUser&&d.push(b),d.push(a),d.join("/")}return b&&b!==a?`${a}/${b}`:a}if(b)return b;if(d)return d}let e=X(a.endpoint)||X(a.providerUrl)||X(a.provider_url)||X(a.baseUrl)||X(a.baseURL)||X(a.base_url)||X(a.url);if(e)return e;let f=Z(a.provider||a.providerId||a.provider_id),g=Z(a.accountName||a.account_name||a.keyName||a.key_name||a.connectionName||a.connection_name||a.providerName||a.provider_name||a.providerLabel||a.provider_label);return f&&!Y(f)?g&&g!==f?`${f}/${g}`:f:g||""}(a,b),e=Z(a.provider||a.providerId||a.provider_id);return!d||"-"===c||String(c).startsWith(`${d}/`)?c:e&&String(c).startsWith(`${e}/`)&&(d.startsWith(`${e}/`)||d.endsWith(`/${e}`))?`${d}/${String(c).slice(e.length+1)}`:`${d}/${c}`}function aa({timestamp:a}){let b,[,c]=(0,e.useState)(0);return(0,d.jsx)(d.Fragment,{children:(b=Math.floor((Date.now()-new Date(a))/1e3))<60?`${b}s ago`:b<3600?`${Math.floor(b/60)}m ago`:b<86400?`${Math.floor(b/3600)}h ago`:`${Math.floor(b/86400)}d ago`})}W.propTypes={period:m().string};let ab=new Set(["ok","success","succeeded","complete","completed","done","200 ok"]),ac=new Set(["pending","running","queued","in_progress","in-progress"]);function ad(a={}){let b,c=String(a.status||a.statusText||a.status_text||"").trim().toLowerCase(),d=(b=String(c||"").match(/\b([1-5]\d{2})\b/))?Number(b[1]):null,e=function(...a){for(let b of a){if(null==b||""===b)continue;let a=Number(b);if(Number.isFinite(a))return a}return null}(a.statusCode,a.status_code,a.gatewayStatusCode,a.gateway_status_code,a.upstreamStatusCode,a.upstream_status_code,d),f=Z(a.errorCode||a.error_code),g=Z(a.errorType||a.error_type),h=Z(a.errorMessageShort||a.error_message_short||a.message||a.error);if(ac.has(c))return{kind:"pending",label:"PENDING",title:"Request is still pending/running.",dotClass:"bg-amber-500",rowClass:"hover:bg-amber-50/60",badgeClass:"bg-amber-100 text-amber-700 border border-amber-200"};if(/\b(error|fail|failed|failure|timeout|cancelled|canceled)\b/i.test(c)||null!==e&&e>=400||f||g||h){let b=null!==e?`ERR ${e}`:c?c.toUpperCase():"ERROR",d=[`Status: ${b}`,f?`Code: ${f}`:"",g?`Type: ${g}`:"",h?`Message: ${h}`:"",a.endpoint?`Endpoint: ${a.endpoint}`:""].filter(Boolean);return{kind:"error",label:b,title:d.join("\n"),dotClass:"bg-error",rowClass:"hover:bg-error/5",badgeClass:"bg-error/10 text-error border border-error/20"}}return null!==e&&e>=200&&e<300||!c||ab.has(c)?{kind:"success",label:e?`OK ${e}`:"OK",title:"Request completed successfully.",dotClass:"bg-success",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-success/10 text-success border border-success/20"}:{kind:"unknown",label:c?c.toUpperCase():"UNKNOWN",title:c?`Status: ${c}`:"Unknown request status.",dotClass:"bg-text-muted",rowClass:"hover:bg-bg-subtle",badgeClass:"bg-bg-subtle text-text-muted border border-border"}}function ae({request:a}){let{cachedTokens:b,cacheCreationTokens:c,totalTokens:e,totalInputTokens:f,newInputTokens:g,reasoningTokens:h,outputTokens:i}=function(a={}){let b=Number(a.promptTokens??a.prompt_tokens??0)||0,c=Number(a.cachedTokens??a.cached_tokens??a.cache_read_input_tokens??0)||0,d=Number(a.cacheCreationTokens??a.cache_creation_input_tokens??0)||0,e=Number(a.completionTokens??a.completion_tokens??0)||0,f=Number(a.totalTokens??a.total_tokens??b+e)||0,g=Number(a.displayTotalInputTokens??a.display_total_input_tokens??b)||0,h=Number(a.displayNewInputTokens??a.display_new_input_tokens??Math.max(0,g-c-d))||0,i=Number(a.displayCachedInputTokens??a.display_cached_input_tokens??c)||0,j=Number(a.displayCacheCreationInputTokens??a.display_cache_creation_input_tokens??d)||0,k=Number(a.displayReasoningTokens??a.display_reasoning_tokens??a.reasoningTokens??a.reasoning_tokens??0)||0,l=Number(a.displayOutputTokens??a.display_output_tokens??e)||0;return{promptTokens:b,cachedTokens:i,cacheCreationTokens:j,completionTokens:e,totalTokens:f,totalInputTokens:g,newInputTokens:h,reasoningTokens:k,outputTokens:l}}(a),j=ad(a),k=f>0?Math.min(100,Math.max(0,Math.round(b/f*100))):0,l=`Total Input: ${x(f)}
|
|
11
11
|
New Input: ${x(g)}
|
|
12
12
|
Cached: ${x(b)}
|
|
13
13
|
Cache Create: ${x(c)}
|
|
@@ -31,7 +31,7 @@ default_model = "${I||"cc/claude-opus-4-7"}"
|
|
|
31
31
|
requires_api_key = true
|
|
32
32
|
|
|
33
33
|
[[providers.bluerouter.models]]
|
|
34
|
-
id = "${I||"cc/claude-opus-4-7"}"`},{filename:"~/.config/jcode/provider-bluerouter.env",content:`JCODE_9ROUTER_API_KEY="${v}"`}])})]})}let M="http://localhost:20128";function N({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>a?.[0]?.key||""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(M),[y,z]=(0,e.useState)(null),A=g?.isWin===!0,B=A||g?.hasCachedPassword||g?.needsSudoPassword===!1,C=g?.isAdmin!==!1;!C&&(A||g?.hasCachedPassword||g?.needsSudoPassword);let D=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),b.mitmRouterBaseUrl&&x(b.mitmRouterBaseUrl),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},[c]),E=a=>{v(null),g&&(B?F(a,""):(r(a),l(!0),t(null)))},F=async(c,d,e=!1)=>{j(!0),v(null);try{let f;if("trust-cert"===c)f=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:d})});else if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_bluerouter");f=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d,mitmRouterBaseUrl:w.trim()||M,forceKillPort443:e})})}else f=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})});if(!f.ok){let a=await f.json().catch(()=>({}));if("PORT_443_BUSY"===a.code&&a.portOwner){l(!1),z({owner:a.portOwner,password:d});return}v(a.error||`Failed to ${c} MITM server`);return}l(!1),n(""),z(null),await D()}catch(a){v(a.message||"Network error")}finally{j(!1),r(null)}},G=()=>{m.trim()?F(q,m):t("Sudo password is required")},H=g?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),H?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:g?.certExists},{label:"Trusted",ok:g?.certTrusted},{label:"Server",ok:H}].map(({label:a,ok:b})=>(0,d.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${b?"text-green-600":"text-text-muted"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:b?"check_circle":"cancel"}),a]},a))})]}),(0,d.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from Bluerouter"]}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → AI Traffic Proxy intercepts → Bluerouter → response to Antigravity/Copilot"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Router Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:M,disabled:H,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!H&&(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",list:"mitm-api-keys",value:o,onChange:a=>p(a.target.value),placeholder:b?"Enter or pick API key":"sk_bluerouter (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),a?.length>0&&(0,d.jsx)("datalist",{id:"mitm-api-keys",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.name||a.key},a.id))})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[g?.certExists&&!g?.certTrusted&&(0,d.jsxs)("button",{onClick:()=>E("trust-cert"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),H?(0,d.jsxs)("button",{onClick:()=>E("stop"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>E("start"),disabled:i||!g||A&&!C,title:A&&!C?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),H&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),u&&(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,d.jsx)("span",{children:u})]}),A&&!C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,d.jsx)("span",{children:"Administrator required — restart Bluerouter as Administrator to use MITM"})]})]})}),k&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:a=>n(a.target.value),onKeyDown:a=>{"Enter"!==a.key||i||G()}}),s&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:s})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{l(!1),n(""),t(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:G,loading:i,children:"Confirm"})]})]})}),y&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,d.jsx)("p",{children:"Port 443 is currently used by another process:"}),(0,d.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[y.owner.name," (PID ",y.owner.pid,")"]}),(0,d.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{z(null),j(!1)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:()=>{F("start",y?.password||"",!0)},loading:i,children:"Kill & Start"})]})]})})]})}var O=c(36811);function P({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,needsSudoPassword:k,isWin:l,apiKeys:m,activeProviders:n,hasActiveProviders:o,modelAliases:p={},cloudEnabled:q,onDnsChange:r}){let[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)({}),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=O.TOOL_HOSTS[a.id]??[],L=l||j||!1===k,M=(0,e.useCallback)(async b=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:b})})}catch{}},[a.id]),N=(a,b)=>{F(c=>({...c,[a]:b}))},Q=()=>{if(!h)return;let a=i?"disable":"enable";L?R(a,""):(B(a),x(!0),D(null))},R=async(b,c)=>{t(!0),v(null);try{let d=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,action:b,sudoPassword:c})}),e=await d.json();if(!d.ok)throw Error(e.error||"Failed to toggle DNS");"enable"===b&&v(`Restart ${a.name} to apply changes`),x(!1),z(""),r?.(e)}catch{}finally{t(!1),B(null)}},S=()=>{y.trim()?R(A,y):D("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),h?i?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted sm:truncate",children:["Intercept ",a.name," requests via AI Traffic Proxy"]})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[K.length>0&&(0,d.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,d.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,d.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:K.map(a=>(0,d.jsxs)("li",{children:["127.0.0.1 ",a]},a))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through Bluerouter via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:E[a.alias]||"",onChange:b=>N(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void M({...E,[c]:d})},placeholder:"provider/model-id",disabled:!i,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!i?"opacity-50 cursor-not-allowed":""}`}),E[a.alias]&&(0,d.jsx)("button",{onClick:()=>{N(a.alias,""),M({...E,[a.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{J(a.alias),H(!0)},disabled:!o||!i,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${o&&i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},a.alias))}),a.defaultModels?.length===0&&(0,d.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:items-start",children:[i?(0,d.jsxs)("button",{onClick:Q,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)("button",{onClick:Q,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:u})]})]})]})]}),w&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"!==a.key||s||S()}}),C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:C})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{x(!1),z(""),D(null)},disabled:s,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:S,loading:s,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:G,onClose:()=>H(!1),onSelect:a=>{if(!I||a.isPlaceholder)return;let b={...E,[I]:a.value};F(b),M(b)},selectedModel:I?E[I]:null,activeProviders:n,modelAliases:p,title:`Select model for ${I}`})]})}var Q=c(2116),R=c.n(Q);function S({tool:a}){return(0,d.jsx)(R(),{href:"/dashboard/mitm",className:"block",children:(0,d.jsx)(f.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}async function T(a){return a?await a.text():""}function U({serverRunning:a,onChanged:b}){let[c,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)("Blue Router Gateway Root CA"),[v,w]=(0,e.useState)("Blue Router Gateway"),[x,y]=(0,e.useState)("VN"),z=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm/root-ca");if(a.ok){let b=await a.json();g(b.rootCA||null)}}catch{}},[]),A=async(a,c)=>{i(!0),k(""),m("");try{let d=await fetch("/api/cli-tools/antigravity-mitm/root-ca",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),e=await d.json().catch(()=>({}));if(!d.ok)throw Error(e.error||"Root CA operation failed");m(c),g(e.rootCA||null),b?.(e.rootCA||null),await z()}catch(a){k(a.message||"Root CA operation failed")}finally{i(!1)}},B=async()=>{if(!n||!p)return void k("Choose both certificate and private key files");let a=await T(n),b=await T(p);await A({action:"upload-pair",certPem:a,keyPem:b},"Root CA certificate + private key imported. Restart MITM to use it.")},C=async()=>{await A({action:"generate-csr",commonName:t,organizationName:v,countryName:x},"CSR generated. Download it, sign it on your CA server, then upload the signed CA certificate.")},D=async()=>{if(!r)return void k("Choose signed CA certificate file");let a=await T(r);await A({action:"upload-signed-cert",certPem:a},"Signed Root CA certificate imported. Restart MITM to use it.")},E=async a=>{i(!0),k("");try{var b;let c=await fetch(`/api/cli-tools/antigravity-mitm/root-ca?download=${a}`);if(!c.ok){let b=await c.json().catch(()=>({}));throw Error(b.error||`Failed to download ${a}`)}await (b="csr"===a?"bluerouter-root-ca.csr":"bluerouter-root-ca.crt",c.blob().then(a=>{let d=(c.headers.get("Content-Disposition")||"").match(/filename=\"?([^\";]+)\"?/i),e=d?.[1]||b,f=URL.createObjectURL(a),g=document.createElement("a");g.href=f,g.download=e,document.body.appendChild(g),g.click(),g.remove(),URL.revokeObjectURL(f)}))}catch(b){k(b.message||`Failed to download ${a}`)}finally{i(!1)}},F=c?.certExists&&c?.keyExists,G=c?.csrExists&&c?.pendingKeyExists;return(0,d.jsx)(f.Zp,{padding:"sm",className:"border-border/60 bg-surface/60",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"workspace_premium"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Root CA"}),F?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Ready"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Missing"}),G&&(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"CSR Pending"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>E("cert"),disabled:h||!c?.certExists,children:"Download Cert"}),(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>E("csr"),disabled:h||!c?.csrExists,children:"Download CSR"})]})]}),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-background/40 p-3 text-xs text-text-muted",children:(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_1fr]",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Subject"}),(0,d.jsx)("span",{className:"font-mono break-all","data-i18n-skip":"true",children:c?.subject||"-"}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Issuer"}),(0,d.jsx)("span",{className:"font-mono break-all","data-i18n-skip":"true",children:c?.issuer||"-"}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Valid until"}),(0,d.jsx)("span",{"data-i18n-skip":"true",children:c?.notAfter?new Date(c.notAfter).toLocaleString():"-"}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Type"}),(0,d.jsx)("span",{children:c?.isSelfSigned===!1?"Externally signed CA / intermediate":"Self-signed or generated CA"})]})}),a&&(0,d.jsx)("div",{className:"rounded-lg border border-yellow-500/30 bg-yellow-500/10 p-3 text-xs text-yellow-700 dark:text-yellow-300",children:"Stop and restart MITM after replacing the Root CA. Existing TLS cache/process will keep using the old CA until restart."}),(0,d.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 bg-surface/40 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"1. Upload cert + private key"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Use this when you already have a CA certificate and matching private key."})]}),(0,d.jsx)("label",{className:"text-xs font-medium text-text-main",children:"CA certificate (.crt/.pem)"}),(0,d.jsx)("input",{type:"file",accept:".crt,.pem,.cer",onChange:a=>o(a.target.files?.[0]||null),className:"text-xs text-text-muted"}),(0,d.jsx)("label",{className:"text-xs font-medium text-text-main",children:"Private key (.key/.pem)"}),(0,d.jsx)("input",{type:"file",accept:".key,.pem",onChange:a=>q(a.target.files?.[0]||null),className:"text-xs text-text-muted"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:B,loading:h,disabled:h,children:"Upload Cert + Key"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 bg-surface/40 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"2. Generate CSR, sign externally"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Generate CSR here, sign it on your CA server with CA:true/keyCertSign, then upload the signed certificate."})]}),(0,d.jsx)(f.pd,{value:t,onChange:a=>u(a.target.value),placeholder:"Common Name"}),(0,d.jsx)(f.pd,{value:v,onChange:a=>w(a.target.value),placeholder:"Organization"}),(0,d.jsx)(f.pd,{value:x,onChange:a=>y(a.target.value),placeholder:"Country, e.g. VN",maxLength:2}),(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:C,loading:h,disabled:h,children:"Generate CSR"}),(0,d.jsx)("label",{className:"text-xs font-medium text-text-main",children:"Signed CA certificate from CA server"}),(0,d.jsx)("input",{type:"file",accept:".crt,.pem,.cer",onChange:a=>s(a.target.files?.[0]||null),className:"text-xs text-text-muted"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:D,loading:h,disabled:h||!G,children:"Upload Signed Cert"})]})]}),l&&(0,d.jsx)("div",{className:"rounded border border-green-500/20 bg-green-500/10 px-3 py-2 text-xs text-green-600 dark:text-green-400",children:l}),j&&(0,d.jsx)("div",{className:"rounded border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-600 dark:text-red-400",children:j})]})})}},62911:(a,b,c)=>{c.d(b,{dM:()=>e,wn:()=>d});let d={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["gemini-3-flash-agent","gemini-3.5-flash-low","gemini-pro-agent","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],defaultModels:[{id:"gemini-3-flash-agent",name:"Gemini 3.5 Flash (High) / Default",alias:"gemini-3-flash-agent"},{id:"gemini-3.5-flash-low",name:"Gemini 3.5 Flash (Medium)",alias:"gemini-3.5-flash-low"},{id:"gemini-pro-agent",name:"Gemini 3.1 Pro (High)",alias:"gemini-pro-agent"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro (Low)",alias:"gemini-3.1-pro-low"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Thinking)",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 (Thinking)",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT-OSS 120B (Medium)",alias:"gpt-oss-120b-medium"},{id:"gemini-3-flash",name:"Gemini 3 Flash (Command)",alias:"gemini-3-flash"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot IDE with MITM",configType:"mitm",mitmDomain:"api.individual.githubcopilot.com",modelAliases:["gpt-4o-mini","claude-haiku-4.5","gpt-4o","gpt-5-mini"],defaultModels:[{id:"gpt-4o",name:"GPT-4o",alias:"gpt-4o"},{id:"gpt-4.1",name:"GPT-4.1",alias:"gpt-4.1"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-sonnet-4",name:"Claude Sonnet 4",alias:"claude-sonnet-4"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"simple-task",name:"Qwen3 Coder Next",alias:"simple-task"}]}},e={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"custom"},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
34
|
+
id = "${I||"cc/claude-opus-4-7"}"`},{filename:"~/.config/jcode/provider-bluerouter.env",content:`JCODE_9ROUTER_API_KEY="${v}"`}])})]})}let M="http://localhost:20128";function N({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>a?.[0]?.key||""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(M),[y,z]=(0,e.useState)(null),A=g?.isWin===!0,B=A||g?.hasCachedPassword||g?.needsSudoPassword===!1,C=g?.isAdmin!==!1;!C&&(A||g?.hasCachedPassword||g?.needsSudoPassword);let D=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),b.mitmRouterBaseUrl&&x(b.mitmRouterBaseUrl),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},[c]),E=a=>{v(null),g&&(B?F(a,""):(r(a),l(!0),t(null)))},F=async(c,d,e=!1)=>{j(!0),v(null);try{let f;if("trust-cert"===c)f=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:d})});else if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_bluerouter");f=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d,mitmRouterBaseUrl:w.trim()||M,forceKillPort443:e})})}else f=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})});if(!f.ok){let a=await f.json().catch(()=>({}));if("PORT_443_BUSY"===a.code&&a.portOwner){l(!1),z({owner:a.portOwner,password:d});return}v(a.error||`Failed to ${c} MITM server`);return}l(!1),n(""),z(null),await D()}catch(a){v(a.message||"Network error")}finally{j(!1),r(null)}},G=()=>{m.trim()?F(q,m):t("Sudo password is required")},H=g?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),H?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:g?.certExists},{label:"Trusted",ok:g?.certTrusted},{label:"Server",ok:H}].map(({label:a,ok:b})=>(0,d.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${b?"text-green-600":"text-text-muted"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:b?"check_circle":"cancel"}),a]},a))})]}),(0,d.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from Bluerouter"]}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → AI Traffic Proxy intercepts → Bluerouter → response to Antigravity/Copilot"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Router Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:M,disabled:H,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!H&&(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",list:"mitm-api-keys",value:o,onChange:a=>p(a.target.value),placeholder:b?"Enter or pick API key":"sk_bluerouter (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),a?.length>0&&(0,d.jsx)("datalist",{id:"mitm-api-keys",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.name||a.key},a.id))})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[g?.certExists&&!g?.certTrusted&&(0,d.jsxs)("button",{onClick:()=>E("trust-cert"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),H?(0,d.jsxs)("button",{onClick:()=>E("stop"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>E("start"),disabled:i||!g||A&&!C,title:A&&!C?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),H&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),u&&(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,d.jsx)("span",{children:u})]}),A&&!C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,d.jsx)("span",{children:"Administrator required — restart Bluerouter as Administrator to use MITM"})]})]})}),k&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:a=>n(a.target.value),onKeyDown:a=>{"Enter"!==a.key||i||G()}}),s&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:s})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{l(!1),n(""),t(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:G,loading:i,children:"Confirm"})]})]})}),y&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,d.jsx)("p",{children:"Port 443 is currently used by another process:"}),(0,d.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[y.owner.name," (PID ",y.owner.pid,")"]}),(0,d.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{z(null),j(!1)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:()=>{F("start",y?.password||"",!0)},loading:i,children:"Kill & Start"})]})]})})]})}var O=c(36811);function P({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,needsSudoPassword:k,isWin:l,apiKeys:m,activeProviders:n,hasActiveProviders:o,modelAliases:p={},cloudEnabled:q,onDnsChange:r}){let[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)({}),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=O.TOOL_HOSTS[a.id]??[],L=l||j||!1===k,M=(0,e.useCallback)(async b=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:b})})}catch{}},[a.id]),N=(a,b)=>{F(c=>({...c,[a]:b}))},Q=()=>{if(!h)return;let a=i?"disable":"enable";L?R(a,""):(B(a),x(!0),D(null))},R=async(b,c)=>{t(!0),v(null);try{let d=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,action:b,sudoPassword:c})}),e=await d.json();if(!d.ok)throw Error(e.error||"Failed to toggle DNS");"enable"===b&&v(`Restart ${a.name} to apply changes`),x(!1),z(""),r?.(e)}catch{}finally{t(!1),B(null)}},S=()=>{y.trim()?R(A,y):D("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),h?i?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted sm:truncate",children:["Intercept ",a.name," requests via AI Traffic Proxy"]})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[K.length>0&&(0,d.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,d.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,d.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:K.map(a=>(0,d.jsxs)("li",{children:["127.0.0.1 ",a]},a))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through Bluerouter via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:E[a.alias]||"",onChange:b=>N(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void M({...E,[c]:d})},placeholder:"provider/model-id",disabled:!i,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!i?"opacity-50 cursor-not-allowed":""}`}),E[a.alias]&&(0,d.jsx)("button",{onClick:()=>{N(a.alias,""),M({...E,[a.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{J(a.alias),H(!0)},disabled:!o||!i,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${o&&i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},a.alias))}),a.defaultModels?.length===0&&(0,d.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:items-start",children:[i?(0,d.jsxs)("button",{onClick:Q,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)("button",{onClick:Q,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:u})]})]})]})]}),w&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"!==a.key||s||S()}}),C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:C})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{x(!1),z(""),D(null)},disabled:s,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:S,loading:s,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:G,onClose:()=>H(!1),onSelect:a=>{if(!I||a.isPlaceholder)return;let b={...E,[I]:a.value};F(b),M(b)},selectedModel:I?E[I]:null,activeProviders:n,modelAliases:p,title:`Select model for ${I}`})]})}var Q=c(2116),R=c.n(Q);function S({tool:a}){return(0,d.jsx)(R(),{href:"/dashboard/mitm",className:"block",children:(0,d.jsx)(f.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}async function T(a){return a?await a.text():""}function U({serverRunning:a,onChanged:b}){let[c,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)("Blue Router Gateway Root CA"),[v,w]=(0,e.useState)("Blue Router Gateway"),[x,y]=(0,e.useState)("VN"),z=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm/root-ca");if(a.ok){let b=await a.json();g(b.rootCA||null)}}catch{}},[]),A=async(a,c)=>{i(!0),k(""),m("");try{let d=await fetch("/api/cli-tools/antigravity-mitm/root-ca",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),e=await d.json().catch(()=>({}));if(!d.ok)throw Error(e.error||"Root CA operation failed");m(c),g(e.rootCA||null),b?.(e.rootCA||null),await z()}catch(a){k(a.message||"Root CA operation failed")}finally{i(!1)}},B=async()=>{if(!n||!p)return void k("Choose both certificate and private key files");let a=await T(n),b=await T(p);await A({action:"upload-pair",certPem:a,keyPem:b},"Root CA certificate + private key imported. Restart MITM to use it.")},C=async()=>{await A({action:"generate-csr",commonName:t,organizationName:v,countryName:x},"CSR generated. Download it, sign it on your CA server, then upload the signed CA certificate.")},D=async()=>{if(!r)return void k("Choose signed CA certificate file");let a=await T(r);await A({action:"upload-signed-cert",certPem:a},"Signed Root CA certificate imported. Restart MITM to use it.")},E=async a=>{i(!0),k("");try{var b;let c=await fetch(`/api/cli-tools/antigravity-mitm/root-ca?download=${a}`);if(!c.ok){let b=await c.json().catch(()=>({}));throw Error(b.error||`Failed to download ${a}`)}await (b="csr"===a?"bluerouter-root-ca.csr":"bluerouter-root-ca.crt",c.blob().then(a=>{let d=(c.headers.get("Content-Disposition")||"").match(/filename=\"?([^\";]+)\"?/i),e=d?.[1]||b,f=URL.createObjectURL(a),g=document.createElement("a");g.href=f,g.download=e,document.body.appendChild(g),g.click(),g.remove(),URL.revokeObjectURL(f)}))}catch(b){k(b.message||`Failed to download ${a}`)}finally{i(!1)}},F=c?.certExists&&c?.keyExists,G=c?.csrExists&&c?.pendingKeyExists;return(0,d.jsx)(f.Zp,{padding:"sm",className:"border-border/60 bg-surface/60",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"workspace_premium"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Root CA"}),F?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Ready"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Missing"}),G&&(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"CSR Pending"})]}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>E("cert"),disabled:h||!c?.certExists,children:"Download Cert"}),(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>E("csr"),disabled:h||!c?.csrExists,children:"Download CSR"})]})]}),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-background/40 p-3 text-xs text-text-muted",children:(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_1fr]",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Subject"}),(0,d.jsx)("span",{className:"font-mono break-all","data-i18n-skip":"true",children:c?.subject||"-"}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Issuer"}),(0,d.jsx)("span",{className:"font-mono break-all","data-i18n-skip":"true",children:c?.issuer||"-"}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Valid until"}),(0,d.jsx)("span",{"data-i18n-skip":"true",children:c?.notAfter?new Date(c.notAfter).toLocaleString():"-"}),(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Type"}),(0,d.jsx)("span",{children:c?.isSelfSigned===!1?"Externally signed CA / intermediate":"Self-signed or generated CA"})]})}),a&&(0,d.jsx)("div",{className:"rounded-lg border border-yellow-500/30 bg-yellow-500/10 p-3 text-xs text-yellow-700 dark:text-yellow-300",children:"Stop and restart MITM after replacing the Root CA. Existing TLS cache/process will keep using the old CA until restart."}),(0,d.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 bg-surface/40 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"1. Upload cert + private key"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Use this when you already have a CA certificate and matching private key."})]}),(0,d.jsx)("label",{className:"text-xs font-medium text-text-main",children:"CA certificate (.crt/.pem)"}),(0,d.jsx)("input",{type:"file",accept:".crt,.pem,.cer",onChange:a=>o(a.target.files?.[0]||null),className:"text-xs text-text-muted"}),(0,d.jsx)("label",{className:"text-xs font-medium text-text-main",children:"Private key (.key/.pem)"}),(0,d.jsx)("input",{type:"file",accept:".key,.pem",onChange:a=>q(a.target.files?.[0]||null),className:"text-xs text-text-muted"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:B,loading:h,disabled:h,children:"Upload Cert + Key"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-border/50 bg-surface/40 p-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"2. Generate CSR, sign externally"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Generate CSR here, sign it on your CA server with CA:true/keyCertSign, then upload the signed certificate."})]}),(0,d.jsx)(f.pd,{value:t,onChange:a=>u(a.target.value),placeholder:"Common Name"}),(0,d.jsx)(f.pd,{value:v,onChange:a=>w(a.target.value),placeholder:"Organization"}),(0,d.jsx)(f.pd,{value:x,onChange:a=>y(a.target.value),placeholder:"Country, e.g. VN",maxLength:2}),(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:C,loading:h,disabled:h,children:"Generate CSR"}),(0,d.jsx)("label",{className:"text-xs font-medium text-text-main",children:"Signed CA certificate from CA server"}),(0,d.jsx)("input",{type:"file",accept:".crt,.pem,.cer",onChange:a=>s(a.target.files?.[0]||null),className:"text-xs text-text-muted"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:D,loading:h,disabled:h||!G,children:"Upload Signed Cert"})]})]}),l&&(0,d.jsx)("div",{className:"rounded border border-green-500/20 bg-green-500/10 px-3 py-2 text-xs text-green-600 dark:text-green-400",children:l}),j&&(0,d.jsx)("div",{className:"rounded border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-600 dark:text-red-400",children:j})]})})}},62911:(a,b,c)=>{c.d(b,{dM:()=>e,wn:()=>d});let d={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["gemini-3.6-flash-high","gemini-3.6-flash-medium","gemini-3.6-flash-low","gemini-3-flash-agent","gemini-3.5-flash-medium","gemini-3.5-flash-low","gemini-pro-agent","gemini-3.1-pro-low","claude-sonnet-4-6","claude-opus-4-6-thinking","gpt-oss-120b-medium","gemini-3-flash"],defaultModels:[{id:"gemini-3.6-flash-high",name:"Gemini 3.6 Flash (High) / Default",alias:"gemini-3.6-flash-high"},{id:"gemini-3.6-flash-medium",name:"Gemini 3.6 Flash (Medium)",alias:"gemini-3.6-flash-medium"},{id:"gemini-3.6-flash-low",name:"Gemini 3.6 Flash (Low)",alias:"gemini-3.6-flash-low"},{id:"gemini-3-flash-agent",name:"Gemini 3.5 Flash (High)",alias:"gemini-3-flash-agent"},{id:"gemini-3.5-flash-medium",name:"Gemini 3.5 Flash (Medium)",alias:"gemini-3.5-flash-medium"},{id:"gemini-3.5-flash-low",name:"Gemini 3.5 Flash (Low)",alias:"gemini-3.5-flash-low"},{id:"gemini-pro-agent",name:"Gemini 3.1 Pro (High)",alias:"gemini-pro-agent"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro (Low)",alias:"gemini-3.1-pro-low"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Thinking)",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 (Thinking)",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT-OSS 120B (Medium)",alias:"gpt-oss-120b-medium"},{id:"gemini-3-flash",name:"Gemini 3 Flash (Command)",alias:"gemini-3-flash"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot IDE with MITM",configType:"mitm",mitmDomain:"api.individual.githubcopilot.com",modelAliases:["gpt-4o-mini","claude-haiku-4.5","gpt-4o","gpt-5-mini"],defaultModels:[{id:"gpt-4o",name:"GPT-4o",alias:"gpt-4o"},{id:"gpt-4.1",name:"GPT-4.1",alias:"gpt-4.1"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-sonnet-4",name:"Claude Sonnet 4",alias:"claude-sonnet-4"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"simple-task",name:"Qwen3 Coder Next",alias:"simple-task"}]}},e={claude:{id:"claude",name:"Claude Code",image:"/providers/claude.png",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI / App",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"custom"},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
35
35
|
"apiBase": "{{baseUrl}}",
|
|
36
36
|
"title": "{{model}}",
|
|
37
37
|
"model": "{{model}}",
|