9router 0.3.72 → 0.3.75
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 +6 -4
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/routes-manifest.json +17 -0
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- 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.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -0
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -0
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +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 +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +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.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +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.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +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.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +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.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +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.js +3 -3
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +1 -1
- 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.js +2 -2
- package/app/.next/server/app/_not-found/page.js.nft.json +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 +4 -4
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
- 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 +2 -2
- package/app/.next/server/app/api/9remote/install/route.js +1 -1
- package/app/.next/server/app/api/9remote/start/route.js +1 -1
- package/app/.next/server/app/api/9remote/status/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +3 -3
- package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/locale/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- package/app/.next/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/models/test/route.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.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-models/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next/server/app/api/settings/database/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/app/.next/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/chart/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/providers/route.js +1 -1
- package/app/.next/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/stats/route.js +1 -1
- package/app/.next/server/app/api/usage/stream/route.js +2 -2
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next/server/app/api/version/route.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +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 +5 -5
- package/app/.next/server/app/callback.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next/server/app/dashboard/basic-chat.rsc +6 -6
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.html +1 -1
- package/app/.next/server/app/dashboard/combos.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.html +1 -1
- package/app/.next/server/app/dashboard/endpoint.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.html +1 -1
- package/app/.next/server/app/dashboard/mitm.rsc +6 -6
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.html +1 -1
- package/app/.next/server/app/dashboard/providers/new.rsc +6 -6
- 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 +6 -6
- 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 +4 -4
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.html +1 -1
- package/app/.next/server/app/dashboard/providers.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.rsc +6 -6
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
- package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/quota.html +2 -2
- package/app/.next/server/app/dashboard/quota.rsc +7 -7
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
- package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +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 +5 -5
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
- 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 +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- 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 +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.html +1 -1
- package/app/.next/server/app/dashboard/usage.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard.html +1 -1
- package/app/.next/server/app/dashboard.rsc +6 -6
- 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 +6 -6
- package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/favicon.ico/route.js +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +4 -4
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +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 +5 -5
- package/app/.next/server/app/landing.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +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 +5 -5
- package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
- package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- 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/manifest.webmanifest/route.js +2 -2
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +6 -4
- package/app/.next/server/chunks/1006.js +1 -0
- package/app/.next/server/chunks/1021.js +2 -2
- package/app/.next/server/chunks/1249.js +1 -1
- package/app/.next/server/chunks/126.js +2 -2
- package/app/.next/server/chunks/1574.js +1 -1
- package/app/.next/server/chunks/1578.js +1 -1
- package/app/.next/server/chunks/2049.js +1 -1
- package/app/.next/server/chunks/2371.js +1 -1
- package/app/.next/server/chunks/242.js +1 -1
- package/app/.next/server/chunks/3437.js +1 -1
- package/app/.next/server/chunks/450.js +1 -1
- package/app/.next/server/chunks/4891.js +1 -1
- package/app/.next/server/chunks/514.js +2 -2
- package/app/.next/server/chunks/6379.js +2 -2
- package/app/.next/server/chunks/7770.js +1 -1
- package/app/.next/server/chunks/8202.js +8 -8
- package/app/.next/server/chunks/9489.js +1 -0
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +2 -2
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/static/{_qgNKf11lJ14fXVq78FHz → Ww_6kqPqPWlQlt6zRVg8A}/_buildManifest.js +1 -1
- package/app/.next/static/chunks/2599-ef3aca3d4fdaa96d.js +1 -0
- package/app/.next/static/chunks/4156-3f71ff6f6ba6ba05.js +7 -0
- package/app/.next/static/chunks/505-89a51ca9c483211d.js +1 -0
- package/app/.next/static/chunks/{7400-50da1ed150e33a12.js → 7400-a5c928f6fdd4565c.js} +2 -2
- package/app/.next/static/chunks/{8035-50a417d15f2c7add.js → 8035-20ab85a50b665aaf.js} +2 -2
- package/app/.next/static/chunks/{8038-eb05e7b987bf8682.js → 8038-368cfbdf9080110b.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-0435d33448929432.js → page-2c8c481b0fc0bb1b.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-0c8d84a9902c82cd.js → page-6af679bf1de2bcd0.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-aae6d82cc06c63dc.js → page-d0ee61fa81abf27e.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-a71f0b04cec6ce33.js → page-2ffb4689f161ca33.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-0b58256fd5ccd8b7.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-6c1c6a107653ebda.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-a01336ce4983ff58.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-51b86e47f0596937.js → page-7985d81ed92c1758.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-9533adb8cd2aa0ac.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/{page-8b6cb89a4a896f1d.js → page-354de24a25e94694.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-48b389fbdc1f0080.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-c37f77536819f259.js → page-426e797917337fd8.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-9d13181d51f5e656.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-6db708ca87ef8001.js → page-44d61ed9744d1025.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-61704bd0d8bd2bdf.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-ea7b3c29209f09f9.js → page-82c184348fd5c917.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-a8264365768d0e3f.js → page-ac2806ccdfd6ecae.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/layout-28cec0ea8271c92a.js +1 -0
- package/app/.next/static/chunks/app/callback/page-80c520a5e353c3ac.js +1 -0
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-d9a2df5b3f666b3b.js +1 -0
- package/app/.next/static/chunks/app/layout-c47481f46f5ae72b.js +1 -0
- package/app/.next/static/chunks/app/login/{page-4db7bca8c7eaced7.js → page-c0d5d5c52ff7317f.js} +1 -1
- package/app/.next/static/css/5ed5a95fa0b29325.css +1 -0
- package/app/package.json +1 -1
- package/app/src/mitm/server.js +1 -1
- package/package.json +1 -1
- package/app/.next/server/chunks/7134.js +0 -1
- package/app/.next/static/chunks/2599-8f4e92ca3efe2987.js +0 -1
- package/app/.next/static/chunks/350-5598fb3601dca0c9.js +0 -1
- package/app/.next/static/chunks/4156-f8e9c6334c5964b1.js +0 -7
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-c5de25b2450ef326.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-b7f6d0ad91fad565.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a8c26437a17c1428.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-4d3ee7c24d230edc.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-dcc45476a839f9bc.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/layout-3cb0ade24c0d3292.js +0 -1
- package/app/.next/static/chunks/app/callback/page-0b1aadd71bae5ed3.js +0 -1
- package/app/.next/static/chunks/app/dashboard/settings/pricing/page-18b73be8f4ae3bf2.js +0 -1
- package/app/.next/static/chunks/app/layout-76aaa65ecb33e97d.js +0 -1
- package/app/.next/static/css/bb060fc0f56debfe.css +0 -1
- /package/app/.next/static/{_qgNKf11lJ14fXVq78FHz → Ww_6kqPqPWlQlt6zRVg8A}/_ssgManifest.js +0 -0
package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a8c26437a17c1428.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{7207:(e,t,i)=>{Promise.resolve().then(i.bind(i,31660))},31660:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>g});var s=i(73365),a=i(1521),r=i(86447),n=i.n(r),o=i(29717),l=i(99568),d=i.n(l),c=i(58872),p=i(74156),x=i(82495),m=i(69633),u=i(96459);let h=new Map,y={"openrouter-free":e=>e.filter(e=>e.pricing?.prompt==="0"&&e.pricing?.completion==="0"&&e.context_length>=2e5).map(e=>({id:e.id,name:e.name,contextLength:e.context_length})).sort((e,t)=>t.contextLength-e.contextLength)};async function f(e){if(!e?.url||!e?.type)return[];let t=h.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=await fetch(e.url);if(!t.ok)return[];let i=await t.json(),s=i.data??i.models??i,a=y[e.type],r=a?a(Array.isArray(s)?s:[]):[];return h.set(e.url,{data:r,expiresAt:Date.now()+6e5}),r}catch{return[]}}function g(){let e=(0,o.useParams)(),t=(0,o.useRouter)(),i=e.id,[r,n]=(0,a.useState)([]),[l,h]=(0,a.useState)(!0),[y,g]=(0,a.useState)(null),[v,N]=(0,a.useState)([]),[$,P]=(0,a.useState)(!1),[T,O]=(0,a.useState)(!1),[E,R]=(0,a.useState)(!1),[_,I]=(0,a.useState)(!1),[D,q]=(0,a.useState)(!1),[U,K]=(0,a.useState)(!1),[M,L]=(0,a.useState)(null),[F,J]=(0,a.useState)({}),[z,W]=(0,a.useState)(!1),[V,B]=(0,a.useState)({}),[G,Z]=(0,a.useState)(""),[Q,H]=(0,a.useState)(null),[X,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)([]),[ei,es]=(0,a.useState)("__none__"),[ea,er]=(0,a.useState)(!1),[en,eo]=(0,a.useState)(null),[el,ed]=(0,a.useState)(""),[ec,ep]=(0,a.useState)([]),[ex,em]=(0,a.useState)([]),{copied:eu,copy:eh}=(0,u.C)(),ey=y?{id:y.id,name:y.name||("anthropic-compatible"===y.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===y.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===y.type?"AC":"OC",apiType:y.apiType,baseUrl:y.baseUrl,type:y.type}:x.zN[i]||x.fg[i]||x.IS[i]||x.nJ[i],ef=!!x.zN[i]||!!x.IS[i],eg=(0,m.KC)(i),eb=(0,x.wG)(i),ev=(0,x.mq)(i),ej=(0,x.gb)(i),eN=ev||ej,ek=eN?i:eb,ew=eN?y?.prefix||i:eb,eC=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&J(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,a.useEffect)(()=>{"kilocode"===i&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&em(e.models)}).catch(()=>{})},[i]);let eS=(0,a.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),r=await e.json(),o=await t.json(),l=await s.json(),d=a.ok?await a.json():{};if(e.ok){let e=(r.connections||[]).filter(e=>e.provider===i);n(e)}s.ok&&N(l.proxyPools||[]);let c=(d.providerStrategies||{})[i]||{};if(eo(c.fallbackStrategy||null),ed(null!=c.stickyRoundRobinLimit?String(c.stickyRoundRobinLimit):"1"),t.ok){let e=(o.nodes||[]).find(e=>e.id===i)||null;if(!e&&eN)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===i)||null))break}g(e)}}catch(e){console.log("Error fetching connections:",e)}finally{h(!1)}},[i,eN]),eA=async e=>{try{let t=await fetch(`/api/provider-nodes/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(g(s.node),await eS(),q(!1))}catch(e){console.log("Error updating provider node:",e)}},e$=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},r={};e&&(r.fallbackStrategy=e),"round-robin"===e&&""!==t&&(r.stickyRoundRobinLimit=Number(t)||3);let n={...a};0===Object.keys(r).length?delete n[i]:n[i]=r,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){console.log("Error saving provider strategy:",e)}};(0,a.useEffect)(()=>{eS(),eC()},[eS,eC]),(0,a.useEffect)(()=>{let e=(x.zN[i]||x.fg[i]||x.IS[i]||x.nJ[i])?.modelsFetcher;e&&f(e).then(ep)},[i]);let eP=async(e,t,i=eb)=>{let s=`${i}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await eC();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},eT=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eC()}catch(e){console.log("Error deleting alias:",e)}},eO=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&n(r.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},eE=()=>{eS(),P(!1)},eR=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,...e})})).ok&&(await eS(),R(!1))}catch(e){console.log("Error saving connection:",e)}},e_=async e=>{try{(await fetch(`/api/providers/${M.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eS(),I(!1))}catch(e){console.log("Error updating connection:",e)}},eI=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&n(i=>i.map(i=>i.id===e?{...i,isActive:t}:i))}catch(e){console.log("Error updating connection status:",e)}},eD=async(e,t)=>{let i=[...r];[i[e],i[t]]=[i[t],i[e]],n(i);try{await Promise.all([fetch(`/api/providers/${i[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${i[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await eS()}},eq=r.filter(e=>ee.includes(e.id));r.length>0&&(ee.length,r.length),(0,a.useEffect)(()=>{et(e=>e.filter(e=>r.some(t=>t.id===e)))},[r]);let eU=(()=>{if(0===eq.length)return"";let e=new Set(eq.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return"All selected currently unbound";let i=v.find(e=>e.id===t);return`All selected currently bound to ${i?.name||t}`}return"Selected connections have mixed proxy bindings"})(),eK=()=>{ea||K(!1)},eM=async()=>{if(0===ee.length)return;let e="__none__"===ei?null:ei;er(!0);try{let t=[];for(let i of ee)try{let s=await fetch(`/api/providers/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:e})});t.push(s.ok)}catch(e){console.log("Error applying bulk proxy pool for",i,e),t.push(!1)}let i=t.filter(e=>!e).length;i>0&&alert(`Updated with ${i} failed request(s).`),await eS(),et([]),es("__none__"),K(!1)}catch(e){console.log("Error applying bulk proxy pool:",e)}finally{er(!1)}},eL=(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:r.map((e,t)=>(0,s.jsx)("div",{className:"flex items-stretch",children:(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)(k,{connection:e,proxyPools:v,isOAuth:ef,isFirst:0===t,isLast:t===r.length-1,onMoveUp:()=>eD(t,t-1),onMoveDown:()=>eD(t,t+1),onToggleActive:t=>eI(e.id,t),onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&n(i=>i.map(i=>i.id===e.id?{...i,providerSpecificData:{...i.providerSpecificData,proxyPoolId:t||null}}:i))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{L(e),I(!0)},onDelete:()=>eO(e.id)})})},e.id))}),eF=[{value:"__none__",label:"None"},...v.map(e=>({value:e.id,label:e.name}))],eJ=0===ee.length?"Select one or more connections, then click Proxy Action.":eU,ez=ee.length>0&&!ea,eW=(0,s.jsx)(p.aF,{isOpen:U,onClose:eK,title:`Proxy Action (${ee.length} selected)`,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.l6,{label:"Proxy Pool",value:ei,onChange:e=>es(e.target.value),options:eF,placeholder:"None"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:eJ}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Selecting None will unbind selected connections from proxy pool."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:eM,fullWidth:!0,disabled:!ez,children:ea?"Applying...":"Apply"}),(0,s.jsx)(p.$n,{onClick:eK,variant:"ghost",fullWidth:!0,disabled:ea,children:"Cancel"})]})]})}),eV=async e=>{if(!Q){H(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${ek}/${e}`})}),i=await t.json();B(t=>({...t,[e]:i.ok?"ok":"error"})),Z(i.ok?"":i.error||"Model not reachable")}catch{B(t=>({...t,[e]:"error"})),Z("Network error")}finally{H(null)}}};return l?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(p.Qv,{}),(0,s.jsx)(p.Qv,{})]}):ey?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"rounded-lg flex items-center justify-center",style:{backgroundColor:`${ey.color}15`},children:z?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:ey.color},children:ey.textIcon||ey.id.slice(0,2).toUpperCase()}):(0,s.jsx)(c.default,{src:ev&&ey.apiType?"responses"===ey.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":ej?"/providers/anthropic-m.png":`/providers/${ey.id}.png`,alt:ey.name,width:48,height:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",sizes:"48px",onError:()=>W(!0)})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:ey.name}),(0,s.jsxs)("p",{className:"text-text-muted",children:[r.length," connection",1===r.length?"":"s"]})]})]})]}),ey.deprecated&&(0,s.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-black/[0.05] dark:border-white/[0.05]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted mt-0.5 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:ey.deprecationNotice})]}),ey.notice&&!ey.deprecated&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-black/[0.05] dark:border-white/[0.05]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted shrink-0",children:"info"}),(0,s.jsx)("p",{className:"text-xs text-text-muted leading-relaxed",children:ey.notice.text}),ey.notice.apiKeyUrl&&(0,s.jsx)("a",{href:ey.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline shrink-0",children:"Get API Key →"})]}),eN&&y&&(0,s.jsxs)(p.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:ej?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:[ej?"Messages API":"responses"===y.apiType?"Responses API":"Chat Completions"," \xb7 ",(y.baseUrl||"").replace(/\/$/,""),"/",ej?"messages":"responses"===y.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>R(!0),disabled:r.length>0,children:"Add"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>q(!0),children:"Edit"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${ej?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${i}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},children:"Delete"})]})]}),r.length>0&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Only one connection is allowed per compatible node. Add another node if you need more connections."})]}),(0,s.jsxs)(p.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(p.lM,{checked:"round-robin"===en,onChange:e=>{let t=e?"round-robin":null,i=e?el||"1":el;e&&!el&&ed("1"),eo(t),e$(t,i)}}),"round-robin"===en&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:el,onChange:e=>{var t;ed(t=e.target.value),e$("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===r.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:ef?"lock":"key"})}),(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No connections yet"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Add your first connection to get started"}),!eN&&(0,s.jsxs)("div",{className:"flex gap-2 justify-center",children:["iflow"===i&&(0,s.jsx)(p.$n,{icon:"cookie",variant:"secondary",onClick:()=>O(!0),children:"Cookie Auth"}),(0,s.jsx)(p.$n,{icon:"add",onClick:()=>ef?P(!0):R(!0),children:"iflow"===i?"OAuth":"Add Connection"})]})]}):(0,s.jsxs)(s.Fragment,{children:[eL,!eN&&(0,s.jsxs)("div",{className:"flex gap-2 mt-4",children:["iflow"===i&&(0,s.jsx)(p.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>O(!0),title:"Add connection using browser cookie",children:"Cookie"}),(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>ef?P(!0):R(!0),children:"Add"})]})]})]}),(0,s.jsxs)(p.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"})}),!!G&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:G}),(()=>{let e,t;if(eN)return(0,s.jsx)(j,{providerStorageAlias:ek,providerDisplayAlias:ew,modelAliases:F,copied:eu,onCopy:eh,onSetAlias:eP,onDeleteAlias:eT,connections:r,isAnthropic:ej});let a=[...eg,...ex.filter(e=>!eg.some(t=>t.id===e.id))],n=Object.entries(F).filter(([e,t])=>{let i=`${ek}/`;if(!t.startsWith(i))return!1;let s=t.slice(i.length);return ey.passthroughModels?!eg.some(e=>e.id===s):!eg.some(e=>e.id===s)&&e===s}).map(([e,t])=>({id:t.slice(`${ek}/`.length),alias:e,fullModel:t}));return(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a.map(e=>{let t=`${ek}/${e.id}`,a=`${i}/${e.id}`,n=Object.entries(F).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(b,{model:e,fullModel:`${ew}/${e.id}`,alias:n,copied:eu,onCopy:eh,onSetAlias:t=>eP(e.id,t,ek),onDeleteAlias:()=>eT(n),testStatus:V[e.id],onTest:r.length>0?()=>eV(e.id):void 0,isTesting:Q===e.id,isFree:e.isFree},e.id)}),n.map(e=>(0,s.jsx)(b,{model:{id:e.id},fullModel:`${ew}/${e.id}`,alias:e.alias,copied:eu,onCopy:eh,onSetAlias:()=>{},onDeleteAlias:()=>eT(e.alias),testStatus:V[e.id],onTest:r.length>0?()=>eV(e.id):void 0,isTesting:Q===e.id,isCustom:!0},e.id)),(0,s.jsxs)("button",{onClick:()=>Y(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),ec.length>0&&(e=new Set(Object.values(F)),0===(t=ec.filter(t=>!e.has(`${ek}/${t.id}`))).length?null:(0,s.jsxs)("div",{className:"w-full mt-2",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map(e=>(0,s.jsxs)("button",{onClick:async()=>{let t=e.id.split("/").pop();await eP(e.id,t,ek)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]}))]})})()]}),eW,"kiro"===i?(0,s.jsx)(p.Mh,{isOpen:$,providerInfo:ey,onSuccess:eE,onClose:()=>P(!1)}):"cursor"===i?(0,s.jsx)(p.G9,{isOpen:$,onSuccess:eE,onClose:()=>P(!1)}):"gitlab"===i?(0,s.jsx)(p.vj,{isOpen:$,providerInfo:ey,onSuccess:eE,onClose:()=>P(!1)}):(0,s.jsx)(p.LF,{isOpen:$,provider:i,providerInfo:ey,onSuccess:eE,onClose:()=>P(!1)}),"iflow"===i&&(0,s.jsx)(p.vE,{isOpen:T,onSuccess:()=>{eS(),O(!1)},onClose:()=>O(!1)}),(0,s.jsx)(w,{isOpen:E,provider:i,providerName:ey.name,isCompatible:eN,isAnthropic:ej,proxyPools:v,onSave:eR,onClose:()=>R(!1)}),(0,s.jsx)(C,{isOpen:_,connection:M,proxyPools:v,onSave:e_,onClose:()=>I(!1)}),eN&&(0,s.jsx)(S,{isOpen:D,node:y,onSave:eA,onClose:()=>q(!1),isAnthropic:ej}),!eN&&(0,s.jsx)(A,{isOpen:X,providerAlias:ek,providerDisplayAlias:ew,onSave:async e=>{let t=ey?.passthroughModels?e.split("/").pop():e;await eP(e,t,ek),Y(!1)},onClose:()=>Y(!1)})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(d(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}function b({model:e,fullModel:t,alias:i,copied:a,onCopy:r,testStatus:n,isCustom:o,isFree:l,onDeleteAlias:d,onTest:c,isTesting:p}){let x="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:x?{color:x}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),c&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:c,disabled:p,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${p?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),o&&(0,s.jsx)("button",{onClick:d,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function v({modelId:e,fullModel:t,copied:i,onCopy:a,onDeleteAlias:r,onTest:n,testStatus:o,isTesting:l}){let d="ok"===o?"#22c55e":"error"===o?"#ef4444":void 0;return(0,s.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===o?"border-green-500/40":"error"===o?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===o?"check_circle":"error"===o?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e}`?"Copied!":"Copy"})]}),n&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:n,disabled:l,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:l?{animation:"spin 1s linear infinite"}:void 0,children:l?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:l?"Testing...":"Test"})]})]})]}),(0,s.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function j({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:i,copied:r,onCopy:n,onSetAlias:o,onDeleteAlias:l,connections:d,isAnthropic:c}){let[x,m]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(null),[N,k]=(0,a.useState)({}),w=async t=>{if(!g){b(t);try{let i=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),s=await i.json();k(e=>({...e,[t]:s.ok?"ok":"error"}))}catch{k(e=>({...e,[t]:"error"}))}finally{b(null)}}},C=Object.entries(i).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,i])=>({modelId:i.replace(`${e}/`,""),fullModel:i,alias:t})),S=s=>{let a,r=`${e}/${s}`;if(Object.values(i).includes(r))return null;let n=(a=s.split("/"))[a.length-1];if(!i[n])return n;let o=`${t}-${n}`;return i[o]?null:o},A=async()=>{if(!x.trim()||u)return;let t=x.trim(),i=S(t);if(!i)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await o(t,i,e),m("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},$=async()=>{if(y)return;let t=d.find(e=>!1!==e.isActive);if(t){f(!0);try{let i=await fetch(`/api/providers/${t.id}/models`),s=await i.json();if(!i.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let r=0;for(let t of a){let i=t.id||t.name||t.model;if(!i)continue;let s=S(i);s&&(await o(i,s,e),r+=1)}0===r&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{f(!1)}}},P=d.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",c?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>m(e.target.value),onKeyDown:e=>"Enter"===e.key&&A(),placeholder:c?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:A,disabled:!x.trim()||u,children:u?"Adding...":"Add"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"download",onClick:$,disabled:!P||y,children:y?"Importing...":"Import from /models"})]}),!P&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({modelId:e,fullModel:i,alias:a})=>(0,s.jsx)(v,{modelId:e,fullModel:`${t}/${e}`,copied:r,onCopy:n,onDeleteAlias:()=>l(a),onTest:d.length>0?()=>w(e):void 0,testStatus:N[e],isTesting:g===e},i))})]})}function N({until:e}){let[t,i]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void i("");let s=Math.floor(t/1e3);if(s<60)i(`${s}s`);else if(s<3600)i(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);i(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function k({connection:e,proxyPools:t,isOAuth:i,isFirst:r,isLast:n,onMoveUp:o,onMoveDown:l,onToggleActive:d,onUpdateProxy:c,onEdit:x,onDelete:m}){let[u,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(!1),g=(0,a.useRef)(null),b=new Map((t||[]).map(e=>[e.id,e])),v=e.providerSpecificData?.proxyPoolId||null,j=v?b.get(v):null,w=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!v||w,S=j?`Pool: ${j.name}`:v?`Pool: ${v} (inactive/missing)`:w?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A="";if(j?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=j?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);A=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{A=t}}let $=j?.noProxy||e.providerSpecificData?.connectionNoProxy||"",P="default";j?.isActive===!0?P="success":(v||w)&&(P="error"),(0,a.useEffect)(()=>{if(!u)return;let e=e=>{g.current&&!g.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let T=async e=>{f(!0);try{await c("__none__"===e?null:e)}finally{f(!1),h(!1)}},O=i?e.name||e.email||e.displayName||"OAuth Account":e.name,[E,R]=(0,a.useState)(!1),_=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,a.useEffect)(()=>{let t=()=>{R(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let i=_?setInterval(t,1e3):null;return()=>{i&&clearInterval(i)}},[_]);let I="unavailable"!==e.testStatus||E?e.testStatus:"active";return(0,s.jsxs)("div",{className:`group flex items-center justify-between p-3 rounded-lg hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:l,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:i?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:O}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)(p.Ex,{variant:!1===e.isActive?"default":"active"===I||"success"===I?"success":"error"===I||"expired"===I||"unavailable"===I?"error":"default",size:"sm",dot:!0,children:!1===e.isActive?"disabled":I||"Unknown"}),C&&(0,s.jsx)(p.Ex,{variant:P,size:"sm",children:"Proxy"}),E&&!1!==e.isActive&&(0,s.jsx)(N,{until:_}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]})]}),C&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:S,children:S}),A&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:A}),$&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:g,children:[(0,s.jsxs)("button",{onClick:()=>h(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),u&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>T("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!v?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>T(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${v===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:x,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:m,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(p.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}function w({isOpen:e,provider:t,providerName:i,isCompatible:r,isAnthropic:n,proxyPools:o,onSave:l,onClose:d}){let c="__none__",[x,m]=(0,a.useState)({name:"",apiKey:"",priority:1,proxyPoolId:c}),[u,h]=(0,a.useState)(!1),[y,f]=(0,a.useState)(null),[g,b]=(0,a.useState)(!1),v=async()=>{h(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:x.apiKey})}),i=await e.json();f(i.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}},j=async()=>{if(t&&x.apiKey){b(!0);try{let e=!1;try{h(!0),f(null);let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:x.apiKey})});e=!!(await i.json()).valid,f(e?"success":"failed")}catch{f("failed")}finally{h(!1)}await l({name:x.name,apiKey:x.apiKey,priority:x.priority,proxyPoolId:x.proxyPoolId===c?null:x.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:void 0})}finally{b(!1)}}};return t?(0,s.jsx)(p.aF,{isOpen:e,title:`Add ${i||t} API Key`,onClose:d,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:x.name,onChange:e=>m({...x,name:e.target.value}),placeholder:"Production Key"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key",type:"password",value:x.apiKey,onChange:e=>m({...x,apiKey:e.target.value}),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:v,disabled:!x.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),y&&(0,s.jsx)(p.Ex,{variant:"success"===y?"success":"error",children:"success"===y?"Valid":"Invalid"}),r&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:n?`Validation checks ${i||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${i||"OpenAI Compatible"} via /models on your base URL.`}),(0,s.jsx)(p.pd,{label:"Priority",type:"number",value:x.priority,onChange:e=>m({...x,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsx)(p.l6,{label:"Proxy Pool",value:x.proxyPoolId,onChange:e=>m({...x,proxyPoolId:e.target.value}),options:[{value:c,label:"None"},...(o||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(o||[]).length&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:j,fullWidth:!0,disabled:!x.name||!x.apiKey||g,children:g?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:d,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function C({isOpen:e,connection:t,proxyPools:i,onSave:r,onClose:n}){let[o,l]=(0,a.useState)({name:"",priority:1,apiKey:""}),[d,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(null),[h,y]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(l({name:t.name||"",priority:t.priority||1,apiKey:""}),u(null),g(null))},[t]);let j=async()=>{if(t?.provider){c(!0),u(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),i=await e.json();u(i.valid?"success":"failed")}catch{u("failed")}finally{c(!1)}}},N=async()=>{if(t?.provider&&o.apiKey){y(!0),g(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:o.apiKey})}),i=await e.json();g(i.valid?"success":"failed")}catch{g("failed")}finally{y(!1)}}},k=async()=>{v(!0);try{let e={name:o.name,priority:o.priority};if(!w&&o.apiKey){e.apiKey=o.apiKey;let i="success"===f;if(!i)try{y(!0),g(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:o.apiKey})});i=!!(await e.json()).valid,g(i?"success":"failed")}catch{g("failed")}finally{y(!1)}i&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}await r(e)}finally{v(!1)}};if(!t)return null;let w="oauth"===t.authType,S=(0,x.mq)(t.provider)||(0,x.gb)(t.provider);return(0,s.jsx)(p.aF,{isOpen:e,title:"Edit Connection",onClose:n,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:o.name,onChange:e=>l({...o,name:e.target.value}),placeholder:w?"Account name":"Production Key"}),w&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),(0,s.jsx)(p.pd,{label:"Priority",type:"number",value:o.priority,onChange:e=>l({...o,priority:Number.parseInt(e.target.value)||1})}),!w&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key",type:"password",value:o.apiKey,onChange:e=>l({...o,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:N,disabled:!o.apiKey||h||b,variant:"secondary",children:h?"Checking...":"Check"})})]}),f&&(0,s.jsx)(p.Ex,{variant:"success"===f?"success":"error",children:"success"===f?"Valid":"Invalid"})]}),!S&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(p.$n,{onClick:j,variant:"secondary",disabled:d,children:d?"Testing...":"Test Connection"}),m&&(0,s.jsx)(p.Ex,{variant:"success"===m?"success":"error",children:"success"===m?"Valid":"Failed"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:k,fullWidth:!0,disabled:b,children:b?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function S({isOpen:e,node:t,onSave:i,onClose:r,isAnthropic:n}){let[o,l]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,a.useState)(!1),[x,m]=(0,a.useState)(""),[u,h]=(0,a.useState)(""),[y,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&l({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,n]);let v=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){c(!0);try{let e={name:o.name,prefix:o.prefix,baseUrl:o.baseUrl};n||(e.apiType=o.apiType),await i(e)}finally{c(!1)}}},j=async()=>{f(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:x,type:n?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{f(!1)}};return t?(0,s.jsx)(p.aF,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:o.name,onChange:e=>l({...o,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,s.jsx)(p.pd,{label:"Prefix",value:o.prefix,onChange:e=>l({...o,prefix:e.target.value}),placeholder:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(0,s.jsx)(p.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:o.apiType,onChange:e=>l({...o,apiType:e.target.value})}),(0,s.jsx)(p.pd,{label:"Base URL",value:o.baseUrl,onChange:e=>l({...o,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key (for Check)",type:"password",value:x,onChange:e=>m(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:j,disabled:!x||y||!o.baseUrl.trim(),variant:"secondary",children:y?"Checking...":"Check"})})]}),(0,s.jsx)(p.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),g&&(0,s.jsx)(p.Ex,{variant:"success"===g?"success":"error",children:"success"===g?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:v,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function A({isOpen:e,providerAlias:t,providerDisplayAlias:i,onSave:r,onClose:n}){let[o,l]=(0,a.useState)(""),[d,c]=(0,a.useState)(null),[x,m]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(l(""),c(null),m(""))},[e]);let y=async()=>{if(o.trim()){c("testing"),m("");try{let e=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${o.trim()}`})}),i=await e.json();c(i.ok?"ok":"error"),m(i.error||"")}catch(e){c("error"),m(e.message)}}},f=async()=>{if(o.trim()&&!u){h(!0);try{await r(o.trim())}finally{h(!1)}}};return(0,s.jsx)(p.aF,{isOpen:e,onClose:n,title:"Add Custom Model",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:o,onChange:e=>{l(e.target.value),c(null),m("")},onKeyDown:e=>{"Enter"===e.key&&y()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,s.jsx)(p.$n,{variant:"secondary",icon:"science",loading:"testing"===d,onClick:y,disabled:!o.trim()||"testing"===d,children:"testing"===d?"Testing...":"Test"})]}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,s.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:o.trim()||"model-id"})]})]}),"ok"===d&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===d&&(0,s.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,s.jsx)("span",{children:x||"Model not reachable"})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(p.$n,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,s.jsx)(p.$n,{onClick:f,fullWidth:!0,size:"sm",disabled:!o.trim()||u,children:u?"Adding...":"Add Model"})]})]})})}b.propTypes={model:n().shape({id:n().string.isRequired}).isRequired,fullModel:n().string.isRequired,alias:n().string,copied:n().string,onCopy:n().func.isRequired,testStatus:n().oneOf(["ok","error"]),isCustom:n().bool,isFree:n().bool,onDeleteAlias:n().func,onTest:n().func,isTesting:n().bool},n().string.isRequired,n().object.isRequired,n().string,n().func.isRequired,n().func.isRequired,n().func.isRequired,v.propTypes={modelId:n().string.isRequired,fullModel:n().string.isRequired,copied:n().string,onCopy:n().func.isRequired,onDeleteAlias:n().func.isRequired,onTest:n().func,testStatus:n().oneOf(["ok","error"]),isTesting:n().bool},j.propTypes={providerStorageAlias:n().string.isRequired,providerDisplayAlias:n().string.isRequired,modelAliases:n().object.isRequired,copied:n().string,onCopy:n().func.isRequired,onSetAlias:n().func.isRequired,onDeleteAlias:n().func.isRequired,connections:n().arrayOf(n().shape({id:n().string,isActive:n().bool})).isRequired,isAnthropic:n().bool},N.propTypes={until:n().string.isRequired},k.propTypes={connection:n().shape({id:n().string,name:n().string,email:n().string,displayName:n().string,modelLockUntil:n().string,testStatus:n().string,isActive:n().bool,lastError:n().string,priority:n().number,globalPriority:n().number}).isRequired,proxyPools:n().arrayOf(n().shape({id:n().string,name:n().string,proxyUrl:n().string,noProxy:n().string,isActive:n().bool})),isOAuth:n().bool.isRequired,isFirst:n().bool.isRequired,isLast:n().bool.isRequired,onMoveUp:n().func.isRequired,onMoveDown:n().func.isRequired,onToggleActive:n().func.isRequired,onUpdateProxy:n().func,onEdit:n().func.isRequired,onDelete:n().func.isRequired},w.propTypes={isOpen:n().bool.isRequired,provider:n().string,providerName:n().string,isCompatible:n().bool,isAnthropic:n().bool,proxyPools:n().arrayOf(n().shape({id:n().string,name:n().string})),onSave:n().func.isRequired,onClose:n().func.isRequired},C.propTypes={isOpen:n().bool.isRequired,connection:n().shape({id:n().string,name:n().string,email:n().string,priority:n().number,authType:n().string,provider:n().string,providerSpecificData:n().object}),proxyPools:n().arrayOf(n().shape({id:n().string,name:n().string})),onSave:n().func.isRequired,onClose:n().func.isRequired},S.propTypes={isOpen:n().bool.isRequired,node:n().shape({id:n().string,name:n().string,prefix:n().string,apiType:n().string,baseUrl:n().string}),onSave:n().func.isRequired,onClose:n().func.isRequired,isAnthropic:n().bool},A.propTypes={isOpen:n().bool.isRequired,providerAlias:n().string.isRequired,providerDisplayAlias:n().string.isRequired,onSave:n().func.isRequired,onClose:n().func.isRequired}}},e=>{e.O(0,[7848,4335,2599,8872,350,4156,2347,5158,7358],()=>e(e.s=7207)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-4d3ee7c24d230edc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{43007:(e,t,s)=>{Promise.resolve().then(s.bind(s,69692))},69692:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(73365),a=s(1521),l=s(86447),i=s.n(l),n=s(74156),o=s(68266),d=s(43202),c=s(82495),p=s(99568),m=s.n(p),x=s(14793);let u={available:{icon:"check_circle",color:"#22c55e",label:"Available"},cooldown:{icon:"schedule",color:"#f59e0b",label:"Cooldown"},unavailable:{icon:"error",color:"#ef4444",label:"Unavailable"},unknown:{icon:"help",color:"#6b7280",label:"Unknown"}};function h(){let[e,t]=(0,a.useState)(null),[s,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,x.i)(),h=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let s=await e.json();t(s)}}catch{}finally{l(!1)}},[]);(0,a.useEffect)(()=>{h();let e=setInterval(h,3e4);return()=>clearInterval(e)},[h]),(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&o(!1)};return i&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let f=async(e,t)=>{c(`${e}:${t}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e,model:t})})).ok?(m.success(`Cooldown cleared for ${t}`),await h()):m.error("Failed to clear cooldown")}catch{m.error("Failed to clear cooldown")}finally{c(null)}};if(s)return null;let b=e?.models||[],g=0===(e?.unavailableCount||b.filter(e=>"available"!==e.status).length),v={};return b.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";v[t]||(v[t]=[]),v[t].push(e)}),(0,r.jsx)("div",{className:"relative",ref:p,children:i&&(0,r.jsxs)("div",{className:"absolute top-full right-0 mt-2 w-80 bg-surface border border-border rounded-xl shadow-2xl z-50 overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-bg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:g?"#22c55e":"#f59e0b"},children:g?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:"Model Status"})]}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:g?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:"All models are responding normally."}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(v).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:e}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let t=u[e.status]||u.unknown,s=d===`${e.provider}:${e.model}`;return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 rounded-lg bg-surface/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] shrink-0",style:{color:t.color},children:t.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:e.model})]}),"cooldown"===e.status&&(0,r.jsx)(n.$n,{size:"sm",variant:"ghost",onClick:()=>f(e.provider,e.model),disabled:s,className:"text-[10px] px-1.5! py-0.5! ml-2",children:s?"...":"Clear"})]},`${e.provider}-${e.model}`)})})]},e))})})]})})}function f(e,t,s){let a=[];if(e>0&&a.push((0,r.jsxs)(n.Ex,{variant:"success",size:"sm",dot:!0,children:[e," Connected"]},"connected")),t>0){let e=s?`${t} Error (${s})`:`${t} Error`;a.push((0,r.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===a.length?(0,r.jsx)("span",{className:"text-text-muted",children:"No connections"}):a}function b(){let[e,t]=(0,a.useState)([]),[s,l]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),[p,m]=(0,a.useState)(!1),[u,f]=(0,a.useState)(!1),[b,C]=(0,a.useState)(null),[k,T]=(0,a.useState)(null),w=(0,x.i)();(0,a.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),a=await s.json();e.ok&&t(r.connections||[]),s.ok&&l(a.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}})()},[]);let A=(t,s)=>{let r=e.filter(e=>e.provider===t&&e.authType===s),a=e=>{let t=Object.entries(e).some(([e,t])=>e.startsWith("modelLock_")&&t&&new Date(t).getTime()>Date.now());return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=a(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=a(e);return"error"===t||"expired"===t||"unavailable"===t}),n=i.length,o=r.length,d=o>0&&r.every(e=>!1===e.isActive),c=i.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:l,error:n,total:o,errorCode:c?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let r=function(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let a=(e.lastError||"").toLowerCase();return a.includes("runtime")||a.includes("not runnable")||a.includes("not installed")?"RUNTIME":a.includes("invalid api key")||a.includes("token invalid")||a.includes("revoked")||a.includes("unauthorized")?"AUTH":"ERR"}(c):null,errorTime:c?.lastErrorAt?function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let r=Math.floor(s/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},I=async(s,r,a)=>{let l=e.filter(e=>e.provider===s&&e.authType===r);t(e=>e.map(e=>e.provider===s&&e.authType===r?{...e,isActive:a}:e)),await Promise.allSettled(l.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})))},$=async(e,t=null)=>{if(!b){C("provider"===e?t:e),T(null);try{let s=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await s.json();if(T(r),r.summary){let{passed:e,failed:t,total:s}=r.summary;0===t?w.success(`All ${s} tests passed`):w.warning(`${e}/${s} passed, ${t} failed`)}}catch(e){T({error:"Test request failed"}),w.error("Provider test failed")}finally{C(null)}}},E=s.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||"OpenAI Compatible",color:"#10A37F",textIcon:"OC",apiType:e.apiType})),S=s.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||"Anthropic Compatible",color:"#D97757",textIcon:"AC"}));return i?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(n.Qv,{}),(0,r.jsx)(n.Qv,{})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-6",children:[(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 flex items-center gap-2",children:"OAuth Providers"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(h,{}),(0,r.jsxs)("button",{onClick:()=>$("oauth"),disabled:!!b,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"oauth"===b?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all OAuth connections","aria-label":"Test all OAuth connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"oauth"===b?" animate-spin":""}`,children:"oauth"===b?"sync":"play_arrow"}),"oauth"===b?"Testing...":"Test All"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(d.zN).map(([e,t])=>(0,r.jsx)(g,{providerId:e,provider:t,stats:A(e,"oauth"),authType:"oauth",onToggle:t=>I(e,"oauth",t)},e))})]}),(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 flex items-center gap-2",children:"Free & Free Tier Providers"}),(0,r.jsxs)("button",{onClick:()=>$("free"),disabled:!!b,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"free"===b?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all Free connections","aria-label":"Test all Free provider connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"free"===b?" animate-spin":""}`,children:"free"===b?"sync":"play_arrow"}),"free"===b?"Testing...":"Test All"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[Object.entries(c.IS).map(([e,t])=>(0,r.jsx)(g,{providerId:e,provider:t,stats:A(e,"oauth"),authType:"free",onToggle:t=>I(e,"oauth",t)},e)),Object.entries(c.nJ).map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:A(e,"apikey"),authType:"apikey",onToggle:t=>I(e,"apikey",t)},e))]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["API Key Providers"," "]}),(0,r.jsxs)("button",{onClick:()=>$("apikey"),disabled:!!b,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"apikey"===b?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg border-border text-text-muted hover:text-text-main hover:border-primary/40"}`,title:"Test all API Key connections","aria-label":"Test all API Key connections",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px]${"apikey"===b?" animate-spin":""}`,children:"apikey"===b?"sync":"play_arrow"}),"apikey"===b?"Testing...":"Test All"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Object.entries(d.fg).map(([e,t])=>(0,r.jsx)(v,{providerId:e,provider:t,stats:A(e,"apikey"),authType:"apikey",onToggle:t=>I(e,"apikey",t)},e))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["API Key Compatible Providers"," "]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>f(!0),children:"Add Anthropic Compatible"}),(0,r.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>m(!0),className:"!bg-white !text-black hover:!bg-gray-100",children:"Add OpenAI Compatible"})]})]}),0===E.length&&0===S.length?(0,r.jsxs)("div",{className:"text-center py-8 border border-dashed border-border rounded-xl",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"extension"}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:"No compatible providers added yet"}),(0,r.jsx)("p",{className:"text-text-muted text-xs mt-1",children:"Use the buttons above to add OpenAI or Anthropic compatible endpoints"})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...E,...S].map(e=>(0,r.jsx)(v,{providerId:e.id,provider:e,stats:A(e.id,"apikey"),authType:"compatible",onToggle:t=>I(e.id,"apikey",t)},e.id))})]}),(0,r.jsx)(y,{isOpen:p,onClose:()=>m(!1),onCreated:e=>{l(t=>[...t,e]),m(!1)}}),(0,r.jsx)(j,{isOpen:u,onClose:()=>f(!1),onCreated:e=>{l(t=>[...t,e]),f(!1)}}),k&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[10vh]",onClick:()=>T(null),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative bg-surface border border-border rounded-xl w-full max-w-[600px] max-h-[80vh] overflow-y-auto shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between px-5 py-3 border-b border-border bg-surface/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Test Results"}),(0,r.jsx)("button",{onClick:()=>T(null),className:"p-1 rounded-lg hover:bg-bg text-text-muted hover:text-text-main transition-colors","aria-label":"Close test results",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]}),(0,r.jsx)("div",{className:"p-5",children:(0,r.jsx)(N,{results:k})})]})]})]})}function g({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:c,errorTime:p,allDisabled:x}=s;return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${x?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:x?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[f(i,d,c),p&&(0,r.jsx)("span",{className:"text-text-muted",children:p})]})})]})]}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!x)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!x,onChange:()=>{},title:x?"Enable provider":"Disable provider"})})})]})})})}function v({providerId:e,provider:t,stats:s,authType:a,onToggle:l}){let{connected:i,error:d,errorCode:p,errorTime:x,allDisabled:u}=s,h=e.startsWith(c.JH),b=e.startsWith(c.DI);return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(n.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${u?"opacity-50":""}`,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color?.length>7?t.color:t.color+"15"}`},children:(0,r.jsx)(o.A,{src:h?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":b?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:t.textIcon||t.id.slice(0,2).toUpperCase(),fallbackColor:t.color})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold",children:t.name}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:u?(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"pause_circle"}),"Disabled"]})}):(0,r.jsxs)(r.Fragment,{children:[f(i,d,p),h&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"responses"===t.apiType?"Responses":"Chat"}),b&&(0,r.jsx)(n.Ex,{variant:"default",size:"sm",children:"Messages"}),x&&(0,r.jsx)("span",{className:"text-text-muted",children:x})]})})]})]}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:s.total>0&&(0,r.jsx)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!!u)},children:(0,r.jsx)(n.lM,{size:"sm",checked:!u,onChange:()=>{},title:u?"Enable provider":"Disable provider"})})})]})})})}function y({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[o,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{i(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[l.apiType]);let g=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,apiType:l.apiType,baseUrl:l.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"openai-compatible",modelId:m.trim()||void 0})}),t=await e.json();b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add OpenAI Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"OpenAI Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>i({...l,apiType:e.target.value})}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.openai.com/v1",hint:"Use the base URL (ending in /v1) for your OpenAI-compatible API."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. gpt-4, claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:g,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function j({isOpen:e,onClose:t,onCreated:s}){let[l,i]=(0,a.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[o,d]=(0,a.useState)(!1),[c,p]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[f,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(b(null),p(""),x(""))},[e]);let g=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){d(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,prefix:l.prefix,baseUrl:l.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(s(t.node),i({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),p(""),b(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{d(!1)}}},v=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:c,type:"anthropic-compatible",modelId:m.trim()||void 0})}),t=await e.json();b(t)}catch{b({valid:!1,error:"Network error"})}finally{h(!1)}};return(0,r.jsx)(n.aF,{isOpen:e,title:"Add Anthropic Compatible",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(n.pd,{label:"Name",value:l.name,onChange:e=>i({...l,name:e.target.value}),placeholder:"Anthropic Compatible (Prod)",hint:"Required. A friendly label for this node."}),(0,r.jsx)(n.pd,{label:"Prefix",value:l.prefix,onChange:e=>i({...l,prefix:e.target.value}),placeholder:"ac-prod",hint:"Required. Used as the provider prefix for model IDs."}),(0,r.jsx)(n.pd,{label:"Base URL",value:l.baseUrl,onChange:e=>i({...l,baseUrl:e.target.value}),placeholder:"https://api.anthropic.com/v1",hint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages."}),(0,r.jsx)(n.pd,{label:"API Key (for Check)",type:"password",value:c,onChange:e=>p(e.target.value)}),(0,r.jsx)(n.pd,{label:"Model ID (optional)",value:m,onChange:e=>x(e.target.value),placeholder:"e.g. claude-3-opus",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(n.$n,{onClick:v,disabled:!c||u||!l.baseUrl.trim(),variant:"secondary",children:u?"Checking...":"Check"}),(()=>{if(!f)return null;let{valid:e,error:t,method:s}=f;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Ex,{variant:"success",children:"Valid"}),"chat"===s&&(0,r.jsx)("span",{className:"text-sm text-text-muted",children:"(via inference test)"})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(n.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(n.$n,{onClick:g,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||o,children:o?"Creating...":"Create"}),(0,r.jsx)(n.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function N({results:e}){if(e.error&&!e.results)return(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2 block",children:"error"}),(0,r.jsx)("p",{className:"text-sm text-red-400",children:e.error})]});let{summary:t,mode:s}=e,a=e.results||[];return(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[t&&(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs mb-1",children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API Key",provider:"Provider",all:"All"}[s]||s," Test"]}),(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:[t.passed," passed"]}),t.failed>0&&(0,r.jsxs)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:[t.failed," failed"]}),(0,r.jsxs)("span",{className:"text-text-muted ml-auto",children:[t.total," tested"]})]}),a.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs px-3 py-2 rounded-lg bg-black/[0.03] dark:bg-white/[0.03]",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[16px] ${e.valid?"text-emerald-500":"text-red-500"}`,children:e.valid?"check_circle":"error"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"font-medium",children:e.connectionName}),(0,r.jsxs)("span",{className:"text-text-muted ml-1.5",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,r.jsxs)("span",{className:"text-text-muted font-mono tabular-nums",children:[e.latencyMs,"ms"]}),(0,r.jsx)("span",{className:`text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${e.valid?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400"}`,children:e.valid?"OK":e.diagnosis?.type||"ERROR"})]},e.connectionId||t)),0===a.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:"No active connections found for this group."})]})}g.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},v.propTypes={providerId:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,apiType:i().string}).isRequired,stats:i().shape({connected:i().number,error:i().number,errorCode:i().string,errorTime:i().string}).isRequired,authType:i().string,onToggle:i().func},y.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},j.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func.isRequired},N.propTypes={results:i().shape({mode:i().string,results:i().array,summary:i().shape({total:i().number,passed:i().number,failed:i().number}),error:i().string}).isRequired}}},e=>{e.O(0,[7848,4335,2599,350,4156,2347,5158,7358],()=>e(e.s=43007)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{292:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});var s=r(73365),a=r(87706);function n({children:e,title:t,subtitle:r,icon:l,action:i,padding:o="md",hover:c=!1,className:d,...u}){return(0,s.jsxs)("div",{className:(0,a.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",c&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[o],d),...u,children:[(t||i)&&(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[l&&(0,s.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l})}),(0,s.jsxs)("div",{children:[t&&(0,s.jsx)("h3",{className:"text-text-main font-semibold",children:t}),r&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:r})]})]}),i]}),e]})}n.Section=function({children:e,className:t,...r}){return(0,s.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),...r,children:e})},n.Row=function({children:e,className:t,...r}){return(0,s.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),...r,children:e})},n.ListItem=function({children:e,actions:t,className:r,...n}){return(0,s.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",r),...n,children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,s.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},390:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},23006:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},31121:(e,t,r)=>{"use strict";var s=r(23006);function a(){}function n(){}n.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,n,l){if(l!==s){var i=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n,resetWarningCache:a};return r.PropTypes=r,r}},32878:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var s=r(73365),a=r(1521),n=r(68266),l=r(292);r(35045);var i=r(94718);function o(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function c({quotas:e=[]}){return e&&0!==e.length?(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full table-fixed",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"w-[30%]"})," ",(0,s.jsx)("col",{className:"w-[45%]"})," ",(0,s.jsx)("col",{className:"w-[25%]"})," "]}),(0,s.jsx)("tbody",{children:e.map((e,t)=>{let r=void 0!==e.remainingPercentage?Math.round(e.remainingPercentage):o(e.used,e.total),a=r>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},n=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,s=t-r;if(s<=0)return"-";let a=Math.ceil(s/6e4);if(a<60)return`${a}m`;let n=Math.floor(a/60),l=a%60;if(n<24)return`${n}h ${l}m`;let i=Math.floor(n/24);return`${i}d ${n%24}h ${l}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,s=new Date(r.getFullYear(),r.getMonth(),r.getDate()),a=new Date(s);a.setDate(a.getDate()+1);let n="";n=t>=s&&t<a?"Today":t>=a&&t<new Date(a.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let l=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${n}, ${l}`}catch{return null}}(e.resetAt);return(0,s.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs",children:a.emoji}),(0,s.jsx)("span",{className:"text-sm font-medium text-text-primary",children:e.name})]})}),(0,s.jsx)("td",{className:"py-2 px-3",children:(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("div",{className:`h-1.5 rounded-full overflow-hidden border ${a.bgLight} ${0===r?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,s.jsx)("div",{className:`h-full transition-all duration-300 ${a.bg}`,style:{width:`${Math.min(r,100)}%`}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,s.jsxs)("span",{className:`font-medium ${a.text}`,children:[r,"%"]})]})]})}),(0,s.jsx)("td",{className:"py-2 px-3",children:"-"!==n||l?(0,s.jsxs)("div",{className:"space-y-0.5",children:["-"!==n&&(0,s.jsxs)("div",{className:"text-sm text-text-primary font-medium",children:["in ",n]}),l&&(0,s.jsx)("div",{className:"text-xs text-text-muted",children:l})]}):(0,s.jsx)("div",{className:"text-sm text-text-muted italic",children:"N/A"})})]},t)})})]})}):null}var d=r(38230),u=r(82495);function m(){let[e,t]=(0,a.useState)([]),[r,m]=(0,a.useState)({}),[x,h]=(0,a.useState)({}),[p,b]=(0,a.useState)({}),[f,g]=(0,a.useState)(!0),[v,j]=(0,a.useState)(null),[y,w]=(0,a.useState)(!1),[N,k]=(0,a.useState)(60),[_,E]=(0,a.useState)(!0),$=(0,a.useRef)(null),q=(0,a.useRef)(null),L=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/providers/client");if(!e.ok)throw Error("Failed to fetch connections");let r=(await e.json()).connections||[];return t(r),r}catch(e){return console.error("Error fetching connections:",e),t([]),[]}},[]),A=(0,a.useCallback)(async(e,t)=>{h(t=>({...t,[e]:!0})),b(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}`);if(!r.ok){let s=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,s),m(t=>({...t,[e]:{quotas:[],message:s}}));return}throw Error(`HTTP ${r.status}: ${s}`)}let s=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let a=function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let s=(0,i.KC)(e);if(s.length>0){let e=new Map(s.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let s=t.modelKey||t.name,a=r.modelKey||r.name;return(e.get(s)??999)-(e.get(a)??999)})}return r}(t,s);m(t=>({...t,[e]:{quotas:a,plan:s.plan||null,message:s.message||null,raw:s}}))}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),b(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{h(t=>({...t,[e]:!1}))}},[]),P=(0,a.useCallback)(async(e,t)=>{await A(e,t),j(new Date)},[A]),S=(0,a.useCallback)(async()=>{if(!y){w(!0),k(60);try{let e=(await L()).filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType);await Promise.all(e.map(e=>A(e.id,e.provider))),j(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{w(!1)}}},[y,L,A]);(0,a.useEffect)(()=>{(async()=>{E(!0);let e=await L();E(!1);let t=e.filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType),r={};t.forEach(e=>{r[e.id]=!0}),h(r),await Promise.all(t.map(e=>A(e.id,e.provider))),j(new Date)})()},[]),(0,a.useEffect)(()=>{if(!f){$.current&&(clearInterval($.current),$.current=null),q.current&&(clearInterval(q.current),q.current=null);return}return $.current=setInterval(()=>{S()},6e4),q.current=setInterval(()=>{k(e=>e<=1?60:e-1)},1e3),()=>{$.current&&clearInterval($.current),q.current&&clearInterval(q.current)}},[f,S]),(0,a.useEffect)(()=>{let e=()=>{document.hidden?($.current&&(clearInterval($.current),$.current=null),q.current&&(clearInterval(q.current),q.current=null)):f&&($.current=setInterval(S,6e4),q.current=setInterval(()=>{k(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[f,S]);let C=(0,a.useCallback)(()=>{if(!v)return"Never";let e=Math.floor((new Date-v)/6e4),t=Math.floor(e/60),r=Math.floor(t/24);return r>0?`${r}d ago`:t>0?`${t}h ago`:e>0?`${e}m ago`:"Just now"},[v]),T=[...e.filter(e=>u.wb.includes(e.provider)&&"oauth"===e.authType)].sort((e,t)=>{let r=u.wb.indexOf(e.provider),s=u.wb.indexOf(t.provider);return r!==s?r-s:e.provider.localeCompare(t.provider)});return(T.length,Object.values(r).filter(e=>e?.quotas?.length>0).length,Object.values(r).reduce((e,t)=>t?.quotas?e+ +!!t.quotas.some(e=>30>o(e.used,e.total)&&e.total>0):e,0),_||0!==T.length)?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-text-primary",children:"Provider Limits"}),(0,s.jsxs)("span",{className:"text-sm text-text-muted",children:["Last updated: ",C()]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("button",{onClick:()=>g(e=>!e),className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-black/10 dark:border-white/10 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",title:f?"Disable auto-refresh":"Enable auto-refresh",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[18px] ${f?"text-primary":"text-text-muted"}`,children:f?"toggle_on":"toggle_off"}),(0,s.jsx)("span",{className:"text-sm text-text-primary",children:"Auto-refresh"}),f&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["(",N,"s)"]})]}),(0,s.jsx)(d.default,{variant:"secondary",size:"md",icon:"refresh",onClick:S,disabled:y,loading:y,children:"Refresh All"})]})]}),(0,s.jsx)("div",{className:"flex flex-col gap-4",children:T.map(e=>{let t=r[e.id],a=x[e.id],i=p[e.id];return(0,s.jsxs)(l.default,{padding:"none",children:[(0,s.jsx)("div",{className:"p-6 border-b border-black/10 dark:border-white/10",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center overflow-hidden",children:(0,s.jsx)(n.A,{src:`/providers/${e.provider}.png`,alt:e.provider,size:40,className:"object-contain",fallbackText:e.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-text-primary capitalize",children:e.provider}),e.name&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:e.name})]})]}),(0,s.jsx)("button",{onClick:()=>P(e.id,e.provider),disabled:a,className:"p-2 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",title:"Refresh quota",children:(0,s.jsx)("span",{className:`material-symbols-outlined text-[20px] text-text-muted ${a?"animate-spin":""}`,children:"refresh"})})]})}),(0,s.jsx)("div",{className:"p-6",children:a?(0,s.jsx)("div",{className:"text-center py-8 text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] animate-spin",children:"progress_activity"})}):i?(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px] text-red-500",children:"error"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:i})]}):t?.message?(0,s.jsx)("div",{className:"text-center py-8",children:(0,s.jsx)("p",{className:"text-sm text-text-muted",children:t.message})}):(0,s.jsx)(c,{quotas:t?.quotas})})]},e.id)})})]}):(0,s.jsx)(l.default,{padding:"lg",children:(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,s.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}},35045:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var s=r(73365),a=r(87706);let n={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"},l={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:r="md",dot:o=!1,icon:c,className:d}){return(0,s.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-full font-semibold",n[t],l[r],d),children:[o&&(0,s.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")}),c&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:c}),e]})}},38230:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var s=r(73365),a=r(87706);let n={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"},l={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:r="md",icon:o,iconRight:c,disabled:d=!1,loading:u=!1,fullWidth:m=!1,className:x,...h}){return(0,s.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",n[t],l[r],m&&"w-full",x),disabled:d||u,...h,children:[u?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,c&&!u&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:c})]})}},58944:(e,t,r)=>{Promise.resolve().then(r.bind(r,32878)),Promise.resolve().then(r.bind(r,91494))},68266:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(73365),a=r(1521),n=r(86447),l=r.n(n);function i({src:e,alt:t,size:r=32,className:n="",fallbackText:l="?",fallbackColor:o}){let[c,d]=(0,a.useState)(!1);return!e||c?(0,s.jsx)("span",{className:`inline-flex items-center justify-center font-bold rounded-lg ${n}`.trim(),style:{width:r,height:r,color:o,fontSize:Math.max(10,Math.floor(.38*r))},children:l}):(0,s.jsx)("img",{src:e,alt:t,width:r,height:r,className:n,onError:()=>d(!0)})}i.propTypes={src:l().string,alt:l().string,size:l().number,className:l().string,fallbackText:l().string,fallbackColor:l().string}},86447:(e,t,r)=>{e.exports=r(31121)()},87706:(e,t,r)=>{"use strict";function s(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}r.d(t,{cn:()=>s})},91494:(e,t,r)=>{"use strict";r.d(t,{CardSkeleton:()=>o,PageLoading:()=>l,Skeleton:()=>i,Spinner:()=>n,default:()=>c});var s=r(73365),a=r(87706);function n({size:e="md",className:t}){return(0,s.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 l({message:e="Loading..."}){return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg",children:[(0,s.jsx)(n,{size:"xl"}),(0,s.jsx)("p",{className:"mt-4 text-text-muted",children:e})]})}function i({className:e,...t}){return(0,s.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-lg bg-border",e),...t})}function o(){return(0,s.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)(i,{className:"h-4 w-24"}),(0,s.jsx)(i,{className:"size-10 rounded-lg"})]}),(0,s.jsx)(i,{className:"h-8 w-16 mb-2"}),(0,s.jsx)(i,{className:"h-3 w-20"})]})}function c({type:e="spinner",...t}){switch(e){case"page":return(0,s.jsx)(l,{...t});case"skeleton":return(0,s.jsx)(i,{...t});case"card":return(0,s.jsx)(o,{...t});default:return(0,s.jsx)(n,{...t})}}}},e=>{e.O(0,[350,2347,5158,7358],()=>e(e.s=58944)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{98023:(e,s,n)=>{Promise.resolve().then(n.bind(n,82455)),Promise.resolve().then(n.bind(n,35045)),Promise.resolve().then(n.bind(n,38230)),Promise.resolve().then(n.bind(n,292)),Promise.resolve().then(n.bind(n,70391)),Promise.resolve().then(n.bind(n,70789)),Promise.resolve().then(n.bind(n,50136)),Promise.resolve().then(n.bind(n,51123)),Promise.resolve().then(n.bind(n,68600)),Promise.resolve().then(n.bind(n,53038)),Promise.resolve().then(n.bind(n,63380)),Promise.resolve().then(n.bind(n,73531)),Promise.resolve().then(n.bind(n,51454)),Promise.resolve().then(n.bind(n,12003)),Promise.resolve().then(n.bind(n,54546)),Promise.resolve().then(n.bind(n,13048)),Promise.resolve().then(n.bind(n,91494)),Promise.resolve().then(n.bind(n,5671)),Promise.resolve().then(n.bind(n,66911)),Promise.resolve().then(n.bind(n,24372)),Promise.resolve().then(n.bind(n,67692)),Promise.resolve().then(n.bind(n,27249)),Promise.resolve().then(n.bind(n,3242)),Promise.resolve().then(n.bind(n,32135)),Promise.resolve().then(n.bind(n,1755)),Promise.resolve().then(n.bind(n,37066)),Promise.resolve().then(n.bind(n,56550)),Promise.resolve().then(n.bind(n,98814)),Promise.resolve().then(n.bind(n,84675)),Promise.resolve().then(n.bind(n,14406)),Promise.resolve().then(n.bind(n,13333)),Promise.resolve().then(n.bind(n,3412))}},e=>{e.O(0,[7848,4335,2599,350,4156,2347,5158,7358],()=>e(e.s=98023)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7852],{29717:(e,s,t)=>{"use strict";var a=t(21505);t.o(a,"useParams")&&t.d(s,{useParams:function(){return a.useParams}}),t.o(a,"usePathname")&&t.d(s,{usePathname:function(){return a.usePathname}}),t.o(a,"useRouter")&&t.d(s,{useRouter:function(){return a.useRouter}}),t.o(a,"useSearchParams")&&t.d(s,{useSearchParams:function(){return a.useSearchParams}})},30948:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>i});var a=t(73365),l=t(1521),r=t(29717);function n(){let e=(0,r.useSearchParams)(),[s,t]=(0,l.useState)("processing");return(0,l.useEffect)(()=>{let s=e.get("code"),a=e.get("state"),l=e.get("error"),r={code:s,state:a,error:l,errorDescription:e.get("error_description"),fullUrl:window.location.href};if(window.location.origin,window.opener)try{window.opener.postMessage({type:"oauth_callback",data:r},"*")}catch(e){console.log("postMessage failed:",e)}try{let e=new BroadcastChannel("oauth_callback");e.postMessage(r),e.close()}catch(e){console.log("BroadcastChannel failed:",e)}try{localStorage.setItem("oauth_callback",JSON.stringify({...r,timestamp:Date.now()}))}catch(e){console.log("localStorage failed:",e)}s||l?(t("success"),setTimeout(()=>{window.close(),setTimeout(()=>t("done"),500)},1500)):setTimeout(()=>t("manual"),0)},[e]),(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,a.jsxs)("div",{className:"text-center p-8 max-w-md",children:["processing"===s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Processing..."}),(0,a.jsx)("p",{className:"text-text-muted",children:"Please wait while we complete the authorization."})]}),("success"===s||"done"===s)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.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,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Authorization Successful!"}),(0,a.jsx)("p",{className:"text-text-muted",children:"success"===s?"This window will close automatically...":"You can close this tab now."})]}),"manual"===s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-yellow-100 dark:bg-yellow-900/30 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-yellow-600",children:"info"})}),(0,a.jsx)("h1",{className:"text-xl font-semibold mb-2",children:"Copy This URL"}),(0,a.jsx)("p",{className:"text-text-muted mb-4",children:"Please copy the URL from the address bar and paste it in the application."}),(0,a.jsx)("div",{className:"bg-surface border border-border rounded-lg p-3 text-left",children:(0,a.jsx)("code",{className:"text-xs break-all",children:window.location.href})})]})]})})}function i(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,a.jsxs)("div",{className:"text-center p-8",children:[(0,a.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,a.jsx)("p",{className:"text-text-muted",children:"Loading..."})]})}),children:(0,a.jsx)(n,{})})}},99617:(e,s,t)=>{Promise.resolve().then(t.bind(t,30948))}},e=>{e.O(0,[2347,5158,7358],()=>e(e.s=99617)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7370],{292:(e,t,c)=>{"use strict";c.d(t,{default:()=>i});var a=c(73365),n=c(87706);function i({children:e,title:t,subtitle:c,icon:r,action:o,padding:s="md",hover:u=!1,className:d,...p}){return(0,a.jsxs)("div",{className:(0,n.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",u&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[s],d),...p,children:[(t||o)&&(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[r&&(0,a.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:r})}),(0,a.jsxs)("div",{children:[t&&(0,a.jsx)("h3",{className:"text-text-main font-semibold",children:t}),c&&(0,a.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),o]}),e]})}i.Section=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...c,children:e})},i.Row=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.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),...c,children:e})},i.ListItem=function({children:e,actions:t,className:c,...i}){return(0,a.jsxs)("div",{className:(0,n.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",c),...i,children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,a.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:t})]})}},10075:(e,t,c)=>{Promise.resolve().then(c.bind(c,32530))},29717:(e,t,c)=>{"use strict";var a=c(21505);c.o(a,"useParams")&&c.d(t,{useParams:function(){return a.useParams}}),c.o(a,"usePathname")&&c.d(t,{usePathname:function(){return a.usePathname}}),c.o(a,"useRouter")&&c.d(t,{useRouter:function(){return a.useRouter}}),c.o(a,"useSearchParams")&&c.d(t,{useSearchParams:function(){return a.useSearchParams}})},32530:(e,t,c)=>{"use strict";c.r(t),c.d(t,{default:()=>u});var a=c(73365),n=c(1521),i=c(29717),r=c(292);let o={cc:{"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},cx:{"gpt-5.3-codex":{input:6,output:24,cached:3,reasoning:36,cache_creation:6},"gpt-5.3-codex-xhigh":{input:10,output:40,cached:5,reasoning:60,cache_creation:10},"gpt-5.3-codex-high":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.3-codex-low":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.3-codex-none":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-codex-mini":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},gc:{"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},qw:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},if:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"deepseek-r1":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"deepseek-v3.2-chat":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"deepseek-v3.2-reasoner":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},ag:{"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},gh:{"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},kr:{"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5}},openai:{"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},anthropic:{"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3}},gemini:{"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},openrouter:{auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},glm:{"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},kimi:{"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},minimax:{"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},deepseek:{"deepseek-chat":{input:.28,output:.42,cached:.028,reasoning:.42,cache_creation:.28},"deepseek-reasoner":{input:.28,output:.42,cached:.028,reasoning:.42,cache_creation:.28}}};function s({isOpen:e,onClose:t,onSave:c}){let[i,r]=(0,n.useState)({}),[u,d]=(0,n.useState)(!0),[p,l]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&h()},[e]);let h=async()=>{d(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();r(t)}else r(o)}catch(e){console.error("Failed to load pricing:",e),r(o)}finally{d(!1)}},g=async()=>{l(!0);try{let e=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.ok)c?.(),t();else{let t=await e.json();alert(`Failed to save pricing: ${t.error}`)}}catch(e){console.error("Failed to save pricing:",e),alert("Failed to save pricing")}finally{l(!1)}},x=async()=>{if(confirm("Reset all pricing to defaults? This cannot be undone."))try{(await fetch("/api/pricing",{method:"DELETE"})).ok&&r(o)}catch(e){console.error("Failed to reset pricing:",e),alert("Failed to reset pricing")}};if(!e)return null;let m=Object.keys(i).sort(),b=["input","output","cached","reasoning","cache_creation"];return(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,a.jsxs)("div",{className:"bg-bg-base border border-border rounded-lg shadow-xl max-w-6xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Pricing Configuration"}),(0,a.jsx)("button",{onClick:t,className:"text-text-muted hover:text-text text-2xl leading-none",children:"\xd7"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-4",children:u?(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"Loading pricing data..."}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"bg-bg-subtle border border-border rounded-lg p-3 text-sm",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:"Pricing Rates Format"}),(0,a.jsxs)("p",{className:"text-text-muted",children:["All rates are in ",(0,a.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: Input rate of 2.50 means $2.50 per 1,000,000 input tokens."]})]}),m.map(e=>{let t=Object.keys(i[e]).sort();return(0,a.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,a.jsx)("div",{className:"bg-bg-subtle px-4 py-2 font-semibold text-sm",children:e.toUpperCase()}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-bg-hover text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Model"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Input"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Output"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cached"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Reasoning"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cache Creation"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50",children:[(0,a.jsx)("td",{className:"px-3 py-2 font-medium",children:t}),b.map(c=>(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:i[e][t][c]||0,onChange:a=>{let n;!isNaN(n=parseFloat(a.target.value))&&!(n<0)&&r(a=>{let i={...a};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={}),i[e][t][c]=n,i})},className:"w-20 px-2 py-1 text-right bg-bg-base border border-border rounded focus:outline-none focus:border-primary"})},c))]},t))})]})})]},e)}),0===m.length&&(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"No pricing data available"})]})}),(0,a.jsxs)("div",{className:"p-4 border-t border-border flex items-center justify-between gap-2",children:[(0,a.jsx)("button",{onClick:x,className:"px-4 py-2 text-sm text-red-500 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",disabled:p,children:"Reset to Defaults"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm text-text-muted hover:text-text border border-border rounded transition-colors",disabled:p,children:"Cancel"}),(0,a.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:p,children:p?"Saving...":"Save Changes"})]})]})]})})}function u(){(0,i.useRouter)();let[e,t]=(0,n.useState)(!1),[c,o]=(0,n.useState)(null),[u,d]=(0,n.useState)(!0);(0,n.useEffect)(()=>{p()},[]);let p=async()=>{d(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();o(t)}}catch(e){console.error("Failed to load pricing:",e)}finally{d(!1)}};return(0,a.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold",children:"Pricing Settings"}),(0,a.jsx)("p",{className:"text-text-muted mt-1",children:"Configure pricing rates for cost tracking and calculations"})]}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary/90 transition-colors",children:"Edit Pricing"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Total Models"}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:u?"...":(()=>{if(!c)return 0;let e=0;for(let t in c)e+=Object.keys(c[t]).length;return e})()})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Providers"}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:u?"...":(!c?[]:Object.keys(c).sort()).length})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:"Status"}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-success",children:u?"...":"Active"})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold mb-4",children:"How Pricing Works"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-text-muted",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Cost Calculation:"}),"Costs are calculated based on token usage and pricing rates. Each request's cost is determined by: (input_tokens \xd7 input_rate) + (output_tokens \xd7 output_rate) + (cached_tokens \xd7 cached_rate)"]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Pricing Format:"})," All rates are in ",(0,a.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: An input rate of 2.50 means $2.50 per 1,000,000 input tokens."]}),(0,a.jsx)("p",{children:(0,a.jsx)("strong",{children:"Token Types:"})}),(0,a.jsxs)("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Input:"})," Standard prompt tokens"]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Output:"})," Completion/response tokens"]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Cached:"})," Cached input tokens (typically 50% of input rate)"]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Reasoning:"})," Special reasoning/thinking tokens (fallback to output rate)"]}),(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:"Cache Creation:"})," Tokens used to create cache entries (fallback to input rate)"]})]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Custom Pricing:"})," You can override default pricing for specific models. Reset to defaults anytime to restore standard rates."]})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Current Pricing Overview"}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"text-primary hover:underline text-sm",children:"View Full Details"})]}),u?(0,a.jsx)("div",{className:"text-center py-4 text-text-muted",children:"Loading pricing data..."}):c?(0,a.jsxs)("div",{className:"space-y-3",children:[Object.keys(c).slice(0,5).map(e=>(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsxs)("span",{className:"font-semibold",children:[e.toUpperCase(),":"]})," ",(0,a.jsxs)("span",{className:"text-text-muted",children:[Object.keys(c[e]).length," models"]})]},e)),Object.keys(c).length>5&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["+ ",Object.keys(c).length-5," more providers"]})]}):(0,a.jsx)("div",{className:"text-text-muted",children:"No pricing data available"})]}),e&&(0,a.jsx)(s,{isOpen:e,onClose:()=>t(!1),onSave:()=>{p()}})]})}},87706:(e,t,c)=>{"use strict";function a(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}c.d(t,{cn:()=>a})}},e=>{e.O(0,[2347,5158,7358],()=>e(e.s=10075)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{390:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},2074:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});var n=r(1521);let a=e=>{let t,r=new Set,n=(e,n)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=n?n:"object"!=typeof a||null===a)?a:Object.assign({},t,a),r.forEach(r=>r(t,e))}},a=()=>t,o={setState:n,getState:a,getInitialState:()=>i,subscribe:e=>(r.add(e),()=>r.delete(e))},i=t=e(n,a,o);return o},o=e=>{let t=e?a(e):a,r=e=>(function(e,t=e=>e){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),n.useCallback(()=>t(e.getInitialState()),[e,t]));return n.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},i=e=>e?o(e):o},5074:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,43333,23)),Promise.resolve().then(r.bind(r,70339)),Promise.resolve().then(r.bind(r,98814)),Promise.resolve().then(r.t.bind(r,88276,23))},11472:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>a});let n=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>n(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>n(t)(e)}}},a=(e,t)=>(r,a,o)=>{let i,s={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let n=e=>null===e?null:JSON.parse(e,void 0),a=null!=(r=t.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},u=!1,l=0,c=new Set,d=new Set,m=s.storage;if(!m)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...e)},a,o);let f=()=>{let e=s.partialize({...a()});return m.setItem(s.name,{state:e,version:s.version})},h=o.setState;o.setState=(e,t)=>(h(e,t),f());let p=e((...e)=>(r(...e),f()),a,o);o.getInitialState=()=>p;let v=()=>{var e,t;if(!m)return;let o=++l;u=!1,c.forEach(e=>{var t;return e(null!=(t=a())?t:p)});let h=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=a())?e:p))||void 0;return n(m.getItem.bind(m))(s.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];else{if(s.migrate){let t=s.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(o!==l)return;let[n,u]=e;if(r(i=s.merge(u,null!=(t=a())?t:p),!0),n)return f()}).then(()=>{o===l&&(null==h||h(a(),void 0),i=a(),u=!0,d.forEach(e=>e(i)))}).catch(e=>{o===l&&(null==h||h(void 0,e))})};return o.persist={setOptions:e=>{s={...s,...e},e.storage&&(m=e.storage)},clearStorage:()=>{null==m||m.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>u,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},s.skipHydration||v(),i||p}},29717:(e,t,r)=>{"use strict";var n=r(21505);r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},43202:(e,t,r)=>{"use strict";r.d(t,{Q2:()=>n.Q2,fg:()=>n.fg,vQ:()=>a,MA:()=>n.MA,UY:()=>i,zN:()=>n.zN,B2:()=>o});var n=r(82495);r(69633);let a={name:"Endpoint Proxy",description:"AI Infrastructure Management",version:"0.3.72"},o={storageKey:"theme",defaultTheme:"system"},i={maxLines:200,pollIntervalMs:1e3}},43333:()=>{},55348:(e,t,r)=>{"use strict";r.d(t,{CL:()=>o,QC:()=>i,Xn:()=>a,YZ:()=>n});let n=["en","vi","zh-CN","zh-TW","ja","pt-BR","pt-PT","ko","es","de","fr","he","ar","ru","pl","cs","nl","tr","uk","tl","id","th","hi","bn","ur","ro","sv","it","el","hu","fi","da","no"],a="en",o="locale";function i(e){return"zh"===e||"zh-CN"===e?"zh-CN":"en"===e?"en":"vi"===e?"vi":"zh-TW"===e?"zh-TW":"ja"===e?"ja":"pt-BR"===e?"pt-BR":"pt-PT"===e?"pt-PT":"ko"===e?"ko":"es"===e?"es":"de"===e?"de":"fr"===e?"fr":"he"===e?"he":"ar"===e?"ar":"ru"===e?"ru":"pl"===e?"pl":"cs"===e?"cs":"nl"===e?"nl":"tr"===e?"tr":"uk"===e?"uk":"tl"===e?"tl":"id"===e?"id":"th"===e?"th":"hi"===e?"hi":"bn"===e?"bn":"ur"===e?"ur":"ro"===e?"ro":"sv"===e?"sv":"it"===e?"it":"el"===e?"el":"hu"===e?"hu":"fi"===e?"fi":"da"===e?"da":"no"===e?"no":a}},69633:(e,t,r)=>{"use strict";r.d(t,{KC:()=>n.KC,Xg:()=>n.Xg});var n=r(94718);Object.entries(r(82495).Q2).filter(([,e])=>e.passthroughModels).map(([e])=>e),Object.entries(n.vq).flatMap(([e,t])=>t.map(t=>({provider:e,model:t.id,name:t.name})))},70339:(e,t,r)=>{"use strict";r.d(t,{RuntimeI18nProvider:()=>s});var n=r(73365),a=r(1521),o=r(29717),i=r(84502);function s({children:e}){let t=(0,o.usePathname)();return(0,a.useEffect)(()=>{(0,i.FE)()},[]),(0,a.useEffect)(()=>{t&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{(0,i.wn)()})})},[t]),(0,n.jsx)(n.Fragment,{children:e})}},83789:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(2074),a=r(11472),o=r(43202);function i(e){let t=document.documentElement,r=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"dark"===("system"===e?r:e)?t.classList.add("dark"):t.classList.remove("dark")}let s=(0,n.v)((0,a.Zr)((e,t)=>({theme:o.B2.defaultTheme,setTheme:t=>{e({theme:t}),i(t)},toggleTheme:()=>{let r="dark"===t().theme?"light":"dark";e({theme:r}),i(r)},initTheme:()=>{i(t().theme)}}),{name:o.B2.storageKey}))},84502:(e,t,r)=>{"use strict";r.d(t,{FE:()=>m,Tl:()=>l,wn:()=>f});var n=r(55348);let a={},o=n.Xn,i=[];function s(){if("u"<typeof document)return n.Xn;let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${n.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):n.Xn;return(0,n.QC)(t)}async function u(e){if("en"===e){a={};return}try{let t=await fetch(`/i18n/literals/${e}.json`);a=await t.json()}catch(e){console.error("Failed to load translations:",e),a={}}}function l(e){if(!e||"string"!=typeof e)return e;let t=e.trim();return t&&"en"!==o&&a[t]||e}function c(e){if(!e.nodeValue||!e.nodeValue.trim())return;let t=e.parentElement;if(!t)return;let r=t;for(;r;){if(r.hasAttribute&&r.hasAttribute("data-i18n-skip"))return;r=r.parentElement}if(["script","style","code","pre","colgroup","table","thead","tbody","tfoot","tr","select","datalist","optgroup"].includes(t.tagName?.toLowerCase()))return;e._originalText||(e._originalText=e.nodeValue);let n=l(e._originalText);n!==e.nodeValue&&(e.nodeValue=n)}function d(e){let t;if(!e)return;let r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),n=[];for(;t=r.nextNode();)n.push(t);n.forEach(c)}async function m(){o=s(),await u(o),d(document.body),new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE?d(e):e.nodeType===Node.TEXT_NODE&&c(e)})})}).observe(document.body,{childList:!0,subtree:!0})}async function f(){o=s(),await u(o),i.forEach(e=>e()),d(document.body)}},88276:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},98814:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>i});var n=r(73365),a=r(1521),o=r(83789);function i({children:e}){let{initTheme:t}=(0,o.A)();return(0,a.useEffect)(()=>{t()},[t]),(0,n.jsx)(n.Fragment,{children:e})}}},e=>{e.O(0,[8424,5261,350,2347,5158,7358],()=>e(e.s=5074)),_N_E=e.O()}]);
|