9router 0.2.78 → 0.2.80
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/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +40 -40
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/providers/route.js +3 -3
- package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +2 -2
- package/app/.next/server/app/callback.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +4 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.html +1 -1
- package/app/.next/server/app/dashboard/combos.rsc +4 -4
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.html +1 -1
- package/app/.next/server/app/dashboard/endpoint.rsc +4 -4
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +4 -4
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.html +1 -1
- package/app/.next/server/app/dashboard/providers/new.rsc +4 -4
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.html +1 -1
- package/app/.next/server/app/dashboard/providers.rsc +4 -4
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.html +1 -1
- package/app/.next/server/app/dashboard/translator.rsc +4 -4
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.html +1 -1
- package/app/.next/server/app/dashboard/usage.rsc +4 -4
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.html +1 -1
- package/app/.next/server/app/dashboard.rsc +4 -4
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +2 -2
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +2 -2
- package/app/.next/server/app/landing.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +3 -3
- package/app/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +40 -40
- package/app/.next/server/chunks/3110.js +2 -2
- package/app/.next/server/chunks/3990.js +3 -3
- package/app/.next/server/chunks/412.js +3 -11
- package/app/.next/server/chunks/5330.js +11 -3
- package/app/.next/server/chunks/7341.js +1 -1
- package/app/.next/server/chunks/7647.js +1 -1
- package/app/.next/server/chunks/8031.js +1 -1
- package/app/.next/server/chunks/8152.js +1 -1
- package/app/.next/server/chunks/8954.js +1 -1
- package/app/.next/server/chunks/9718.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{5497-ad7fb90ac4a481cb.js → 5497-22ff80798e3ea482.js} +2 -2
- package/app/.next/static/chunks/8729-357c4b76a239bd75.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-7b546958559f0a9d.js +1 -0
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-fb47ee60e862be6a.js +1 -0
- package/app/.next/static/chunks/{webpack-34add7e75711617f.js → webpack-79a9aedf42a631d8.js} +1 -1
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next/static/chunks/8729-fc0f92ed5e5d2411.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-738071ba2546b274.js +0 -1
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-9d8903890389d598.js +0 -1
- /package/app/.next/static/{jfmN0W_9Gk1asYjgWltrV → aAu7AvTHT43IAQeElfaSV}/_buildManifest.js +0 -0
- /package/app/.next/static/{jfmN0W_9Gk1asYjgWltrV → aAu7AvTHT43IAQeElfaSV}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5497],{98:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({label:e,options:t=[],value:s,onChange:l,placeholder:n="Select an option",error:i,hint:o,disabled:c=!1,required:d=!1,className:x,selectClassName:m,...u}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",x),children:[e&&(0,r.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,d&&(0,r.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:s,onChange:l,disabled:c,className:(0,a.cn)("w-full py-2 px-3 pr-10 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md appearance-none","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",m),...u,children:[(0,r.jsx)("option",{value:"",disabled:!0,children:n}),t.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,r.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),i&&(0,r.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),o&&!i&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},815:(e,t,s)=>{s.d(t,{default:()=>o});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497);function o({isOpen:e,onSuccess:t,onClose:s}){let[l,n]=(0,a.useState)(""),[o,c]=(0,a.useState)(""),[d,x]=(0,a.useState)(null),[m,u]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(async()=>{p(!0),x(null),f(!1);try{let e=await fetch("/api/oauth/cursor/auto-import"),t=await e.json();t.found?(n(t.accessToken),c(t.machineId),f(!0)):x(t.error||"Could not auto-detect tokens")}catch(e){x("Failed to auto-detect tokens")}finally{p(!1)}})()},[e]);let g=async()=>{if(!l.trim())return void x("Please enter an access token");if(!o.trim())return void x("Please enter a machine ID");u(!0),x(null);try{let e=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:l.trim(),machineId:o.trim()})}),r=await e.json();if(!e.ok)throw Error(r.error||"Import failed");t?.(),s()}catch(e){x(e.message)}finally{u(!1)}};return(0,r.jsx)(i.aF,{isOpen:e,title:"Connect Cursor IDE",onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!h&&(0,r.jsxs)(r.Fragment,{children:[b&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),!b&&!d&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{value:l,onChange:e=>n(e.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(i.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),d&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:d})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:g,fullWidth:!0,disabled:m||!l.trim()||!o.trim(),children:m?"Importing...":"Import Token"}),(0,r.jsx)(i.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}o.propTypes={isOpen:n().bool.isRequired,onSuccess:n().func,onClose:n().func.isRequired}},882:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497),o=s(1059);function c({isOpen:e,provider:t,providerInfo:s,onSuccess:l,onClose:n}){let[c,d]=(0,a.useState)("waiting"),[x,m]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1),[j,v]=(0,a.useState)(null),[N,y]=(0,a.useState)(!1),k=(0,a.useRef)(null),{copied:w,copy:C}=(0,o.C)(),[S,T]=(0,a.useState)(!1),[O,$]=(0,a.useState)("/callback?code=..."),L=(0,a.useRef)(!1);(0,a.useEffect)(()=>{T("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),$(`${window.location.origin}/callback?code=...`)},[]);let R=(0,a.useCallback)(async(e,s)=>{if(x)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:x.redirectUri,codeVerifier:x.codeVerifier,state:s})}),a=await r.json();if(!r.ok)throw Error(a.error);d("success"),l?.()}catch(e){b(e.message),d("error")}},[x,t,l]),z=(0,a.useCallback)(async(e,s,r,a)=>{y(!0);for(let n=0;n<60;n++){await new Promise(e=>setTimeout(e,1e3*r));try{let n=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:s,extraData:a})}),i=await n.json();if(i.success){d("success"),y(!1),l?.();return}if("expired_token"===i.error||"access_denied"===i.error)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(r=Math.min(r+5,30))}catch(e){b(e.message),d("error"),y(!1);return}}b("Authorization timeout"),d("error"),y(!1)},[t,l]),E=(0,a.useCallback)(async()=>{if(t)try{let e;if(b(null),"github"===t||"qwen"===t||"kiro"===t){g(!0),d("waiting");let e=await fetch(`/api/oauth/${t}/device-code`),s=await e.json();if(!e.ok)throw Error(s.error);v(s);let r=s.verification_uri_complete||s.verification_uri;r&&window.open(r,"_blank");let a="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret}:null;z(s.device_code,s.codeVerifier,s.interval||5,a);return}if("codex"===t)e="http://localhost:1455/auth/callback";else{let t=window.location.port||("https:"===window.location.protocol?"443":"80");e=`http://localhost:${t}/callback`}let s=await fetch(`/api/oauth/${t}/authorize?redirect_uri=${encodeURIComponent(e)}`),r=await s.json();if(!s.ok)throw Error(r.error);m({...r,redirectUri:e}),"codex"!==t&&S?(d("waiting"),k.current=window.open(r.authUrl,"oauth_popup","width=600,height=700"),k.current||d("input")):(d("input"),window.open(r.authUrl,"_blank"))}catch(e){b(e.message),d("error")}},[t,S,z]);(0,a.useEffect)(()=>{e&&t&&(m(null),h(""),b(null),g(!1),v(null),y(!1),E())},[e,t,E]),(0,a.useEffect)(()=>{let e;if(!x)return;L.current=!1;let t=async e=>{if(L.current)return;let{code:t,state:s,error:r,errorDescription:a}=e;if(r){L.current=!0,b(a||r),d("error");return}t&&(L.current=!0,await R(t,s))},s=e=>{e.origin===window.location.origin&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",s);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let s=JSON.parse(e.newValue);t(s),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let s=JSON.parse(e);s.timestamp&&Date.now()-s.timestamp<3e4&&(t(s),localStorage.removeItem("oauth_callback"))}}catch{}return()=>{window.removeEventListener("message",s),window.removeEventListener("storage",r),e&&e.close()}},[x,R]);let I=async()=>{try{b(null);let e=new URL(u),t=e.searchParams.get("code"),s=e.searchParams.get("state"),r=e.searchParams.get("error");if(r)throw Error(e.searchParams.get("error_description")||r);if(!t)throw Error("No authorization code found in URL");await R(t,s)}catch(e){b(e.message),d("error")}};return t&&s?(0,r.jsx)(i.aF,{isOpen:e,title:`Connect ${s.name}`,onClose:n,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===c&&!f&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,r.jsx)(i.$n,{variant:"ghost",onClick:()=>d("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===c&&f&&j&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:j.verification_uri}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"verify_url"===w?"check":"content_copy",onClick:()=>C(j.verification_uri,"verify_url")})]})]}),(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:j.user_code}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"user_code"===w?"check":"content_copy",onClick:()=>C(j.user_code,"user_code")})]})]})]}),N&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===c&&!f&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:x?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===w?"check":"content_copy",onClick:()=>C(x?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,r.jsx)(i.pd,{value:u,onChange:e=>h(e.target.value),placeholder:O,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:I,fullWidth:!0,disabled:!u,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",s.name," account has been connected."]}),(0,r.jsx)(i.$n,{onClick:n,fullWidth:!0,children:"Done"})]}),"error"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:p}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:E,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}c.propTypes={isOpen:n().bool.isRequired,provider:n().string,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},1059:(e,t,s)=>{s.d(t,{C:()=>a});var r=s(2115);function a(e=2e3){let[t,s]=(0,r.useState)(null),l=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{navigator.clipboard.writeText(t),s(r),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},1127:(e,t,s)=>{s.d(t,{ConfirmModal:()=>o,default:()=>i});var r=s(5155),a=s(2115),l=s(1474),n=s(2542);function i({isOpen:e,onClose:t,title:s,children:n,footer:i,size:o="md",closeOnOverlay:c=!0,showCloseButton:d=!0,className:x}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:c?t:void 0}),(0,r.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[o],x),children:[(s||d)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),s&&(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})]}),d&&(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:n}),i&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:i})]})]}):null}function o({isOpen:e,onClose:t,onConfirm:s,title:a="Confirm",message:l,confirmText:o="Confirm",cancelText:c="Cancel",variant:d="danger",loading:x=!1}){return(0,r.jsx)(i,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{variant:"ghost",onClick:t,disabled:x,children:c}),(0,r.jsx)(n.default,{variant:d,onClick:s,loading:x,children:o})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:l})})}},1450:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(4051),l=s.n(a),n=s(8587);function i({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,r.jsx)(n.default,{variant:"card"})}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}i.propTypes={children:l().node.isRequired}},1474:(e,t,s)=>{s.d(t,{cn:()=>r});function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},1500:(e,t,s)=>{s.d(t,{default:()=>o});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497);function o({isOpen:e,onMethodSelect:t,onClose:s}){let[l,n]=(0,a.useState)(null),[o,c]=(0,a.useState)(""),[d,x]=(0,a.useState)("us-east-1"),[m,u]=(0,a.useState)(""),[h,p]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"import"===l&&e&&(async()=>{j(!0),p(null),N(!1);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(u(t.refreshToken),N(!0)):p(t.error||"Could not auto-detect token")}catch(e){p("Failed to auto-detect token")}finally{j(!1)}})()},[l,e]);let y=e=>{n(e),p(null)},k=()=>{n(null),p(null)},w=async()=>{if(!m.trim())return void p("Please enter a refresh token");f(!0),p(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:m.trim()})}),t=await e.json();if(!e.ok)throw Error(t.error||"Import failed");s()}catch(e){p(e.message)}finally{f(!1)}},C=e=>{t("social",{provider:e})};return(0,r.jsx)(i.aF,{isOpen:e,title:"Connect Kiro",onClose:s,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!l&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,r.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,r.jsx)("button",{onClick:()=>y("idc"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,r.jsx)("button",{onClick:()=>y("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>y("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>y("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(i.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,r.jsx)(i.pd,{value:d,onChange:e=>x(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),h&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:h}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>{o.trim()?t("idc",{startUrl:o.trim(),region:d}):p("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>C("google"),fullWidth:!0,children:"Continue with Google"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>C("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[g&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!g&&(0,r.jsxs)(r.Fragment,{children:[v&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!h&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(i.pd,{value:m,onChange:e=>u(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),h&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:h})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:w,fullWidth:!0,disabled:b||!m.trim(),children:b?"Importing...":"Import Token"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}o.propTypes={isOpen:n().bool.isRequired,onMethodSelect:n().func.isRequired,onClose:n().func.isRequired}},1620:(e,t,s)=>{s.d(t,{D:()=>o});var r=s(2115),a=s(85);function l(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function n(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function i(){return!1}function o(){let{theme:e,setTheme:t,toggleTheme:s,initTheme:o}=(0,a.A)(),c=(0,r.useSyncExternalStore)(l,n,i);(0,r.useEffect)(()=>{o()},[o]),(0,r.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>o();return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[e,o]);let d="dark"===e||"system"===e&&c;return{theme:e,setTheme:t,toggleTheme:s,isDark:d}}},1910:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({label:e,type:t="text",placeholder:s,value:l,onChange:n,error:i,hint:o,icon:c,disabled:d=!1,required:x=!1,className:m,inputClassName:u,...h}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",m),children:[e&&(0,r.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,x&&(0,r.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[c&&(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c})}),(0,r.jsx)("input",{type:t,placeholder:s,value:l,onChange:n,disabled:d,className:(0,a.cn)("w-full py-2 px-3 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md","placeholder-text-muted/60","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all shadow-inner disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",u),...h})]}),i&&(0,r.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),o&&!i&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},2173:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(5155),a=s(8500),l=s.n(a),n=s(620);let i=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],c=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function d(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:n.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:c.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",n.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},2542:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(1474);let l={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},n={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function i({children:e,variant:t="primary",size:s="md",icon:i,iconRight:o,disabled:c=!1,loading:d=!1,fullWidth:x=!1,className:m,...u}){return(0,r.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[s],x&&"w-full",m),disabled:c||d,...u,children:[d?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):i?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i}):null,e,o&&!d&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o})]})}},2622:(e,t,s)=>{s.d(t,{default:()=>f});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(8500),o=s.n(i),c=s(3321),d=s(1474),x=s(620),m=s(2542),u=s(1127);let h=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],p=[{href:"/dashboard/translator",label:"Translator",icon:"translate"}],b=[{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function f({onClose:e}){let t=(0,c.usePathname)(),[s,l]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),[j,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>v(e?.enableRequestLogs===!0)).catch(()=>{})},[]);let N=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e),y=async()=>{i(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(e){}i(!1),l(!1),g(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:"flex w-72 flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-colors duration-300",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-6 pt-5 pb-2",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),(0,r.jsx)("div",{className:"px-6 py-4",children:(0,r.jsxs)(o(),{href:"/dashboard",className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-9 rounded bg-linear-to-br from-[#f97815] to-[#c2590a]",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-white text-[20px]",children:"hub"})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:x.vQ.name}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["v",x.vQ.version]})]})]})}),(0,r.jsxs)("nav",{className:"flex-1 px-4 py-2 space-y-1 overflow-y-auto custom-scrollbar",children:[h.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,d.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",N(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",N(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t.label})]},t.href)),j&&(0,r.jsxs)("div",{className:"pt-4 mt-2",children:[(0,r.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Debug"}),p.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,d.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",N(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",N(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t.label})]},t.href))]}),(0,r.jsxs)("div",{className:"pt-4 mt-2",children:[(0,r.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),b.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,d.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",N(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",N(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t.label})]},t.href))]})]}),(0,r.jsxs)("div",{className:"p-3 border-t border-black/5 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]}),(0,r.jsx)(m.default,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>l(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"})]})]}),(0,r.jsx)(u.ConfirmModal,{isOpen:s,onClose:()=>l(!1),onConfirm:y,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:n}),f&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center p-8",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,r.jsx)(m.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}f.propTypes={onClose:n().func}},2899:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(882),o=s(1500),c=s(4230);function d({isOpen:e,providerInfo:t,onSuccess:s,onClose:l}){let[n,d]=(0,a.useState)(null),[x,m]=(0,a.useState)(null),[u,h]=(0,a.useState)(null),p=(0,a.useCallback)((e,t)=>{"builder-id"===e?d("builder-id"):"idc"===e?(d("idc"),h(t)):"social"===e?(d("social"),m(t.provider)):"import"===e&&s?.()},[s]),b=()=>{d(null),m(null),h(null)};return n?"builder-id"===n||"idc"===n?(0,r.jsx)(i.default,{isOpen:e,provider:"kiro",providerInfo:t,onSuccess:()=>{d(null),h(null),s?.()},onClose:b,idcConfig:u}):"social"===n&&x?(0,r.jsx)(c.default,{isOpen:e,provider:x,onSuccess:()=>{d(null),m(null),s?.()},onClose:b}):null:(0,r.jsx)(o.default,{isOpen:e,onMethodSelect:p,onClose:l})}d.propTypes={isOpen:n().bool.isRequired,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},2908:(e,t,s)=>{s.d(t,{default:()=>x});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(1127),o=s(8777),c=s(2679);let d=[...Object.keys(c.zN),...Object.keys(c.fg)];function x({isOpen:e,onClose:t,onSelect:s,selectedModel:l,activeProviders:n=[],title:x="Select Model",modelAliases:m={}}){let[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)([]),[f,g]=(0,a.useState)([]),j=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();b(t.combos||[])}catch(e){console.error("Error fetching combos:",e),b([])}};(0,a.useEffect)(()=>{e&&j()},[e]);let v=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();g(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),g([])}};(0,a.useEffect)(()=>{e&&v()},[e]);let N=(0,a.useMemo)(()=>({...c.zN,...c.fg}),[]),y=(0,a.useMemo)(()=>{let e={};return[...new Set([...n.map(e=>e.provider)])].sort((e,t)=>{let s=d.indexOf(e),r=d.indexOf(t);return(-1===s?999:s)-(-1===r?999:r)}).forEach(t=>{let s=o.Xg[t]||t,r=N[t]||{name:t,color:"#666"},a=(0,c.mq)(t)||(0,c.gb)(t);if(r.passthroughModels){let a=Object.entries(m).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:t}));if(a.length>0){let l=f.find(e=>e.id===t),n=l?.name||r.name;e[t]={name:n,alias:s,color:r.color,models:a}}}else if(a){let s=f.find(e=>e.id===t),a=s?.name||r.name,l=Object.entries(m).filter(([,e])=>e.startsWith(`${t}/`)).map(([e,s])=>({id:s.replace(`${t}/`,""),name:e,value:s}));l.length>0&&(e[t]={name:a,alias:s?.prefix||t,color:r.color,models:l,isCustom:!0,hasModels:!0})}else{let a=(0,o.KC)(t);a.length>0&&(e[t]={name:r.name,alias:s,color:r.color,models:a.map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`}))})}}),e},[n,m,N,f]),k=(0,a.useMemo)(()=>{if(!u.trim())return p;let e=u.toLowerCase();return p.filter(t=>t.name.toLowerCase().includes(e))},[p,u]),w=(0,a.useMemo)(()=>{if(!u.trim())return y;let e=u.toLowerCase(),t={};return Object.entries(y).forEach(([s,r])=>{let a=r.models.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)),l=r.name.toLowerCase().includes(e);(a.length>0||l)&&(t[s]={...r,models:a})}),t},[y,u]),C=e=>{s(e),t(),h("")};return(0,r.jsxs)(i.default,{isOpen:e,onClose:()=>{t(),h("")},title:x,size:"md",className:"p-4!",children:[(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,r.jsx)("input",{type:"text",placeholder:"Search...",value:u,onChange:e=>h(e.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,r.jsxs)("div",{className:"max-h-[300px] overflow-y-auto space-y-3",children:[k.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",k.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:k.map(e=>{let t=l===e.name;return(0,r.jsx)("button",{onClick:()=>C({id:e.name,name:e.name,value:e.name}),className:`
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5497],{98:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({label:e,options:t=[],value:s,onChange:l,placeholder:n="Select an option",error:i,hint:o,disabled:c=!1,required:d=!1,className:x,selectClassName:m,...u}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",x),children:[e&&(0,r.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,d&&(0,r.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("select",{value:s,onChange:l,disabled:c,className:(0,a.cn)("w-full py-2 px-3 pr-10 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md appearance-none","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",m),...u,children:[(0,r.jsx)("option",{value:"",disabled:!0,children:n}),t.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,r.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),i&&(0,r.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),o&&!i&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},815:(e,t,s)=>{s.d(t,{default:()=>o});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497);function o({isOpen:e,onSuccess:t,onClose:s}){let[l,n]=(0,a.useState)(""),[o,c]=(0,a.useState)(""),[d,x]=(0,a.useState)(null),[m,u]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(async()=>{p(!0),x(null),f(!1);try{let e=await fetch("/api/oauth/cursor/auto-import"),t=await e.json();t.found?(n(t.accessToken),c(t.machineId),f(!0)):x(t.error||"Could not auto-detect tokens")}catch(e){x("Failed to auto-detect tokens")}finally{p(!1)}})()},[e]);let g=async()=>{if(!l.trim())return void x("Please enter an access token");if(!o.trim())return void x("Please enter a machine ID");u(!0),x(null);try{let e=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:l.trim(),machineId:o.trim()})}),r=await e.json();if(!e.ok)throw Error(r.error||"Import failed");t?.(),s()}catch(e){x(e.message)}finally{u(!1)}};return(0,r.jsx)(i.aF,{isOpen:e,title:"Connect Cursor IDE",onClose:s,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[h&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!h&&(0,r.jsxs)(r.Fragment,{children:[b&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),!b&&!d&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)("textarea",{value:l,onChange:e=>n(e.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(i.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),d&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:d})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:g,fullWidth:!0,disabled:m||!l.trim()||!o.trim(),children:m?"Importing...":"Import Token"}),(0,r.jsx)(i.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}o.propTypes={isOpen:n().bool.isRequired,onSuccess:n().func,onClose:n().func.isRequired}},882:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497),o=s(1059);function c({isOpen:e,provider:t,providerInfo:s,onSuccess:l,onClose:n}){let[c,d]=(0,a.useState)("waiting"),[x,m]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1),[j,y]=(0,a.useState)(null),[N,v]=(0,a.useState)(!1),k=(0,a.useRef)(null),{copied:w,copy:C}=(0,o.C)(),[S,T]=(0,a.useState)(!1),[O,$]=(0,a.useState)("/callback?code=..."),I=(0,a.useRef)(!1);(0,a.useEffect)(()=>{T("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),$(`${window.location.origin}/callback?code=...`)},[]);let M=(0,a.useCallback)(async(e,s)=>{if(x)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:x.redirectUri,codeVerifier:x.codeVerifier,state:s})}),a=await r.json();if(!r.ok)throw Error(a.error);d("success"),l?.()}catch(e){b(e.message),d("error")}},[x,t,l]),E=(0,a.useCallback)(async(e,s,r,a)=>{v(!0);for(let n=0;n<60;n++){await new Promise(e=>setTimeout(e,1e3*r));try{let n=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:s,extraData:a})}),i=await n.json();if(i.success){d("success"),v(!1),l?.();return}if("expired_token"===i.error||"access_denied"===i.error)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(r=Math.min(r+5,30))}catch(e){b(e.message),d("error"),v(!1);return}}b("Authorization timeout"),d("error"),v(!1)},[t,l]),L=(0,a.useCallback)(async()=>{if(t)try{let e;if(b(null),"github"===t||"qwen"===t||"kiro"===t){g(!0),d("waiting");let e=await fetch(`/api/oauth/${t}/device-code`),s=await e.json();if(!e.ok)throw Error(s.error);y(s);let r=s.verification_uri_complete||s.verification_uri;r&&window.open(r,"_blank");let a="kiro"===t?{_clientId:s._clientId,_clientSecret:s._clientSecret}:null;E(s.device_code,s.codeVerifier,s.interval||5,a);return}if("codex"===t)e="http://localhost:1455/auth/callback";else{let t=window.location.port||("https:"===window.location.protocol?"443":"80");e=`http://localhost:${t}/callback`}let s=await fetch(`/api/oauth/${t}/authorize?redirect_uri=${encodeURIComponent(e)}`),r=await s.json();if(!s.ok)throw Error(r.error);m({...r,redirectUri:e}),"codex"!==t&&S?(d("waiting"),k.current=window.open(r.authUrl,"oauth_popup","width=600,height=700"),k.current||d("input")):(d("input"),window.open(r.authUrl,"_blank"))}catch(e){b(e.message),d("error")}},[t,S,E]);(0,a.useEffect)(()=>{e&&t&&(m(null),h(""),b(null),g(!1),y(null),v(!1),L())},[e,t,L]),(0,a.useEffect)(()=>{let e;if(!x)return;I.current=!1;let t=async e=>{if(I.current)return;let{code:t,state:s,error:r,errorDescription:a}=e;if(r){I.current=!0,b(a||r),d("error");return}t&&(I.current=!0,await M(t,s))},s=e=>{e.origin===window.location.origin&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",s);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let s=JSON.parse(e.newValue);t(s),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let s=JSON.parse(e);s.timestamp&&Date.now()-s.timestamp<3e4&&(t(s),localStorage.removeItem("oauth_callback"))}}catch{}return()=>{window.removeEventListener("message",s),window.removeEventListener("storage",r),e&&e.close()}},[x,M]);let R=async()=>{try{b(null);let e=new URL(u),t=e.searchParams.get("code"),s=e.searchParams.get("state"),r=e.searchParams.get("error");if(r)throw Error(e.searchParams.get("error_description")||r);if(!t)throw Error("No authorization code found in URL");await M(t,s)}catch(e){b(e.message),d("error")}};return t&&s?(0,r.jsx)(i.aF,{isOpen:e,title:`Connect ${s.name}`,onClose:n,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===c&&!f&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,r.jsx)(i.$n,{variant:"ghost",onClick:()=>d("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===c&&f&&j&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:j.verification_uri}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"verify_url"===w?"check":"content_copy",onClick:()=>C(j.verification_uri,"verify_url")})]})]}),(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:j.user_code}),(0,r.jsx)(i.$n,{size:"sm",variant:"ghost",icon:"user_code"===w?"check":"content_copy",onClick:()=>C(j.user_code,"user_code")})]})]})]}),N&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===c&&!f&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:x?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===w?"check":"content_copy",onClick:()=>C(x?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,r.jsx)(i.pd,{value:u,onChange:e=>h(e.target.value),placeholder:O,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:R,fullWidth:!0,disabled:!u,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",s.name," account has been connected."]}),(0,r.jsx)(i.$n,{onClick:n,fullWidth:!0,children:"Done"})]}),"error"===c&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:p}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:L,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}c.propTypes={isOpen:n().bool.isRequired,provider:n().string,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},1059:(e,t,s)=>{s.d(t,{C:()=>a});var r=s(2115);function a(e=2e3){let[t,s]=(0,r.useState)(null),l=(0,r.useRef)(null);return{copied:t,copy:(0,r.useCallback)((t,r="default")=>{navigator.clipboard.writeText(t),s(r),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(null)},e)},[e])}}},1127:(e,t,s)=>{s.d(t,{ConfirmModal:()=>o,default:()=>i});var r=s(5155),a=s(2115),l=s(1474),n=s(2542);function i({isOpen:e,onClose:t,title:s,children:n,footer:i,size:o="md",closeOnOverlay:c=!0,showCloseButton:d=!0,className:x}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:c?t:void 0}),(0,r.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[o],x),children:[(s||d)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),s&&(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})]}),d&&(0,r.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:n}),i&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:i})]})]}):null}function o({isOpen:e,onClose:t,onConfirm:s,title:a="Confirm",message:l,confirmText:o="Confirm",cancelText:c="Cancel",variant:d="danger",loading:x=!1}){return(0,r.jsx)(i,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.default,{variant:"ghost",onClick:t,disabled:x,children:c}),(0,r.jsx)(n.default,{variant:d,onClick:s,loading:x,children:o})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:l})})}},1450:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(4051),l=s.n(a),n=s(8587);function i({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,r.jsx)(n.default,{variant:"card"})}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}i.propTypes={children:l().node.isRequired}},1474:(e,t,s)=>{s.d(t,{cn:()=>r});function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},1500:(e,t,s)=>{s.d(t,{default:()=>o});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497);function o({isOpen:e,onMethodSelect:t,onClose:s}){let[l,n]=(0,a.useState)(null),[o,c]=(0,a.useState)(""),[d,x]=(0,a.useState)("us-east-1"),[m,u]=(0,a.useState)(""),[h,p]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[y,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"import"===l&&e&&(async()=>{j(!0),p(null),N(!1);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(u(t.refreshToken),N(!0)):p(t.error||"Could not auto-detect token")}catch(e){p("Failed to auto-detect token")}finally{j(!1)}})()},[l,e]);let v=e=>{n(e),p(null)},k=()=>{n(null),p(null)},w=async()=>{if(!m.trim())return void p("Please enter a refresh token");f(!0),p(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:m.trim()})}),t=await e.json();if(!e.ok)throw Error(t.error||"Import failed");s()}catch(e){p(e.message)}finally{f(!1)}},C=e=>{t("social",{provider:e})};return(0,r.jsx)(i.aF,{isOpen:e,title:"Connect Kiro",onClose:s,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!l&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,r.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,r.jsx)("button",{onClick:()=>v("idc"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,r.jsx)("button",{onClick:()=>v("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>v("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,r.jsx)("button",{onClick:()=>v("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(i.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,r.jsx)(i.pd,{value:d,onChange:e=>x(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),h&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:h}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>{o.trim()?t("idc",{startUrl:o.trim(),region:d}):p("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>C("google"),fullWidth:!0,children:"Continue with Google"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,r.jsxs)("div",{className:"flex-1 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,r.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>C("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===l&&(0,r.jsxs)("div",{className:"space-y-4",children:[g&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!g&&(0,r.jsxs)(r.Fragment,{children:[y&&(0,r.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,r.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!y&&!h&&(0,r.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,r.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsx)(i.pd,{value:m,onChange:e=>u(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),h&&(0,r.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,r.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:h})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:w,fullWidth:!0,disabled:b||!m.trim(),children:b?"Importing...":"Import Token"}),(0,r.jsx)(i.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}o.propTypes={isOpen:n().bool.isRequired,onMethodSelect:n().func.isRequired,onClose:n().func.isRequired}},1620:(e,t,s)=>{s.d(t,{D:()=>o});var r=s(2115),a=s(85);function l(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function n(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function i(){return!1}function o(){let{theme:e,setTheme:t,toggleTheme:s,initTheme:o}=(0,a.A)(),c=(0,r.useSyncExternalStore)(l,n,i);(0,r.useEffect)(()=>{o()},[o]),(0,r.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>o();return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[e,o]);let d="dark"===e||"system"===e&&c;return{theme:e,setTheme:t,toggleTheme:s,isDark:d}}},1910:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({label:e,type:t="text",placeholder:s,value:l,onChange:n,error:i,hint:o,icon:c,disabled:d=!1,required:x=!1,className:m,inputClassName:u,...h}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",m),children:[e&&(0,r.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,x&&(0,r.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,r.jsxs)("div",{className:"relative",children:[c&&(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c})}),(0,r.jsx)("input",{type:t,placeholder:s,value:l,onChange:n,disabled:d,className:(0,a.cn)("w-full py-2 px-3 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md","placeholder-text-muted/60","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all shadow-inner disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",i?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",u),...h})]}),i&&(0,r.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),i]}),o&&!i&&(0,r.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},2173:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(5155),a=s(8500),l=s.n(a),n=s(620);let i=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],c=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function d(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:n.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:i.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:c.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",n.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},2542:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(1474);let l={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},n={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function i({children:e,variant:t="primary",size:s="md",icon:i,iconRight:o,disabled:c=!1,loading:d=!1,fullWidth:x=!1,className:m,...u}){return(0,r.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],n[s],x&&"w-full",m),disabled:c||d,...u,children:[d?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):i?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:i}):null,e,o&&!d&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o})]})}},2622:(e,t,s)=>{s.d(t,{default:()=>f});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(8500),o=s.n(i),c=s(3321),d=s(1474),x=s(620),m=s(2542),u=s(1127);let h=[{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combos",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],p=[{href:"/dashboard/translator",label:"Translator",icon:"translate"}],b=[{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function f({onClose:e}){let t=(0,c.usePathname)(),[s,l]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>y(e?.enableRequestLogs===!0)).catch(()=>{})},[]);let N=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e),v=async()=>{i(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(e){}i(!1),l(!1),g(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:"flex w-72 flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-colors duration-300",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-6 pt-5 pb-2",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),(0,r.jsx)("div",{className:"px-6 py-4",children:(0,r.jsxs)(o(),{href:"/dashboard",className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-9 rounded bg-linear-to-br from-[#f97815] to-[#c2590a]",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-white text-[20px]",children:"hub"})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:x.vQ.name}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["v",x.vQ.version]})]})]})}),(0,r.jsxs)("nav",{className:"flex-1 px-4 py-2 space-y-1 overflow-y-auto custom-scrollbar",children:[h.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,d.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",N(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",N(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t.label})]},t.href)),j&&(0,r.jsxs)("div",{className:"pt-4 mt-2",children:[(0,r.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"Debug"}),p.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,d.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",N(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",N(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t.label})]},t.href))]}),(0,r.jsxs)("div",{className:"pt-4 mt-2",children:[(0,r.jsx)("p",{className:"px-4 text-xs font-semibold text-text-muted/60 uppercase tracking-wider mb-2",children:"System"}),b.map(t=>(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,d.cn)("flex items-center gap-3 px-4 py-2 rounded-lg transition-all group",N(t.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,r.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",N(t.href)?"fill-1":"group-hover:text-primary transition-colors"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-medium",children:t.label})]},t.href))]})]}),(0,r.jsxs)("div",{className:"p-3 border-t border-black/5 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,r.jsx)("div",{className:"flex flex-col",children:(0,r.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]}),(0,r.jsx)(m.default,{variant:"outline",fullWidth:!0,icon:"power_settings_new",onClick:()=>l(!0),className:"text-red-500 border-red-200 hover:bg-red-50 hover:border-red-300",children:"Shutdown"})]})]}),(0,r.jsx)(u.ConfirmModal,{isOpen:s,onClose:()=>l(!1),onConfirm:v,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:n}),f&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"text-center p-8",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,r.jsx)(m.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}f.propTypes={onClose:n().func}},2899:(e,t,s)=>{s.d(t,{default:()=>d});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(882),o=s(1500),c=s(4230);function d({isOpen:e,providerInfo:t,onSuccess:s,onClose:l}){let[n,d]=(0,a.useState)(null),[x,m]=(0,a.useState)(null),[u,h]=(0,a.useState)(null),p=(0,a.useCallback)((e,t)=>{"builder-id"===e?d("builder-id"):"idc"===e?(d("idc"),h(t)):"social"===e?(d("social"),m(t.provider)):"import"===e&&s?.()},[s]),b=()=>{d(null),m(null),h(null)};return n?"builder-id"===n||"idc"===n?(0,r.jsx)(i.default,{isOpen:e,provider:"kiro",providerInfo:t,onSuccess:()=>{d(null),h(null),s?.()},onClose:b,idcConfig:u}):"social"===n&&x?(0,r.jsx)(c.default,{isOpen:e,provider:x,onSuccess:()=>{d(null),m(null),s?.()},onClose:b}):null:(0,r.jsx)(o.default,{isOpen:e,onMethodSelect:p,onClose:l})}d.propTypes={isOpen:n().bool.isRequired,providerInfo:n().shape({name:n().string}),onSuccess:n().func,onClose:n().func.isRequired}},2908:(e,t,s)=>{s.d(t,{default:()=>x});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(1127),o=s(8777),c=s(2679);let d=[...Object.keys(c.zN),...Object.keys(c.fg)];function x({isOpen:e,onClose:t,onSelect:s,selectedModel:l,activeProviders:n=[],title:x="Select Model",modelAliases:m={}}){let[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)([]),[f,g]=(0,a.useState)([]),j=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();b(t.combos||[])}catch(e){console.error("Error fetching combos:",e),b([])}};(0,a.useEffect)(()=>{e&&j()},[e]);let y=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();g(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),g([])}};(0,a.useEffect)(()=>{e&&y()},[e]);let N=(0,a.useMemo)(()=>({...c.zN,...c.fg}),[]),v=(0,a.useMemo)(()=>{let e={};return[...new Set([...n.map(e=>e.provider)])].sort((e,t)=>{let s=d.indexOf(e),r=d.indexOf(t);return(-1===s?999:s)-(-1===r?999:r)}).forEach(t=>{let s=o.Xg[t]||t,r=N[t]||{name:t,color:"#666"},a=(0,c.mq)(t)||(0,c.gb)(t);if(r.passthroughModels){let a=Object.entries(m).filter(([,e])=>e.startsWith(`${s}/`)).map(([e,t])=>({id:t.replace(`${s}/`,""),name:e,value:t}));if(a.length>0){let l=f.find(e=>e.id===t),n=l?.name||r.name;e[t]={name:n,alias:s,color:r.color,models:a}}}else if(a){let s=f.find(e=>e.id===t),a=s?.name||r.name,l=Object.entries(m).filter(([,e])=>e.startsWith(`${t}/`)).map(([e,s])=>({id:s.replace(`${t}/`,""),name:e,value:s}));l.length>0&&(e[t]={name:a,alias:s?.prefix||t,color:r.color,models:l,isCustom:!0,hasModels:!0})}else{let a=(0,o.KC)(t);a.length>0&&(e[t]={name:r.name,alias:s,color:r.color,models:a.map(e=>({id:e.id,name:e.name,value:`${s}/${e.id}`}))})}}),e},[n,m,N,f]),k=(0,a.useMemo)(()=>{if(!u.trim())return p;let e=u.toLowerCase();return p.filter(t=>t.name.toLowerCase().includes(e))},[p,u]),w=(0,a.useMemo)(()=>{if(!u.trim())return v;let e=u.toLowerCase(),t={};return Object.entries(v).forEach(([s,r])=>{let a=r.models.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)),l=r.name.toLowerCase().includes(e);(a.length>0||l)&&(t[s]={...r,models:a})}),t},[v,u]),C=e=>{s(e),t(),h("")};return(0,r.jsxs)(i.default,{isOpen:e,onClose:()=>{t(),h("")},title:x,size:"md",className:"p-4!",children:[(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,r.jsx)("input",{type:"text",placeholder:"Search...",value:u,onChange:e=>h(e.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,r.jsxs)("div",{className:"max-h-[300px] overflow-y-auto space-y-3",children:[k.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",k.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:k.map(e=>{let t=l===e.name;return(0,r.jsx)("button",{onClick:()=>C({id:e.name,name:e.name,value:e.name}),className:`
|
|
2
2
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
3
3
|
${t?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
4
4
|
`,children:e.name},e.id)})})]}),Object.entries(w).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t.color}}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=l===e.value;return(0,r.jsx)("button",{onClick:()=>C(e),className:`
|
|
5
5
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
6
6
|
${t?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
7
|
-
`,children:e.name},e.id)})})]},e)),0===Object.keys(w).length&&0===k.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}x.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSelect:n().func.isRequired,selectedModel:n().string,activeProviders:n().arrayOf(n().shape({provider:n().string.isRequired})),title:n().string,modelAliases:n().object}},3615:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(5155),a=s(2115),l=s(4588);function n(){let[e,t]=(0,a.useState)([]),[s,n]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!0);(0,a.useEffect)(()=>{c()},[]),(0,a.useEffect)(()=>{let e;return i&&(e=setInterval(()=>{c(!1)},3e3)),()=>clearInterval(e)},[i]);let c=async(e=!0)=>{e&&n(!0);try{let e=await fetch("/api/usage/request-logs");if(e.ok){let s=await e.json();t(s)}}catch(e){console.error("Failed to fetch logs:",e)}finally{e&&n(!1)}};return(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,r.jsx)("span",{children:"Auto Refresh (3s)"}),(0,r.jsx)("div",{onClick:()=>o(!i),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${i?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,r.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${i?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,r.jsx)(l.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,r.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:s&&0===e.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===e.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,r.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,r.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,r.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let s=e.split(" | ");if(s.length<7)return null;let a=s[6],l=a.includes("PENDING"),n=a.includes("FAILED"),i=a.includes("OK");return(0,r.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${l?"bg-primary/5":""}`,children:[(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:s[0]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:s[1]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:s[2]})}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:s[3],children:s[3]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:s[4]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:s[5]}),(0,r.jsx)("td",{className:`px-3 py-1.5 font-bold ${i?"text-success":n?"text-error":"text-primary animate-pulse"}`,children:a})]},t)})})]})})}),(0,r.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are saved to log.txt in the application data directory."})]})}},4230:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497),o=s(1059);function c({isOpen:e,provider:t,onSuccess:s,onClose:l}){let[n,c]=(0,a.useState)("loading"),[d,x]=(0,a.useState)(""),[m,u]=(0,a.useState)(null),[h,p]=(0,a.useState)(""),[b,f]=(0,a.useState)(null),{copied:g,copy:j}=(0,o.C)();(0,a.useEffect)(()=>{e&&t&&(async()=>{try{f(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),s=await e.json();if(!e.ok)throw Error(s.error);u(s),x(s.authUrl),c("input"),window.open(s.authUrl,"_blank")}catch(e){f(e.message),c("error")}})()},[e,t]);let v=async()=>{try{let e;f(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let a=e.searchParams.get("error");if(a)throw Error(e.searchParams.get("error_description")||a);if(!r)throw Error("No authorization code found in URL");let l=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:m.codeVerifier,provider:t})}),n=await l.json();if(!l.ok)throw Error(n.error);c("success"),s?.()}catch(e){f(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,r.jsx)(i.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:l,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:d,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===g?"check":"content_copy",onClick:()=>j(d,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(i.pd,{value:h,onChange:e=>p(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:v,fullWidth:!0,disabled:!h,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,r.jsx)(i.$n,{onClick:l,fullWidth:!0,children:"Done"})]}),"error"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}c.propTypes={isOpen:n().bool.isRequired,provider:n().oneOf(["google","github"]).isRequired,onSuccess:n().func,onClose:n().func.isRequired}},4588:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({children:e,title:t,subtitle:s,icon:l,action:n,padding:i="md",hover:o=!1,className:c,...d}){return(0,r.jsxs)("div",{className:(0,a.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",o&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[i],c),...d,children:[(t||n)&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,r.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l})}),(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("h3",{className:"text-text-main font-semibold",children:t}),s&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:s})]})]}),n]}),e]})}l.Section=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...s,children:e})},l.Row=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...s,children:e})},l.ListItem=function({children:e,actions:t,className:s,...l}){return(0,r.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",s),...l,children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,r.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},4891:(e,t,s)=>{s.d(t,{default:()=>m});var r=s(5155),a=s(3321),l=s(8500),n=s.n(l),i=s(5772),o=s(4051),c=s.n(o),d=s(5497),x=s(620);function m({onMenuClick:e,showMenuButton:t=!0}){let s=(0,a.usePathname)(),l=(0,a.useRouter)(),{title:o,description:c,breadcrumbs:m}=(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/providers\/([^/]+)$/);if(t){let e=t[1],s=x.zN[e]||x.fg[e];if(s)return{title:s.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:s.name,image:`/providers/${s.id}.png`}]}}return e.includes("/providers")?{title:"Providers",description:"Manage your AI provider connections",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(s),u=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(l.push("/login"),l.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,r.jsxs)("header",{className:"flex items-center justify-between px-8 py-5 border-b border-black/5 dark:border-white/5 bg-bg/80 backdrop-blur-xl z-10 sticky top-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-3 lg:hidden",children:t&&(0,r.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,r.jsx)("div",{className:"hidden lg:flex flex-col",children:m.length>0?(0,r.jsx)("div",{className:"flex items-center gap-2",children:m.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,r.jsx)(n(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,r.jsx)(i.default,{src:e.image,alt:e.label,width:28,height:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",sizes:"28px",onError:e=>{e.currentTarget.style.display="none"}}),(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:e.label})]})]},`${e.label}-${e.href||"current"}`))}):o?(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:o}),c&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:c})]}):null}),(0,r.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,r.jsx)(d.UW,{}),(0,r.jsx)("button",{onClick:u,className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-all",title:"Logout",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"logout"})})]})]})}m.propTypes={onMenuClick:c().func,showMenuButton:c().bool}},5086:(e,t,s)=>{s.d(t,{CardSkeleton:()=>o,PageLoading:()=>n,Skeleton:()=>i,Spinner:()=>l,default:()=>c});var r=s(5155),a=s(1474);function l({size:e="md",className:t}){return(0,r.jsx)("span",{className:(0,a.cn)("material-symbols-outlined animate-spin text-primary",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[e],t),children:"progress_activity"})}function n({message:e="Loading..."}){return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,r.jsx)(l,{size:"xl"}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:e})]})}function i({className:e,...t}){return(0,r.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-lg bg-border",e),...t})}function o(){return(0,r.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)(i,{className:"h-4 w-24"}),(0,r.jsx)(i,{className:"size-10 rounded-lg"})]}),(0,r.jsx)(i,{className:"h-8 w-16 mb-2"}),(0,r.jsx)(i,{className:"h-3 w-20"})]})}function c({type:e="spinner",...t}){switch(e){case"page":return(0,r.jsx)(n,{...t});case"skeleton":return(0,r.jsx)(i,{...t});case"card":return(0,r.jsx)(o,{...t});default:return(0,r.jsx)(l,{...t})}}},5497:(e,t,s)=>{s.d(t,{Ex:()=>c.default,$n:()=>r.default,Zp:()=>n.default,Qv:()=>o.CardSkeleton,G9:()=>g.default,pd:()=>a.default,Mh:()=>f.default,uR:()=>h.default,aF:()=>i.default,rq:()=>u.default,LF:()=>m.default,gM:()=>b.default,Iz:()=>j.default,l6:()=>l.default,UW:()=>x.default,lM:()=>d.default,jK:()=>p.default});var r=s(2542),a=s(1910),l=s(98),n=s(4588),i=s(1127),o=s(5086);s(6319);var c=s(6061),d=s(8542),x=s(8587);s(1110),s(2622),s(4891),s(2173);var m=s(882),u=s(2908),h=s(8815),p=s(7827),b=s(3615);s(1500);var f=s(2899);s(4230);var g=s(815),j=s(8067);s(7648),s(1450)},6061:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(1474);let l={default:"bg-black/5 dark:bg-white/10 text-text-muted",primary:"bg-primary/10 text-primary",success:"bg-green-500/10 text-green-600 dark:text-green-400",warning:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",error:"bg-red-500/10 text-red-600 dark:text-red-400",info:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},n={sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function i({children:e,variant:t="default",size:s="md",dot:i=!1,icon:o,className:c}){return(0,r.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",l[t],n[s],c),children:[i&&(0,r.jsx)("span",{className:(0,a.cn)("size-1.5 rounded-full","success"===t&&"bg-green-500","warning"===t&&"bg-yellow-500","error"===t&&"bg-red-500","info"===t&&"bg-blue-500","primary"===t&&"bg-primary","default"===t&&"bg-gray-500")}),o&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:o}),e]})}},6319:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({src:e,alt:t="Avatar",name:s,size:l="md",className:n}){let i={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return e?(0,r.jsx)("div",{className:(0,a.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[l],n),style:{backgroundImage:`url(${e})`},role:"img","aria-label":t}):(0,r.jsx)("div",{className:(0,a.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[l],(e=>{if(!e)return"bg-primary";let t=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],s=e.charCodeAt(0)%t.length;return t[s]})(s),n),role:"img","aria-label":t,children:(e=>{if(!e)return"?";let t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()})(s)})}},7648:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(2115),l=s(2622),n=s(4891);function i({children:e}){let[t,s]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[t&&(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>s(!1)}),(0,r.jsx)("div",{className:"hidden lg:flex",children:(0,r.jsx)(l.default,{})}),(0,r.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,r.jsx)(l.default,{onClose:()=>s(!1)})}),(0,r.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300",children:[(0,r.jsx)(n.default,{onMenuClick:()=>s(!0)}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 lg:p-10",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:e})})]})]})}},7827:(e,t,s)=>{s.d(t,{default:()=>u});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(3321),o=s(4588),c=s(6061),d=s(5086);function x({field:e,currentSort:t,currentOrder:s}){return t!==e?(0,r.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,r.jsx)("span",{className:"ml-1",children:"asc"===s?"↑":"↓"})}function m({data:e,colorClass:t="bg-primary"}){let s=Math.max(...e,1);return(0,r.jsx)("div",{className:"flex items-end gap-1 h-8 w-24",children:e.slice(-9).map((e,a)=>(0,r.jsx)("div",{className:`flex-1 rounded-t-sm transition-all duration-500 ${t}`,style:{height:`${Math.max(e/s*100,5)}%`},title:String(e)},`bar-${a}-${e}`))})}function u(){let e=(0,i.useRouter)(),t=(0,i.useSearchParams)(),s=t.get("sortBy")||"rawModel",l=t.get("sortOrder")||"asc",[n,u]=(0,a.useState)(null),[h,p]=(0,a.useState)(!0),[b,f]=(0,a.useState)(!0),[g,j]=(0,a.useState)("tokens"),[v,N]=(0,a.useState)(5e3),[y,k]=(0,a.useState)(0),w=r=>{let a=new URLSearchParams(t.toString());s===r?a.set("sortOrder","asc"===l?"desc":"asc"):(a.set("sortBy",r),a.set("sortOrder","asc")),e.replace(`?${a.toString()}`,{scroll:!1})},C=(0,a.useCallback)((e,t={})=>Object.entries(e||{}).map(([e,s])=>{let r=(s.promptTokens||0)+(s.completionTokens||0),a=s.cost||0,l=r>0?(s.promptTokens||0)*(a/r):0,n=r>0?(s.completionTokens||0)*(a/r):0;return{...s,key:e,totalTokens:r,totalCost:a,inputCost:l,outputCost:n,pending:t[e]||0}}).sort((e,t)=>{let r=e[s],a=t[s];return("string"==typeof r&&(r=r.toLowerCase()),"string"==typeof a&&(a=a.toLowerCase()),r<a)?"asc"===l?-1:1:r>a?"asc"===l?1:-1:0}),[s,l]),S=(0,a.useMemo)(()=>C(n?.byModel,n?.pending?.byModel),[n?.byModel,n?.pending?.byModel,C]),T=(0,a.useMemo)(()=>{let e={};return n?.pending?.byAccount&&Object.entries(n.byAccount||{}).forEach(([t,s])=>{let r=n.pending.byAccount[s.connectionId];if(r){let a=s.provider?`${s.rawModel} (${s.provider})`:s.rawModel;e[t]=r[a]||0}}),C(n?.byAccount,e)},[n?.byAccount,n?.pending?.byAccount,C]),O=(0,a.useCallback)(async(e=!0)=>{e&&p(!0);try{let e=await fetch("/api/usage/history");if(e.ok){let t=await e.json();u(t);let s=t.totalRequests||0;s>y?N(5e3):N(e=>Math.min(2*e,6e4)),k(s)}}catch(e){console.error("Failed to fetch usage stats:",e)}finally{e&&p(!1)}},[y]);if((0,a.useEffect)(()=>{O()},[O]),(0,a.useEffect)(()=>{let e,t=!0,s=()=>{(t=!document.hidden)&&b&&O(!1)};return document.addEventListener("visibilitychange",s),b&&(e&&clearInterval(e),e=setInterval(()=>{t&&O(!1)},v)),()=>{e&&clearInterval(e),document.removeEventListener("visibilitychange",s)}},[b,v,O]),h)return(0,r.jsx)(d.CardSkeleton,{});if(!n)return(0,r.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let $=e=>new Intl.NumberFormat().format(e||0),L=e=>`$${(e||0).toFixed(2)}`,R=e=>{if(!e)return"Never";let t=new Date(e),s=Math.floor((new Date-t)/6e4);return s<1?"Just now":s<60?`${s}m ago`:s<1440?`${Math.floor(s/60)}h ago`:t.toLocaleDateString()};return(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Usage Overview"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:[(0,r.jsx)("button",{onClick:()=>j("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===g?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,r.jsx)("button",{onClick:()=>j("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===g?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"})]}),(0,r.jsxs)("div",{className:"text-sm font-medium text-text-muted flex items-center gap-2",children:[(0,r.jsxs)("span",{children:["Auto Refresh (",v/1e3,"s)"]}),(0,r.jsx)("button",{type:"button",onClick:()=>f(!b),role:"switch","aria-checked":b,"aria-label":"Toggle auto refresh",className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${b?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,r.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${b?"translate-x-5":"translate-x-1"}`})})]})]})]}),(n.activeRequests||[]).length>0&&(0,r.jsx)(o.default,{className:"p-3 border-primary/20 bg-primary/5",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-primary font-semibold text-sm uppercase tracking-wider",children:[(0,r.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,r.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),(0,r.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),"Active Requests"]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-3",children:n.activeRequests.map(e=>(0,r.jsxs)("div",{className:"px-3 py-1.5 rounded-md bg-bg-subtle border border-primary/20 text-xs font-mono shadow-sm",children:[(0,r.jsx)("span",{className:"text-primary font-bold",children:e.model}),(0,r.jsx)("span",{className:"mx-1 text-text-muted",children:"|"}),(0,r.jsx)("span",{className:"text-text",children:e.provider}),(0,r.jsx)("span",{className:"mx-1 text-text-muted",children:"|"}),(0,r.jsx)("span",{className:"text-text font-medium",children:e.account}),e.count>1&&(0,r.jsxs)("span",{className:"ml-2 px-1.5 py-0.5 rounded bg-primary text-white font-bold",children:["x",e.count]})]},`${e.model}-${e.provider}-${e.account}`))})]})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,r.jsx)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,r.jsx)("span",{className:"text-2xl font-bold",children:$(n.totalRequests)})]}),(0,r.jsx)(m,{data:(n.last10Minutes||[]).map(e=>e.requests),colorClass:"bg-text-muted/30"})]})}),(0,r.jsx)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-primary",children:$(n.totalPromptTokens)})]}),(0,r.jsx)(m,{data:(n.last10Minutes||[]).map(e=>e.promptTokens),colorClass:"bg-primary/50"})]})}),(0,r.jsx)(o.default,{className:"px-4 py-2 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-success",children:$(n.totalCompletionTokens)})]}),(0,r.jsx)("div",{className:"w-px bg-border self-stretch mx-2"}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Cost"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-warning",children:L(n.totalCost)})]})]})})]}),(0,r.jsxs)(o.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:"Usage by Model"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("rawModel"),children:["Model"," ",(0,r.jsx)(x,{field:"rawModel",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("provider"),children:["Provider"," ",(0,r.jsx)(x,{field:"provider",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("requests"),children:["Requests"," ",(0,r.jsx)(x,{field:"requests",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("lastUsed"),children:["Last Used"," ",(0,r.jsx)(x,{field:"lastUsed",currentSort:s,currentOrder:l})]}),"tokens"===g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Tokens"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Tokens"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(x,{field:"totalTokens",currentSort:s,currentOrder:l})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Cost"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Cost"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("cost"),children:["Total Cost"," ",(0,r.jsx)(x,{field:"cost",currentSort:s,currentOrder:l})]})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[S.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-bg-subtle/20",children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(c.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:$(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:R(e.lastUsed)}),"tokens"===g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:$(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:L(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:L(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:L(e.totalCost)})]})]},e.key)),0===S.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:8,className:"px-6 py-8 text-center text-text-muted",children:"No usage recorded yet. Make some requests to see data here."})})]})]})})]}),(0,r.jsxs)(o.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:"Usage by Account"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("rawModel"),children:["Model"," ",(0,r.jsx)(x,{field:"rawModel",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("provider"),children:["Provider"," ",(0,r.jsx)(x,{field:"provider",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("accountName"),children:["Account"," ",(0,r.jsx)(x,{field:"accountName",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("requests"),children:["Requests"," ",(0,r.jsx)(x,{field:"requests",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("lastUsed"),children:["Last Used"," ",(0,r.jsx)(x,{field:"lastUsed",currentSort:s,currentOrder:l})]}),"tokens"===g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Tokens"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Tokens"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(x,{field:"totalTokens",currentSort:s,currentOrder:l})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("promptTokens"),children:["Input Cost"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("completionTokens"),children:["Output Cost"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>w("cost"),children:["Total Cost"," ",(0,r.jsx)(x,{field:"cost",currentSort:s,currentOrder:l})]})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[T.map(e=>(0,r.jsxs)("tr",{className:"hover:bg-bg-subtle/20",children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(c.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)("span",{className:`font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.accountName||`Account ${e.connectionId?.slice(0,8)}...`})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:$(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:R(e.lastUsed)}),"tokens"===g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:$(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:$(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:L(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:L(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:L(e.totalCost)})]})]},e.key)),0===T.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:9,className:"px-6 py-8 text-center text-text-muted",children:"No account-specific usage recorded yet. Make requests using OAuth accounts to see data here."})})]})]})})]})]})}x.propTypes={field:n().string.isRequired,currentSort:n().string.isRequired,currentOrder:n().string.isRequired},m.propTypes={data:n().arrayOf(n().number).isRequired,colorClass:n().string}},8067:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({options:e=[],value:t,onChange:s,size:l="md",className:n}){let i={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,r.jsx)("div",{className:(0,a.cn)("inline-flex items-center p-1 rounded-lg","bg-black/5 dark:bg-white/5",n),children:e.map(e=>(0,r.jsxs)("button",{onClick:()=>s(e.value),className:(0,a.cn)("px-4 rounded-md font-medium transition-all",i[l],t===e.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[e.icon&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:e.icon}),e.label]},e.value))})}},8542:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({checked:e=!1,onChange:t,label:s,description:l,disabled:n=!1,size:i="md",className:o}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",n&&"opacity-50 cursor-not-allowed",o),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:n,onClick:()=>{!n&&t&&t(!e)},className:(0,a.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-1 focus:ring-primary/30",e?"bg-primary":"bg-black/10 dark:bg-white/20",c[i].track,n&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[i].translate:"translate-x-0.5",c[i].thumb,"mt-0.5")})}),(s||l)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[s&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:s}),l&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:l})]})]})}},8587:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(5155),a=s(1620),l=s(1474);function n({className:e,variant:t="default"}){let{theme:s,toggleTheme:n,isDark:i}=(0,a.D)(),o={default:(0,l.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted","hover:bg-black/5","hover:text-text-main","transition-colors"),card:(0,l.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60","hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-md","text-text-muted-light hover:text-primary","hover:text-primary","transition-all group")};return(0,r.jsx)("button",{onClick:n,className:(0,l.cn)(o[t],e),"aria-label":`Switch to ${i?"light":"dark"} mode`,title:`Switch to ${i?"light":"dark"} mode`,children:(0,r.jsx)("span",{className:(0,l.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:i?"light_mode":"dark_mode"})})}},8815:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(2115),l=s(1127),n=s(2542);function i({isOpen:e,onClose:t,title:s="Manual Configuration",configs:i=[]}){let[o,c]=(0,a.useState)(null),d=async(e,t)=>{try{await navigator.clipboard.writeText(e),c(t),setTimeout(()=>c(null),2e3)}catch(e){console.log("Failed to copy:",e)}};return(0,r.jsx)(l.default,{isOpen:e,onClose:t,title:s,size:"xl",children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:i.map((e,t)=>(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.filename}),(0,r.jsxs)(n.default,{variant:"ghost",size:"sm",onClick:()=>d(e.content,t),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:o===t?"check":"content_copy"}),o===t?"Copied!":"Copy"]})]}),(0,r.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:e.content})]},t))})})}}}]);
|
|
7
|
+
`,children:e.name},e.id)})})]},e)),0===Object.keys(w).length&&0===k.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}x.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onSelect:n().func.isRequired,selectedModel:n().string,activeProviders:n().arrayOf(n().shape({provider:n().string.isRequired})),title:n().string,modelAliases:n().object}},3615:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(5155),a=s(2115),l=s(4588);function n(){let[e,t]=(0,a.useState)([]),[s,n]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!0);(0,a.useEffect)(()=>{c()},[]),(0,a.useEffect)(()=>{let e;return i&&(e=setInterval(()=>{c(!1)},3e3)),()=>clearInterval(e)},[i]);let c=async(e=!0)=>{e&&n(!0);try{let e=await fetch("/api/usage/request-logs");if(e.ok){let s=await e.json();t(s)}}catch(e){console.error("Failed to fetch logs:",e)}finally{e&&n(!1)}};return(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Request Logs"}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsxs)("label",{className:"text-sm font-medium text-text-muted flex items-center gap-2 cursor-pointer",children:[(0,r.jsx)("span",{children:"Auto Refresh (3s)"}),(0,r.jsx)("div",{onClick:()=>o(!i),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ${i?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,r.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${i?"translate-x-5":"translate-x-1"}`})})]})})]}),(0,r.jsx)(l.default,{className:"overflow-hidden bg-black/5 dark:bg-black/20",children:(0,r.jsx)("div",{className:"p-0 overflow-x-auto max-h-[600px] overflow-y-auto font-mono text-xs",children:s&&0===e.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"Loading logs..."}):0===e.length?(0,r.jsx)("div",{className:"p-8 text-center text-text-muted",children:"No logs recorded yet."}):(0,r.jsxs)("table",{className:"w-full text-left border-collapse whitespace-nowrap",children:[(0,r.jsx)("thead",{className:"sticky top-0 bg-bg-subtle border-b border-border z-10",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"DateTime"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Model"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Provider"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Account"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"In"}),(0,r.jsx)("th",{className:"px-3 py-2 border-r border-border",children:"Out"}),(0,r.jsx)("th",{className:"px-3 py-2",children:"Status"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-border/50",children:e.map((e,t)=>{let s=e.split(" | ");if(s.length<7)return null;let a=s[6],l=a.includes("PENDING"),n=a.includes("FAILED"),i=a.includes("OK");return(0,r.jsxs)("tr",{className:`hover:bg-primary/5 transition-colors ${l?"bg-primary/5":""}`,children:[(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-text-muted",children:s[0]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border font-medium",children:s[1]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border",children:(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded bg-bg-subtle border border-border text-[10px] uppercase font-bold",children:s[2]})}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border truncate max-w-[150px]",title:s[3],children:s[3]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-primary",children:s[4]}),(0,r.jsx)("td",{className:"px-3 py-1.5 border-r border-border text-right text-success",children:s[5]}),(0,r.jsx)("td",{className:`px-3 py-1.5 font-bold ${i?"text-success":n?"text-error":"text-primary animate-pulse"}`,children:a})]},t)})})]})})}),(0,r.jsx)("div",{className:"text-[10px] text-text-muted italic",children:"Logs are saved to log.txt in the application data directory."})]})}},4230:(e,t,s)=>{s.d(t,{default:()=>c});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(5497),o=s(1059);function c({isOpen:e,provider:t,onSuccess:s,onClose:l}){let[n,c]=(0,a.useState)("loading"),[d,x]=(0,a.useState)(""),[m,u]=(0,a.useState)(null),[h,p]=(0,a.useState)(""),[b,f]=(0,a.useState)(null),{copied:g,copy:j}=(0,o.C)();(0,a.useEffect)(()=>{e&&t&&(async()=>{try{f(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),s=await e.json();if(!e.ok)throw Error(s.error);u(s),x(s.authUrl),c("input"),window.open(s.authUrl,"_blank")}catch(e){f(e.message),c("error")}})()},[e,t]);let y=async()=>{try{let e;f(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let a=e.searchParams.get("error");if(a)throw Error(e.searchParams.get("error_description")||a);if(!r)throw Error("No authorization code found in URL");let l=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:m.codeVerifier,provider:t})}),n=await l.json();if(!l.ok)throw Error(n.error);c("success"),s?.()}catch(e){f(e.message),c("error")}},N="google"===t?"Google":"GitHub";return(0,r.jsx)(i.aF,{isOpen:e,title:`Connect Kiro via ${N}`,onClose:l,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",N," authentication"]})]}),"input"===n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.pd,{value:d,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(i.$n,{variant:"secondary",icon:"auth_url"===g?"check":"content_copy",onClick:()=>j(d,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(i.pd,{value:h,onChange:e=>p(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:y,fullWidth:!0,disabled:!h,children:"Connect"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",N," has been connected."]}),(0,r.jsx)(i.$n,{onClick:l,fullWidth:!0,children:"Done"})]}),"error"===n&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:b}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(i.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(i.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}c.propTypes={isOpen:n().bool.isRequired,provider:n().oneOf(["google","github"]).isRequired,onSuccess:n().func,onClose:n().func.isRequired}},4588:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({children:e,title:t,subtitle:s,icon:l,action:n,padding:i="md",hover:o=!1,className:c,...d}){return(0,r.jsxs)("div",{className:(0,a.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",o&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[i],c),...d,children:[(t||n)&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,r.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l})}),(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("h3",{className:"text-text-main font-semibold",children:t}),s&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:s})]})]}),n]}),e]})}l.Section=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...s,children:e})},l.Row=function({children:e,className:t,...s}){return(0,r.jsx)("div",{className:(0,a.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...s,children:e})},l.ListItem=function({children:e,actions:t,className:s,...l}){return(0,r.jsxs)("div",{className:(0,a.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",s),...l,children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,r.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},4891:(e,t,s)=>{s.d(t,{default:()=>m});var r=s(5155),a=s(3321),l=s(8500),n=s.n(l),i=s(5772),o=s(4051),c=s.n(o),d=s(5497),x=s(620);function m({onMenuClick:e,showMenuButton:t=!0}){let s=(0,a.usePathname)(),l=(0,a.useRouter)(),{title:o,description:c,breadcrumbs:m}=(e=>{if(!e)return{title:"",description:"",breadcrumbs:[]};let t=e.match(/\/providers\/([^/]+)$/);if(t){let e=t[1],s=x.zN[e]||x.fg[e];if(s)return{title:s.name,description:"",breadcrumbs:[{label:"Providers",href:"/dashboard/providers"},{label:s.name,image:`/providers/${s.id}.png`}]}}return e.includes("/providers")?{title:"Providers",description:"Manage your AI provider connections",breadcrumbs:[]}:e.includes("/combos")?{title:"Combos",description:"Model combos with fallback",breadcrumbs:[]}:e.includes("/usage")?{title:"Usage & Analytics",description:"Monitor your API usage, token consumption, and request logs",breadcrumbs:[]}:e.includes("/cli-tools")?{title:"CLI Tools",description:"Configure CLI tools",breadcrumbs:[]}:e.includes("/endpoint")?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:e.includes("/profile")?{title:"Settings",description:"Manage your preferences",breadcrumbs:[]}:"/dashboard"===e?{title:"Endpoint",description:"API endpoint configuration",breadcrumbs:[]}:{title:"",description:"",breadcrumbs:[]}})(s),u=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&(l.push("/login"),l.refresh())}catch(e){console.error("Failed to logout:",e)}};return(0,r.jsxs)("header",{className:"flex items-center justify-between px-8 py-5 border-b border-black/5 dark:border-white/5 bg-bg/80 backdrop-blur-xl z-10 sticky top-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-3 lg:hidden",children:t&&(0,r.jsx)("button",{onClick:e,className:"text-text-main hover:text-primary transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"menu"})})}),(0,r.jsx)("div",{className:"hidden lg:flex flex-col",children:m.length>0?(0,r.jsx)("div",{className:"flex items-center gap-2",children:m.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[t>0&&(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted text-base",children:"chevron_right"}),e.href?(0,r.jsx)(n(),{href:e.href,className:"text-text-muted hover:text-primary transition-colors",children:e.label}):(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.image&&(0,r.jsx)(i.default,{src:e.image,alt:e.label,width:28,height:28,className:"object-contain rounded max-w-[28px] max-h-[28px]",sizes:"28px",onError:e=>{e.currentTarget.style.display="none"}}),(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:e.label})]})]},`${e.label}-${e.href||"current"}`))}):o?(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold text-text-main tracking-tight",children:o}),c&&(0,r.jsx)("p",{className:"text-sm text-text-muted",children:c})]}):null}),(0,r.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,r.jsx)(d.UW,{}),(0,r.jsx)("button",{onClick:u,className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-red-500 hover:bg-red-500/10 transition-all",title:"Logout",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"logout"})})]})]})}m.propTypes={onMenuClick:c().func,showMenuButton:c().bool}},5086:(e,t,s)=>{s.d(t,{CardSkeleton:()=>o,PageLoading:()=>n,Skeleton:()=>i,Spinner:()=>l,default:()=>c});var r=s(5155),a=s(1474);function l({size:e="md",className:t}){return(0,r.jsx)("span",{className:(0,a.cn)("material-symbols-outlined animate-spin text-primary",{sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"}[e],t),children:"progress_activity"})}function n({message:e="Loading..."}){return(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,r.jsx)(l,{size:"xl"}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:e})]})}function i({className:e,...t}){return(0,r.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-lg bg-border",e),...t})}function o(){return(0,r.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)(i,{className:"h-4 w-24"}),(0,r.jsx)(i,{className:"size-10 rounded-lg"})]}),(0,r.jsx)(i,{className:"h-8 w-16 mb-2"}),(0,r.jsx)(i,{className:"h-3 w-20"})]})}function c({type:e="spinner",...t}){switch(e){case"page":return(0,r.jsx)(n,{...t});case"skeleton":return(0,r.jsx)(i,{...t});case"card":return(0,r.jsx)(o,{...t});default:return(0,r.jsx)(l,{...t})}}},5497:(e,t,s)=>{s.d(t,{Ex:()=>c.default,$n:()=>r.default,Zp:()=>n.default,Qv:()=>o.CardSkeleton,G9:()=>g.default,pd:()=>a.default,Mh:()=>f.default,uR:()=>h.default,aF:()=>i.default,rq:()=>u.default,LF:()=>m.default,gM:()=>b.default,Iz:()=>j.default,l6:()=>l.default,UW:()=>x.default,lM:()=>d.default,jK:()=>p.default});var r=s(2542),a=s(1910),l=s(98),n=s(4588),i=s(1127),o=s(5086);s(6319);var c=s(6061),d=s(8542),x=s(8587);s(1110),s(2622),s(4891),s(2173);var m=s(882),u=s(2908),h=s(8815),p=s(7827),b=s(3615);s(1500);var f=s(2899);s(4230);var g=s(815),j=s(8067);s(7648),s(1450)},6061:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(1474);let l={default:"bg-black/5 dark:bg-white/10 text-text-muted",primary:"bg-primary/10 text-primary",success:"bg-green-500/10 text-green-600 dark:text-green-400",warning:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",error:"bg-red-500/10 text-red-600 dark:text-red-400",info:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},n={sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-1 text-xs",lg:"px-3 py-1.5 text-sm"};function i({children:e,variant:t="default",size:s="md",dot:i=!1,icon:o,className:c}){return(0,r.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",l[t],n[s],c),children:[i&&(0,r.jsx)("span",{className:(0,a.cn)("size-1.5 rounded-full","success"===t&&"bg-green-500","warning"===t&&"bg-yellow-500","error"===t&&"bg-red-500","info"===t&&"bg-blue-500","primary"===t&&"bg-primary","default"===t&&"bg-gray-500")}),o&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:o}),e]})}},6319:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({src:e,alt:t="Avatar",name:s,size:l="md",className:n}){let i={xs:"size-6 text-xs",sm:"size-8 text-sm",md:"size-10 text-base",lg:"size-12 text-lg",xl:"size-16 text-xl"};return e?(0,r.jsx)("div",{className:(0,a.cn)("rounded-full bg-cover bg-center bg-no-repeat","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[l],n),style:{backgroundImage:`url(${e})`},role:"img","aria-label":t}):(0,r.jsx)("div",{className:(0,a.cn)("rounded-full flex items-center justify-center font-semibold text-white","ring-2 ring-white dark:ring-surface-dark shadow-sm",i[l],(e=>{if(!e)return"bg-primary";let t=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],s=e.charCodeAt(0)%t.length;return t[s]})(s),n),role:"img","aria-label":t,children:(e=>{if(!e)return"?";let t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()})(s)})}},7648:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(2115),l=s(2622),n=s(4891);function i({children:e}){let[t,s]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[t&&(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>s(!1)}),(0,r.jsx)("div",{className:"hidden lg:flex",children:(0,r.jsx)(l.default,{})}),(0,r.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,r.jsx)(l.default,{onClose:()=>s(!1)})}),(0,r.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300",children:[(0,r.jsx)(n.default,{onMenuClick:()=>s(!0)}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 lg:p-10",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto",children:e})})]})]})}},7827:(e,t,s)=>{s.d(t,{default:()=>u});var r=s(5155),a=s(2115),l=s(4051),n=s.n(l),i=s(3321),o=s(4588),c=s(6061),d=s(5086);function x({field:e,currentSort:t,currentOrder:s}){return t!==e?(0,r.jsx)("span",{className:"ml-1 opacity-20",children:"↕"}):(0,r.jsx)("span",{className:"ml-1",children:"asc"===s?"↑":"↓"})}function m({data:e,colorClass:t="bg-primary"}){let s=Math.max(...e,1);return(0,r.jsx)("div",{className:"flex items-end gap-1 h-8 w-24",children:e.slice(-9).map((e,a)=>(0,r.jsx)("div",{className:`flex-1 rounded-t-sm transition-all duration-500 ${t}`,style:{height:`${Math.max(e/s*100,5)}%`},title:String(e)},`bar-${a}-${e}`))})}function u(){let e=(0,i.useRouter)(),t=(0,i.useSearchParams)(),s=t.get("modelSortBy")||"rawModel",l=t.get("modelSortOrder")||"asc",n=t.get("accountSortBy")||"rawModel",u=t.get("accountSortOrder")||"asc",h=t.get("apiKeySortBy")||"keyName",p=t.get("apiKeySortOrder")||"asc",[b,f]=(0,a.useState)(null),[g,j]=(0,a.useState)(!0),[y,N]=(0,a.useState)(!0),[v,k]=(0,a.useState)("tokens"),[w,C]=(0,a.useState)(5e3),[S,T]=(0,a.useState)(0),[O,$]=(0,a.useState)(new Set),[I,M]=(0,a.useState)(new Set),[E,L]=(0,a.useState)(new Set),R=(s,r)=>{let a={model:{by:"modelSortBy",order:"modelSortOrder"},account:{by:"accountSortBy",order:"accountSortOrder"},apiKey:{by:"apiKeySortBy",order:"apiKeySortOrder"}}[s],l=new URLSearchParams(t.toString()),n=l.get(a.by),i=l.get(a.order);n===r?l.set(a.order,"asc"===i?"desc":"asc"):(l.set(a.by,r),l.set(a.order,"asc")),e.replace(`?${l.toString()}`,{scroll:!1})},z=(0,a.useCallback)((e,t={},s,r)=>Object.entries(e||{}).map(([e,s])=>{let r=(s.promptTokens||0)+(s.completionTokens||0),a=s.cost||0,l=r>0?(s.promptTokens||0)*(a/r):0,n=r>0?(s.completionTokens||0)*(a/r):0;return{...s,key:e,totalTokens:r,totalCost:a,inputCost:l,outputCost:n,pending:t[e]||0}}).sort((e,t)=>{let a=e[s],l=t[s];return("string"==typeof a&&(a=a.toLowerCase()),"string"==typeof l&&(l=l.toLowerCase()),a<l)?"asc"===r?-1:1:a>l?"asc"===r?1:-1:0}),[]),F=(0,a.useCallback)((e,t)=>{switch(t){case"rawModel":return e.rawModel||"Unknown Model";case"accountName":return e.accountName||`Account ${e.connectionId?.slice(0,8)}...`||"Unknown Account";case"keyName":return e.keyName||"Unknown Key";default:return e[t]||"Unknown"}},[]),_=(0,a.useCallback)((e,t)=>{if(!Array.isArray(e))return[];let s={};return e.forEach(e=>{let r=F(e,t);s[r]||(s[r]={groupKey:r,summary:{requests:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,inputCost:0,outputCost:0,lastUsed:null,pending:0},items:[]});let a=s[r];a.summary.requests+=e.requests||0,a.summary.promptTokens+=e.promptTokens||0,a.summary.completionTokens+=e.completionTokens||0,a.summary.totalTokens+=e.totalTokens||0,a.summary.cost+=e.cost||0,a.summary.inputCost+=e.inputCost||0,a.summary.outputCost+=e.outputCost||0,a.summary.pending+=e.pending||0,e.lastUsed&&(!a.summary.lastUsed||new Date(e.lastUsed)>new Date(a.summary.lastUsed))&&(a.summary.lastUsed=e.lastUsed),a.items.push(e)}),Object.values(s)},[F]),A=(0,a.useMemo)(()=>z(b?.byModel,b?.pending?.byModel,s,l),[b?.byModel,b?.pending?.byModel,s,l,z]),U=(0,a.useMemo)(()=>_(A,"rawModel"),[A,_]),q=(0,a.useMemo)(()=>{let e={};return b?.pending?.byAccount&&Object.entries(b.byAccount||{}).forEach(([t,s])=>{let r=b.pending.byAccount[s.connectionId];if(r){let a=s.provider?`${s.rawModel} (${s.provider})`:s.rawModel;e[t]=r[a]||0}}),z(b?.byAccount,e,n,u)},[b?.byAccount,b?.pending?.byAccount,n,u,z]),P=(0,a.useMemo)(()=>_(q,"accountName"),[q,_]),K=(0,a.useMemo)(()=>z(b?.byApiKey,{},h,p),[b?.byApiKey,h,p,z]),W=(0,a.useMemo)(()=>_(K,"keyName"),[K,_]),D=(0,a.useCallback)(async(e=!0)=>{e&&j(!0);try{let e=await fetch("/api/usage/history");if(e.ok){let t=await e.json();f(t);let s=t.totalRequests||0;s>S?C(5e3):C(e=>Math.min(2*e,6e4)),T(s)}}catch(e){console.error("Failed to fetch usage stats:",e)}finally{e&&j(!1)}},[S]);(0,a.useEffect)(()=>{D()},[D]),(0,a.useEffect)(()=>{try{let e=localStorage.getItem("usage-stats:expanded-models");e&&$(new Set(JSON.parse(e)))}catch(e){console.error("Failed to load expanded models from localStorage:",e)}},[]),(0,a.useEffect)(()=>{try{localStorage.setItem("usage-stats:expanded-models",JSON.stringify([...O]))}catch(e){console.error("Failed to save expanded models to localStorage:",e)}},[O]),(0,a.useEffect)(()=>{try{let e=localStorage.getItem("usage-stats:expanded-accounts");e&&M(new Set(JSON.parse(e)))}catch(e){console.error("Failed to load expanded accounts from localStorage:",e)}},[]),(0,a.useEffect)(()=>{try{localStorage.setItem("usage-stats:expanded-accounts",JSON.stringify([...I]))}catch(e){console.error("Failed to save expanded accounts to localStorage:",e)}},[I]),(0,a.useEffect)(()=>{try{let e=localStorage.getItem("usage-stats:expanded-apikeys");e&&L(new Set(JSON.parse(e)))}catch(e){console.error("Failed to load expanded API keys from localStorage:",e)}},[]),(0,a.useEffect)(()=>{try{localStorage.setItem("usage-stats:expanded-apikeys",JSON.stringify([...E]))}catch(e){console.error("Failed to save expanded API keys to localStorage:",e)}},[E]);let B=(0,a.useCallback)(e=>{$(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),J=(0,a.useCallback)(e=>{M(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),G=(0,a.useCallback)(e=>{L(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);if((0,a.useEffect)(()=>{let e,t=!0,s=()=>{(t=!document.hidden)&&y&&D(!1)};return document.addEventListener("visibilitychange",s),y&&(e&&clearInterval(e),e=setInterval(()=>{t&&D(!1)},w)),()=>{e&&clearInterval(e),document.removeEventListener("visibilitychange",s)}},[y,w,D]),g)return(0,r.jsx)(d.CardSkeleton,{});if(!b)return(0,r.jsx)("div",{className:"text-text-muted",children:"Failed to load usage statistics."});let V=e=>new Intl.NumberFormat().format(e||0),H=e=>`$${(e||0).toFixed(2)}`,Y=e=>{if(!e)return"Never";let t=new Date(e),s=Math.floor((new Date-t)/6e4);return s<1?"Just now":s<60?`${s}m ago`:s<1440?`${Math.floor(s/60)}h ago`:t.toLocaleDateString()};return(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"Usage Overview"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 bg-bg-subtle rounded-lg p-1 border border-border",children:[(0,r.jsx)("button",{onClick:()=>k("tokens"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"tokens"===v?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Tokens"}),(0,r.jsx)("button",{onClick:()=>k("costs"),className:`px-3 py-1 rounded-md text-sm font-medium transition-colors ${"costs"===v?"bg-primary text-white shadow-sm":"text-text-muted hover:text-text hover:bg-bg-hover"}`,children:"Costs"})]}),(0,r.jsxs)("div",{className:"text-sm font-medium text-text-muted flex items-center gap-2",children:[(0,r.jsxs)("span",{children:["Auto Refresh (",w/1e3,"s)"]}),(0,r.jsx)("button",{type:"button",onClick:()=>N(!y),role:"switch","aria-checked":y,"aria-label":"Toggle auto refresh",className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${y?"bg-primary":"bg-bg-subtle border border-border"}`,children:(0,r.jsx)("span",{className:`inline-block h-3 w-3 transform rounded-full bg-white transition-transform ${y?"translate-x-5":"translate-x-1"}`})})]})]})]}),(b.activeRequests||[]).length>0&&(0,r.jsx)(o.default,{className:"p-3 border-primary/20 bg-primary/5",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-primary font-semibold text-sm uppercase tracking-wider",children:[(0,r.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,r.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),(0,r.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),"Active Requests"]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-3",children:b.activeRequests.map(e=>(0,r.jsxs)("div",{className:"px-3 py-1.5 rounded-md bg-bg-subtle border border-primary/20 text-xs font-mono shadow-sm",children:[(0,r.jsx)("span",{className:"text-primary font-bold",children:e.model}),(0,r.jsx)("span",{className:"mx-1 text-text-muted",children:"|"}),(0,r.jsx)("span",{className:"text-text",children:e.provider}),(0,r.jsx)("span",{className:"mx-1 text-text-muted",children:"|"}),(0,r.jsx)("span",{className:"text-text font-medium",children:e.account}),e.count>1&&(0,r.jsxs)("span",{className:"ml-2 px-1.5 py-0.5 rounded bg-primary text-white font-bold",children:["x",e.count]})]},`${e.model}-${e.provider}-${e.account}`))})]})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,r.jsx)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Requests"}),(0,r.jsx)("span",{className:"text-2xl font-bold",children:V(b.totalRequests)})]}),(0,r.jsx)(m,{data:(b.last10Minutes||[]).map(e=>e.requests),colorClass:"bg-text-muted/30"})]})}),(0,r.jsx)(o.default,{className:"px-4 py-3 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Input Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-primary",children:V(b.totalPromptTokens)})]}),(0,r.jsx)(m,{data:(b.last10Minutes||[]).map(e=>e.promptTokens),colorClass:"bg-primary/50"})]})}),(0,r.jsx)(o.default,{className:"px-4 py-2 flex flex-col gap-1",children:(0,r.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Output Tokens"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-success",children:V(b.totalCompletionTokens)})]}),(0,r.jsx)("div",{className:"w-px bg-border self-stretch mx-2"}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,r.jsx)("span",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Cost"}),(0,r.jsx)("span",{className:"text-2xl font-bold text-warning",children:H(b.totalCost)})]})]})})]}),(0,r.jsxs)(o.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:"Usage by Model"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","rawModel"),children:["Model"," ",(0,r.jsx)(x,{field:"rawModel",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","provider"),children:["Provider"," ",(0,r.jsx)(x,{field:"provider",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","requests"),children:["Requests"," ",(0,r.jsx)(x,{field:"requests",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","lastUsed"),children:["Last Used"," ",(0,r.jsx)(x,{field:"lastUsed",currentSort:s,currentOrder:l})]}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","promptTokens"),children:["Input Tokens"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","completionTokens"),children:["Output Tokens"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(x,{field:"totalTokens",currentSort:s,currentOrder:l})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","promptTokens"),children:["Input Cost"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","completionTokens"),children:["Output Cost"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:s,currentOrder:l})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("model","cost"),children:["Total Cost"," ",(0,r.jsx)(x,{field:"cost",currentSort:s,currentOrder:l})]})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[U.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>B(e.groupKey),children:[(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${O.has(e.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,r.jsx)("span",{className:`font-medium transition-colors ${e.summary.pending>0?"text-primary":""}`,children:e.groupKey})]})}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:V(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:Y(e.summary.lastUsed)}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.summary.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.summary.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:V(e.summary.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.summary.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.summary.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:H(e.summary.totalCost)})]})]},`summary-${e.groupKey}`),O.has(e.groupKey)&&e.items.map(e=>(0,r.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(c.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:V(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:Y(e.lastUsed)}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:V(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:H(e.totalCost)})]})]},`detail-${e.key}`))]},e.groupKey)),0===U.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:8,className:"px-6 py-8 text-center text-text-muted",children:"No usage recorded yet. Make some requests to see data here."})})]})]})})]}),(0,r.jsxs)(o.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:"Usage by Account"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","rawModel"),children:["Model"," ",(0,r.jsx)(x,{field:"rawModel",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","provider"),children:["Provider"," ",(0,r.jsx)(x,{field:"provider",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","accountName"),children:["Account"," ",(0,r.jsx)(x,{field:"accountName",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","requests"),children:["Requests"," ",(0,r.jsx)(x,{field:"requests",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","lastUsed"),children:["Last Used"," ",(0,r.jsx)(x,{field:"lastUsed",currentSort:n,currentOrder:u})]}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","promptTokens"),children:["Input Tokens"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","completionTokens"),children:["Output Tokens"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(x,{field:"totalTokens",currentSort:n,currentOrder:u})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","promptTokens"),children:["Input Cost"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","completionTokens"),children:["Output Cost"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:n,currentOrder:u})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("account","cost"),children:["Total Cost"," ",(0,r.jsx)(x,{field:"cost",currentSort:n,currentOrder:u})]})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[P.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>J(e.groupKey),children:[(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${I.has(e.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,r.jsx)("span",{className:`font-medium transition-colors ${e.summary.pending>0?"text-primary":""}`,children:e.groupKey})]})}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:V(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:Y(e.summary.lastUsed)}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:V(e.summary.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:H(e.summary.totalCost)})]})]},`summary-${e.groupKey}`),I.has(e.groupKey)&&e.items.map(e=>(0,r.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)("span",{className:`font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.accountName||`Account ${e.connectionId?.slice(0,8)}...`})}),(0,r.jsx)("td",{className:`px-6 py-3 font-medium transition-colors ${e.pending>0?"text-primary":""}`,children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(c.default,{variant:e.pending>0?"primary":"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:V(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:Y(e.lastUsed)}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:V(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:H(e.totalCost)})]})]},`detail-${e.key}`))]},e.groupKey)),0===P.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:9,className:"px-6 py-8 text-center text-text-muted",children:"No account-specific usage recorded yet. Make requests using OAuth accounts to see data here."})})]})]})})]}),(0,r.jsxs)(o.default,{className:"overflow-hidden",children:[(0,r.jsx)("div",{className:"p-4 border-b border-border bg-bg-subtle/50",children:(0,r.jsx)("h3",{className:"font-semibold",children:"Usage by API Key"})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm text-left",children:[(0,r.jsx)("thead",{className:"bg-bg-subtle/30 text-text-muted uppercase text-xs",children:(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","keyName"),children:["API Key Name"," ",(0,r.jsx)(x,{field:"keyName",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","rawModel"),children:["Model"," ",(0,r.jsx)(x,{field:"rawModel",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","provider"),children:["Provider"," ",(0,r.jsx)(x,{field:"provider",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","requests"),children:["Requests"," ",(0,r.jsx)(x,{field:"requests",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","lastUsed"),children:["Last Used"," ",(0,r.jsx)(x,{field:"lastUsed",currentSort:h,currentOrder:p})]}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","promptTokens"),children:["Input Tokens"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","completionTokens"),children:["Output Tokens"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","totalTokens"),children:["Total Tokens"," ",(0,r.jsx)(x,{field:"totalTokens",currentSort:h,currentOrder:p})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","promptTokens"),children:["Input Cost"," ",(0,r.jsx)(x,{field:"promptTokens",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","completionTokens"),children:["Output Cost"," ",(0,r.jsx)(x,{field:"completionTokens",currentSort:h,currentOrder:p})]}),(0,r.jsxs)("th",{className:"px-6 py-3 text-right cursor-pointer hover:bg-bg-subtle/50",onClick:()=>R("apiKey","cost"),children:["Total Cost"," ",(0,r.jsx)(x,{field:"cost",currentSort:h,currentOrder:p})]})]})]})}),(0,r.jsxs)("tbody",{className:"divide-y divide-border",children:[W.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{className:"group-summary cursor-pointer hover:bg-bg-subtle/50 transition-colors",onClick:()=>G(e.groupKey),children:[(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted transition-transform ${E.has(e.groupKey)?"rotate-90":""}`,children:"chevron_right"}),(0,r.jsx)("span",{className:"font-medium",children:e.groupKey})]})}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-text-muted",children:"—"}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:V(e.summary.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:Y(e.summary.lastUsed)}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.summary.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.summary.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:V(e.summary.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.summary.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.summary.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:H(e.summary.totalCost)})]})]},`summary-${e.groupKey}`),E.has(e.groupKey)&&e.items.map(e=>(0,r.jsxs)("tr",{className:"group-detail hover:bg-bg-subtle/20 transition-colors",children:[(0,r.jsx)("td",{className:"px-6 py-3 font-medium",children:e.keyName}),(0,r.jsx)("td",{className:"px-6 py-3",children:e.rawModel}),(0,r.jsx)("td",{className:"px-6 py-3",children:(0,r.jsx)(c.default,{variant:"neutral",size:"sm",children:e.provider})}),(0,r.jsx)("td",{className:"px-6 py-3 text-right",children:V(e.requests)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted whitespace-nowrap",children:Y(e.lastUsed)}),"tokens"===v?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.promptTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:V(e.completionTokens)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium",children:V(e.totalTokens)})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.inputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right text-text-muted",children:H(e.outputCost)}),(0,r.jsx)("td",{className:"px-6 py-3 text-right font-medium text-warning",children:H(e.totalCost)})]})]},`detail-${e.key}`))]},e.groupKey)),0===W.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:9,className:"px-6 py-8 text-center text-text-muted",children:"No API key usage recorded yet. Make requests using API keys to see data here."})})]})]})})]})]})}x.propTypes={field:n().string.isRequired,currentSort:n().string.isRequired,currentOrder:n().string.isRequired},m.propTypes={data:n().arrayOf(n().number).isRequired,colorClass:n().string}},8067:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({options:e=[],value:t,onChange:s,size:l="md",className:n}){let i={sm:"h-7 text-xs",md:"h-9 text-sm",lg:"h-11 text-base"};return(0,r.jsx)("div",{className:(0,a.cn)("inline-flex items-center p-1 rounded-lg","bg-black/5 dark:bg-white/5",n),children:e.map(e=>(0,r.jsxs)("button",{onClick:()=>s(e.value),className:(0,a.cn)("px-4 rounded-md font-medium transition-all",i[l],t===e.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[e.icon&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] mr-1.5",children:e.icon}),e.label]},e.value))})}},8542:(e,t,s)=>{s.d(t,{default:()=>l});var r=s(5155),a=s(1474);function l({checked:e=!1,onChange:t,label:s,description:l,disabled:n=!1,size:i="md",className:o}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,r.jsxs)("div",{className:(0,a.cn)("flex items-center gap-3",n&&"opacity-50 cursor-not-allowed",o),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:n,onClick:()=>{!n&&t&&t(!e)},className:(0,a.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-1 focus:ring-primary/30",e?"bg-primary":"bg-black/10 dark:bg-white/20",c[i].track,n&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,a.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[i].translate:"translate-x-0.5",c[i].thumb,"mt-0.5")})}),(s||l)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[s&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:s}),l&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:l})]})]})}},8587:(e,t,s)=>{s.d(t,{default:()=>n});var r=s(5155),a=s(1620),l=s(1474);function n({className:e,variant:t="default"}){let{theme:s,toggleTheme:n,isDark:i}=(0,a.D)(),o={default:(0,l.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted","hover:bg-black/5","hover:text-text-main","transition-colors"),card:(0,l.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60","hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-md","text-text-muted-light hover:text-primary","hover:text-primary","transition-all group")};return(0,r.jsx)("button",{onClick:n,className:(0,l.cn)(o[t],e),"aria-label":`Switch to ${i?"light":"dark"} mode`,title:`Switch to ${i?"light":"dark"} mode`,children:(0,r.jsx)("span",{className:(0,l.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:i?"light_mode":"dark_mode"})})}},8815:(e,t,s)=>{s.d(t,{default:()=>i});var r=s(5155),a=s(2115),l=s(1127),n=s(2542);function i({isOpen:e,onClose:t,title:s="Manual Configuration",configs:i=[]}){let[o,c]=(0,a.useState)(null),d=async(e,t)=>{try{await navigator.clipboard.writeText(e),c(t),setTimeout(()=>c(null),2e3)}catch(e){console.log("Failed to copy:",e)}};return(0,r.jsx)(l.default,{isOpen:e,onClose:t,title:s,size:"xl",children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:i.map((e,t)=>(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:e.filename}),(0,r.jsxs)(n.default,{variant:"ghost",size:"sm",onClick:()=>d(e.content,t),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:o===t?"check":"content_copy"}),o===t?"Copied!":"Copy"]})]}),(0,r.jsx)("pre",{className:"px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs overflow-x-auto whitespace-pre-wrap break-all max-h-60 overflow-y-auto border border-border",children:e.content})]},t))})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8729],{85:(i,e,n)=>{n.d(e,{A:()=>t});var a=n(1934),o=n(9311),m=n(620);function d(i){let e=document.documentElement,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"dark"===("system"===i?n:i)?e.classList.add("dark"):e.classList.remove("dark")}let t=(0,a.v)((0,o.Zr)((i,e)=>({theme:m.B2.defaultTheme,setTheme:e=>{i({theme:e}),d(e)},toggleTheme:()=>{let n="dark"===e().theme?"light":"dark";i({theme:n}),d(n)},initTheme:()=>{d(e().theme)}}),{name:m.B2.storageKey}))},620:(i,e,n)=>{n.d(e,{Q2:()=>a.Q2,fg:()=>a.fg,vQ:()=>o,MA:()=>a.MA,zN:()=>a.zN,B2:()=>m});var a=n(2679);n(8777);let o={name:"Endpoint Proxy",description:"AI Infrastructure Management",version:"0.2.80"},m={storageKey:"theme",defaultTheme:"system"}},1110:(i,e,n)=>{n.d(e,{ThemeProvider:()=>d});var a=n(5155),o=n(2115),m=n(85);function d({children:i}){let{initTheme:e}=(0,m.A)();return(0,o.useEffect)(()=>{e()},[e]),(0,a.jsx)(a.Fragment,{children:i})}},2679:(i,e,n)=>{n.d(e,{DI:()=>t,IS:()=>a,JH:()=>d,MA:()=>u,Q2:()=>r,fg:()=>m,gb:()=>c,mq:()=>l,wG:()=>s,wb:()=>p,zN:()=>o,zt:()=>g});let a={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"}},o={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"}},m={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#6366F1",textIcon:"OR",passthroughModels:!0},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL"},"glm-cn":{id:"glm-cn",alias:"glm-cn",name:"GLM Coding (China)",icon:"code",color:"#DC2626",textIcon:"GC"},kimi:{id:"kimi",alias:"kimi",name:"Kimi Coding",icon:"psychology",color:"#1E3A8A",textIcon:"KM"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE"}},d="openai-compatible-",t="anthropic-compatible-";function l(i){return"string"==typeof i&&i.startsWith(d)}function c(i){return"string"==typeof i&&i.startsWith(t)}let r={...a,...o,...m},u={oauth:{id:"oauth",name:"OAuth",icon:"lock"},apikey:{id:"apikey",name:"API Key",icon:"key"}};function g(i){for(let e of Object.values(r))if(e.alias===i||e.id===i)return e;return null}function s(i){let e=r[i];return e?.alias||i}Object.values(r).reduce((i,e)=>(i[e.alias]=e.id,i),{}),Object.values(r).reduce((i,e)=>(i[e.id]=e.alias,i),{});let p=["antigravity","kiro","github"]},3097:(i,e,n)=>{n.d(e,{KC:()=>m,Xg:()=>o,vq:()=>a});let a={cc:[{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-opus-4-5-20251101",name:"Claude 4.5 Opus"},{id:"claude-sonnet-4-5-20250929",name:"Claude 4.5 Sonnet"},{id:"claude-haiku-4-5-20251001",name:"Claude 4.5 Haiku"}],cx:[{id:"gpt-5.3-codex",name:"GPT 5.3 Codex"},{id:"gpt-5.3-codex-xhigh",name:"GPT 5.3 Codex (xHigh)"},{id:"gpt-5.3-codex-high",name:"GPT 5.3 Codex (High)"},{id:"gpt-5.3-codex-low",name:"GPT 5.3 Codex (Low)"},{id:"gpt-5.3-codex-none",name:"GPT 5.3 Codex (None)"},{id:"gpt-5.1-codex-mini",name:"GPT 5.1 Codex Mini"},{id:"gpt-5.1-codex-mini-high",name:"GPT 5.1 Codex Mini (High)"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"},{id:"gpt-5.2",name:"GPT 5.2"},{id:"gpt-5.1-codex-max",name:"GPT 5.1 Codex Max"},{id:"gpt-5.1-codex",name:"GPT 5.1 Codex"},{id:"gpt-5.1",name:"GPT 5.1"},{id:"gpt-5-codex",name:"GPT 5 Codex"},{id:"gpt-5-codex-mini",name:"GPT 5 Codex Mini"}],gc:[{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}],qw:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash"},{id:"vision-model",name:"Qwen3 Vision Model"}],if:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"kimi-k2",name:"Kimi K2"},{id:"kimi-k2-thinking",name:"Kimi K2 Thinking"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"deepseek-r1",name:"DeepSeek R1"},{id:"deepseek-v3.2-chat",name:"DeepSeek V3.2 Chat"},{id:"minimax-m2.1",name:"MiniMax M2.1"},{id:"glm-4.7",name:"GLM 4.7"},{id:"glm-4.6",name:"GLM 4.6"},{id:"glm-5",name:"GLM 5"}],ag:[{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking"},{id:"claude-opus-4-5-thinking",name:"Claude Opus 4.5 Thinking"},{id:"claude-sonnet-4-5-thinking",name:"Claude Sonnet 4.5 Thinking"},{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5"},{id:"gemini-3-pro-high",name:"Gemini 3 Pro High"},{id:"gemini-3-pro-low",name:"Gemini 3 Pro Low"},{id:"gemini-3-flash",name:"Gemini 3 Flash"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"}],gh:[{id:"gpt-3.5-turbo",name:"GPT-3.5 Turbo"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o mini"},{id:"gpt-4.1",name:"GPT-4.1"},{id:"gpt-5",name:"GPT-5"},{id:"gpt-5-mini",name:"GPT-5 Mini"},{id:"gpt-5-codex",name:"GPT-5 Codex"},{id:"gpt-5.1",name:"GPT-5.1"},{id:"gpt-5.1-codex",name:"GPT-5.1 Codex"},{id:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini"},{id:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5.2-codex",name:"GPT-5.2 Codex"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"},{id:"claude-opus-4.1",name:"Claude Opus 4.1"},{id:"claude-opus-4.5",name:"Claude Opus 4.5"},{id:"claude-sonnet-4",name:"Claude Sonnet 4"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"claude-opus-4.6",name:"Claude Opus 4.6"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash"},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro"},{id:"grok-code-fast-1",name:"Grok Code Fast 1"},{id:"oswe-vscode-prime",name:"Raptor Mini"}],kr:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"}],cu:[{id:"default",name:"Auto (Server Picks)"},{id:"claude-4.5-opus-high-thinking",name:"Claude 4.5 Opus High Thinking"},{id:"claude-4.5-opus-high",name:"Claude 4.5 Opus High"},{id:"claude-4.5-sonnet-thinking",name:"Claude 4.5 Sonnet Thinking"},{id:"claude-4.5-sonnet",name:"Claude 4.5 Sonnet"},{id:"claude-4.5-haiku",name:"Claude 4.5 Haiku"},{id:"claude-4.5-opus",name:"Claude 4.5 Opus"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"}],openai:[{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"o1",name:"O1"},{id:"o1-mini",name:"O1 Mini"}],anthropic:[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"claude-opus-4-20250514",name:"Claude Opus 4"},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"}],gemini:[{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}],openrouter:[{id:"auto",name:"Auto (Best Available)"}],glm:[{id:"glm-4.7",name:"GLM 4.7"},{id:"glm-4.6v",name:"GLM 4.6V (Vision)"}],"glm-cn":[{id:"glm-4.7",name:"GLM-4.7"},{id:"glm-4.6",name:"GLM-4.6"},{id:"glm-4.5",name:"GLM-4.5"},{id:"glm-4.5-air",name:"GLM-4.5-Air"}],kimi:[{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"}],minimax:[{id:"MiniMax-M2.1",name:"MiniMax M2.1"}],"minimax-cn":[{id:"MiniMax-M2.1",name:"MiniMax M2.1"}]},o={claude:"cc",codex:"cx","gemini-cli":"gc",qwen:"qw",iflow:"if",antigravity:"ag",github:"gh",kiro:"kr",cursor:"cu",openai:"openai",anthropic:"anthropic",gemini:"gemini",openrouter:"openrouter",glm:"glm","glm-cn":"glm-cn",kimi:"kimi",minimax:"minimax","minimax-cn":"minimax-cn"};function m(i){return a[o[i]||i]||[]}},8777:(i,e,n)=>{n.d(e,{KC:()=>a.KC,Xg:()=>a.Xg});var a=n(3097);Object.entries(n(2679).Q2).filter(([,i])=>i.passthroughModels).map(([i])=>i),Object.entries(a.vq).flatMap(([i,e])=>e.map(e=>({provider:i,model:e.id,name:e.name})))}}]);
|