omniroute 2.0.0 → 2.0.2
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/README.ar.md +4 -3
- package/README.bg.md +4 -3
- package/README.da.md +4 -2
- package/README.de.md +3 -2
- package/README.es.md +1 -0
- package/README.fi.md +1 -0
- package/README.fr.md +1 -0
- package/README.he.md +9 -8
- package/README.hu.md +1 -0
- package/README.id.md +1 -0
- package/README.in.md +9 -8
- package/README.it.md +1 -0
- package/README.ja.md +3 -0
- package/README.ko.md +9 -8
- package/README.md +17 -16
- package/README.ms.md +9 -8
- package/README.nl.md +9 -8
- package/README.no.md +1 -0
- package/README.phi.md +2 -1
- package/README.pl.md +9 -8
- package/README.pt-BR.md +3 -2
- package/README.pt.md +1 -0
- package/README.ro.md +2 -0
- package/README.ru.md +1 -0
- package/README.sk.md +1 -0
- package/README.sv.md +1 -0
- package/README.th.md +1 -0
- package/README.uk-UA.md +1 -0
- package/README.vi.md +1 -0
- package/README.zh-CN.md +10 -9
- package/app/.env +122 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +54 -54
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +3 -3
- 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/costs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/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/health/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/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/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +3 -3
- 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/.well-known/agent.json/route.js +1 -1
- package/app/.next/server/app/.well-known/agent.json/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/400/page.js +2 -2
- package/app/.next/server/app/400/page.js.nft.json +1 -1
- package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/401/page.js +2 -2
- package/app/.next/server/app/401/page.js.nft.json +1 -1
- package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/403/page.js +2 -2
- package/app/.next/server/app/403/page.js.nft.json +1 -1
- package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/408/page.js +2 -2
- package/app/.next/server/app/408/page.js.nft.json +1 -1
- package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/429/page.js +2 -2
- package/app/.next/server/app/429/page.js.nft.json +1 -1
- package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/500/page.js +2 -2
- package/app/.next/server/app/500/page.js.nft.json +1 -1
- package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/502/page.js +2 -2
- package/app/.next/server/app/502/page.js.nft.json +1 -1
- package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/503/page.js +2 -2
- package/app/.next/server/app/503/page.js.nft.json +1 -1
- package/app/.next/server/app/503/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 +2 -2
- package/app/.next/server/app/_global-error.rsc +5 -5
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +5 -5
- 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 +4 -4
- 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/a2a/route.js +2 -2
- package/app/.next/server/app/a2a/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/status/route.js +1 -1
- package/app/.next/server/app/api/a2a/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/route.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/route.js +1 -1
- package/app/.next/server/app/api/a2a/tasks/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/status/route.js +1 -1
- package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/route.js +1 -1
- package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/stats/route.js +1 -1
- package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.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/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +3 -3
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/backups/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.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/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/status/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/auto/route.js +1 -1
- package/app/.next/server/app/api/combos/auto/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/test/route.js +1 -1
- package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/route.js +1 -1
- package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/route.js +1 -1
- package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route.js +2 -2
- package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js +1 -1
- package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/audit/route.js +2 -2
- package/app/.next/server/app/api/mcp/audit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/audit/stats/route.js +2 -2
- package/app/.next/server/app/api/mcp/audit/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/sse/route.js +1 -1
- package/app/.next/server/app/api/mcp/sse/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/status/route.js +1 -1
- package/app/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/stream/route.js +1 -1
- package/app/.next/server/app/api/mcp/stream/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/mcp/tools/route.js +1 -1
- package/app/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route.js +2 -2
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +2 -2
- package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/monitoring/health/route.js +2 -2
- package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route.js +2 -2
- package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/models/route.js +1 -1
- package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-metrics/route.js +2 -2
- package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-models/route.js +1 -1
- package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +2 -2
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +2 -2
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route.js +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js +1 -1
- package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/route.js +1 -1
- package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/restart/route.js +1 -1
- package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sessions/route.js +1 -1
- package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/background-degradation/route.js +1 -1
- package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/model-aliases/route.js +1 -1
- package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/storage/health/route.js +1 -1
- package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/token-health/route.js +1 -1
- package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/detect/route.js +1 -1
- package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/history/route.js +1 -1
- package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +2 -2
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/budget/route.js +2 -2
- package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -1
- package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/quota/route.js +1 -1
- package/app/.next/server/app/api/usage/quota/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.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/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +2 -2
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.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/docs/page.js +4 -4
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page.js +2 -2
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page.js +2 -2
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- 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/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/maintenance/page.js +2 -2
- package/app/.next/server/app/maintenance/page.js.nft.json +1 -1
- package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/offline/page.js +2 -2
- package/app/.next/server/app/offline/page.js.nft.json +1 -1
- package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- 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/privacy/page.js +2 -2
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/status/page.js +2 -2
- package/app/.next/server/app/status/page.js.nft.json +1 -1
- package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page.js +2 -2
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +54 -54
- package/app/.next/server/chunks/1033.js +1 -1
- package/app/.next/server/chunks/1909.js +2 -0
- package/app/.next/server/chunks/2180.js +1 -1
- package/app/.next/server/chunks/2901.js +1 -1
- package/app/.next/server/chunks/2910.js +1 -1
- package/app/.next/server/chunks/3498.js +1 -1
- package/app/.next/server/chunks/3969.js +1 -1
- package/app/.next/server/chunks/4488.js +1 -1
- package/app/.next/server/chunks/4631.js +2 -2
- package/app/.next/server/chunks/7109.js +1 -1
- package/app/.next/server/chunks/7167.js +1 -0
- package/app/.next/server/chunks/7669.js +1 -1
- package/app/.next/server/chunks/8020.js +3 -3
- package/app/.next/server/chunks/8369.js +1 -1
- package/app/.next/server/chunks/9548.js +1 -1
- package/app/.next/server/instrumentation.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +3 -3
- package/app/.next/server/next-font-manifest.js +1 -1
- package/app/.next/server/next-font-manifest.json +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{5846-c2071f4db5ecc3da.js → 5846-014698d5430bb218.js} +1 -1
- package/app/.next/static/chunks/{647-f42f77310d9d9936.js → 647-52d3e2e64d7de62e.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/a2a/page-ed1f5b1ae0e01c02.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-6a2bb3ad980b05b9.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/{page-bef5c045e7eae657.js → page-6ab7701da3357bb9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-027b3eb09d2d46e0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c9b98846b8479f3f.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/auto-combo/{page-8e609f4c9b26a901.js → page-851063ded34ab7a6.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-86acc32f9984a4e2.js +15 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-ac5dcffbe54f77f9.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/{page-7a233357dfbd2e05.js → page-8f6233f59f5277e9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-36f33de29eb978a1.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/{page-66ee4e631429e0d8.js → page-1e1eb2f79d606ab2.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-e8a28e4cf62889bd.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/{page-6e4bcb48b8731915.js → page-95e4b5e0bf023d76.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mcp/page-d9b5c3282ec5d809.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-72b768421394b42c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/{page-d424641c7e428be9.js → page-5378e9473a20cd6a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-40d20c1273f57206.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-350aed2e86512c23.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{error-0400f175dd1372fa.js → error-a5ae03ba05400b04.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/loading-7deaa9f550841465.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-3ef302da4b756e50.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-87f0d43ce6cca0cb.js → page-cd0feb6c545b8a49.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{error-c39d18f10fb7d3f6.js → error-ec9643134a96bbcd.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{loading-b5faf05c78a2cc54.js → loading-3519a633b514f31a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{page-6b38a30bfddf3b89.js → page-cbaa4b638a583fe9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/{page-a4b8b03ffb39da1d.js → page-69eb8b0eb0e9de00.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-b29f17c4dc7d449f.js → page-8cc93e616925f0a0.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-8c8f2d59d0cbb516.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/{layout-6d0afc53f5f2a538.js → layout-7ae0c66c22bee8a1.js} +1 -1
- package/app/.next/static/chunks/app/400/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/401/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/403/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/408/{page-3b77bf358909019a.js → page-3b9079ea400ca287.js} +1 -1
- package/app/.next/static/chunks/app/429/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/500/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/502/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/503/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/callback/{page-585a53f7dc6a30f1.js → page-0f0ebc0820dd18a5.js} +1 -1
- package/app/.next/static/chunks/app/docs/{page-9624e5fb8cabf7d8.js → page-dc88e0a01d291518.js} +1 -1
- package/app/.next/static/chunks/app/{error-f7f595c541537e63.js → error-32c03f14529d3920.js} +1 -1
- package/app/.next/static/chunks/app/forbidden/page-8d8e1709a1e32585.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-d5c9b77748aa9deb.js +1 -0
- package/app/.next/static/chunks/app/global-error-5840b1caa830f2ec.js +1 -0
- package/app/.next/static/chunks/app/landing/page-75b0c988db383cfc.js +1 -0
- package/app/.next/static/chunks/app/{layout-108592eafb959363.js → layout-070972eb026af319.js} +1 -1
- package/app/.next/static/chunks/app/{loading-e063375d5b12a2f7.js → loading-da2f6e1471afc070.js} +1 -1
- package/app/.next/static/chunks/app/login/{page-cf6b82187b09a701.js → page-26d717c652d56032.js} +1 -1
- package/app/.next/static/chunks/app/maintenance/page-3b9079ea400ca287.js +1 -0
- package/app/.next/static/chunks/app/not-found-faf36d2a9a452506.js +1 -0
- package/app/.next/static/chunks/app/offline/page-bf68bf461af876a3.js +1 -0
- package/app/.next/static/chunks/app/privacy/{page-9624e5fb8cabf7d8.js → page-dc88e0a01d291518.js} +1 -1
- package/app/.next/static/chunks/app/status/page-29a433b40631ce12.js +1 -0
- package/app/.next/static/chunks/app/terms/{page-9624e5fb8cabf7d8.js → page-dc88e0a01d291518.js} +1 -1
- package/app/.next/static/chunks/{main-app-c9da11a8061df107.js → main-app-ae230f6bf51a5edb.js} +1 -1
- package/app/logs/application/app.log +1 -0
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/package.json +1 -1
- package/app/.next/server/chunks/5248.js +0 -1
- package/app/.next/server/chunks/7889.js +0 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/a2a/page-43d6fa6b75cca497.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-49ae846d72948391.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-16f886b3711a6a50.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-e5bf8955e7b9a4f5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-d1e5ed188e14c618.js +0 -15
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-8d4d2f071d114b90.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-7b1037d65eef97a8.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-d5e0c556e2b32478.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/mcp/page-8e35334b9f393139.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-1d0ca9b5d3eaf7cd.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-d75ccdb976b36258.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-1abb3ea768844f2b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/loading-9552383fd2e11282.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-d57908b59d4b482c.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-9e20463252daf023.js +0 -1
- package/app/.next/static/chunks/app/429/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/500/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/502/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/503/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/forbidden/page-b33079c1573b0bfa.js +0 -1
- package/app/.next/static/chunks/app/forgot-password/page-90cd6259c75badfc.js +0 -1
- package/app/.next/static/chunks/app/global-error-1dfd1c91ad5199fe.js +0 -1
- package/app/.next/static/chunks/app/landing/page-9d540ab1716f8e3e.js +0 -1
- package/app/.next/static/chunks/app/maintenance/page-3b77bf358909019a.js +0 -1
- package/app/.next/static/chunks/app/not-found-511518956bcae7bc.js +0 -1
- package/app/.next/static/chunks/app/offline/page-9d6ea493783a0219.js +0 -1
- package/app/.next/static/chunks/app/status/page-4e5e9b5a513aa474.js +0 -1
- /package/app/.next/static/{i4hXorUJfOXsVFs23YXiR → GDoUzLvy4YDqhnGqUCiZ0}/_buildManifest.js +0 -0
- /package/app/.next/static/{i4hXorUJfOXsVFs23YXiR → GDoUzLvy4YDqhnGqUCiZ0}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8013],{40993:(e,t,r)=>{"use strict";r.d(t,{Ex:()=>i.default,$n:()=>l.default,Zp:()=>s.default,Qv:()=>c.CardSkeleton,G9:()=>f.default,bQ:()=>w.default,pp:()=>j.default,Qn:()=>N.default,pd:()=>a.default,Mh:()=>v.default,uR:()=>m.default,aF:()=>n.default,rq:()=>u.default,LF:()=>x.default,KN:()=>g.default,Lo:()=>h.default,y7:()=>b.default,Iz:()=>y.default,l6:()=>o.default,lM:()=>d.default,cn:()=>p.default});var l=r(35806),a=r(34422),o=r(42994),s=r(81060),n=r(71361),c=r(92542);r(17705);var i=r(80927),d=r(19790);r(6261),r(55846),r(34243),r(89938),r(99023);var x=r(80178),u=r(85444),m=r(91961);r(25112);var p=r(45624),b=r(37415),g=r(48643),h=r(8287);r(1652);var v=r(92701);r(18150);var f=r(71689),y=r(33709);r(76332);var j=r(66200);r(61580);var N=r(51503);r(54128);var w=r(44638);r(21720),r(97050)},53586:(e,t,r)=>{Promise.resolve().then(r.bind(r,58802))},58802:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var l=r(95155),a=r(12115),o=r(40993),s=r(50910);let n={debug:"text-gray-400",trace:"text-gray-500",info:"text-cyan-400",warn:"text-yellow-400",error:"text-red-400",fatal:"text-fuchsia-400"},c={debug:"bg-gray-500/10 border-gray-500/20",trace:"bg-gray-500/10 border-gray-500/20",info:"bg-cyan-500/10 border-cyan-500/20",warn:"bg-yellow-500/10 border-yellow-500/20",error:"bg-red-500/10 border-red-500/20",fatal:"bg-fuchsia-500/10 border-fuchsia-500/20"};function i(){let e=(0,s.c)("loggers"),[t,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(!0),[d,x]=(0,a.useState)(null),[u,m]=(0,a.useState)("all"),[p,b]=(0,a.useState)(""),[g,h]=(0,a.useState)(!0),[v,f]=(0,a.useState)(null),[y,j]=(0,a.useState)(null),N=(0,a.useRef)(null),w=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;"all"!==u&&e.set("level",u),e.set("limit","500");let t=await fetch(`/api/logs/console?${e.toString()}`);if(!t.ok)throw Error(`HTTP ${t.status}`);let l=await t.json();r(l),f(new Date),x(null)}catch(e){x(e.message||"Failed to fetch logs")}finally{i(!1)}},[u]);(0,a.useEffect)(()=>{w();let e=setInterval(w,5e3);return()=>clearInterval(e)},[w]),(0,a.useEffect)(()=>{g&&N.current&&(N.current.scrollTop=N.current.scrollHeight)},[t,g]);let S=p?t.filter(e=>JSON.stringify(e).toLowerCase().includes(p.toLowerCase())):t;return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",children:[(0,l.jsxs)("select",{value:u,onChange:e=>m(e.target.value),"aria-label":"Filter by log level",className:"px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] focus:outline-2 focus:outline-[var(--color-accent)]",children:[(0,l.jsx)("option",{value:"all",children:e("allLevels")}),(0,l.jsx)("option",{value:"debug",children:"Debug+"}),(0,l.jsx)("option",{value:"info",children:"Info+"}),(0,l.jsx)("option",{value:"warn",children:"Warn+"}),(0,l.jsx)("option",{value:"error",children:"Error+"})]}),(0,l.jsx)("input",{type:"text",placeholder:"Search logs...",value:p,onChange:e=>b(e.target.value),"aria-label":"Search log entries",className:"flex-1 min-w-[200px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsxs)("button",{onClick:()=>h(!g),title:g?"Disable auto-scroll":"Enable auto-scroll",className:`px-3 py-2 rounded-lg text-sm font-medium border transition-colors ${g?"bg-cyan-500/15 text-cyan-400 border-cyan-500/30":"bg-[var(--color-bg)] text-[var(--color-text-muted)] border-[var(--color-border)]"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-1",children:g?"vertical_align_bottom":"lock"}),"Auto-scroll"]}),(0,l.jsx)("button",{onClick:w,disabled:o,className:"px-3 py-2 rounded-lg text-sm font-medium bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-50 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle",children:"refresh"})}),(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-auto text-xs text-[var(--color-text-muted)]",children:[(0,l.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500 animate-pulse"}),(0,l.jsxs)("span",{children:[S.length," entries"]}),(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsx)("span",{children:"Last 1h"}),v&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsxs)("span",{children:["Updated ",v.toLocaleTimeString()]})]})]})]}),d&&(0,l.jsxs)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-2",children:"error"}),d,(0,l.jsx)("span",{className:"text-xs ml-2 opacity-70",children:"— Make sure the application is writing logs to file (LOG_TO_FILE=true)"})]}),(0,l.jsxs)("div",{ref:N,className:"rounded-xl border border-[var(--color-border)] bg-[#0d1117] overflow-auto font-mono text-xs leading-relaxed",style:{maxHeight:"calc(100vh - 340px)",minHeight:"400px"},role:"log","aria-label":"Application console logs","aria-live":"polite",children:[(0,l.jsxs)("div",{className:"sticky top-0 z-10 px-4 py-2 bg-[#161b22] border-b border-[#30363d] flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"}),(0,l.jsx)("span",{className:"ml-3 text-[#8b949e] text-[11px]",children:"OmniRoute — Application Console"})]}),(0,l.jsxs)("div",{className:"p-3 space-y-px",children:[0!==S.length||o?S.map((e,t)=>{let r=(e.level||"info").toLowerCase(),a=n[r]||n.info,o=c[r]||"",s=e.component||e.module||"",i=e.msg||e.message||"";return(0,l.jsxs)("div",{className:`group flex items-start gap-2 px-2 py-1 rounded hover:bg-white/5 transition-colors ${"error"===r||"fatal"===r?"bg-red-500/5":""}`,children:[(0,l.jsx)("span",{className:"text-[#484f58] whitespace-nowrap shrink-0 select-none",children:(e=>{try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}catch{return e}})(e.timestamp)}),(0,l.jsx)("span",{className:`inline-block px-1.5 py-0 rounded text-[10px] font-semibold uppercase border shrink-0 ${a} ${o}`,children:r.padEnd(5)}),s&&(0,l.jsxs)("span",{className:"text-purple-400/80 shrink-0",children:["[",s,"]"]}),(0,l.jsxs)("span",{className:"text-[#c9d1d9] flex-1 break-all",children:[i,e.correlationId&&(0,l.jsxs)("span",{className:"text-[#484f58] ml-2",children:["cid:",e.correlationId.slice(0,8)]})]}),(0,l.jsx)("button",{onClick:()=>{let r;return r=JSON.stringify(e,null,2),void navigator.clipboard.writeText(r).then(()=>{j(t),setTimeout(()=>j(null),2e3)})},title:"Copy log entry",className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 text-[#8b949e] hover:text-white",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:y===t?"check":"content_copy"})})]},t)}):(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[40px] block mb-2 opacity-30",children:"terminal"}),(0,l.jsx)("p",{children:e("noLogEntries")}),(0,l.jsx)("p",{className:"text-[10px] mt-1 opacity-60",children:"Ensure LOG_TO_FILE=true is set in your .env file"})]}),o&&0===S.length&&(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[24px] animate-spin block mb-2",children:"progress_activity"}),"Loading logs..."]})]})]})]})}function d(){let[e,t]=(0,a.useState)([]),[r,o]=(0,a.useState)(!0),[n,c]=(0,a.useState)(null),[i,d]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[m,p]=(0,a.useState)(0),[b,g]=(0,a.useState)(!1),h=(0,s.c)("logs"),v=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=new URLSearchParams;i&&e.set("action",i),x&&e.set("actor",x),e.set("limit",String(26)),e.set("offset",String(m));let r=await fetch(`/api/compliance/audit-log?${e.toString()}`);if(!r.ok)throw Error(h("failedFetchAuditLog"));let l=await r.json();g(l.length>25),t(l.slice(0,25))}catch(e){c(e.message||h("failedFetchAuditLog"))}finally{o(!1)}},[i,x,m,h]);(0,a.useEffect)(()=>{v()},[v]);let f=()=>{p(0),v()};return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-[var(--color-text-main)]",children:h("auditLog")}),(0,l.jsx)("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:h("auditLogDesc")})]}),(0,l.jsx)("button",{onClick:v,disabled:r,"aria-label":h("refreshAuditLogAria"),className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] transition-colors disabled:opacity-50",children:r?h("loading"):h("refresh")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",role:"search","aria-label":h("filterEntriesAria"),children:[(0,l.jsx)("input",{type:"text",placeholder:h("filterByAction"),value:i,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),"aria-label":h("filterByActionTypeAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("input",{type:"text",placeholder:h("filterByActor"),value:x,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),"aria-label":h("filterByActorAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("button",{onClick:f,className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-[var(--color-accent)]",children:h("search")})]}),n&&(0,l.jsx)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:n}),(0,l.jsx)("div",{className:"overflow-x-auto rounded-xl border border-[var(--color-border)]",children:(0,l.jsxs)("table",{className:"w-full text-sm",role:"table","aria-label":h("tableAria"),children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"bg-[var(--color-bg-alt)] border-b border-[var(--color-border)]",children:[(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("timestamp")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("action")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("actor")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("target")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("details")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("ipAddress")})]})}),(0,l.jsx)("tbody",{children:0!==e.length||r?e.map(e=>{var t;return(0,l.jsxs)("tr",{className:"border-b border-[var(--color-border)] hover:bg-[var(--color-bg-alt)] transition-colors",children:[(0,l.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-[var(--color-text-muted)] font-mono text-xs",children:(e=>{try{return new Date(e).toLocaleString()}catch{return e}})(e.timestamp)}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsx)("span",{className:`inline-block px-2 py-0.5 rounded-md text-xs font-medium border ${(t=e.action).includes("delete")||t.includes("remove")?"bg-red-500/15 text-red-400 border-red-500/20":t.includes("create")||t.includes("add")?"bg-green-500/15 text-green-400 border-green-500/20":t.includes("update")||t.includes("change")?"bg-blue-500/15 text-blue-400 border-blue-500/20":t.includes("login")||t.includes("auth")?"bg-purple-500/15 text-purple-400 border-purple-500/20":"bg-gray-500/15 text-gray-400 border-gray-500/20"}`,children:e.action})}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-main)]",children:e.actor}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[200px] truncate",children:e.target||h("notAvailable")}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[300px] truncate font-mono text-xs",children:e.details?JSON.stringify(e.details):h("notAvailable")}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] font-mono text-xs whitespace-nowrap",children:e.ip_address||h("notAvailable")})]},e.id)}):(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-[var(--color-text-muted)]",children:h("noEntries")})})})]})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-xs text-[var(--color-text-muted)]",children:h("showing",{count:e.length,offset:m})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("button",{onClick:()=>p(Math.max(0,m-25)),disabled:0===m,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:["← ",h("previous")]}),(0,l.jsxs)("button",{onClick:()=>p(m+25),disabled:!b,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:[h("next")," →"]})]})]})]})}function x(){let[e,t]=(0,a.useState)("request-logs"),r=(0,s.c)("logs");return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(o.Iz,{options:[{value:"request-logs",label:r("requestLogs")},{value:"proxy-logs",label:r("proxyLogs")},{value:"audit-logs",label:r("auditLog")},{value:"console",label:r("console")}],value:e,onChange:t}),"request-logs"===e&&(0,l.jsx)(o.y7,{}),"proxy-logs"===e&&(0,l.jsx)(o.Lo,{}),"audit-logs"===e&&(0,l.jsx)(d,{}),"console"===e&&(0,l.jsx)(i,{})]})}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=53586)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8013],{40993:(e,t,r)=>{"use strict";r.d(t,{Ex:()=>i.default,$n:()=>l.default,Zp:()=>s.default,Qv:()=>c.CardSkeleton,G9:()=>f.default,bQ:()=>w.default,pp:()=>j.default,Qn:()=>N.default,pd:()=>a.default,Mh:()=>v.default,uR:()=>m.default,aF:()=>n.default,rq:()=>u.default,LF:()=>x.default,KN:()=>g.default,Lo:()=>h.default,y7:()=>b.default,Iz:()=>y.default,l6:()=>o.default,lM:()=>d.default,cn:()=>p.default});var l=r(35806),a=r(34422),o=r(42994),s=r(81060),n=r(71361),c=r(92542);r(17705);var i=r(80927),d=r(19790);r(6261),r(55846),r(34243),r(89938),r(99023);var x=r(80178),u=r(85444),m=r(91961);r(25112);var p=r(45624),b=r(37415),g=r(48643),h=r(8287);r(1652);var v=r(92701);r(18150);var f=r(71689),y=r(33709);r(76332);var j=r(66200);r(61580);var N=r(51503);r(54128);var w=r(44638);r(21720),r(97050)},56646:(e,t,r)=>{Promise.resolve().then(r.bind(r,58802))},58802:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var l=r(95155),a=r(12115),o=r(40993),s=r(50910);let n={debug:"text-gray-400",trace:"text-gray-500",info:"text-cyan-400",warn:"text-yellow-400",error:"text-red-400",fatal:"text-fuchsia-400"},c={debug:"bg-gray-500/10 border-gray-500/20",trace:"bg-gray-500/10 border-gray-500/20",info:"bg-cyan-500/10 border-cyan-500/20",warn:"bg-yellow-500/10 border-yellow-500/20",error:"bg-red-500/10 border-red-500/20",fatal:"bg-fuchsia-500/10 border-fuchsia-500/20"};function i(){let e=(0,s.c)("loggers"),[t,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(!0),[d,x]=(0,a.useState)(null),[u,m]=(0,a.useState)("all"),[p,b]=(0,a.useState)(""),[g,h]=(0,a.useState)(!0),[v,f]=(0,a.useState)(null),[y,j]=(0,a.useState)(null),N=(0,a.useRef)(null),w=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;"all"!==u&&e.set("level",u),e.set("limit","500");let t=await fetch(`/api/logs/console?${e.toString()}`);if(!t.ok)throw Error(`HTTP ${t.status}`);let l=await t.json();r(l),f(new Date),x(null)}catch(e){x(e.message||"Failed to fetch logs")}finally{i(!1)}},[u]);(0,a.useEffect)(()=>{w();let e=setInterval(w,5e3);return()=>clearInterval(e)},[w]),(0,a.useEffect)(()=>{g&&N.current&&(N.current.scrollTop=N.current.scrollHeight)},[t,g]);let S=p?t.filter(e=>JSON.stringify(e).toLowerCase().includes(p.toLowerCase())):t;return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",children:[(0,l.jsxs)("select",{value:u,onChange:e=>m(e.target.value),"aria-label":"Filter by log level",className:"px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] focus:outline-2 focus:outline-[var(--color-accent)]",children:[(0,l.jsx)("option",{value:"all",children:e("allLevels")}),(0,l.jsx)("option",{value:"debug",children:"Debug+"}),(0,l.jsx)("option",{value:"info",children:"Info+"}),(0,l.jsx)("option",{value:"warn",children:"Warn+"}),(0,l.jsx)("option",{value:"error",children:"Error+"})]}),(0,l.jsx)("input",{type:"text",placeholder:"Search logs...",value:p,onChange:e=>b(e.target.value),"aria-label":"Search log entries",className:"flex-1 min-w-[200px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsxs)("button",{onClick:()=>h(!g),title:g?"Disable auto-scroll":"Enable auto-scroll",className:`px-3 py-2 rounded-lg text-sm font-medium border transition-colors ${g?"bg-cyan-500/15 text-cyan-400 border-cyan-500/30":"bg-[var(--color-bg)] text-[var(--color-text-muted)] border-[var(--color-border)]"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-1",children:g?"vertical_align_bottom":"lock"}),"Auto-scroll"]}),(0,l.jsx)("button",{onClick:w,disabled:o,className:"px-3 py-2 rounded-lg text-sm font-medium bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-50 transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle",children:"refresh"})}),(0,l.jsxs)("div",{className:"flex items-center gap-2 ml-auto text-xs text-[var(--color-text-muted)]",children:[(0,l.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500 animate-pulse"}),(0,l.jsxs)("span",{children:[S.length," entries"]}),(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsx)("span",{children:"Last 1h"}),v&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-[var(--color-text-muted)]/50",children:"•"}),(0,l.jsxs)("span",{children:["Updated ",v.toLocaleTimeString()]})]})]})]}),d&&(0,l.jsxs)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] align-middle mr-2",children:"error"}),d,(0,l.jsx)("span",{className:"text-xs ml-2 opacity-70",children:"— Make sure the application is writing logs to file (LOG_TO_FILE=true)"})]}),(0,l.jsxs)("div",{ref:N,className:"rounded-xl border border-[var(--color-border)] bg-[#0d1117] overflow-auto font-mono text-xs leading-relaxed",style:{maxHeight:"calc(100vh - 340px)",minHeight:"400px"},role:"log","aria-label":"Application console logs","aria-live":"polite",children:[(0,l.jsxs)("div",{className:"sticky top-0 z-10 px-4 py-2 bg-[#161b22] border-b border-[#30363d] flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"}),(0,l.jsx)("span",{className:"ml-3 text-[#8b949e] text-[11px]",children:"OmniRoute — Application Console"})]}),(0,l.jsxs)("div",{className:"p-3 space-y-px",children:[0!==S.length||o?S.map((e,t)=>{let r=(e.level||"info").toLowerCase(),a=n[r]||n.info,o=c[r]||"",s=e.component||e.module||"",i=e.msg||e.message||"";return(0,l.jsxs)("div",{className:`group flex items-start gap-2 px-2 py-1 rounded hover:bg-white/5 transition-colors ${"error"===r||"fatal"===r?"bg-red-500/5":""}`,children:[(0,l.jsx)("span",{className:"text-[#484f58] whitespace-nowrap shrink-0 select-none",children:(e=>{try{return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}catch{return e}})(e.timestamp)}),(0,l.jsx)("span",{className:`inline-block px-1.5 py-0 rounded text-[10px] font-semibold uppercase border shrink-0 ${a} ${o}`,children:r.padEnd(5)}),s&&(0,l.jsxs)("span",{className:"text-purple-400/80 shrink-0",children:["[",s,"]"]}),(0,l.jsxs)("span",{className:"text-[#c9d1d9] flex-1 break-all",children:[i,e.correlationId&&(0,l.jsxs)("span",{className:"text-[#484f58] ml-2",children:["cid:",e.correlationId.slice(0,8)]})]}),(0,l.jsx)("button",{onClick:()=>{let r;return r=JSON.stringify(e,null,2),void navigator.clipboard.writeText(r).then(()=>{j(t),setTimeout(()=>j(null),2e3)})},title:"Copy log entry",className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 text-[#8b949e] hover:text-white",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:y===t?"check":"content_copy"})})]},t)}):(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[40px] block mb-2 opacity-30",children:"terminal"}),(0,l.jsx)("p",{children:e("noLogEntries")}),(0,l.jsx)("p",{className:"text-[10px] mt-1 opacity-60",children:"Ensure LOG_TO_FILE=true is set in your .env file"})]}),o&&0===S.length&&(0,l.jsxs)("div",{className:"text-[#8b949e] text-center py-12",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[24px] animate-spin block mb-2",children:"progress_activity"}),"Loading logs..."]})]})]})]})}function d(){let[e,t]=(0,a.useState)([]),[r,o]=(0,a.useState)(!0),[n,c]=(0,a.useState)(null),[i,d]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[m,p]=(0,a.useState)(0),[b,g]=(0,a.useState)(!1),h=(0,s.c)("logs"),v=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=new URLSearchParams;i&&e.set("action",i),x&&e.set("actor",x),e.set("limit",String(26)),e.set("offset",String(m));let r=await fetch(`/api/compliance/audit-log?${e.toString()}`);if(!r.ok)throw Error(h("failedFetchAuditLog"));let l=await r.json();g(l.length>25),t(l.slice(0,25))}catch(e){c(e.message||h("failedFetchAuditLog"))}finally{o(!1)}},[i,x,m,h]);(0,a.useEffect)(()=>{v()},[v]);let f=()=>{p(0),v()};return(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-bold text-[var(--color-text-main)]",children:h("auditLog")}),(0,l.jsx)("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:h("auditLogDesc")})]}),(0,l.jsx)("button",{onClick:v,disabled:r,"aria-label":h("refreshAuditLogAria"),className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] transition-colors disabled:opacity-50",children:r?h("loading"):h("refresh")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-3 p-4 rounded-xl bg-[var(--color-surface)] border border-[var(--color-border)]",role:"search","aria-label":h("filterEntriesAria"),children:[(0,l.jsx)("input",{type:"text",placeholder:h("filterByAction"),value:i,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),"aria-label":h("filterByActionTypeAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("input",{type:"text",placeholder:h("filterByActor"),value:x,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),"aria-label":h("filterByActorAria"),className:"flex-1 min-w-[180px] px-3 py-2 rounded-lg text-sm bg-[var(--color-bg)] border border-[var(--color-border)] text-[var(--color-text-main)] placeholder:text-[var(--color-text-muted)] focus:outline-2 focus:outline-[var(--color-accent)]"}),(0,l.jsx)("button",{onClick:f,className:"px-4 py-2 rounded-lg text-sm font-medium bg-[var(--color-accent)] text-white hover:bg-[var(--color-accent-hover)] transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-[var(--color-accent)]",children:h("search")})]}),n&&(0,l.jsx)("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",role:"alert",children:n}),(0,l.jsx)("div",{className:"overflow-x-auto rounded-xl border border-[var(--color-border)]",children:(0,l.jsxs)("table",{className:"w-full text-sm",role:"table","aria-label":h("tableAria"),children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"bg-[var(--color-bg-alt)] border-b border-[var(--color-border)]",children:[(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("timestamp")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("action")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("actor")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("target")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("details")}),(0,l.jsx)("th",{className:"text-left px-4 py-3 font-medium text-[var(--color-text-muted)]",children:h("ipAddress")})]})}),(0,l.jsx)("tbody",{children:0!==e.length||r?e.map(e=>{var t;return(0,l.jsxs)("tr",{className:"border-b border-[var(--color-border)] hover:bg-[var(--color-bg-alt)] transition-colors",children:[(0,l.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-[var(--color-text-muted)] font-mono text-xs",children:(e=>{try{return new Date(e).toLocaleString()}catch{return e}})(e.timestamp)}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsx)("span",{className:`inline-block px-2 py-0.5 rounded-md text-xs font-medium border ${(t=e.action).includes("delete")||t.includes("remove")?"bg-red-500/15 text-red-400 border-red-500/20":t.includes("create")||t.includes("add")?"bg-green-500/15 text-green-400 border-green-500/20":t.includes("update")||t.includes("change")?"bg-blue-500/15 text-blue-400 border-blue-500/20":t.includes("login")||t.includes("auth")?"bg-purple-500/15 text-purple-400 border-purple-500/20":"bg-gray-500/15 text-gray-400 border-gray-500/20"}`,children:e.action})}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-main)]",children:e.actor}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[200px] truncate",children:e.target||h("notAvailable")}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] max-w-[300px] truncate font-mono text-xs",children:e.details?JSON.stringify(e.details):h("notAvailable")}),(0,l.jsx)("td",{className:"px-4 py-3 text-[var(--color-text-muted)] font-mono text-xs whitespace-nowrap",children:e.ip_address||h("notAvailable")})]},e.id)}):(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-[var(--color-text-muted)]",children:h("noEntries")})})})]})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-xs text-[var(--color-text-muted)]",children:h("showing",{count:e.length,offset:m})}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("button",{onClick:()=>p(Math.max(0,m-25)),disabled:0===m,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:["← ",h("previous")]}),(0,l.jsxs)("button",{onClick:()=>p(m+25),disabled:!b,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--color-surface)] border border-[var(--color-border)] text-[var(--color-text-main)] hover:bg-[var(--color-bg-alt)] disabled:opacity-30 transition-colors",children:[h("next")," →"]})]})]})]})}function x(){let[e,t]=(0,a.useState)("request-logs"),r=(0,s.c)("logs");return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(o.Iz,{options:[{value:"request-logs",label:r("requestLogs")},{value:"proxy-logs",label:r("proxyLogs")},{value:"audit-logs",label:r("auditLog")},{value:"console",label:r("console")}],value:e,onChange:t}),"request-logs"===e&&(0,l.jsx)(o.y7,{}),"proxy-logs"===e&&(0,l.jsx)(o.Lo,{}),"audit-logs"===e&&(0,l.jsx)(d,{}),"console"===e&&(0,l.jsx)(i,{})]})}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=56646)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3542],{55305:(e,s,_)=>{Promise.resolve().then(_.bind(_,24726))}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,4726,8441,3794,7358],()=>e(e.s=55305)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1606],{20433:(e,t,s)=>{Promise.resolve().then(s.bind(s,38701))},38701:(e,t,s)=>{"use strict";s.d(t,{default:()=>n});var a=s(95155),r=s(12115),l=s(50910);let i={image:{icon:"image",endpoint:"/api/v1/images/generations",label:"Image Generation",placeholder:"A serene landscape with mountains at sunset...",color:"from-purple-500 to-pink-500"},video:{icon:"videocam",endpoint:"/api/v1/videos/generations",label:"Video Generation",placeholder:"A timelapse of a flower blooming...",color:"from-blue-500 to-cyan-500"},music:{icon:"music_note",endpoint:"/api/v1/music/generations",label:"Music Generation",placeholder:"Upbeat electronic music with synth pads...",color:"from-orange-500 to-yellow-500"}};function n(){let e=(0,l.c)("media"),[t,s]=(0,r.useState)("image"),[n,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[m,x]=(0,r.useState)([]),[u,p]=(0,r.useState)(!1),[h,b]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null),[j,y]=(0,r.useState)(null),N=async e=>{b(!0);try{let t=await fetch(i[e].endpoint);if(t.ok){let e=(await t.json()).data||[];x(e),e.length>0&&c(e[0].id)}}catch{x([])}b(!1)},v=async()=>{if(n.trim()){p(!0),y(null),f(null);try{let e=i[t],s=await fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:d||void 0,prompt:n.trim(),..."image"===t?{size:"1024x1024",n:1}:{}})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e?.error?.message||`Generation failed (${s.status})`)}let a=await s.json();f({type:t,data:a,timestamp:Date.now()})}catch(e){y(e.message||"Generation failed")}p(!1)}};(0,r.useState)(()=>{N("image")});let w=i[t];return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:e("title")}),(0,a.jsx)("p",{className:"text-text-muted text-sm mt-1",children:e("subtitle")})]}),(0,a.jsx)("div",{className:"flex gap-2 p-1 bg-surface/50 rounded-xl border border-black/5 dark:border-white/5",children:Object.keys(i).map(e=>{let r=i[e],l=e===t;return(0,a.jsxs)("button",{onClick:()=>{s(e),o(""),f(null),y(null),N(e)},className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium transition-all ${l?"bg-primary/10 text-primary shadow-sm border border-primary/20":"text-text-muted hover:text-text-main hover:bg-surface/80"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r.icon}),r.label]},e)})}),(0,a.jsxs)("div",{className:"bg-surface/30 rounded-xl border border-black/5 dark:border-white/5 p-6 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-text-main mb-2",children:e("model")}),h?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[16px]",children:"progress_activity"}),e("loadingModels")]}):m.length>0?(0,a.jsx)("select",{value:d,onChange:e=>c(e.target.value),className:"w-full px-3 py-2 rounded-lg bg-surface border border-black/10 dark:border-white/10 text-text-main text-sm focus:outline-none focus:ring-2 focus:ring-primary/30",children:m.map(e=>(0,a.jsx)("option",{value:e.id,children:e.id},e.id))}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:e("noModels")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-text-main mb-2",children:e("prompt")}),(0,a.jsx)("textarea",{rows:3,value:n,onChange:e=>o(e.target.value),placeholder:w.placeholder,className:"w-full px-3 py-2 rounded-lg bg-surface border border-black/10 dark:border-white/10 text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/30 resize-none"})]}),(0,a.jsx)("button",{onClick:v,disabled:u||!n.trim(),className:`w-full flex items-center justify-center gap-2 px-4 py-3 rounded-lg text-white font-medium transition-all bg-gradient-to-r ${w.color} ${u||!n.trim()?"opacity-50 cursor-not-allowed":"hover:opacity-90 hover:shadow-lg"}`,children:u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}),e("generating")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"auto_awesome"}),e("generate")," ",w.label]})})]}),j&&(0,a.jsxs)("div",{className:"bg-red-500/10 border border-red-500/20 rounded-xl p-4 flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[20px] mt-0.5",children:"error"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-red-500",children:e("error")}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:j})]})]}),g&&(0,a.jsxs)("div",{className:"bg-surface/30 rounded-xl border border-black/5 dark:border-white/5 p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] bg-gradient-to-r ${w.color} bg-clip-text text-transparent`,children:w.icon}),(0,a.jsx)("h3",{className:"text-sm font-medium text-text-main",children:e("result")}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:new Date(g.timestamp).toLocaleTimeString()})]}),(0,a.jsx)("pre",{className:"bg-surface rounded-lg p-4 text-xs text-text-muted overflow-auto max-h-96 custom-scrollbar",children:JSON.stringify(g.data,null,2)})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:Object.keys(i).map(t=>{let s=i[t];return(0,a.jsxs)("div",{className:"bg-surface/30 rounded-xl border border-black/5 dark:border-white/5 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("div",{className:`flex items-center justify-center size-8 rounded-lg bg-gradient-to-r ${s.color}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-white text-[16px]",children:s.icon})}),(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:s.label})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e(`${t}Description`)}),(0,a.jsxs)("code",{className:"block mt-2 text-xs text-primary/70 bg-primary/5 rounded px-2 py-1",children:["POST ",s.endpoint]})]},t)})})]})}},50910:(e,t,s)=>{"use strict";s.d(t,{c:()=>l});var a=s(33418);function r(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let l=r(0,a.c3);r(0,a.kc)}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=20433)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9971],{4051:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var r=s(95155),i=s(12115),a=s(73321),n=s(50910);let o=["welcome","security","provider","test","done"],c=["waving_hand","lock","dns","play_circle","check_circle"],l=[{id:"openai",name:"OpenAI",color:"#10A37F"},{id:"anthropic",name:"Anthropic",color:"#D97757"},{id:"google",name:"Google AI",color:"#4285F4"},{id:"openrouter",name:"OpenRouter",color:"#6B21A8"},{id:"groq",name:"Groq",color:"#F55036"},{id:"mistral",name:"Mistral",color:"#FF7000"}];function d(){let e=(0,a.useRouter)(),t=(0,n.c)("onboarding"),s=(0,n.c)("common"),[d,m]=(0,i.useState)(0),[x,p]=(0,i.useState)(!0),[u,h]=(0,i.useState)("http://localhost:20128/api/v1"),[g,b]=(0,i.useState)(""),[y,f]=(0,i.useState)(""),[j,v]=(0,i.useState)(!1),[w,N]=(0,i.useState)(null),[k,C]=(0,i.useState)(""),[P,S]=(0,i.useState)(""),[_,O]=(0,i.useState)(""),[T,A]=(0,i.useState)("idle"),[E,F]=(0,i.useState)("");(0,i.useEffect)(()=>{(async()=>{try{let s=await fetch("/api/settings");if(s.ok){var t;let r,i,a=await s.json();if(t=a?.apiPort,r=window.location.protocol,i=window.location.hostname,h(`${r}//${i}:${t||20128}/api/v1`),a.setupComplete)return void e.replace("/dashboard")}}catch{}p(!1)})()},[e]);let $=o.map((e,s)=>({id:e,title:t("done"===e?"ready":e),icon:c[s]})),q=$[d],D=d===$.length-1,R=()=>{d<$.length-1&&m(d+1)},[J,K]=(0,i.useState)(""),M=async()=>{if(j)return void R();if(g===y){K("");try{let e=await fetch("/api/settings/require-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:!0,password:g})});if(!e.ok){let s=await e.json().catch(()=>({}));K(s.error||t("failedSetPassword"));return}R()}catch{K(t("connectionError"))}}},z=async()=>{if(w&&P){K("");try{let e=l.find(e=>e.id===w),s=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:w,name:_||e?.name||w,url:k||({openai:"https://api.openai.com",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com",openrouter:"https://openrouter.ai/api",groq:"https://api.groq.com/openai",mistral:"https://api.mistral.ai"})[w]||"",apiKey:P,isActive:!0})});if(!s.ok){let e=await s.json().catch(()=>({}));K(e.error||t("failedAddProvider"));return}R()}catch{K(t("connectionError"))}}},G=async()=>{A("testing"),F(t("testingConnection"));try{let e=await fetch("/api/providers");if(!e.ok)throw Error("Failed to fetch");let s=await e.json(),r=s.connections?.[0];if(!r){A("error"),F(t("noProviderFound"));return}let i=await fetch(`/api/providers/${r.id}/test`,{method:"POST"});if(i.ok)A("success"),F(t("connectionSuccessful"));else{let e=await i.json().catch(()=>({}));A("error"),F(e.error||t("testFailed"))}}catch{A("error"),F(t("couldNotTest"))}},I=async()=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({setupComplete:!0})})}catch{}e.push("/dashboard")};return x?(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,r.jsx)("div",{className:"animate-pulse text-text-muted",children:s("loading")})}):(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,r.jsxs)("div",{className:"w-full max-w-lg",children:[(0,r.jsx)("div",{className:"flex items-center justify-center gap-2 mb-8",children:$.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold transition-all duration-300 ${t<d?"bg-green-500/20 text-green-400":t===d?"bg-primary/20 text-primary ring-2 ring-primary/40":"bg-white/5 text-text-muted"}`,children:t<d?(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check"}):t+1}),t<$.length-1&&(0,r.jsx)("div",{className:`w-8 h-0.5 rounded-full transition-colors ${t<d?"bg-green-500/40":"bg-white/10"}`})]},e.id))}),(0,r.jsxs)("div",{className:"bg-surface rounded-2xl border border-white/[0.06] p-8 shadow-xl",children:[(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[48px] mb-3 block ${"done"===q.id?"text-green-400":"text-primary"}`,children:q.icon}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-text-main mb-1",children:q.title})]}),(0,r.jsxs)("div",{className:"min-h-[200px]",children:["welcome"===q.id&&(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("p",{className:"text-text-muted",children:t("welcomeDesc")}),(0,r.jsx)("div",{className:"grid grid-cols-3 gap-3 mt-6",children:[{icon:"swap_horiz",label:t("multiProvider")},{icon:"monitoring",label:t("usageTracking")},{icon:"shield",label:t("apiKeyMgmt")}].map(e=>(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded-xl p-3 text-center border border-white/[0.06]",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[24px] mb-1 block",children:e.icon}),(0,r.jsx)("span",{className:"text-xs text-text-muted",children:e.label})]},e.icon))})]}),"security"===q.id&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted text-center",children:t("securityDesc")}),(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-text-muted",children:[(0,r.jsx)("input",{type:"checkbox",checked:j,onChange:e=>v(e.target.checked),className:"accent-primary"}),t("skipPassword")]}),!j&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{type:"password",placeholder:t("enterPassword"),value:g,onChange:e=>b(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,r.jsx)("input",{type:"password",placeholder:t("confirmPasswordPlaceholder"),value:y,onChange:e=>f(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),g&&y&&g!==y&&(0,r.jsx)("p",{className:"text-xs text-red-400",children:t("passwordsMismatch")})]})]}),"provider"===q.id&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted text-center",children:t("providerDesc")}),(0,r.jsx)("div",{className:"grid grid-cols-3 gap-2",children:l.map(e=>(0,r.jsx)("button",{onClick:()=>{N(e.id),O(e.name)},className:`p-3 rounded-xl border text-center text-xs font-medium transition-all cursor-pointer ${w===e.id?"border-primary/60 bg-primary/10 text-primary":"border-white/10 bg-white/[0.03] text-text-muted hover:border-white/20"}`,children:e.name},e.id))}),w&&(0,r.jsxs)("div",{className:"space-y-3 mt-4",children:[(0,r.jsx)("input",{type:"password",placeholder:t("apiKeyRequired"),value:P,onChange:e=>S(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,r.jsx)("input",{type:"text",placeholder:t("customUrlOptional"),value:k,onChange:e=>C(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"})]})]}),"test"===q.id&&(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:t("testDesc")}),"idle"===T&&(0,r.jsx)("button",{onClick:G,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:t("runTest")}),"testing"===T&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:E})]}),"success"===T&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-green-400",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"check_circle"}),(0,r.jsx)("span",{className:"text-sm",children:E})]}),"error"===T&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-amber-400",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"warning"}),(0,r.jsx)("span",{className:"text-sm",children:E})]}),(0,r.jsx)("button",{onClick:G,className:"text-xs text-text-muted underline cursor-pointer",children:t("retry")})]})]}),"done"===q.id&&(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("p",{className:"text-text-muted",children:t("doneDesc")}),(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded-xl p-4 border border-white/[0.06] text-left",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2 font-medium",children:t("yourEndpoint")}),(0,r.jsx)("code",{className:"text-sm text-primary",children:u})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-8 pt-6 border-t border-white/[0.06]",children:[(0,r.jsx)("div",{children:d>0&&!D&&(0,r.jsx)("button",{onClick:()=>{d>0&&m(d-1)},className:"px-4 py-2 text-sm text-text-muted hover:text-text-main transition-colors cursor-pointer",children:s("back")})}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[!D&&d>0&&(0,r.jsx)("button",{onClick:R,className:"px-4 py-2 text-sm text-text-muted hover:text-text-main transition-colors cursor-pointer",children:t("skip")}),"welcome"===q.id&&(0,r.jsx)("button",{onClick:R,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:t("getStarted")}),"security"===q.id&&(0,r.jsx)("button",{onClick:M,disabled:!j&&(!g||g!==y),className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:j?t("skipAndContinue"):t("setPassword")}),"provider"===q.id&&(0,r.jsx)("button",{onClick:z,disabled:!w||!P,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:t("addProvider")}),"test"===q.id&&(0,r.jsx)("button",{onClick:R,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:"success"===T?t("continue"):t("skip")}),D&&(0,r.jsx)("button",{onClick:I,className:"px-6 py-2.5 bg-green-500 rounded-lg text-white font-medium text-sm hover:bg-green-500/90 transition-colors cursor-pointer",children:t("goToDashboard")})]})]})]}),!D&&(0,r.jsx)("div",{className:"text-center mt-4",children:(0,r.jsx)("button",{onClick:I,className:"text-xs text-text-muted/60 hover:text-text-muted transition-colors cursor-pointer",children:t("skipWizard")})})]})})}},50910:(e,t,s)=>{"use strict";s.d(t,{c:()=>a});var r=s(33418);function i(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let a=i(0,r.c3);i(0,r.kc)},73321:(e,t,s)=>{"use strict";var r=s(74645);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},89848:(e,t,s)=>{Promise.resolve().then(s.bind(s,4051))}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=89848)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9971],{4051:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var r=s(95155),i=s(12115),a=s(73321),n=s(50910);let o=["welcome","security","provider","test","done"],c=["waving_hand","lock","dns","play_circle","check_circle"],l=[{id:"openai",name:"OpenAI",color:"#10A37F"},{id:"anthropic",name:"Anthropic",color:"#D97757"},{id:"google",name:"Google AI",color:"#4285F4"},{id:"openrouter",name:"OpenRouter",color:"#6B21A8"},{id:"groq",name:"Groq",color:"#F55036"},{id:"mistral",name:"Mistral",color:"#FF7000"}];function d(){let e=(0,a.useRouter)(),t=(0,n.c)("onboarding"),s=(0,n.c)("common"),[d,m]=(0,i.useState)(0),[x,p]=(0,i.useState)(!0),[u,h]=(0,i.useState)("http://localhost:20128/api/v1"),[g,b]=(0,i.useState)(""),[y,f]=(0,i.useState)(""),[j,v]=(0,i.useState)(!1),[w,N]=(0,i.useState)(null),[k,C]=(0,i.useState)(""),[P,S]=(0,i.useState)(""),[_,O]=(0,i.useState)(""),[T,A]=(0,i.useState)("idle"),[E,F]=(0,i.useState)("");(0,i.useEffect)(()=>{(async()=>{try{let s=await fetch("/api/settings");if(s.ok){var t;let r,i,a=await s.json();if(t=a?.apiPort,r=window.location.protocol,i=window.location.hostname,h(`${r}//${i}:${t||20128}/api/v1`),a.setupComplete)return void e.replace("/dashboard")}}catch{}p(!1)})()},[e]);let $=o.map((e,s)=>({id:e,title:t("done"===e?"ready":e),icon:c[s]})),q=$[d],D=d===$.length-1,R=()=>{d<$.length-1&&m(d+1)},[J,K]=(0,i.useState)(""),M=async()=>{if(j)return void R();if(g===y){K("");try{let e=await fetch("/api/settings/require-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:!0,password:g})});if(!e.ok){let s=await e.json().catch(()=>({}));K(s.error||t("failedSetPassword"));return}R()}catch{K(t("connectionError"))}}},z=async()=>{if(w&&P){K("");try{let e=l.find(e=>e.id===w),s=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:w,name:_||e?.name||w,url:k||({openai:"https://api.openai.com",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com",openrouter:"https://openrouter.ai/api",groq:"https://api.groq.com/openai",mistral:"https://api.mistral.ai"})[w]||"",apiKey:P,isActive:!0})});if(!s.ok){let e=await s.json().catch(()=>({}));K(e.error||t("failedAddProvider"));return}R()}catch{K(t("connectionError"))}}},G=async()=>{A("testing"),F(t("testingConnection"));try{let e=await fetch("/api/providers");if(!e.ok)throw Error("Failed to fetch");let s=await e.json(),r=s.connections?.[0];if(!r){A("error"),F(t("noProviderFound"));return}let i=await fetch(`/api/providers/${r.id}/test`,{method:"POST"});if(i.ok)A("success"),F(t("connectionSuccessful"));else{let e=await i.json().catch(()=>({}));A("error"),F(e.error||t("testFailed"))}}catch{A("error"),F(t("couldNotTest"))}},I=async()=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({setupComplete:!0})})}catch{}e.push("/dashboard")};return x?(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg",children:(0,r.jsx)("div",{className:"animate-pulse text-text-muted",children:s("loading")})}):(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,r.jsxs)("div",{className:"w-full max-w-lg",children:[(0,r.jsx)("div",{className:"flex items-center justify-center gap-2 mb-8",children:$.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold transition-all duration-300 ${t<d?"bg-green-500/20 text-green-400":t===d?"bg-primary/20 text-primary ring-2 ring-primary/40":"bg-white/5 text-text-muted"}`,children:t<d?(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check"}):t+1}),t<$.length-1&&(0,r.jsx)("div",{className:`w-8 h-0.5 rounded-full transition-colors ${t<d?"bg-green-500/40":"bg-white/10"}`})]},e.id))}),(0,r.jsxs)("div",{className:"bg-surface rounded-2xl border border-white/[0.06] p-8 shadow-xl",children:[(0,r.jsxs)("div",{className:"text-center mb-6",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[48px] mb-3 block ${"done"===q.id?"text-green-400":"text-primary"}`,children:q.icon}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-text-main mb-1",children:q.title})]}),(0,r.jsxs)("div",{className:"min-h-[200px]",children:["welcome"===q.id&&(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("p",{className:"text-text-muted",children:t("welcomeDesc")}),(0,r.jsx)("div",{className:"grid grid-cols-3 gap-3 mt-6",children:[{icon:"swap_horiz",label:t("multiProvider")},{icon:"monitoring",label:t("usageTracking")},{icon:"shield",label:t("apiKeyMgmt")}].map(e=>(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded-xl p-3 text-center border border-white/[0.06]",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary text-[24px] mb-1 block",children:e.icon}),(0,r.jsx)("span",{className:"text-xs text-text-muted",children:e.label})]},e.icon))})]}),"security"===q.id&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted text-center",children:t("securityDesc")}),(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-text-muted",children:[(0,r.jsx)("input",{type:"checkbox",checked:j,onChange:e=>v(e.target.checked),className:"accent-primary"}),t("skipPassword")]}),!j&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{type:"password",placeholder:t("enterPassword"),value:g,onChange:e=>b(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,r.jsx)("input",{type:"password",placeholder:t("confirmPasswordPlaceholder"),value:y,onChange:e=>f(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),g&&y&&g!==y&&(0,r.jsx)("p",{className:"text-xs text-red-400",children:t("passwordsMismatch")})]})]}),"provider"===q.id&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted text-center",children:t("providerDesc")}),(0,r.jsx)("div",{className:"grid grid-cols-3 gap-2",children:l.map(e=>(0,r.jsx)("button",{onClick:()=>{N(e.id),O(e.name)},className:`p-3 rounded-xl border text-center text-xs font-medium transition-all cursor-pointer ${w===e.id?"border-primary/60 bg-primary/10 text-primary":"border-white/10 bg-white/[0.03] text-text-muted hover:border-white/20"}`,children:e.name},e.id))}),w&&(0,r.jsxs)("div",{className:"space-y-3 mt-4",children:[(0,r.jsx)("input",{type:"password",placeholder:t("apiKeyRequired"),value:P,onChange:e=>S(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,r.jsx)("input",{type:"text",placeholder:t("customUrlOptional"),value:k,onChange:e=>C(e.target.value),className:"w-full px-4 py-2.5 bg-white/[0.04] border border-white/10 rounded-lg text-text-main text-sm placeholder:text-text-muted/50 focus:outline-none focus:ring-2 focus:ring-primary/40"})]})]}),"test"===q.id&&(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:t("testDesc")}),"idle"===T&&(0,r.jsx)("button",{onClick:G,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:t("runTest")}),"testing"===T&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:E})]}),"success"===T&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-green-400",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"check_circle"}),(0,r.jsx)("span",{className:"text-sm",children:E})]}),"error"===T&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-amber-400",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"warning"}),(0,r.jsx)("span",{className:"text-sm",children:E})]}),(0,r.jsx)("button",{onClick:G,className:"text-xs text-text-muted underline cursor-pointer",children:t("retry")})]})]}),"done"===q.id&&(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("p",{className:"text-text-muted",children:t("doneDesc")}),(0,r.jsxs)("div",{className:"bg-white/[0.03] rounded-xl p-4 border border-white/[0.06] text-left",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2 font-medium",children:t("yourEndpoint")}),(0,r.jsx)("code",{className:"text-sm text-primary",children:u})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-8 pt-6 border-t border-white/[0.06]",children:[(0,r.jsx)("div",{children:d>0&&!D&&(0,r.jsx)("button",{onClick:()=>{d>0&&m(d-1)},className:"px-4 py-2 text-sm text-text-muted hover:text-text-main transition-colors cursor-pointer",children:s("back")})}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[!D&&d>0&&(0,r.jsx)("button",{onClick:R,className:"px-4 py-2 text-sm text-text-muted hover:text-text-main transition-colors cursor-pointer",children:t("skip")}),"welcome"===q.id&&(0,r.jsx)("button",{onClick:R,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:t("getStarted")}),"security"===q.id&&(0,r.jsx)("button",{onClick:M,disabled:!j&&(!g||g!==y),className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:j?t("skipAndContinue"):t("setPassword")}),"provider"===q.id&&(0,r.jsx)("button",{onClick:z,disabled:!w||!P,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",children:t("addProvider")}),"test"===q.id&&(0,r.jsx)("button",{onClick:R,className:"px-6 py-2.5 bg-primary rounded-lg text-white font-medium text-sm hover:bg-primary/90 transition-colors cursor-pointer",children:"success"===T?t("continue"):t("skip")}),D&&(0,r.jsx)("button",{onClick:I,className:"px-6 py-2.5 bg-green-500 rounded-lg text-white font-medium text-sm hover:bg-green-500/90 transition-colors cursor-pointer",children:t("goToDashboard")})]})]})]}),!D&&(0,r.jsx)("div",{className:"text-center mt-4",children:(0,r.jsx)("button",{onClick:I,className:"text-xs text-text-muted/60 hover:text-text-muted transition-colors cursor-pointer",children:t("skipWizard")})})]})})}},12916:(e,t,s)=>{Promise.resolve().then(s.bind(s,4051))},50910:(e,t,s)=>{"use strict";s.d(t,{c:()=>a});var r=s(33418);function i(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let a=i(0,r.c3);i(0,r.kc)},73321:(e,t,s)=>{"use strict";var r=s(74645);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=12916)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{14005:(e,s,t)=>{Promise.resolve().then(t.bind(t,49433))},40993:(e,s,t)=>{"use strict";t.d(s,{Ex:()=>o.default,$n:()=>l.default,Zp:()=>i.default,Qv:()=>d.CardSkeleton,G9:()=>v.default,bQ:()=>k.default,pp:()=>N.default,Qn:()=>y.default,pd:()=>r.default,Mh:()=>g.default,uR:()=>u.default,aF:()=>n.default,rq:()=>m.default,LF:()=>x.default,KN:()=>f.default,Lo:()=>b.default,y7:()=>h.default,Iz:()=>j.default,l6:()=>a.default,lM:()=>c.default,cn:()=>p.default});var l=t(35806),r=t(34422),a=t(42994),i=t(81060),n=t(71361),d=t(92542);t(17705);var o=t(80927),c=t(19790);t(6261),t(55846),t(34243),t(89938),t(99023);var x=t(80178),m=t(85444),u=t(91961);t(25112);var p=t(45624),h=t(37415),f=t(48643),b=t(8287);t(1652);var g=t(92701);t(18150);var v=t(71689),j=t(33709);t(76332);var N=t(66200);t(61580);var y=t(51503);t(54128);var k=t(44638);t(21720),t(97050)},49433:(e,s,t)=>{"use strict";t.d(s,{default:()=>h});var l=t(95155),r=t(50910),a=t(12115),i=t(14051),n=t.n(i),d=t(5772),o=t(98500),c=t.n(o),x=t(73321),m=t(40993),u=t(20909),p=t(67671);function h({machineId:e}){let s=(0,r.c)("home"),t=(0,r.c)("common"),i=(0,r.c)("sidebar"),[n,d]=(0,a.useState)([]),[o,x]=(0,a.useState)([]),[p,h]=(0,a.useState)(!0),[g,v]=(0,a.useState)("/v1"),[j,N]=(0,a.useState)(null),[y,k]=(0,a.useState)({});(0,a.useEffect)(()=>{v(`${window.location.origin}/v1`)},[]);let w=(0,a.useCallback)(async()=>{try{let[e,s,t]=await Promise.all([fetch("/api/providers"),fetch("/api/models"),fetch("/api/provider-metrics")]);if(e.ok){let s=await e.json();d(s.connections||[])}if(s.ok){let e=await s.json();x(e.models||[])}if(t.ok){let e=await t.json();k(e.metrics||{})}}catch(e){console.log("Error fetching data:",e)}finally{h(!1)}},[]);(0,a.useEffect)(()=>{w()},[w]);let S=(0,a.useMemo)(()=>Object.entries(u.Q2).map(([e,s])=>{let t=n.filter(s=>s.provider===e),l=t.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,r=t.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length,a=new Set([e,s.alias].filter(Boolean)),i=o.filter(e=>a.has(e.provider)),d=u.IS[e]?"free":u.zN[e]?"oauth":"apikey";return{id:e,provider:s,total:t.length,connected:l,errors:r,modelCount:i.length,authType:d}}),[n,o]),R=(0,a.useMemo)(()=>{if(!j)return[];let e=new Set([j.id,j.provider?.alias].filter(Boolean));return o.filter(s=>e.has(s.provider))},[j,o]),q=[{label:s("documentation"),href:"/docs",icon:"menu_book"},{label:i("providers"),href:"/dashboard/providers",icon:"dns"},{label:i("combos"),href:"/dashboard/combos",icon:"layers"},{label:i("analytics"),href:"/dashboard/analytics",icon:"analytics"},{label:s("healthMonitor"),href:"/dashboard/health",icon:"health_and_safety"},{label:i("cliTools"),href:"/dashboard/cli-tools",icon:"terminal"},{label:s("reportIssue"),href:"https://github.com/diegosouzapw/OmniRoute/issues",external:!0,icon:"bug_report"}];return p?(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)(m.Qv,{}),(0,l.jsx)(m.Qv,{})]}):(0,l.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,l.jsx)(m.Zp,{children:(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:s("quickStart")}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:s("quickStartDesc")})]}),(0,l.jsxs)(c(),{href:"/docs",className:"hidden sm:inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"menu_book"}),s("fullDocs")]})]}),(0,l.jsxs)("ol",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,l.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10 text-primary shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"key"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-semibold",children:s("step1Title")}),(0,l.jsx)("p",{className:"text-text-muted mt-0.5",children:s.rich("step1Desc",{endpoint:e=>(0,l.jsx)(c(),{href:"/dashboard/endpoint",className:"text-primary hover:underline",children:e})})})]})]}),(0,l.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-green-500/10 text-green-500 shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"dns"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-semibold",children:s("step2Title")}),(0,l.jsx)("p",{className:"text-text-muted mt-0.5",children:s.rich("step2Desc",{providers:e=>(0,l.jsx)(c(),{href:"/dashboard/providers",className:"text-primary hover:underline",children:e})})})]})]}),(0,l.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-blue-500/10 text-blue-500 shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"link"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-semibold",children:s("step3Title")}),(0,l.jsx)("p",{className:"text-text-muted mt-0.5",children:s("step3Desc",{url:g})})]})]}),(0,l.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-amber-500/10 text-amber-500 shrink-0",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"analytics"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:"font-semibold",children:s("step4Title")}),(0,l.jsx)("p",{className:"text-text-muted mt-0.5",children:s.rich("step4Desc",{logs:e=>(0,l.jsx)(c(),{href:"/dashboard/usage",className:"text-primary hover:underline",children:e}),analytics:e=>(0,l.jsx)(c(),{href:"/dashboard/analytics",className:"text-primary hover:underline",children:e})})})]})]})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:q.map(e=>(0,l.jsxs)("a",{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon||(e.external?"open_in_new":"arrow_forward")}),e.label]},e.href))})]})}),(0,l.jsxs)(m.Zp,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:s("providersOverview")}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:s("configuredOf",{configured:S.filter(e=>e.total>0).length,total:S.length})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsxs)("div",{className:"hidden sm:flex items-center gap-3 text-[11px] text-text-muted",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," ",t("free")]}),(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{className:"size-2 rounded-full bg-blue-500"})," ",s("oauthLabel")]}),(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{className:"size-2 rounded-full bg-amber-500"})," ",s("apiKeyLabel")]})]}),(0,l.jsxs)(c(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-border text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"settings"}),t("manage")]})]})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:S.map(e=>(0,l.jsx)(f,{item:e,metrics:y[e.provider.alias]||y[e.id],onClick:()=>N(e)},e.id))})]}),j&&(0,l.jsx)(b,{provider:j,models:R,onClose:()=>N(null)})]})}function f({item:e,metrics:s,onClick:t}){let[i,n]=(0,a.useState)(!1),o=(0,r.c)("home"),c=(0,r.c)("common"),x=e.errors>0?"text-red-500":e.connected>0?"text-green-500":"text-text-muted",m={free:{color:"bg-green-500",label:c("free")},oauth:{color:"bg-blue-500",label:o("oauthLabel")},apikey:{color:"bg-amber-500",label:o("apiKeyLabel")}},u=m[e.authType]||m.apikey;return(0,l.jsx)("button",{onClick:t,className:"border border-border rounded-lg p-3 hover:bg-surface/40 transition-colors text-left cursor-pointer w-full",children:(0,l.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.provider.color||"#888"}15`},children:i?(0,l.jsx)("span",{className:"text-[10px] font-bold",style:{color:e.provider.color||"#888"},children:e.provider.textIcon||e.provider.id.slice(0,2).toUpperCase()}):(0,l.jsx)(d.default,{src:`/providers/${e.provider.id}.png`,alt:e.provider.name,width:26,height:26,className:"object-contain rounded-lg",sizes:"26px",onError:()=>n(!0)})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("p",{className:"text-sm font-semibold truncate",children:e.provider.name}),(0,l.jsx)("span",{className:`size-2 rounded-full ${u.color} shrink-0`,title:u.label})]}),(0,l.jsx)("p",{className:`text-xs ${x}`,children:0===e.total?c("notConfigured"):o("activeError",{active:e.connected,errors:e.errors})}),s&&s.totalRequests>0&&(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,l.jsx)("span",{className:"text-emerald-500",children:s.totalSuccesses}),"/",o("requestsShort",{count:s.totalRequests})]}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:[s.successRate,"%"]}),(0,l.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",s.avgLatencyMs,"ms"]})]})]}),(0,l.jsxs)("div",{className:"text-right shrink-0",children:[(0,l.jsx)("p",{className:"text-xs font-medium text-text-main",children:e.modelCount}),(0,l.jsx)("p",{className:"text-[10px] text-text-muted",children:c("models")})]})]})})}function b({provider:e,models:s,onClose:t}){let[i,n]=(0,a.useState)(null),d=(0,p.i)(),o=(0,x.useRouter)(),c=(0,r.c)("home"),u=(0,r.c)("common"),h=(0,r.c)("sidebar");return(0,l.jsx)(m.aF,{isOpen:!0,title:c("providerModelsTitle",{provider:e.provider.name}),onClose:t,children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"token"}),1===s.length?c("modelAvailable",{count:s.length}):c("modelsAvailable",{count:s.length}),e.total>0&&(0,l.jsxs)("span",{className:"ml-auto text-xs text-green-500",children:["●"," ",1===e.connected?c("connectionsActive",{count:e.connected}):c("connectionsActivePlural",{count:e.connected})]})]}),0===s.length?(0,l.jsxs)("div",{className:"text-center py-6",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:c("noModelsAvailable")}),(0,l.jsx)("p",{className:"text-xs text-text-muted mt-1",children:c("configureFirst",{providers:h("providers")})})]}):(0,l.jsx)("div",{className:"flex flex-col gap-1 max-h-[400px] overflow-y-auto",children:s.map(e=>(0,l.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg hover:bg-surface/50 transition-colors group",children:[(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("p",{className:"font-mono text-sm text-text-main truncate",children:e.fullModel}),e.alias!==e.model&&(0,l.jsxs)("p",{className:"text-[10px] text-text-muted",children:[c("aliasLabel"),": ",e.alias]})]}),(0,l.jsx)("button",{onClick:()=>{var s;return s=e.fullModel,void(navigator.clipboard.writeText(s),n(s),d.success(c("copiedModel",{model:s})),setTimeout(()=>n(null),2e3))},className:"shrink-0 ml-2 p-1.5 rounded-lg text-text-muted hover:text-text-main hover:bg-bg-subtle transition-colors opacity-0 group-hover:opacity-100",title:c("copyModelName"),children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:i===e.fullModel?"check":"content_copy"})})]},e.fullModel))}),(0,l.jsxs)("div",{className:"flex gap-2 pt-2 border-t border-border",children:[(0,l.jsxs)(m.$n,{variant:"secondary",fullWidth:!0,size:"sm",onClick:()=>{var s;return s=`/dashboard/providers/${e.id}`,void(t(),o.push(s))},className:"flex-1",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"settings"}),c("configureProvider")]}),(0,l.jsx)(m.$n,{variant:"ghost",size:"sm",onClick:t,children:u("close")})]})]})})}h.propTypes={machineId:n().string},f.propTypes={item:n().shape({id:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string,alias:n().string}).isRequired,total:n().number.isRequired,connected:n().number.isRequired,errors:n().number.isRequired,modelCount:n().number.isRequired,authType:n().string.isRequired}).isRequired,metrics:n().shape({totalRequests:n().number,totalSuccesses:n().number,successRate:n().number,avgLatencyMs:n().number}),onClick:n().func.isRequired},b.propTypes={provider:n().object.isRequired,models:n().array.isRequired,onClose:n().func.isRequired}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=14005)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-350aed2e86512c23.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{3751:(e,t,r)=>{Promise.resolve().then(r.bind(r,88618))},40993:(e,t,r)=>{"use strict";r.d(t,{Ex:()=>d.default,$n:()=>s.default,Zp:()=>l.default,Qv:()=>n.CardSkeleton,G9:()=>b.default,bQ:()=>C.default,pp:()=>j.default,Qn:()=>N.default,pd:()=>a.default,Mh:()=>y.default,uR:()=>u.default,aF:()=>o.default,rq:()=>m.default,LF:()=>p.default,KN:()=>f.default,Lo:()=>g.default,y7:()=>h.default,Iz:()=>v.default,l6:()=>i.default,lM:()=>c.default,cn:()=>x.default});var s=r(35806),a=r(34422),i=r(42994),l=r(81060),o=r(71361),n=r(92542);r(17705);var d=r(80927),c=r(19790);r(6261),r(55846),r(34243),r(89938),r(99023);var p=r(80178),m=r(85444),u=r(91961);r(25112);var x=r(45624),h=r(37415),f=r(48643),g=r(8287);r(1652);var y=r(92701);r(18150);var b=r(71689),v=r(33709);r(76332);var j=r(66200);r(61580);var N=r(51503);r(54128);var C=r(44638);r(21720),r(97050)},88618:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(67671),l=r(14051),o=r.n(l),n=r(73321),d=r(98500),c=r.n(d),p=r(5772),m=r(50910),u=r(40993),x=r(20909),h=r(81135),f=r(30949);function g(){let e=(0,n.useParams)(),t=(0,n.useRouter)(),r=e.id,[i,l]=(0,a.useState)([]),[o,d]=(0,a.useState)(!0),[g,v]=(0,a.useState)(null),[C,w]=(0,a.useState)(!1),[A,R]=(0,a.useState)(!1),[$,M]=(0,a.useState)(!1),[P,_]=(0,a.useState)(!1),[O,I]=(0,a.useState)(null),[K,q]=(0,a.useState)(null),[L,U]=(0,a.useState)({}),[F,D]=(0,a.useState)(!1),{copied:z,copy:J}=(0,f.C)(),B=(0,m.c)("providers"),W=(0,a.useRef)(!1),V=(0,a.useRef)(!1),[H,Q]=(0,a.useState)(null),[G,Z]=(0,a.useState)(null),[Y,X]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!1),[er,es]=(0,a.useState)({current:0,total:0,phase:"idle",status:"",logs:[],error:"",importedCount:0}),ea=g?{id:g.id,name:g.name||("anthropic-compatible"===g.type?B("anthropicCompatibleName"):B("openaiCompatibleName")),color:"anthropic-compatible"===g.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===g.type?"AC":"OC",apiType:g.apiType,baseUrl:g.baseUrl,type:g.type}:x.IS[r]||x.zN[r]||x.fg[r],ei=!!x.IS[r]||!!x.zN[r],el=(0,h.KC)(r),eo=(0,x.wG)(r),en=(0,x.mq)(r),ed=(0,x.gb)(r),ec=en||ed,ep=ec?r:eo,em=ec?g?.prefix||r:eo,eu=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&U(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),ex=(0,a.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"})]),s=await e.json(),a=await t.json();if(e.ok){let e=(s.connections||[]).filter(e=>e.provider===r);l(e)}if(t.ok){let e=(a.nodes||[]).find(e=>e.id===r)||null;if(!e&&ec)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===r)||null))break}v(e)}}catch(e){console.log("Error fetching connections:",e)}finally{d(!1)}},[r,ec]),eh=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(v(s.node),await ex(),_(!1))}catch(e){console.log("Error updating provider node:",e)}};(0,a.useEffect)(()=>{ex(),eu(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>Z(e)).catch(()=>{})},[ex,eu]),(0,a.useEffect)(()=>{o||0!==i.length||!ea||ec||W.current||V.current||(W.current=!0,ei?w(!0):R(!0))},[o]);let ef=async(e,t,r=eo)=>{let s=`${r}/${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 eu();else{let t=await e.json();alert(t.error||B("failedSetAlias"))}}catch(e){console.log("Error setting alias:",e)}},eg=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await eu()}catch(e){console.log("Error deleting alias:",e)}},ey=async e=>{if(confirm(B("deleteConnectionConfirm")))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&l(i.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},eb=(0,a.useCallback)(()=>{ex(),w(!1)},[ex]),ev=async e=>{try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})});if(t.ok)return await ex(),R(!1),null;let s=await t.json().catch(()=>({}));return s.error?.message||s.error||B("failedSaveConnection")}catch(e){return console.log("Error saving connection:",e),B("failedSaveConnectionRetry")}},ej=async e=>{try{(await fetch(`/api/providers/${O.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await ex(),M(!1))}catch(e){console.log("Error updating connection:",e)}},eN=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&l(r=>r.map(r=>r.id===e?{...r,isActive:t}:r))}catch(e){console.log("Error updating connection status:",e)}},eC=async(e,t)=>{try{(await fetch("/api/rate-limits",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,enabled:t})})).ok&&l(r=>r.map(r=>r.id===e?{...r,rateLimitProtection:t}:r))}catch(e){console.error("Error toggling rate limit:",e)}},ew=async e=>{if(e&&!K){q(e);try{let t=await fetch(`/api/providers/${e}/test`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>({}));alert(e.error||B("failedRetestConnection"));return}await ex()}catch(e){console.error("Error retesting connection:",e)}finally{q(null)}}},ek=async(e,t)=>{if(e&&t)try{let r=t.priority,s=e.priority;r===s&&(r=i.indexOf(e)>i.indexOf(t)?t.priority-.5:t.priority+.5),await Promise.all([fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:r})}),fetch(`/api/providers/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:s})})]),await ex()}catch(e){console.log("Error swapping priority:",e)}},eS=async()=>{if(Y)return;let e=i.find(e=>!1!==e.isActive);if(e){X(!0),et(!0),es({current:0,total:0,phase:"fetching",status:B("fetchingModels"),logs:[],error:"",importedCount:0});try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void es(e=>({...e,phase:"error",status:B("failedFetchModels"),error:s.error||B("failedImportModels")}));let a=s.models||[];if(0===a.length)return void es(e=>({...e,phase:"done",status:B("noModelsFound"),logs:[B("noModelsReturnedFromEndpoint")]}));es(e=>({...e,phase:"importing",total:a.length,status:B("importingModelsProgress",{current:0,total:a.length}),logs:[B("foundModelsStartingImport",{count:a.length})]}));let i=0;for(let e=0;e<a.length;e++){let t=a[e],s=t.id||t.name||t.model;if(!s)continue;let l=s.split("/"),o=l[l.length-1];es(t=>({...t,current:e+1,status:B("importingModelsProgress",{current:e+1,total:a.length}),logs:[...t.logs,B("importingModelById",{modelId:s})]})),await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,modelId:s,modelName:t.name||s,source:"imported"})}),L[o]||await ef(s,o,ep),i+=1}await eu(),es(e=>({...e,phase:"done",current:a.length,status:i>0?B("importSuccessCount",{count:i}):B("noNewModelsAddedExisting"),logs:[...e.logs,i>0?B("importDoneCount",{count:i}):B("noNewModelsAdded")],importedCount:i})),i>0&&setTimeout(()=>{window.location.reload()},2e3)}catch(e){console.log("Error importing models:",e),es(t=>({...t,phase:"error",status:B("importFailed"),error:e instanceof Error?e.message:B("unexpectedErrorOccurred")}))}finally{X(!1)}}},eT=async(e,t)=>{et(!0),es({current:0,total:0,phase:"fetching",status:B("fetchingModels"),logs:[],error:"",importedCount:0});try{let r=(await e()).models||[];if(0===r.length)return void es(e=>({...e,phase:"done",status:B("noModelsFound"),logs:[B("noModelsReturnedFromEndpoint")]}));es(e=>({...e,phase:"importing",total:r.length,status:B("importingModelsProgress",{current:0,total:r.length}),logs:[B("foundModelsStartingImport",{count:r.length})]}));let s=0;for(let e=0;e<r.length;e++){let a=r[e],i=a.id||a.name||a.model;i&&(es(t=>({...t,current:e+1,status:B("importingModelsProgress",{current:e+1,total:r.length}),logs:[...t.logs,B("importingModelById",{modelId:i})]})),await t(a)&&(s+=1))}es(e=>({...e,phase:"done",current:r.length,status:s>0?B("importSuccessCount",{count:s}):B("noNewModelsAdded"),logs:[...e.logs,s>0?B("importDoneCount",{count:s}):B("noNewModelsAdded")],importedCount:s})),s>0&&setTimeout(()=>{window.location.reload()},2e3)}catch(e){console.log("Error importing models:",e),es(t=>({...t,phase:"error",status:B("importFailed"),error:e instanceof Error?e.message:B("unexpectedErrorOccurred")}))}},eE=i.some(e=>!1!==e.isActive);return o?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(u.Qv,{}),(0,s.jsx)(u.Qv,{})]}):ea?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(c(),{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"}),B("backToProviders")]}),(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:`${ea.color}15`},children:F?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:ea.color},children:ea.textIcon||ea.id.slice(0,2).toUpperCase()}):(0,s.jsx)(p.default,{src:en&&ea.apiType?"responses"===ea.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":ed?"/providers/anthropic-m.png":`/providers/${ea.id}.png`,alt:ea.name,width:48,height:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",sizes:"48px",onError:()=>D(!0)})}),(0,s.jsxs)("div",{children:[ea.website?(0,s.jsxs)("a",{href:ea.website,target:"_blank",rel:"noopener noreferrer",className:"text-3xl font-semibold tracking-tight hover:underline inline-flex items-center gap-2",style:{color:ea.color},children:[ea.name,(0,s.jsx)("span",{className:"material-symbols-outlined text-lg opacity-60",children:"open_in_new"})]}):(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:ea.name}),(0,s.jsx)("p",{className:"text-text-muted",children:B("connectionCountLabel",{count:i.length})})]})]})]}),ec&&g&&(0,s.jsxs)(u.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:ed?B("anthropicCompatibleDetails"):B("openaiCompatibleDetails")}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:[ed?B("messagesApi"):"responses"===g.apiType?B("responsesApi"):B("chatCompletions")," ","\xb7 ",(g.baseUrl||"").replace(/\/$/,""),"/",ed?B("messagesPath"):"responses"===g.apiType?B("responsesPath"):B("chatCompletionsPath")]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:()=>R(!0),disabled:i.length>0,children:B("add")}),(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>_(!0),children:B("edit")}),(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(B("deleteCompatibleNodeConfirm",{type:ed?B("anthropic"):B("openai")})))try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},children:B("delete")})]})]}),i.length>0&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:B("singleConnectionPerCompatible")})]}),(0,s.jsxs)(u.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:B("connections")}),(0,s.jsxs)("button",{onClick:()=>Q({level:"provider",id:r,label:ea?.name||r}),className:`inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium transition-all ${G?.providers?.[r]?"bg-amber-500/15 text-amber-500 hover:bg-amber-500/25":"bg-black/[0.03] dark:bg-white/[0.03] text-text-muted/50 hover:text-text-muted hover:bg-black/[0.06] dark:hover:bg-white/[0.06]"}`,title:G?.providers?.[r]?B("providerProxyTitleConfigured",{host:G.providers[r].host||B("configured")}):B("providerProxyConfigureHint"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"vpn_lock"}),G?.providers?.[r]&&G.providers[r].host||B("providerProxy")]})]}),!ec&&(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:()=>ei?w(!0):R(!0),children:B("add")})]}),0===i.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:ei?"lock":"key"})}),(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:B("noConnectionsYet")}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:B("addFirstConnectionHint")}),!ec&&(0,s.jsx)(u.$n,{icon:"add",onClick:()=>ei?w(!0):R(!0),children:B("addConnection")})]}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:i.sort((e,t)=>(e.priority||0)-(t.priority||0)).map((e,t)=>(0,s.jsx)(k,{connection:e,isOAuth:ei,isFirst:0===t,isLast:t===i.length-1,onMoveUp:()=>ek(e,i[t-1]),onMoveDown:()=>ek(e,i[t+1]),onToggleActive:t=>eN(e.id,t),onToggleRateLimit:t=>eC(e.id,t),onRetest:()=>ew(e.id),isRetesting:K===e.id,onEdit:()=>{I(e),M(!0)},onDelete:()=>ey(e.id),onReauth:ei?()=>w(!0):void 0,onProxy:()=>Q({level:"key",id:e.id,label:e.name||e.email||e.id}),hasProxy:!!(G?.keys?.[e.id]||G?.providers?.[r]||G?.global),proxySource:G?.keys?.[e.id]?"key":G?.providers?.[r]?"provider":G?.global?"global":null,proxyHost:(G?.keys?.[e.id]||G?.providers?.[r]||G?.global)?.host||null},e.id))})]}),(0,s.jsxs)(u.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:B("availableModels")}),(()=>{if(ec)return(0,s.jsx)(N,{providerStorageAlias:ep,providerDisplayAlias:em,modelAliases:L,copied:z,onCopy:J,onSetAlias:ef,onDeleteAlias:eg,connections:i,isAnthropic:ed,onImportWithProgress:eT});if(ea.passthroughModels)return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eS,disabled:!eE||Y,children:Y?B("importingModels"):B("importFromModels")}),!eE&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:B("addConnectionToImport")})]}),(0,s.jsx)(b,{providerAlias:eo,modelAliases:L,copied:z,onCopy:J,onSetAlias:ef,onDeleteAlias:eg})]});let e=(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eS,disabled:!eE||Y,children:Y?B("importingModels"):B("importFromModels")}),!eE&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:B("addConnectionToImport")})]});return 0===el.length?(0,s.jsxs)("div",{children:[e,(0,s.jsx)("p",{className:"text-sm text-text-muted",children:B("noModelsConfigured")})]}):(0,s.jsxs)("div",{children:[e,(0,s.jsx)("div",{className:"flex flex-wrap gap-3",children:el.map(e=>{let t=`${ep}/${e.id}`,a=`${r}/${e.id}`,i=Object.entries(L).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(y,{model:e,fullModel:`${em}/${e.id}`,alias:i,copied:z,onCopy:J,onSetAlias:t=>ef(e.id,t,ep),onDeleteAlias:()=>eg(i)},e.id)})})]})})(),!ec&&(0,s.jsx)(j,{providerId:r,providerAlias:em,copied:z,onCopy:J})]}),"kiro"===r?(0,s.jsx)(u.Mh,{isOpen:C,providerInfo:ea,onSuccess:eb,onClose:()=>{V.current=!0,w(!1)}}):"cursor"===r?(0,s.jsx)(u.G9,{isOpen:C,onSuccess:eb,onClose:()=>{V.current=!0,w(!1)}}):(0,s.jsx)(u.LF,{isOpen:C,provider:r,providerInfo:ea,onSuccess:eb,onClose:()=>{V.current=!0,w(!1)}}),(0,s.jsx)(S,{isOpen:A,provider:r,providerName:ea.name,isCompatible:ec,isAnthropic:ed,onSave:ev,onClose:()=>R(!1)}),(0,s.jsx)(T,{isOpen:$,connection:O,onSave:ej,onClose:()=>M(!1)}),ec&&(0,s.jsx)(E,{isOpen:P,node:g,onSave:eh,onClose:()=>_(!1),isAnthropic:ed}),H&&(0,s.jsx)(u.KN,{isOpen:!!H,onClose:()=>Q(null),level:H.level,levelId:H.id,levelLabel:H.label}),(0,s.jsx)(u.aF,{isOpen:ee,onClose:()=>{("done"===er.phase||"error"===er.phase)&&et(!1)},title:B("importingModelsTitle"),size:"md",closeOnOverlay:!1,showCloseButton:"done"===er.phase||"error"===er.phase,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:["fetching"===er.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-primary animate-spin",children:"progress_activity"}),"importing"===er.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-primary animate-spin",children:"progress_activity"}),"done"===er.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-green-500",children:"check_circle"}),"error"===er.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"error"}),(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:er.status})]}),("importing"===er.phase||"done"===er.phase)&&er.total>0&&(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[er.current," / ",er.total]}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[Math.round(er.current/er.total*100),"%"]})]}),(0,s.jsx)("div",{className:"w-full h-2.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full transition-all duration-300 ease-out",style:{width:`${er.current/er.total*100}%`,background:"done"===er.phase?"linear-gradient(90deg, #22c55e, #16a34a)":"linear-gradient(90deg, var(--color-primary), var(--color-primary-hover, var(--color-primary)))"}})})]}),"fetching"===er.phase&&(0,s.jsx)("div",{className:"w-full h-2.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full animate-pulse",style:{width:"60%",background:"linear-gradient(90deg, var(--color-primary), var(--color-primary-hover, var(--color-primary)))"}})}),"error"===er.phase&&er.error&&(0,s.jsx)("div",{className:"p-3 rounded-lg bg-red-500/10 border border-red-500/20",children:(0,s.jsx)("p",{className:"text-sm text-red-400",children:er.error})}),er.logs.length>0&&(0,s.jsx)("div",{className:"max-h-48 overflow-y-auto rounded-lg bg-black/5 dark:bg-white/5 p-3 border border-black/5 dark:border-white/5",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:er.logs.map((e,t)=>(0,s.jsx)("p",{className:`text-xs font-mono ${e.startsWith("✓")?"text-green-500 font-semibold":"text-text-muted"}`,children:e},t))})}),"done"===er.phase&&er.importedCount>0&&(0,s.jsx)("p",{className:"text-xs text-text-muted text-center animate-pulse",children:B("pageAutoRefresh")})]})})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:B("providerNotFound")}),(0,s.jsx)(c(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:B("backToProviders")})]})}function y({model:e,fullModel:t,alias:r,copied:a,onCopy:i,onSetAlias:l,onDeleteAlias:o}){let n=(0,m.c)("providers");return(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"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}),(0,s.jsx)("button",{onClick:()=>i(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:n("copyModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})})]})}function b({providerAlias:e,modelAliases:t,copied:r,onCopy:i,onSetAlias:l,onDeleteAlias:o}){let n=(0,m.c)("providers"),[d,c]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),h=Object.entries(t).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,r])=>({modelId:r.replace(`${e}/`,""),fullModel:r,alias:t})),f=async()=>{let e;if(!d.trim()||p)return;let r=d.trim(),s=(e=r.split("/"))[e.length-1];if(t[s])return void alert(n("aliasExistsAlert",{alias:s}));x(!0);try{await l(r,s),c("")}catch(e){console.log("Error adding model:",e)}finally{x(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:n("openRouterAnyModelHint")}),(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{htmlFor:"new-model-input",className:"text-xs text-text-muted mb-1 block",children:n("modelIdFromOpenRouter")}),(0,s.jsx)("input",{id:"new-model-input",type:"text",value:d,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),placeholder:n("openRouterModelPlaceholder"),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)(u.$n,{size:"sm",icon:"add",onClick:f,disabled:!d.trim()||p,children:p?n("adding"):n("add")})]}),h.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:h.map(({modelId:e,fullModel:t,alias:a})=>(0,s.jsx)(v,{modelId:e,fullModel:t,copied:r,onCopy:i,onDeleteAlias:()=>o(a)},t))})]})}function v({modelId:e,fullModel:t,copied:r,onCopy:a,onDeleteAlias:i}){let l=(0,m.c)("providers");return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"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.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:l("copyModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e}`?"check":"content_copy"})})]})]}),(0,s.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:l("removeModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function j({providerId:e,providerAlias:t,copied:r,onCopy:i}){let l=(0,m.c)("providers"),[o,n]=(0,a.useState)([]),[d,c]=(0,a.useState)(""),[p,x]=(0,a.useState)(""),[h,f]=(0,a.useState)("chat-completions"),[g,y]=(0,a.useState)(["chat"]),[b,v]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!0),C=(0,a.useCallback)(async()=>{try{let t=await fetch(`/api/provider-models?provider=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();n(e.models||[])}}catch(e){console.error("Failed to fetch custom models:",e)}finally{N(!1)}},[e]);(0,a.useEffect)(()=>{C()},[C]);let w=async()=>{if(d.trim()&&!b){v(!0);try{(await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:d.trim(),modelName:p.trim()||void 0,apiFormat:h,supportedEndpoints:g})})).ok&&(c(""),x(""),f("chat-completions"),y(["chat"]),await C())}catch(e){console.error("Failed to add custom model:",e)}finally{v(!1)}}},k=async t=>{try{await fetch(`/api/provider-models?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(t)}`,{method:"DELETE"}),await C()}catch(e){console.error("Failed to remove custom model:",e)}};return(0,s.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[(0,s.jsxs)("h3",{className:"text-sm font-semibold mb-3 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary",children:"tune"}),l("customModels")]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-3",children:l("customModelsHint")}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mb-3",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{htmlFor:"custom-model-id",className:"text-xs text-text-muted mb-1 block",children:l("modelId")}),(0,s.jsx)("input",{id:"custom-model-id",type:"text",value:d,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:l("customModelPlaceholder"),className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsxs)("div",{className:"w-40",children:[(0,s.jsx)("label",{htmlFor:"custom-model-name",className:"text-xs text-text-muted mb-1 block",children:l("displayName")}),(0,s.jsx)("input",{id:"custom-model-name",type:"text",value:p,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:l("optional"),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)(u.$n,{size:"sm",icon:"add",onClick:w,disabled:!d.trim()||b,children:b?l("adding"):l("add")})]}),(0,s.jsxs)("div",{className:"flex items-end gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"w-48",children:[(0,s.jsx)("label",{htmlFor:"custom-api-format",className:"text-xs text-text-muted mb-1 block",children:"API Format"}),(0,s.jsxs)("select",{id:"custom-api-format",value:h,onChange:e=>f(e.target.value),className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"chat-completions",children:"Chat Completions"}),(0,s.jsx)("option",{value:"responses",children:"Responses API"})]})]}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted mb-1 block",children:"Supported Endpoints"}),(0,s.jsx)("div",{className:"flex items-center gap-3",children:["chat","embeddings","images","audio"].map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-main cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:g.includes(e),onChange:t=>{t.target.checked?y(t=>[...t,e]):y(t=>t.filter(t=>t!==e))},className:"rounded border-border"}),"chat"===e?"\uD83D\uDCAC Chat":"embeddings"===e?"\uD83D\uDCD0 Embeddings":"images"===e?"\uD83D\uDDBC️ Images":"\uD83D\uDD0A Audio"]},e))})]})]})]}),j?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:l("loading")}):o.length>0?(0,s.jsx)("div",{className:"flex flex-col gap-2",children:o.map(e=>{let a=`${t}/${e.id}`,o=`custom-${e.id}`;return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary",children:"tune"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e.name||e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1 flex-wrap",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:a}),(0,s.jsx)("button",{onClick:()=>i(a,o),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:l("copyModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===o?"check":"content_copy"})}),"responses"===e.apiFormat&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-blue-500/15 text-blue-400 font-medium",children:"Responses"}),e.supportedEndpoints?.includes("embeddings")&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-purple-500/15 text-purple-400 font-medium",children:"\uD83D\uDCD0 Embed"}),e.supportedEndpoints?.includes("images")&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-amber-500/15 text-amber-400 font-medium",children:"\uD83D\uDDBC️ Images"}),e.supportedEndpoints?.includes("audio")&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-green-500/15 text-green-400 font-medium",children:"\uD83D\uDD0A Audio"})]})]}),(0,s.jsx)("button",{onClick:()=>k(e.id),className:"p-1 hover:bg-red-50 rounded text-red-500",title:l("removeCustomModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]},e.id)})}):(0,s.jsx)("p",{className:"text-xs text-text-muted",children:l("noCustomModels")})]})}function N({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:r,copied:l,onCopy:o,onSetAlias:n,onDeleteAlias:d,connections:c,isAnthropic:p,onImportWithProgress:x}){let h=(0,m.c)("providers"),[f,g]=(0,a.useState)(""),[y,b]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),C=(0,i.i)(),w=Object.entries(r).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,r])=>({modelId:r.replace(`${e}/`,""),fullModel:r,alias:t})),k=e=>{let s,a=(s=e.split("/"))[s.length-1];if(!r[a])return a;let i=`${t}-${a}`;return r[i]?null:i},S=async()=>{if(!f.trim()||y)return;let t=f.trim(),r=k(t);if(!r)return void C.error(h("allSuggestedAliasesExist"));b(!0);try{let s=await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:t,modelName:t,source:"manual"})});if(!s.ok){let e={};try{e=await s.json()}catch(e){console.error("Failed to parse error response from custom model API:",e)}throw Error(e.error?.message||h("failedSaveCustomModel"))}await n(t,r,e),g(""),C.success(h("modelAddedSuccess",{modelId:t}))}catch(e){console.error("Error adding model:",e),C.error(e instanceof Error?e.message:h("failedAddModelTryAgain"))}finally{b(!1)}},T=async()=>{if(j)return;let t=c.find(e=>!1!==e.isActive);if(t){N(!0);try{await x(async()=>{let e=await fetch(`/api/providers/${t.id}/models`),r=await e.json();if(!e.ok)throw Error(r.error||h("failedImportModels"));return r},async t=>{let r=t.id||t.name||t.model;if(!r)return!1;let s=k(r);return!!s&&((await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:r,modelName:t.name||r,source:"imported"})})).ok?(await n(r,s,e),!0):(C.error(h("failedSaveImportedModel")),!1))})}catch(e){console.error("Error importing models:",e),C.error(h("failedImportModelsTryAgain"))}finally{N(!1)}}},E=c.some(e=>!1!==e.isActive),A=async(t,r)=>{try{if(!(await fetch(`/api/provider-models?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(t)}`,{method:"DELETE"})).ok)throw Error(h("failedRemoveModelFromDatabase"));await d(r),C.success(h("modelRemovedSuccess"))}catch(e){console.error("Error deleting model:",e),C.error(e instanceof Error?e.message:h("failedDeleteModelTryAgain"))}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:h("compatibleModelsDescription",{type:p?h("anthropic"):h("openai")})}),(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:h("modelId")}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:f,onChange:e=>g(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:p?h("anthropicCompatibleModelPlaceholder"):h("openaiCompatibleModelPlaceholder"),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)(u.$n,{size:"sm",icon:"add",onClick:S,disabled:!f.trim()||y,children:y?h("adding"):h("add")}),(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!E||j,children:j?h("importingModels"):h("importFromModels")})]}),!E&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:h("addConnectionToImport")}),w.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:w.map(({modelId:e,fullModel:r,alias:a})=>(0,s.jsx)(v,{modelId:e,fullModel:`${t}/${e}`,copied:l,onCopy:o,onDeleteAlias:()=>A(e,a)},r))})]})}function C({until:e}){let[t,r]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void r("");let s=Math.floor(t/1e3);if(s<60)r(`${s}s`);else if(s<3600)r(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);r(`${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}y.propTypes={model:o().shape({id:o().string.isRequired}).isRequired,fullModel:o().string.isRequired,alias:o().string,copied:o().string,onCopy:o().func.isRequired},b.propTypes={providerAlias:o().string.isRequired,modelAliases:o().object.isRequired,copied:o().string,onCopy:o().func.isRequired,onSetAlias:o().func.isRequired,onDeleteAlias:o().func.isRequired},v.propTypes={modelId:o().string.isRequired,fullModel:o().string.isRequired,copied:o().string,onCopy:o().func.isRequired,onDeleteAlias:o().func.isRequired},j.propTypes={providerId:o().string.isRequired,providerAlias:o().string.isRequired,copied:o().string,onCopy:o().func.isRequired},N.propTypes={providerStorageAlias:o().string.isRequired,providerDisplayAlias:o().string.isRequired,modelAliases:o().object.isRequired,copied:o().string,onCopy:o().func.isRequired,onSetAlias:o().func.isRequired,onDeleteAlias:o().func.isRequired,connections:o().arrayOf(o().shape({id:o().string,isActive:o().bool})).isRequired,isAnthropic:o().bool,onImportWithProgress:o().func.isRequired},C.propTypes={until:o().string.isRequired};let w={runtime_error:{labelKey:"errorTypeRuntime",variant:"warning"},upstream_auth_error:{labelKey:"errorTypeUpstreamAuth",variant:"error"},auth_missing:{labelKey:"errorTypeMissingCredential",variant:"warning"},token_refresh_failed:{labelKey:"errorTypeRefreshFailed",variant:"warning"},token_expired:{labelKey:"errorTypeTokenExpired",variant:"warning"},upstream_rate_limited:{labelKey:"errorTypeRateLimited",variant:"warning"},upstream_unavailable:{labelKey:"errorTypeUpstreamUnavailable",variant:"error"},network_error:{labelKey:"errorTypeNetworkError",variant:"warning"},unsupported:{labelKey:"errorTypeTestUnsupported",variant:"default"},upstream_error:{labelKey:"errorTypeUpstreamError",variant:"error"}};function k({connection:e,isOAuth:t,isFirst:r,isLast:i,onMoveUp:l,onMoveDown:o,onToggleActive:n,onToggleRateLimit:d,onRetest:c,isRetesting:p,onEdit:x,onDelete:h,onReauth:f,onProxy:g,hasProxy:y,proxySource:b,proxyHost:v}){let j,N=(0,m.c)("providers"),k=t?e.name||e.email||e.displayName||N("oauthAccount"):e.name,[S,T]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=()=>{T(e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now())};t();let r=e.rateLimitedUntil?setInterval(t,1e3):null;return()=>{r&&clearInterval(r)}},[e.rateLimitedUntil]);let E="unavailable"!==e.testStatus||S?e.testStatus:"active",A=function(e,t,r,s){if(!1===e.isActive)return{statusVariant:"default",statusLabel:s("statusDisabled"),errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};if("active"===t||"success"===t)return{statusVariant:"success",statusLabel:s("statusConnected"),errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};let a=function(e,t){if(t)return"upstream_rate_limited";if(e.lastErrorType)return e.lastErrorType;let r=Number(e.errorCode);if(401===r||403===r)return"upstream_auth_error";if(429===r)return"upstream_rate_limited";if(r>=500)return"upstream_unavailable";let s=(e.lastError||"").toLowerCase();return s?s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")||s.includes("healthcheck")?"runtime_error":s.includes("refresh failed")?"token_refresh_failed":s.includes("token expired")||s.includes("expired")?"token_expired":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.includes("access denied")||s.includes("unauthorized")?"upstream_auth_error":s.includes("rate limit")||s.includes("quota")||s.includes("too many requests")||s.includes("429")?"upstream_rate_limited":s.includes("fetch failed")||s.includes("network")||s.includes("timeout")||s.includes("econn")||s.includes("enotfound")?"network_error":s.includes("not supported")?"unsupported":"upstream_error":null}(e,r),i=a&&w[a]||null;return"runtime_error"===a?{statusVariant:"warning",statusLabel:s("statusRuntimeIssue"),errorType:a,errorBadge:i,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"upstream_auth_error"===a||"auth_missing"===a||"token_refresh_failed"===a||"token_expired"===a?{statusVariant:"error",statusLabel:s("statusAuthFailed"),errorType:a,errorBadge:i,errorTextClass:"text-red-500"}:"upstream_rate_limited"===a?{statusVariant:"warning",statusLabel:s("statusRateLimited"),errorType:a,errorBadge:i,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"network_error"===a?{statusVariant:"warning",statusLabel:s("statusNetworkIssue"),errorType:a,errorBadge:i,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"unsupported"===a?{statusVariant:"default",statusLabel:s("statusTestUnsupported"),errorType:a,errorBadge:i,errorTextClass:"text-text-muted"}:{statusVariant:"error",statusLabel:({unavailable:s("statusUnavailable"),failed:s("statusFailed"),error:s("statusError")})[t]||t||s("statusError"),errorType:a,errorBadge:i,errorTextClass:"text-red-500"}}(e,E,S,N),R=!!e.rateLimitProtection;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:l,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:o,disabled:i,className:`p-0.5 rounded ${i?"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:t?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:k}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[(0,s.jsx)(u.Ex,{variant:A.statusVariant,size:"sm",dot:!0,children:A.statusLabel}),S&&!1!==e.isActive&&(0,s.jsx)(C,{until:e.rateLimitedUntil}),A.errorBadge&&!1!==e.isActive&&(0,s.jsx)(u.Ex,{variant:A.errorBadge.variant,size:"sm",children:N(A.errorBadge.labelKey)}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:`text-xs truncate max-w-[300px] ${A.errorTextClass}`,title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:N("autoPriority",{priority:e.globalPriority})}),(0,s.jsx)("span",{className:"text-text-muted/30 select-none",children:"|"}),(0,s.jsxs)("button",{onClick:()=>d(!R),className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium transition-all cursor-pointer ${R?"bg-emerald-500/15 text-emerald-500 hover:bg-emerald-500/25":"bg-black/[0.03] dark:bg-white/[0.03] text-text-muted/50 hover:text-text-muted hover:bg-black/[0.06] dark:hover:bg-white/[0.06]"}`,title:N(R?"disableRateLimitProtection":"enableRateLimitProtection"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"shield"}),N(R?"rateLimitProtected":"rateLimitUnprotected")]}),y&&(j=N("global"===b?"proxySourceGlobal":"provider"===b?"proxySourceProvider":"proxySourceKey"),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-text-muted/30 select-none",children:"|"}),(0,s.jsxs)("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-xs font-medium ${"global"===b?"bg-emerald-500/15 text-emerald-500":"provider"===b?"bg-amber-500/15 text-amber-500":"bg-blue-500/15 text-blue-500"}`,title:N("proxyConfiguredBySource",{source:j,host:v||N("configured")}),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"vpn_lock"}),v||N("proxy")]})]}))]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.$n,{size:"sm",variant:"ghost",icon:"refresh",loading:p,disabled:!1===e.isActive,onClick:c,className:"!h-7 !px-2 text-xs",title:N("retestAuthentication"),children:N("retest")}),(0,s.jsx)(u.lM,{size:"sm",checked:e.isActive??!0,onChange:n,title:N(e.isActive??!0?"disableConnection":"enableConnection")}),(0,s.jsxs)("div",{className:"flex gap-1 ml-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[f&&(0,s.jsx)("button",{onClick:f,className:"p-2 hover:bg-amber-500/10 rounded text-amber-600 hover:text-amber-500",title:N("reauthenticateConnection"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"passkey"})}),(0,s.jsx)("button",{onClick:x,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,s.jsx)("button",{onClick:g,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",title:N("proxyConfig"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:h,className:"p-2 hover:bg-red-500/10 rounded text-red-500",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]})]})}function S({isOpen:e,provider:t,providerName:r,isCompatible:i,isAnthropic:l,onSave:o,onClose:n}){let d=(0,m.c)("providers"),[c,p]=(0,a.useState)({name:"",apiKey:"",priority:1}),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[y,b]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),N=async()=>{h(!0),j(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),r=await e.json();g(r.valid?"success":"failed")}catch{g("failed")}finally{h(!1)}},C=async()=>{if(t&&c.apiKey){b(!0),j(null);try{let e=!1;try{h(!0),g(null);let r=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await r.json()).valid,g(e?"success":"failed")}catch{g("failed")}finally{h(!1)}if(!e)return void j(d("apiKeyValidationFailed"));let r=await o({name:c.name,apiKey:c.apiKey,priority:c.priority,testStatus:"active"});r&&j("string"==typeof r?r:d("failedSaveConnection"))}finally{b(!1)}}};return t?(0,s.jsx)(u.aF,{isOpen:e,title:d("addProviderApiKeyTitle",{provider:r||t}),onClose:n,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(u.pd,{label:d("nameLabel"),value:c.name,onChange:e=>p({...c,name:e.target.value}),placeholder:d("productionKey")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.pd,{label:d("apiKeyLabel"),type:"password",value:c.apiKey,onChange:e=>p({...c,apiKey:e.target.value}),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(u.$n,{onClick:N,disabled:!c.apiKey||x||y,variant:"secondary",children:x?d("checking"):d("check")})})]}),f&&(0,s.jsx)(u.Ex,{variant:"success"===f?"success":"error",children:"success"===f?d("valid"):d("invalid")}),v&&(0,s.jsx)("div",{className:"text-sm text-red-500 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:v}),i&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:l?d("validationChecksAnthropicCompatible",{provider:r||d("anthropicCompatibleName")}):d("validationChecksOpenAiCompatible",{provider:r||d("openaiCompatibleName")})}),(0,s.jsx)(u.pd,{label:d("priorityLabel"),type:"number",value:c.priority,onChange:e=>p({...c,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.$n,{onClick:C,fullWidth:!0,disabled:!c.name||!c.apiKey||y,children:y?d("saving"):d("save")}),(0,s.jsx)(u.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:d("cancel")})]})]})}):null}function T({isOpen:e,connection:t,onSave:r,onClose:i}){let l=(0,m.c)("providers"),[o,n]=(0,a.useState)({name:"",priority:1,apiKey:"",healthCheckInterval:60}),[d,c]=(0,a.useState)(!1),[p,h]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[v,j]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(n({name:t.name||"",priority:t.priority||1,apiKey:"",healthCheckInterval:t.healthCheckInterval??60}),h(null),b(null))},[t]);let N=async()=>{if(t?.provider){c(!0),h(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),r=await e.json();h({valid:!!r.valid,diagnosis:r.diagnosis||null,message:r.error||null})}catch{h({valid:!1,diagnosis:{type:"network_error"},message:l("failedTestConnection")})}finally{c(!1)}}},C=async()=>{if(t?.provider&&o.apiKey){g(!0),b(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})}),r=await e.json();b(r.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}}},k=async()=>{j(!0);try{let e={name:o.name,priority:o.priority,healthCheckInterval:o.healthCheckInterval};if(!S&&o.apiKey){e.apiKey=o.apiKey;let r="success"===y;if(!r)try{g(!0),b(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:o.apiKey})});r=!!(await e.json()).valid,b(r?"success":"failed")}catch{b("failed")}finally{g(!1)}r&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null,e.lastErrorType=null,e.lastErrorSource=null,e.errorCode=null,e.rateLimitedUntil=null)}await r(e)}finally{j(!1)}};if(!t)return null;let S="oauth"===t.authType,T=(0,x.mq)(t.provider)||(0,x.gb)(t.provider),E=!p?.valid&&p?.diagnosis?.type&&w[p.diagnosis.type]||null;return(0,s.jsx)(u.aF,{isOpen:e,title:l("editConnection"),onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(u.pd,{label:l("nameLabel"),value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:S?l("accountName"):l("productionKey")}),S&&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:l("email")}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),S&&(0,s.jsx)(u.pd,{label:l("healthCheckMinutes"),type:"number",value:o.healthCheckInterval,onChange:e=>n({...o,healthCheckInterval:Math.max(0,Number.parseInt(e.target.value)||0)}),hint:l("healthCheckHint")}),(0,s.jsx)(u.pd,{label:l("priorityLabel"),type:"number",value:o.priority,onChange:e=>n({...o,priority:Number.parseInt(e.target.value)||1})}),!S&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.pd,{label:l("apiKeyLabel"),type:"password",value:o.apiKey,onChange:e=>n({...o,apiKey:e.target.value}),placeholder:l("enterNewApiKey"),hint:l("leaveBlankKeepCurrentApiKey"),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(u.$n,{onClick:C,disabled:!o.apiKey||f||v,variant:"secondary",children:f?l("checking"):l("check")})})]}),y&&(0,s.jsx)(u.Ex,{variant:"success"===y?"success":"error",children:"success"===y?l("valid"):l("invalid")})]}),!T&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(u.$n,{onClick:N,variant:"secondary",disabled:d,children:d?l("testing"):l("testConnection")}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Ex,{variant:p.valid?"success":"error",children:p.valid?l("valid"):l("failed")}),E&&(0,s.jsx)(u.Ex,{variant:E.variant,children:l(E.labelKey)})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.$n,{onClick:k,fullWidth:!0,disabled:v,children:v?l("saving"):l("save")}),(0,s.jsx)(u.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:l("cancel")})]})]})})}function E({isOpen:e,node:t,onSave:r,onClose:i,isAnthropic:l}){let o=(0,m.c)("providers"),[n,d]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&d({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let v=[{value:"chat",label:o("chatCompletions")},{value:"responses",label:o("responsesApi")}],j=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){p(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};l||(e.apiType=n.apiType),await r(e)}finally{p(!1)}}},N=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:x,type:l?"anthropic-compatible":"openai-compatible"})}),t=await e.json();b(t.valid?"success":"failed")}catch{b("failed")}finally{g(!1)}};return t?(0,s.jsx)(u.aF,{isOpen:e,title:o("editCompatibleTitle",{type:o(l?"anthropic":"openai")}),onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(u.pd,{label:o("nameLabel"),value:n.name,onChange:e=>d({...n,name:e.target.value}),placeholder:o("compatibleProdPlaceholder",{type:o(l?"anthropic":"openai")}),hint:o("nameHint")}),(0,s.jsx)(u.pd,{label:o("prefixLabel"),value:n.prefix,onChange:e=>d({...n,prefix:e.target.value}),placeholder:o(l?"anthropicPrefixPlaceholder":"openaiPrefixPlaceholder"),hint:o("prefixHint")}),!l&&(0,s.jsx)(u.l6,{label:o("apiTypeLabel"),options:v,value:n.apiType,onChange:e=>d({...n,apiType:e.target.value})}),(0,s.jsx)(u.pd,{label:o("baseUrlLabel"),value:n.baseUrl,onChange:e=>d({...n,baseUrl:e.target.value}),placeholder:o(l?"anthropicBaseUrlPlaceholder":"openaiBaseUrlPlaceholder"),hint:o("compatibleBaseUrlHint",{type:o(l?"anthropic":"openai")})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.pd,{label:o("apiKeyForCheck"),type:"password",value:x,onChange:e=>h(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(u.$n,{onClick:N,disabled:!x||f||!n.baseUrl.trim(),variant:"secondary",children:o(f?"checking":"check")})})]}),y&&(0,s.jsx)(u.Ex,{variant:"success"===y?"success":"error",children:o("success"===y?"valid":"invalid")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.$n,{onClick:j,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||c,children:o(c?"saving":"save")}),(0,s.jsx)(u.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:o("cancel")})]})]})}):null}k.propTypes={connection:o().shape({id:o().string,name:o().string,email:o().string,displayName:o().string,rateLimitedUntil:o().string,rateLimitProtection:o().bool,testStatus:o().string,isActive:o().bool,priority:o().number,lastError:o().string,lastErrorType:o().string,lastErrorSource:o().string,errorCode:o().oneOfType([o().string,o().number]),globalPriority:o().number}).isRequired,isOAuth:o().bool.isRequired,isFirst:o().bool.isRequired,isLast:o().bool.isRequired,onMoveUp:o().func.isRequired,onMoveDown:o().func.isRequired,onToggleActive:o().func.isRequired,onToggleRateLimit:o().func.isRequired,onRetest:o().func.isRequired,isRetesting:o().bool,onEdit:o().func.isRequired,onDelete:o().func.isRequired,onReauth:o().func},S.propTypes={isOpen:o().bool.isRequired,provider:o().string,providerName:o().string,isCompatible:o().bool,isAnthropic:o().bool,onSave:o().func.isRequired,onClose:o().func.isRequired},T.propTypes={isOpen:o().bool.isRequired,connection:o().shape({id:o().string,name:o().string,email:o().string,priority:o().number,authType:o().string,provider:o().string}),onSave:o().func.isRequired,onClose:o().func.isRequired},E.propTypes={isOpen:o().bool.isRequired,node:o().shape({id:o().string,name:o().string,prefix:o().string,apiType:o().string,baseUrl:o().string}),onSave:o().func.isRequired,onClose:o().func.isRequired,isAnthropic:o().bool}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=3751)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4525],{1777:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(95155);function i({error:e,reset:t}){return(0,s.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-6",role:"alert","aria-live":"assertive",children:(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-red-600 dark:text-red-400",children:"Failed to load providers"}),(0,s.jsx)("p",{className:"text-text-muted max-w-md",children:"We could not load provider data right now. Check your connection and try again."}),e?.digest&&(0,s.jsxs)("p",{className:"text-xs text-text-muted font-mono",children:["Error ID: ",e.digest]}),!1,(0,s.jsx)("button",{onClick:t,className:"px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-hover transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-primary",children:"Try Again"})]})})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4525],{1777:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(95155);function i({error:e,reset:t}){return(0,s.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-6",role:"alert","aria-live":"assertive",children:(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-red-600 dark:text-red-400",children:"Failed to load providers"}),(0,s.jsx)("p",{className:"text-text-muted max-w-md",children:"We could not load provider data right now. Check your connection and try again."}),e?.digest&&(0,s.jsxs)("p",{className:"text-xs text-text-muted font-mono",children:["Error ID: ",e.digest]}),!1,(0,s.jsx)("button",{onClick:t,className:"px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-hover transition-colors focus:outline-2 focus:outline-offset-2 focus:outline-primary",children:"Try Again"})]})})}},91262:(e,t,r)=>{Promise.resolve().then(r.bind(r,1777))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=91262)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/loading-7deaa9f550841465.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9507],{67040:(e,s,a)=>{"use strict";function r(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}a.d(s,{cn:()=>r})},68715:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>i});var r=a(95155),n=a(92542);function i(){return(0,r.jsxs)("div",{className:"space-y-6 p-6",role:"status","aria-live":"polite","aria-busy":"true",children:[(0,r.jsx)(n.Skeleton,{className:"h-8 w-48"}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[0,1,2].map(e=>(0,r.jsx)(n.CardSkeleton,{},e))})]})}},92542:(e,s,a)=>{"use strict";a.d(s,{CardSkeleton:()=>d,PageLoading:()=>l,Skeleton:()=>c,Spinner:()=>t,default:()=>o});var r=a(95155),n=a(67040);let i={sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"};function t({size:e="md",className:s,label:a="Loading"}){return(0,r.jsxs)("span",{role:"status","aria-live":"polite","aria-label":a,className:(0,n.cn)("inline-flex",s),children:[(0,r.jsx)("span",{className:"sr-only",children:a}),(0,r.jsx)("span",{"aria-hidden":"true",className:(0,n.cn)("material-symbols-outlined text-primary animate-spin motion-reduce:animate-none",i[e]),children:"progress_activity"})]})}function l({message:e="Loading...",className:s}){return(0,r.jsxs)("div",{className:(0,n.cn)("fixed inset-0 z-50 flex flex-col items-center justify-center bg-bg px-6",s),role:"status","aria-live":"polite","aria-busy":"true",children:[(0,r.jsx)(t,{size:"xl"}),(0,r.jsx)("p",{className:"mt-4 text-text-muted text-center",children:e})]})}function c({className:e,...s}){return(0,r.jsx)("div",{"aria-hidden":"true",className:(0,n.cn)("animate-pulse motion-reduce:animate-none rounded-lg bg-border",e),...s})}function d(){return(0,r.jsxs)("div",{className:"p-6 rounded-xl border border-border bg-surface","aria-hidden":"true",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 gap-4",children:[(0,r.jsx)(c,{className:"h-4 w-24"}),(0,r.jsx)(c,{className:"size-10 rounded-lg"})]}),(0,r.jsx)(c,{className:"h-8 w-16 mb-2"}),(0,r.jsx)(c,{className:"h-3 w-20"})]})}function o({type:e="spinner",className:s,message:a,size:n,label:i,...o}){switch(e){case"page":return(0,r.jsx)(l,{message:a,className:s});case"skeleton":return(0,r.jsx)(c,{className:s,...o});case"card":return(0,r.jsx)(d,{});default:return(0,r.jsx)(t,{size:n,className:s,label:i})}}},93992:(e,s,a)=>{Promise.resolve().then(a.bind(a,68715))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=93992)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-3ef302da4b756e50.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{12022:(e,a,r)=>{Promise.resolve().then(r.bind(r,91241))},40993:(e,a,r)=>{"use strict";r.d(a,{Ex:()=>n.default,$n:()=>t.default,Zp:()=>d.default,Qv:()=>o.CardSkeleton,G9:()=>y.default,bQ:()=>k.default,pp:()=>N.default,Qn:()=>g.default,pd:()=>l.default,Mh:()=>f.default,uR:()=>m.default,aF:()=>i.default,rq:()=>p.default,LF:()=>u.default,KN:()=>v.default,Lo:()=>b.default,y7:()=>x.default,Iz:()=>j.default,l6:()=>s.default,lM:()=>c.default,cn:()=>h.default});var t=r(35806),l=r(34422),s=r(42994),d=r(81060),i=r(71361),o=r(92542);r(17705);var n=r(80927),c=r(19790);r(6261),r(55846),r(34243),r(89938),r(99023);var u=r(80178),p=r(85444),m=r(91961);r(25112);var h=r(45624),x=r(37415),v=r(48643),b=r(8287);r(1652);var f=r(92701);r(18150);var y=r(71689),j=r(33709);r(76332);var N=r(66200);r(61580);var g=r(51503);r(54128);var k=r(44638);r(21720),r(97050)},91241:(e,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>m});var t=r(95155),l=r(12115),s=r(73321),d=r(98500),i=r.n(d),o=r(40993),n=r(52529),c=r(50910);let u=Object.values(n.Q2).map(e=>({value:e.id,label:e.name})),p=Object.values(n.MA).map(e=>({value:e.id,label:e.name}));function m(){let e=(0,s.useRouter)(),[a,r]=(0,l.useState)(!1),d=(0,c.c)("providers"),[m,h]=(0,l.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[x,v]=(0,l.useState)({}),b=(e,a)=>{h(r=>({...r,[e]:a})),x[e]&&v(a=>({...a,[e]:null}))},f=async a=>{let t;if(a.preventDefault(),t={},m.provider||(t.provider=d("selectProvider")),"api_key"!==m.authMethod||m.apiKey||(t.apiKey=d("apiKeyRequired")),v(t),0===Object.keys(t).length){r(!0);try{let a=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(a.ok)e.push("/dashboard/providers");else{let e=await a.json();v({submit:e.error||d("failedCreate")})}}catch(e){v({submit:d("errorOccurred")})}finally{r(!1)}}},y=n.Q2[m.provider];return(0,t.jsxs)("div",{className:"max-w-2xl mx-auto min-w-0",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsxs)(i(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),d("backToProviders")]}),(0,t.jsx)("h1",{className:"text-2xl sm:text-3xl font-semibold tracking-tight break-words",children:d("addNewProvider")}),(0,t.jsx)("p",{className:"text-text-muted mt-2",children:d("configureNewProvider")})]}),(0,t.jsx)(o.Zp,{children:(0,t.jsxs)("form",{onSubmit:f,className:"flex flex-col gap-6",children:[(0,t.jsx)(o.l6,{label:d("providerLabel"),options:u,value:m.provider,onChange:e=>b("provider",e.target.value),placeholder:d("selectProvider"),error:x.provider,required:!0}),y&&(0,t.jsxs)(o.Zp.Section,{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:y.color},children:y.icon})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:y.name}),(0,t.jsx)("p",{className:"text-sm text-text-muted",children:d("selectedProvider")})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("label",{className:"text-sm font-medium",children:[d("authMethod")," ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,t.jsx)("div",{className:"flex flex-col sm:flex-row gap-3",children:p.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>b("authMethod",e.value),className:`flex-1 min-w-0 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${m.authMethod===e.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[(0,t.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,t.jsx)("span",{className:"font-medium text-center break-words",children:"api_key"===e.value?d("apiKeyLabel"):d("oauth2Label")})]},e.value))})]}),"api_key"===m.authMethod&&(0,t.jsx)(o.pd,{label:d("apiKeyLabel"),type:"password",placeholder:d("enterApiKey"),value:m.apiKey,onChange:e=>b("apiKey",e.target.value),error:x.apiKey,hint:d("apiKeySecure"),required:!0}),"oauth2"===m.authMethod&&(0,t.jsxs)(o.Zp.Section,{className:"",children:[(0,t.jsx)("p",{className:"text-sm text-text-muted mb-4",children:d("oauth2Desc")}),(0,t.jsx)(o.$n,{type:"button",variant:"secondary",icon:"link",children:d("oauth2Connect")})]}),(0,t.jsx)(o.pd,{label:d("displayName"),placeholder:d("displayNamePlaceholder"),value:m.displayName,onChange:e=>b("displayName",e.target.value),hint:d("displayNameHint")}),(0,t.jsx)(o.lM,{checked:m.isActive,onChange:e=>b("isActive",e),label:d("active"),description:d("activeDescription")}),x.submit&&(0,t.jsx)("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:x.submit}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 pt-4 border-t border-border",children:[(0,t.jsx)(i(),{href:"/dashboard/providers",className:"flex-1",children:(0,t.jsx)(o.$n,{type:"button",variant:"ghost",fullWidth:!0,children:d("cancel")})}),(0,t.jsx)(o.$n,{type:"submit",loading:a,fullWidth:!0,className:"flex-1",children:d("createProvider")})]})]})})]})}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=12022)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{37667:(e,t,a)=>{Promise.resolve().then(a.bind(a,75926))},40993:(e,t,a)=>{"use strict";a.d(t,{Ex:()=>d.default,$n:()=>r.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,G9:()=>v.default,bQ:()=>C.default,pp:()=>j.default,Qn:()=>N.default,pd:()=>s.default,Mh:()=>g.default,uR:()=>x.default,aF:()=>n.default,rq:()=>m.default,LF:()=>p.default,KN:()=>b.default,Lo:()=>f.default,y7:()=>h.default,Iz:()=>y.default,l6:()=>l.default,lM:()=>c.default,cn:()=>u.default});var r=a(35806),s=a(34422),l=a(42994),i=a(81060),n=a(71361),o=a(92542);a(17705);var d=a(80927),c=a(19790);a(6261),a(55846),a(34243),a(89938),a(99023);var p=a(80178),m=a(85444),x=a(91961);a(25112);var u=a(45624),h=a(37415),b=a(48643),f=a(8287);a(1652);var g=a(92701);a(18150);var v=a(71689),y=a(33709);a(76332);var j=a(66200);a(61580);var N=a(51503);a(54128);var C=a(44638);a(21720),a(97050)},75926:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>f});var r=a(95155),s=a(12115),l=a(5772),i=a(14051),n=a.n(i),o=a(40993),d=a(52529),c=a(20909),p=a(98500),m=a.n(p),x=a(67671),u=a(50910);function h(){let e=(0,u.c)("providers"),t=(0,u.c)("common"),a={available:{icon:"check_circle",color:"#22c55e",label:e("available")},cooldown:{icon:"schedule",color:"#f59e0b",label:e("cooldown")},unavailable:{icon:"error",color:"#ef4444",label:e("unavailable")},unknown:{icon:"help",color:"#6b7280",label:e("unknown")}},[l,i]=(0,s.useState)(null),[n,d]=(0,s.useState)(!0),[c,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),b=(0,s.useRef)(null),f=(0,x.i)(),g=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let t=await e.json();i(t)}}catch{}finally{d(!1)}},[]);(0,s.useEffect)(()=>{g();let e=setInterval(g,3e4);return()=>clearInterval(e)},[g]),(0,s.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&p(!1)};return c&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);let v=async(t,a)=>{h(`${t}:${a}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:t,model:a})})).ok?(f.success(e("cooldownCleared",{model:a})),await g()):f.error(e("failedClearCooldown"))}catch{f.error(e("failedClearCooldown"))}finally{h(null)}};if(n)return null;let y=l?.models||[],j=l?.unavailableCount||y.filter(e=>"available"!==e.status).length,N=0===j,C={};return y.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";C[t]||(C[t]=[]),C[t].push(e)}),(0,r.jsxs)("div",{className:"relative",ref:b,children:[(0,r.jsxs)("button",{onClick:()=>p(!c),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-all ${N?"bg-emerald-500/10 border-emerald-500/20 text-emerald-500 hover:bg-emerald-500/15":"bg-amber-500/10 border-amber-500/20 text-amber-500 hover:bg-amber-500/15"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:N?"verified":"warning"}),N?e("allModelsOperational"):e("modelsWithIssues",{count:j})]}),c&&(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:N?"#22c55e":"#f59e0b"},"aria-hidden":"true",children:N?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:e("modelStatus")})]}),(0,r.jsx)("button",{onClick:g,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:t("refresh"),children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:N?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:e("allModelsNormal")}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(C).map(([t,s])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:t}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:s.map(t=>{let s=a[t.status]||a.unknown,l=m===`${t.provider}:${t.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:s.color},"aria-hidden":"true",children:s.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:t.model})]}),"cooldown"===t.status&&(0,r.jsx)(o.$n,{size:"sm",variant:"ghost",onClick:()=>v(t.provider,t.model),disabled:l,className:"text-[10px] px-1.5! py-0.5! ml-2",children:l?e("clearing"):e("clearCooldown")})]},`${t.provider}-${t.model}`)})})]},t))})})]})]})}function b(e,t,a,s){let l=[];if(e>0&&l.push((0,r.jsx)(o.Ex,{variant:"success",size:"sm",dot:!0,children:s("connected",{count:e})},"connected")),t>0){let e=a?s("errorCount",{count:t,code:a}):s("errorCountNoCode",{count:t});l.push((0,r.jsx)(o.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===l.length?(0,r.jsx)("span",{className:"text-text-muted",children:s("noConnections")}):l}function f(){let[e,t]=(0,s.useState)([]),[a,l]=(0,s.useState)([]),[i,n]=(0,s.useState)(!0),[p,m]=(0,s.useState)(!1),[b,f]=(0,s.useState)(!1),[C,k]=(0,s.useState)(null),[w,T]=(0,s.useState)(null),S=(0,x.i)(),U=(0,u.c)("providers"),E=(0,u.c)("common");(0,s.useEffect)(()=>{(async()=>{try{let[e,a]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),s=await a.json();e.ok&&t(r.connections||[]),a.ok&&l(s.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}})()},[]);let $=(t,a)=>{let r=e.filter(e=>e.provider===t&&e.authType===a),s=e=>{let t=e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now();return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=s(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=s(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 a=Number(e.errorCode);if(Number.isFinite(a)&&a>=400)return String(a);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 s=(e.lastError||"").toLowerCase();return s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")?"RUNTIME":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.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 a=Math.floor(t/60);if(a<24)return`${a}h ago`;let r=Math.floor(a/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},A=async(a,r,s)=>{let l=e.filter(e=>e.provider===a&&e.authType===r);t(e=>e.map(e=>e.provider===a&&e.authType===r?{...e,isActive:s}:e)),await Promise.allSettled(l.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},O=async(e,t=null)=>{if(!C){k("provider"===e?t:e),T(null);try{let a=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await a.json();if(T(r),r.summary){let{passed:e,failed:t,total:a}=r.summary;0===t?S.success(U("allTestsPassed",{total:a})):S.warning(U("testSummary",{passed:e,failed:t,total:a}))}}catch(e){T({error:U("providerTestFailed")}),S.error(U("providerTestFailed"))}finally{k(null)}}},P=a.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||U("openaiCompatibleName"),color:"#10A37F",textIcon:"OC",apiType:e.apiType})),L=a.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||U("anthropicCompatibleName"),color:"#D97757",textIcon:"AC"}));return i?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(o.Qv,{}),(0,r.jsx)(o.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.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[U("oauthProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-blue-500",title:U("oauthLabel")})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(h,{}),(0,r.jsxs)("button",{onClick:()=>O("oauth"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"oauth"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllOAuth"),"aria-label":U("testAllOAuth"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"oauth"===C?"sync":"play_arrow"}),"oauth"===C?U("testing"):U("testAll")]})]})]}),(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:$(e,"oauth"),authType:"oauth",onToggle:t=>A(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.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[U("freeProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-green-500",title:E("free")})]}),(0,r.jsxs)("button",{onClick:()=>O("free"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"free"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllFree"),"aria-label":U("testAllFree"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"free"===C?"sync":"play_arrow"}),"free"===C?U("testing"):U("testAll")]})]}),(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(c.IS).map(([e,t])=>(0,r.jsx)(g,{providerId:e,provider:t,stats:$(e,"oauth"),authType:"free",onToggle:t=>A(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.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[U("apiKeyProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-amber-500",title:U("apiKeyLabel")})]}),(0,r.jsxs)("button",{onClick:()=>O("apikey"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"apikey"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllApiKey"),"aria-label":U("testAllApiKey"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"apikey"===C?"sync":"play_arrow"}),"apikey"===C?U("testing"):U("testAll")]})]}),(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:$(e,"apikey"),authType:"apikey",onToggle:t=>A(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:[U("compatibleProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-orange-500",title:U("compatibleLabel")})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(P.length>0||L.length>0)&&(0,r.jsxs)("button",{onClick:()=>O("compatible"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"compatible"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllCompatible"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"compatible"===C?"sync":"play_arrow"}),"compatible"===C?U("testing"):U("testAll")]}),(0,r.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>f(!0),children:U("addAnthropicCompatible")}),(0,r.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>m(!0),className:"!bg-white !text-black hover:!bg-gray-100",children:U("addOpenAICompatible")})]})]}),0===P.length&&0===L.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:U("noCompatibleYet")}),(0,r.jsx)("p",{className:"text-text-muted text-xs mt-1",children:U("compatibleHint")})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...P,...L].map(e=>(0,r.jsx)(v,{providerId:e.id,provider:e,stats:$(e.id,"apikey"),authType:"compatible",onToggle:t=>A(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:b,onClose:()=>f(!1),onCreated:e=>{l(t=>[...t,e]),f(!1)}}),w&&(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-bg-primary 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-bg-primary/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:U("testResults")}),(0,r.jsx)("button",{onClick:()=>T(null),className:"p-1 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors","aria-label":E("close"),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:w})})]})]})]})}function g({providerId:e,provider:t,stats:a,authType:i,onToggle:n}){let d=(0,u.c)("providers"),c=(0,u.c)("common"),{connected:p,error:x,errorCode:h,errorTime:f,allDisabled:g}=a,[v,y]=(0,s.useState)(!1),j={free:"bg-green-500",oauth:"bg-blue-500",apikey:"bg-amber-500",compatible:"bg-orange-500"},N={free:c("free"),oauth:d("oauthLabel"),apikey:d("apiKeyLabel"),compatible:d("compatibleLabel")};return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(o.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${g?"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}15`},children:v?(0,r.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,r.jsx)(l.default,{src:`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",sizes:"32px",onError:()=>y(!0)})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"font-semibold flex items-center gap-1.5",children:[t.name,(0,r.jsx)("span",{className:`size-2 rounded-full ${j[i]||j.oauth} shrink-0`,title:N[i]||d("oauthLabel")})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:g?(0,r.jsx)(o.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"}),d("disabled")]})}):(0,r.jsxs)(r.Fragment,{children:[b(p,x,h,d),f&&(0,r.jsxs)("span",{className:"text-text-muted",children:["• ",f]})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[a.total>0&&(0,r.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!g)},className:"",children:(0,r.jsx)(o.lM,{size:"sm",checked:!g,onChange:()=>{},title:d(g?"enableProvider":"disableProvider")})}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})]})})})}function v({providerId:e,provider:t,stats:a,authType:i,onToggle:n}){let d=(0,u.c)("providers"),p=(0,u.c)("common"),{connected:x,error:h,errorCode:f,errorTime:g,allDisabled:v}=a,y=e.startsWith(c.JH),j=e.startsWith(c.DI),[N,C]=(0,s.useState)(!1),k={free:"bg-green-500",oauth:"bg-blue-500",apikey:"bg-amber-500",compatible:"bg-orange-500"},w={free:p("free"),oauth:d("oauthLabel"),apikey:d("apiKeyLabel"),compatible:d("compatibleLabel")};return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(o.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${v?"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}15`},children:N?(0,r.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,r.jsx)(l.default,{src:y?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":j?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",sizes:"30px",onError:()=>C(!0)})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"font-semibold flex items-center gap-1.5",children:[t.name,(0,r.jsx)("span",{className:`size-2 rounded-full ${k[i]||k.apikey} shrink-0`,title:w[i]||d("apiKeyLabel")})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:v?(0,r.jsx)(o.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"}),d("disabled")]})}):(0,r.jsxs)(r.Fragment,{children:[b(x,h,f,d),y&&(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:d("responses"===t.apiType?"responses":"chat")}),j&&(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:d("messages")}),g&&(0,r.jsxs)("span",{className:"text-text-muted",children:["• ",g]})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[a.total>0&&(0,r.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!v)},className:"",children:(0,r.jsx)(o.lM,{size:"sm",checked:!v,onChange:()=>{},title:d(v?"enableProvider":"disableProvider")})}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})]})})})}function y({isOpen:e,onClose:t,onCreated:a}){let l=(0,u.c)("providers"),[i,n]=(0,s.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,s.useState)(!1),[p,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(!1),[b,f]=(0,s.useState)(null),g=[{value:"chat",label:l("chatCompletions")},{value:"responses",label:l("responsesApi")}];(0,s.useEffect)(()=>{n(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[i.apiType]);let v=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){c(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,apiType:i.apiType,baseUrl:i.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(a(t.node),n({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),m(""),f(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{c(!1)}}},y=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:i.baseUrl,apiKey:p,type:"openai-compatible"})}),t=await e.json();f(t.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}};return(0,r.jsx)(o.aF,{isOpen:e,title:l("addOpenAICompatible"),onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.pd,{label:l("nameLabel"),value:i.name,onChange:e=>n({...i,name:e.target.value}),placeholder:l("compatibleProdPlaceholder",{type:l("openai")}),hint:l("nameHint")}),(0,r.jsx)(o.pd,{label:l("prefixLabel"),value:i.prefix,onChange:e=>n({...i,prefix:e.target.value}),placeholder:l("openaiPrefixPlaceholder"),hint:l("prefixHint")}),(0,r.jsx)(o.l6,{label:l("apiTypeLabel"),options:g,value:i.apiType,onChange:e=>n({...i,apiType:e.target.value})}),(0,r.jsx)(o.pd,{label:l("baseUrlLabel"),value:i.baseUrl,onChange:e=>n({...i,baseUrl:e.target.value}),placeholder:l("openaiBaseUrlPlaceholder"),hint:l("compatibleBaseUrlHint",{type:l("openai")})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.pd,{label:l("apiKeyForCheck"),type:"password",value:p,onChange:e=>m(e.target.value),className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(o.$n,{onClick:y,disabled:!p||x||!i.baseUrl.trim(),variant:"secondary",children:l(x?"checking":"check")})})]}),b&&(0,r.jsx)(o.Ex,{variant:"success"===b?"success":"error",children:l("success"===b?"valid":"invalid")}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.$n,{onClick:v,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||d,children:l(d?"creating":"add")}),(0,r.jsx)(o.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:l("cancel")})]})]})})}function j({isOpen:e,onClose:t,onCreated:a}){let l=(0,u.c)("providers"),[i,n]=(0,s.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[d,c]=(0,s.useState)(!1),[p,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(!1),[b,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{e&&(f(null),m(""))},[e]);let g=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){c(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,baseUrl:i.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(a(t.node),n({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),m(""),f(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{c(!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:i.baseUrl,apiKey:p,type:"anthropic-compatible"})}),t=await e.json();f(t.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}};return(0,r.jsx)(o.aF,{isOpen:e,title:l("addAnthropicCompatible"),onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.pd,{label:l("nameLabel"),value:i.name,onChange:e=>n({...i,name:e.target.value}),placeholder:l("compatibleProdPlaceholder",{type:l("anthropic")}),hint:l("nameHint")}),(0,r.jsx)(o.pd,{label:l("prefixLabel"),value:i.prefix,onChange:e=>n({...i,prefix:e.target.value}),placeholder:l("anthropicPrefixPlaceholder"),hint:l("prefixHint")}),(0,r.jsx)(o.pd,{label:l("baseUrlLabel"),value:i.baseUrl,onChange:e=>n({...i,baseUrl:e.target.value}),placeholder:l("anthropicBaseUrlPlaceholder"),hint:l("compatibleBaseUrlHint",{type:l("anthropic")})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.pd,{label:l("apiKeyForCheck"),type:"password",value:p,onChange:e=>m(e.target.value),className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(o.$n,{onClick:v,disabled:!p||x||!i.baseUrl.trim(),variant:"secondary",children:l(x?"checking":"check")})})]}),b&&(0,r.jsx)(o.Ex,{variant:"success"===b?"success":"error",children:l("success"===b?"valid":"invalid")}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.$n,{onClick:g,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||d,children:l(d?"creating":"add")}),(0,r.jsx)(o.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:l("cancel")})]})]})})}function N({results:e}){let t=(0,u.c)("providers"),a=(0,u.c)("common");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:s,mode:l}=e,i=e.results||[],n={oauth:t("oauthLabel"),free:a("free"),apikey:t("apiKeyLabel"),compatible:t("compatibleLabel"),provider:t("providerLabel"),all:a("all")}[l]||l;return(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[s&&(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs mb-1",children:[(0,r.jsx)("span",{className:"text-text-muted",children:t("modeTest",{mode:n})}),(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:t("passedCount",{count:s.passed})}),s.failed>0&&(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:t("failedCount",{count:s.failed})}),(0,r.jsx)("span",{className:"text-text-muted ml-auto",children:t("testedCount",{count:s.total})})]}),i.map((e,a)=>(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.jsx)("span",{className:"text-text-muted font-mono tabular-nums",children:t("millisecondsAbbr",{value:e.latencyMs})}),(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?t("okShort"):e.diagnosis?.type||t("errorShort")})]},e.connectionId||a)),0===i.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:t("noActiveConnectionsInGroup")})]})}g.propTypes={providerId:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string}).isRequired,stats:n().shape({connected:n().number,error:n().number,errorCode:n().string,errorTime:n().string}).isRequired,authType:n().string},v.propTypes={providerId:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string,apiType:n().string}).isRequired,stats:n().shape({connected:n().number,error:n().number,errorCode:n().string,errorTime:n().string}).isRequired,authType:n().string},y.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func.isRequired},j.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func.isRequired},N.propTypes={results:n().shape({mode:n().string,results:n().array,summary:n().shape({total:n().number,passed:n().number,failed:n().number}),error:n().string}).isRequired}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=37667)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8460],{19303:(e,t,a)=>{Promise.resolve().then(a.bind(a,75926))},40993:(e,t,a)=>{"use strict";a.d(t,{Ex:()=>d.default,$n:()=>r.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,G9:()=>v.default,bQ:()=>C.default,pp:()=>j.default,Qn:()=>N.default,pd:()=>s.default,Mh:()=>g.default,uR:()=>x.default,aF:()=>n.default,rq:()=>m.default,LF:()=>p.default,KN:()=>b.default,Lo:()=>f.default,y7:()=>h.default,Iz:()=>y.default,l6:()=>l.default,lM:()=>c.default,cn:()=>u.default});var r=a(35806),s=a(34422),l=a(42994),i=a(81060),n=a(71361),o=a(92542);a(17705);var d=a(80927),c=a(19790);a(6261),a(55846),a(34243),a(89938),a(99023);var p=a(80178),m=a(85444),x=a(91961);a(25112);var u=a(45624),h=a(37415),b=a(48643),f=a(8287);a(1652);var g=a(92701);a(18150);var v=a(71689),y=a(33709);a(76332);var j=a(66200);a(61580);var N=a(51503);a(54128);var C=a(44638);a(21720),a(97050)},75926:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>f});var r=a(95155),s=a(12115),l=a(5772),i=a(14051),n=a.n(i),o=a(40993),d=a(52529),c=a(20909),p=a(98500),m=a.n(p),x=a(67671),u=a(50910);function h(){let e=(0,u.c)("providers"),t=(0,u.c)("common"),a={available:{icon:"check_circle",color:"#22c55e",label:e("available")},cooldown:{icon:"schedule",color:"#f59e0b",label:e("cooldown")},unavailable:{icon:"error",color:"#ef4444",label:e("unavailable")},unknown:{icon:"help",color:"#6b7280",label:e("unknown")}},[l,i]=(0,s.useState)(null),[n,d]=(0,s.useState)(!0),[c,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null),b=(0,s.useRef)(null),f=(0,x.i)(),g=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/models/availability");if(e.ok){let t=await e.json();i(t)}}catch{}finally{d(!1)}},[]);(0,s.useEffect)(()=>{g();let e=setInterval(g,3e4);return()=>clearInterval(e)},[g]),(0,s.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&p(!1)};return c&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);let v=async(t,a)=>{h(`${t}:${a}`);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:t,model:a})})).ok?(f.success(e("cooldownCleared",{model:a})),await g()):f.error(e("failedClearCooldown"))}catch{f.error(e("failedClearCooldown"))}finally{h(null)}};if(n)return null;let y=l?.models||[],j=l?.unavailableCount||y.filter(e=>"available"!==e.status).length,N=0===j,C={};return y.forEach(e=>{if("available"===e.status)return;let t=e.provider||"unknown";C[t]||(C[t]=[]),C[t].push(e)}),(0,r.jsxs)("div",{className:"relative",ref:b,children:[(0,r.jsxs)("button",{onClick:()=>p(!c),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-all ${N?"bg-emerald-500/10 border-emerald-500/20 text-emerald-500 hover:bg-emerald-500/15":"bg-amber-500/10 border-amber-500/20 text-amber-500 hover:bg-amber-500/15"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:N?"verified":"warning"}),N?e("allModelsOperational"):e("modelsWithIssues",{count:j})]}),c&&(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:N?"#22c55e":"#f59e0b"},"aria-hidden":"true",children:N?"verified":"warning"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-text-main",children:e("modelStatus")})]}),(0,r.jsx)("button",{onClick:g,className:"p-1 rounded-lg hover:bg-surface text-text-muted hover:text-text-main transition-colors",title:t("refresh"),children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"})})]}),(0,r.jsx)("div",{className:"px-4 py-3 max-h-60 overflow-y-auto",children:N?(0,r.jsx)("p",{className:"text-sm text-text-muted text-center py-2",children:e("allModelsNormal")}):(0,r.jsx)("div",{className:"flex flex-col gap-2.5",children:Object.entries(C).map(([t,s])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-text-main mb-1.5 capitalize",children:t}),(0,r.jsx)("div",{className:"flex flex-col gap-1",children:s.map(t=>{let s=a[t.status]||a.unknown,l=m===`${t.provider}:${t.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:s.color},"aria-hidden":"true",children:s.icon}),(0,r.jsx)("span",{className:"font-mono text-xs text-text-main truncate",children:t.model})]}),"cooldown"===t.status&&(0,r.jsx)(o.$n,{size:"sm",variant:"ghost",onClick:()=>v(t.provider,t.model),disabled:l,className:"text-[10px] px-1.5! py-0.5! ml-2",children:l?e("clearing"):e("clearCooldown")})]},`${t.provider}-${t.model}`)})})]},t))})})]})]})}function b(e,t,a,s){let l=[];if(e>0&&l.push((0,r.jsx)(o.Ex,{variant:"success",size:"sm",dot:!0,children:s("connected",{count:e})},"connected")),t>0){let e=a?s("errorCount",{count:t,code:a}):s("errorCountNoCode",{count:t});l.push((0,r.jsx)(o.Ex,{variant:"error",size:"sm",dot:!0,children:e},"error"))}return 0===l.length?(0,r.jsx)("span",{className:"text-text-muted",children:s("noConnections")}):l}function f(){let[e,t]=(0,s.useState)([]),[a,l]=(0,s.useState)([]),[i,n]=(0,s.useState)(!0),[p,m]=(0,s.useState)(!1),[b,f]=(0,s.useState)(!1),[C,k]=(0,s.useState)(null),[w,T]=(0,s.useState)(null),S=(0,x.i)(),U=(0,u.c)("providers"),E=(0,u.c)("common");(0,s.useEffect)(()=>{(async()=>{try{let[e,a]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),r=await e.json(),s=await a.json();e.ok&&t(r.connections||[]),a.ok&&l(s.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}})()},[]);let $=(t,a)=>{let r=e.filter(e=>e.provider===t&&e.authType===a),s=e=>{let t=e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now();return"unavailable"!==e.testStatus||t?e.testStatus:"active"},l=r.filter(e=>{let t=s(e);return"active"===t||"success"===t}).length,i=r.filter(e=>{let t=s(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 a=Number(e.errorCode);if(Number.isFinite(a)&&a>=400)return String(a);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 s=(e.lastError||"").toLowerCase();return s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")?"RUNTIME":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.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 a=Math.floor(t/60);if(a<24)return`${a}h ago`;let r=Math.floor(a/24);return`${r}d ago`}(c.lastErrorAt):null,allDisabled:d}},A=async(a,r,s)=>{let l=e.filter(e=>e.provider===a&&e.authType===r);t(e=>e.map(e=>e.provider===a&&e.authType===r?{...e,isActive:s}:e)),await Promise.allSettled(l.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},O=async(e,t=null)=>{if(!C){k("provider"===e?t:e),T(null);try{let a=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),r=await a.json();if(T(r),r.summary){let{passed:e,failed:t,total:a}=r.summary;0===t?S.success(U("allTestsPassed",{total:a})):S.warning(U("testSummary",{passed:e,failed:t,total:a}))}}catch(e){T({error:U("providerTestFailed")}),S.error(U("providerTestFailed"))}finally{k(null)}}},P=a.filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,name:e.name||U("openaiCompatibleName"),color:"#10A37F",textIcon:"OC",apiType:e.apiType})),L=a.filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,name:e.name||U("anthropicCompatibleName"),color:"#D97757",textIcon:"AC"}));return i?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(o.Qv,{}),(0,r.jsx)(o.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.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[U("oauthProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-blue-500",title:U("oauthLabel")})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(h,{}),(0,r.jsxs)("button",{onClick:()=>O("oauth"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"oauth"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllOAuth"),"aria-label":U("testAllOAuth"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"oauth"===C?"sync":"play_arrow"}),"oauth"===C?U("testing"):U("testAll")]})]})]}),(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:$(e,"oauth"),authType:"oauth",onToggle:t=>A(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.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[U("freeProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-green-500",title:E("free")})]}),(0,r.jsxs)("button",{onClick:()=>O("free"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"free"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllFree"),"aria-label":U("testAllFree"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"free"===C?"sync":"play_arrow"}),"free"===C?U("testing"):U("testAll")]})]}),(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(c.IS).map(([e,t])=>(0,r.jsx)(g,{providerId:e,provider:t,stats:$(e,"oauth"),authType:"free",onToggle:t=>A(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.jsxs)("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[U("apiKeyProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-amber-500",title:U("apiKeyLabel")})]}),(0,r.jsxs)("button",{onClick:()=>O("apikey"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"apikey"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllApiKey"),"aria-label":U("testAllApiKey"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"apikey"===C?"sync":"play_arrow"}),"apikey"===C?U("testing"):U("testAll")]})]}),(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:$(e,"apikey"),authType:"apikey",onToggle:t=>A(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:[U("compatibleProviders")," ",(0,r.jsx)("span",{className:"size-2.5 rounded-full bg-orange-500",title:U("compatibleLabel")})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(P.length>0||L.length>0)&&(0,r.jsxs)("button",{onClick:()=>O("compatible"),disabled:!!C,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${"compatible"===C?"bg-primary/20 border-primary/40 text-primary animate-pulse":"bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40"}`,title:U("testAllCompatible"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"compatible"===C?"sync":"play_arrow"}),"compatible"===C?U("testing"):U("testAll")]}),(0,r.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>f(!0),children:U("addAnthropicCompatible")}),(0,r.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>m(!0),className:"!bg-white !text-black hover:!bg-gray-100",children:U("addOpenAICompatible")})]})]}),0===P.length&&0===L.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:U("noCompatibleYet")}),(0,r.jsx)("p",{className:"text-text-muted text-xs mt-1",children:U("compatibleHint")})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[...P,...L].map(e=>(0,r.jsx)(v,{providerId:e.id,provider:e,stats:$(e.id,"apikey"),authType:"compatible",onToggle:t=>A(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:b,onClose:()=>f(!1),onCreated:e=>{l(t=>[...t,e]),f(!1)}}),w&&(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-bg-primary 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-bg-primary/95 backdrop-blur-sm rounded-t-xl",children:[(0,r.jsx)("h3",{className:"font-semibold",children:U("testResults")}),(0,r.jsx)("button",{onClick:()=>T(null),className:"p-1 rounded-lg hover:bg-bg-subtle text-text-muted hover:text-text-primary transition-colors","aria-label":E("close"),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:w})})]})]})]})}function g({providerId:e,provider:t,stats:a,authType:i,onToggle:n}){let d=(0,u.c)("providers"),c=(0,u.c)("common"),{connected:p,error:x,errorCode:h,errorTime:f,allDisabled:g}=a,[v,y]=(0,s.useState)(!1),j={free:"bg-green-500",oauth:"bg-blue-500",apikey:"bg-amber-500",compatible:"bg-orange-500"},N={free:c("free"),oauth:d("oauthLabel"),apikey:d("apiKeyLabel"),compatible:d("compatibleLabel")};return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(o.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${g?"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}15`},children:v?(0,r.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,r.jsx)(l.default,{src:`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[32px] max-h-[32px]",sizes:"32px",onError:()=>y(!0)})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"font-semibold flex items-center gap-1.5",children:[t.name,(0,r.jsx)("span",{className:`size-2 rounded-full ${j[i]||j.oauth} shrink-0`,title:N[i]||d("oauthLabel")})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:g?(0,r.jsx)(o.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"}),d("disabled")]})}):(0,r.jsxs)(r.Fragment,{children:[b(p,x,h,d),f&&(0,r.jsxs)("span",{className:"text-text-muted",children:["• ",f]})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[a.total>0&&(0,r.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!g)},className:"",children:(0,r.jsx)(o.lM,{size:"sm",checked:!g,onChange:()=>{},title:d(g?"enableProvider":"disableProvider")})}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})]})})})}function v({providerId:e,provider:t,stats:a,authType:i,onToggle:n}){let d=(0,u.c)("providers"),p=(0,u.c)("common"),{connected:x,error:h,errorCode:f,errorTime:g,allDisabled:v}=a,y=e.startsWith(c.JH),j=e.startsWith(c.DI),[N,C]=(0,s.useState)(!1),k={free:"bg-green-500",oauth:"bg-blue-500",apikey:"bg-amber-500",compatible:"bg-orange-500"},w={free:p("free"),oauth:d("oauthLabel"),apikey:d("apiKeyLabel"),compatible:d("compatibleLabel")};return(0,r.jsx)(m(),{href:`/dashboard/providers/${e}`,className:"group",children:(0,r.jsx)(o.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${v?"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}15`},children:N?(0,r.jsx)("span",{className:"text-xs font-bold",style:{color:t.color},children:t.textIcon||t.id.slice(0,2).toUpperCase()}):(0,r.jsx)(l.default,{src:y?"responses"===t.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":j?"/providers/anthropic-m.png":`/providers/${t.id}.png`,alt:t.name,width:30,height:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",sizes:"30px",onError:()=>C(!0)})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"font-semibold flex items-center gap-1.5",children:[t.name,(0,r.jsx)("span",{className:`size-2 rounded-full ${k[i]||k.apikey} shrink-0`,title:w[i]||d("apiKeyLabel")})]}),(0,r.jsx)("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:v?(0,r.jsx)(o.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"}),d("disabled")]})}):(0,r.jsxs)(r.Fragment,{children:[b(x,h,f,d),y&&(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:d("responses"===t.apiType?"responses":"chat")}),j&&(0,r.jsx)(o.Ex,{variant:"default",size:"sm",children:d("messages")}),g&&(0,r.jsxs)("span",{className:"text-text-muted",children:["• ",g]})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[a.total>0&&(0,r.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),n(!!v)},className:"",children:(0,r.jsx)(o.lM,{size:"sm",checked:!v,onChange:()=>{},title:d(v?"enableProvider":"disableProvider")})}),(0,r.jsx)("span",{className:"material-symbols-outlined text-text-muted opacity-0 group-hover:opacity-100 transition-opacity",children:"chevron_right"})]})]})})})}function y({isOpen:e,onClose:t,onCreated:a}){let l=(0,u.c)("providers"),[i,n]=(0,s.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,s.useState)(!1),[p,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(!1),[b,f]=(0,s.useState)(null),g=[{value:"chat",label:l("chatCompletions")},{value:"responses",label:l("responsesApi")}];(0,s.useEffect)(()=>{n(e=>({...e,baseUrl:"https://api.openai.com/v1"}))},[i.apiType]);let v=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){c(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,apiType:i.apiType,baseUrl:i.baseUrl,type:"openai-compatible"})}),t=await e.json();e.ok&&(a(t.node),n({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),m(""),f(null))}catch(e){console.log("Error creating OpenAI Compatible node:",e)}finally{c(!1)}}},y=async()=>{h(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:i.baseUrl,apiKey:p,type:"openai-compatible"})}),t=await e.json();f(t.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}};return(0,r.jsx)(o.aF,{isOpen:e,title:l("addOpenAICompatible"),onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.pd,{label:l("nameLabel"),value:i.name,onChange:e=>n({...i,name:e.target.value}),placeholder:l("compatibleProdPlaceholder",{type:l("openai")}),hint:l("nameHint")}),(0,r.jsx)(o.pd,{label:l("prefixLabel"),value:i.prefix,onChange:e=>n({...i,prefix:e.target.value}),placeholder:l("openaiPrefixPlaceholder"),hint:l("prefixHint")}),(0,r.jsx)(o.l6,{label:l("apiTypeLabel"),options:g,value:i.apiType,onChange:e=>n({...i,apiType:e.target.value})}),(0,r.jsx)(o.pd,{label:l("baseUrlLabel"),value:i.baseUrl,onChange:e=>n({...i,baseUrl:e.target.value}),placeholder:l("openaiBaseUrlPlaceholder"),hint:l("compatibleBaseUrlHint",{type:l("openai")})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.pd,{label:l("apiKeyForCheck"),type:"password",value:p,onChange:e=>m(e.target.value),className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(o.$n,{onClick:y,disabled:!p||x||!i.baseUrl.trim(),variant:"secondary",children:l(x?"checking":"check")})})]}),b&&(0,r.jsx)(o.Ex,{variant:"success"===b?"success":"error",children:l("success"===b?"valid":"invalid")}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.$n,{onClick:v,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||d,children:l(d?"creating":"add")}),(0,r.jsx)(o.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:l("cancel")})]})]})})}function j({isOpen:e,onClose:t,onCreated:a}){let l=(0,u.c)("providers"),[i,n]=(0,s.useState)({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),[d,c]=(0,s.useState)(!1),[p,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(!1),[b,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{e&&(f(null),m(""))},[e]);let g=async()=>{if(i.name.trim()&&i.prefix.trim()&&i.baseUrl.trim()){c(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.name,prefix:i.prefix,baseUrl:i.baseUrl,type:"anthropic-compatible"})}),t=await e.json();e.ok&&(a(t.node),n({name:"",prefix:"",baseUrl:"https://api.anthropic.com/v1"}),m(""),f(null))}catch(e){console.log("Error creating Anthropic Compatible node:",e)}finally{c(!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:i.baseUrl,apiKey:p,type:"anthropic-compatible"})}),t=await e.json();f(t.valid?"success":"failed")}catch{f("failed")}finally{h(!1)}};return(0,r.jsx)(o.aF,{isOpen:e,title:l("addAnthropicCompatible"),onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.pd,{label:l("nameLabel"),value:i.name,onChange:e=>n({...i,name:e.target.value}),placeholder:l("compatibleProdPlaceholder",{type:l("anthropic")}),hint:l("nameHint")}),(0,r.jsx)(o.pd,{label:l("prefixLabel"),value:i.prefix,onChange:e=>n({...i,prefix:e.target.value}),placeholder:l("anthropicPrefixPlaceholder"),hint:l("prefixHint")}),(0,r.jsx)(o.pd,{label:l("baseUrlLabel"),value:i.baseUrl,onChange:e=>n({...i,baseUrl:e.target.value}),placeholder:l("anthropicBaseUrlPlaceholder"),hint:l("compatibleBaseUrlHint",{type:l("anthropic")})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.pd,{label:l("apiKeyForCheck"),type:"password",value:p,onChange:e=>m(e.target.value),className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(o.$n,{onClick:v,disabled:!p||x||!i.baseUrl.trim(),variant:"secondary",children:l(x?"checking":"check")})})]}),b&&(0,r.jsx)(o.Ex,{variant:"success"===b?"success":"error",children:l("success"===b?"valid":"invalid")}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.$n,{onClick:g,fullWidth:!0,disabled:!i.name.trim()||!i.prefix.trim()||!i.baseUrl.trim()||d,children:l(d?"creating":"add")}),(0,r.jsx)(o.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:l("cancel")})]})]})})}function N({results:e}){let t=(0,u.c)("providers"),a=(0,u.c)("common");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:s,mode:l}=e,i=e.results||[],n={oauth:t("oauthLabel"),free:a("free"),apikey:t("apiKeyLabel"),compatible:t("compatibleLabel"),provider:t("providerLabel"),all:a("all")}[l]||l;return(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[s&&(0,r.jsxs)("div",{className:"flex items-center gap-3 text-xs mb-1",children:[(0,r.jsx)("span",{className:"text-text-muted",children:t("modeTest",{mode:n})}),(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-emerald-500/15 text-emerald-400 font-medium",children:t("passedCount",{count:s.passed})}),s.failed>0&&(0,r.jsx)("span",{className:"px-2 py-0.5 rounded bg-red-500/15 text-red-400 font-medium",children:t("failedCount",{count:s.failed})}),(0,r.jsx)("span",{className:"text-text-muted ml-auto",children:t("testedCount",{count:s.total})})]}),i.map((e,a)=>(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.jsx)("span",{className:"text-text-muted font-mono tabular-nums",children:t("millisecondsAbbr",{value:e.latencyMs})}),(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?t("okShort"):e.diagnosis?.type||t("errorShort")})]},e.connectionId||a)),0===i.length&&(0,r.jsx)("div",{className:"text-center py-4 text-text-muted text-sm",children:t("noActiveConnectionsInGroup")})]})}g.propTypes={providerId:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string}).isRequired,stats:n().shape({connected:n().number,error:n().number,errorCode:n().string,errorTime:n().string}).isRequired,authType:n().string},v.propTypes={providerId:n().string.isRequired,provider:n().shape({id:n().string.isRequired,name:n().string.isRequired,color:n().string,textIcon:n().string,apiType:n().string}).isRequired,stats:n().shape({connected:n().number,error:n().number,errorCode:n().string,errorTime:n().string}).isRequired,authType:n().string},y.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func.isRequired},j.propTypes={isOpen:n().bool.isRequired,onClose:n().func.isRequired,onCreated:n().func.isRequired},N.propTypes={results:n().shape({mode:n().string,results:n().array,summary:n().shape({total:n().number,passed:n().number,failed:n().number}),error:n().string}).isRequired}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=19303)),_N_E=e.O()}]);
|