omniroute 0.8.5 → 0.9.0
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.de.md +995 -0
- package/README.es.md +995 -0
- package/README.fr.md +995 -0
- package/README.it.md +995 -0
- package/README.md +725 -101
- package/README.pt-BR.md +995 -0
- package/README.ru.md +995 -0
- package/README.zh-CN.md +995 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +25 -24
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +27 -3
- package/app/.next/routes-manifest.json +6 -0
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +1 -1
- 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/cli-tools/page.js +5 -5
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 -0
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -0
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +3 -3
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/route_client-reference-manifest.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 +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
- 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 +1 -1
- 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 +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- 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.js.nft.json +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 +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/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.js.nft.json +1 -1
- 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-settings/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +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 +1 -1
- package/app/.next/server/app/api/cli-tools/status/route.js.nft.json +1 -1
- 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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.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/metrics/route_client-reference-manifest.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_client-reference-manifest.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/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.js.nft.json +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.js.nft.json +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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/route.js +1 -1
- 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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +1 -1
- package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.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_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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sessions/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.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/providers/[provider]/chat/completions/route_client-reference-manifest.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_client-reference-manifest.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_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback.html +1 -1
- package/app/.next/server/app/callback.rsc +3 -3
- package/app/.next/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.html +1 -1
- package/app/.next/server/app/dashboard/analytics.rsc +5 -5
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/analytics.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/analytics.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next/server/app/dashboard/cli-tools.rsc +5 -5
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.html +1 -1
- package/app/.next/server/app/dashboard/combos.rsc +5 -5
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/costs.html +1 -1
- package/app/.next/server/app/dashboard/costs.rsc +5 -5
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard/costs.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/costs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/costs.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/costs.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/costs.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/costs.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.html +1 -1
- package/app/.next/server/app/dashboard/endpoint.rsc +5 -5
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/health.html +1 -1
- package/app/.next/server/app/dashboard/health.rsc +5 -5
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard/health.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/health.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/health.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/health.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/health.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/limits.html +2 -0
- package/app/.next/server/app/dashboard/limits.meta +17 -0
- package/app/.next/server/app/dashboard/limits.rsc +24 -0
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits/__PAGE__.segment.rsc +9 -0
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard/limits.segment.rsc +4 -0
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +4 -0
- package/app/.next/server/app/dashboard/limits.segments/!KGRhc2hib2FyZCk.segment.rsc +5 -0
- package/app/.next/server/app/dashboard/limits.segments/_full.segment.rsc +24 -0
- package/app/.next/server/app/dashboard/limits.segments/_head.segment.rsc +6 -0
- package/app/.next/server/app/dashboard/limits.segments/_index.segment.rsc +9 -0
- package/app/.next/server/app/dashboard/limits.segments/_tree.segment.rsc +5 -0
- package/app/.next/server/app/dashboard/onboarding.html +1 -1
- package/app/.next/server/app/dashboard/onboarding.rsc +4 -4
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard/onboarding.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/onboarding.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/onboarding.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/onboarding.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/onboarding.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.html +1 -1
- package/app/.next/server/app/dashboard/profile.rsc +4 -4
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.html +1 -1
- package/app/.next/server/app/dashboard/providers/new.rsc +5 -5
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.html +1 -1
- package/app/.next/server/app/dashboard/providers.rsc +5 -5
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings.html +1 -1
- package/app/.next/server/app/dashboard/settings.rsc +5 -5
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/settings.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/settings.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/settings.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/settings.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.html +2 -2
- package/app/.next/server/app/dashboard/translator.rsc +5 -5
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.html +1 -1
- package/app/.next/server/app/dashboard/usage.rsc +5 -5
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/docs/page.js +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs.html +1 -1
- package/app/.next/server/app/docs.rsc +3 -3
- package/app/.next/server/app/docs.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/docs.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden.html +1 -1
- package/app/.next/server/app/forbidden.rsc +3 -3
- package/app/.next/server/app/forbidden.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/forbidden.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/forbidden.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/forbidden.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/forbidden.segments/forbidden/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/forbidden.segments/forbidden.segment.rsc +1 -1
- package/app/.next/server/app/forgot-password/page.js +1 -1
- 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/forgot-password.html +1 -1
- package/app/.next/server/app/forgot-password.rsc +4 -4
- package/app/.next/server/app/forgot-password.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/forgot-password.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/forgot-password.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/forgot-password.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/forgot-password.segments/forgot-password/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/forgot-password.segments/forgot-password.segment.rsc +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +3 -3
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing.html +1 -1
- package/app/.next/server/app/landing.rsc +3 -3
- package/app/.next/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next/server/app/login/page.js +1 -1
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login.html +1 -1
- package/app/.next/server/app/login.rsc +4 -4
- package/app/.next/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy.html +1 -1
- package/app/.next/server/app/privacy.rsc +3 -3
- package/app/.next/server/app/privacy.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/privacy.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/privacy.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/privacy.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/privacy.segments/privacy/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/privacy.segments/privacy.segment.rsc +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms.html +1 -1
- package/app/.next/server/app/terms.rsc +3 -3
- package/app/.next/server/app/terms.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/terms.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/terms.segments/_index.segment.rsc +3 -3
- package/app/.next/server/app/terms.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/terms.segments/terms/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/terms.segments/terms.segment.rsc +1 -1
- package/app/.next/server/app-paths-manifest.json +25 -24
- package/app/.next/server/chunks/1020.js +1 -1
- package/app/.next/server/chunks/239.js +2 -2
- package/app/.next/server/chunks/2620.js +2 -2
- package/app/.next/server/chunks/4277.js +1 -0
- package/app/.next/server/chunks/438.js +1 -0
- package/app/.next/server/chunks/5583.js +1 -1
- package/app/.next/server/chunks/7669.js +2 -2
- package/app/.next/server/chunks/8369.js +1 -1
- package/app/.next/server/chunks/9824.js +1 -1
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/8ACUE6hz9uxBNe_Q_ZH6y/_buildManifest.js +1 -0
- package/app/.next/static/chunks/1149-fefe7f95f0e9842f.js +1 -0
- package/app/.next/static/chunks/{5846-2708fad522c4092b.js → 5846-0541241939d8c7e3.js} +1 -1
- package/app/.next/static/chunks/{993-6be0cd05a02eb09b.js → 993-b74bac8c882e8d1a.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-74ac2092c2a6b3dc.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-918d5f38d5cdbbc2.js +15 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-2cf4a7b419667452.js → page-421e732016c49ee4.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/{page-6913ad5d715dcc3f.js → page-9495b294cfe54d73.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/{page-a446f6fd8dc64f29.js → page-623e54048b5d4f69.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-58ea3e55f475ea7b.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/{usage/page-8e19076a0d9227ca.js → limits/page-3b7083be8adedc57.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-3c840eaf6d7cd77d.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-26ec85a0bf8624f2.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-521cffebf9da74b1.js → page-200bed170f9ee2b0.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-627628d3588d56d0.js → page-98c6b97d0c195a2c.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-038687bc5d2c3bb5.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-c3cbea97c4f3a3b3.js → page-efca884c20a509a4.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-51a813eac9d71eed.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/{layout-c498dd9c790d0115.js → layout-cf710bbfb7c3ba11.js} +1 -1
- package/app/.next/static/chunks/app/forgot-password/{page-3682163d66078655.js → page-373672767bb0aae4.js} +1 -1
- package/app/.next/static/chunks/app/login/{page-319adaa570f7cef2.js → page-8a9aa887783f2370.js} +1 -1
- package/app/.next/static/css/1c99dc691f001331.css +1 -0
- package/app/package.json +1 -1
- package/app/public/providers/ironclaw.png +0 -0
- package/app/public/providers/nanobot.png +0 -0
- package/app/public/providers/opencode.svg +18 -0
- package/app/public/providers/picoclaw.jpg +0 -0
- package/app/public/providers/zeroclaw.png +0 -0
- package/package.json +1 -1
- package/app/.next/server/chunks/2951.js +0 -1
- package/app/.next/static/4zh9cgkOJsay7eUxfk-tb/_buildManifest.js +0 -1
- package/app/.next/static/chunks/7013-718042994c9127fa.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-a7a7e3485f278504.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-1c6897612e762e03.js +0 -15
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/page-d3f501b59334c3d5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-7312e2dd8b5feff0.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a9c594cf56c3465e.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-ae5e43ea2a576094.js +0 -1
- package/app/.next/static/css/c08bd521c418658c.css +0 -1
- /package/app/.next/static/{4zh9cgkOJsay7eUxfk-tb → 8ACUE6hz9uxBNe_Q_ZH6y}/_ssgManifest.js +0 -0
package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/page-a7a7e3485f278504.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8978],{53701:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(95155),l=s(12115),n=s(40993),r=s(67671);function i(){let[e,t]=(0,l.useState)([]),[s,i]=(0,l.useState)(null),[c,d]=(0,l.useState)(!0),[x,m]=(0,l.useState)(null),[o,u]=(0,l.useState)({current:0,total:0}),[p,h]=(0,l.useState)({}),[y,f]=(0,l.useState)(""),[g,j]=(0,l.useState)(null),v=(0,r.i)(),N=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/evals");if(e.ok){let s=await e.json();t(Array.isArray(s)?s:s.suites||[])}}catch{}finally{d(!1)}},[]),b=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/keys");if(!e.ok)return;let t=await e.json(),s=t?.keys?.[0]?.key||null;i(s)}catch{}},[]);(0,l.useEffect)(()=>{N(),b()},[N,b]);let k=async e=>{try{let t={"Content-Type":"application/json"};s&&(t.Authorization=`Bearer ${s}`);let a=await fetch("/v1/chat/completions",{method:"POST",headers:t,body:JSON.stringify({model:e.model||"gpt-4o",messages:e.input?.messages||[],max_tokens:512,stream:!1})});if(!a.ok)return`[ERROR: HTTP ${a.status}]`;let l=await a.json();return l.choices?.[0]?.message?.content||"[No content returned]"}catch(e){return`[ERROR: ${e.message}]`}},w=async e=>{let t=e.cases||[];if(0===t.length)return void v.warning("No test cases defined for this suite");m(e.id),u({current:0,total:t.length});try{let s={};for(let e=0;e<t.length;e++){u({current:e+1,total:t.length});let a=await k(t[e]);s[t[e].id]=a}let a=await fetch("/api/evals",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suiteId:e.id,outputs:s})}),l=await a.json();if(h(t=>({...t,[e.id]:l})),l.summary){let{passed:t,failed:s,total:a}=l.summary;0===s?v.success(`All ${a} cases passed ✅`,`Eval: ${e.name}`):v.warning(`${t}/${a} passed, ${s} failed`,`Eval: ${e.name}`)}j(e.id)}catch{v.error("Eval run failed")}finally{m(null),u({current:0,total:0})}},C=e.filter(e=>!y||e.name?.toLowerCase().includes(y.toLowerCase())||e.id?.toLowerCase().includes(y.toLowerCase()));if(c)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted p-8 animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"}),"Loading eval suites..."]});if(0===e.length)return(0,a.jsx)(n.pp,{icon:"science",title:"No Eval Suites",description:"Eval suites can be defined via the API to test model outputs against expected results."});let S=[{key:"caseName",label:"Case"},{key:"status",label:"Status"},{key:"durationMs",label:"Latency"},{key:"details",label:"Details"}];return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)(n.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"science"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Evaluation Suites"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Run test cases against your LLM endpoints to validate response quality"})]})]}),(0,a.jsx)(n.Qn,{searchValue:y,onSearchChange:f,placeholder:"Search suites...",filters:[],activeFilters:{},onFilterChange:()=>{},children:null}),(0,a.jsx)("div",{className:"flex flex-col gap-3 mt-4",children:C.map(e=>{let t=p[e.id],s=x===e.id,l=g===e.id,r=e.cases?.length||e.caseCount||0;return(0,a.jsxs)("div",{className:"border border-border/30 rounded-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 cursor-pointer hover:bg-surface/30 transition-colors",onClick:()=>j(l?null:e.id),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:l?"expand_more":"chevron_right"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name||e.id}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[r," case",1!==r?"s":"",e.description&&(0,a.jsxs)("span",{className:"ml-1",children:["— ",e.description]}),t?.summary&&(0,a.jsxs)("span",{className:"ml-2",children:["• Last run: ",t.summary.passed||0," ✅"," ",t.summary.failed||0," ❌ (",t.summary.passRate,"%)"]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s&&o.total>0&&(0,a.jsxs)("span",{className:"text-xs text-text-muted font-mono tabular-nums",children:[o.current,"/",o.total]}),(0,a.jsx)(n.$n,{size:"sm",variant:"primary",onClick:t=>{t.stopPropagation(),w(e)},loading:s,disabled:s,children:s?`Running ${o.current}/${o.total}...`:"Run Eval"})]})]}),l&&(0,a.jsx)("div",{className:"border-t border-border/20 p-4",children:t?.results?(0,a.jsxs)(a.Fragment,{children:[t.summary&&(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4 p-3 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:`text-lg font-bold ${100===t.summary.passRate?"text-emerald-400":t.summary.passRate>=80?"text-amber-400":"text-red-400"}`,children:[t.summary.passRate,"%"]}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"pass rate"})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted",children:[t.summary.passed," passed \xb7 ",t.summary.failed," ","failed \xb7 ",t.summary.total," total"]})]}),(0,a.jsx)(n.bQ,{columns:S,data:t.results.map((e,t)=>({...e,id:e.caseId||t})),renderCell:(e,t)=>{if("status"===t.key)return e.passed?(0,a.jsx)("span",{className:"text-emerald-400",children:"✅ Passed"}):(0,a.jsx)("span",{className:"text-red-400",children:"❌ Failed"});if("durationMs"===t.key)return(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono",children:null!=e.durationMs?`${e.durationMs}ms`:"—"});if("details"===t.key){let t=e.details||{};return(0,a.jsx)("span",{className:"text-text-muted text-xs truncate max-w-[300px] block",children:String(t.searchTerm?`Contains: "${t.searchTerm}"`:t.pattern?`Regex: ${t.pattern}`:t.expected?`Expected: "${String(t.expected).slice(0,50)}"`:e.error||"—")})}return(0,a.jsx)("span",{className:"text-sm text-text-main",children:e[t.key]||"—"})},maxHeight:"400px",emptyMessage:"No results yet"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-text-muted",children:"checklist"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted font-medium",children:["Test Cases (",(e.cases||[]).length,")"]})]}),(0,a.jsx)(n.bQ,{columns:[{key:"name",label:"Case"},{key:"model",label:"Model"},{key:"strategy",label:"Strategy"},{key:"expected",label:"Expected"}],data:(e.cases||[]).map((e,t)=>({id:e.id||t,name:e.name,model:e.model||"—",strategy:e.expected?.strategy||"—",expected:e.expected?.value?String(e.expected.value).slice(0,80):"—"})),renderCell:(e,t)=>"strategy"===t.key?(0,a.jsx)("span",{className:`text-xs font-mono ${{contains:"text-sky-400",exact:"text-emerald-400",regex:"text-amber-400",custom:"text-violet-400"}[e.strategy]||"text-text-muted"}`,children:e.strategy}):"expected"===t.key?(0,a.jsx)("span",{className:"text-text-muted text-xs font-mono truncate max-w-[300px] block",children:e.expected}):(0,a.jsx)("span",{className:"text-sm text-text-main",children:e[t.key]||"—"}),maxHeight:"400px",emptyMessage:"No test cases defined"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-3 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),'Click "Run Eval" to execute all cases against your LLM endpoint']})]})})]},e.id)})})]})})}function c(){let[e,t]=(0,l.useState)("overview");return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(n.Iz,{options:[{value:"overview",label:"Overview"},{value:"evals",label:"Evals"}],value:e,onChange:t}),"overview"===e&&(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(n.Qv,{}),children:(0,a.jsx)(n.cn,{})}),"evals"===e&&(0,a.jsx)(i,{})]})}},69589:(e,t,s)=>{Promise.resolve().then(s.bind(s,53701))}},e=>{e.O(0,[8500,9751,782,7013,5846,993,8441,3794,7358],()=>e(e.s=69589)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-1c6897612e762e03.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{33782:(e,t,s)=>{Promise.resolve().then(s.bind(s,96758))},96758:(e,t,s)=>{"use strict";s.d(t,{default:()=>k});var a=s(95155),l=s(12115),r=s(40993);let i={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-5-20251101"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-5-20250929"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresCloud:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant CLI",configType:"custom"},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant CLI",configType:"custom"},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
|
|
2
|
-
"apiBase": "{{baseUrl}}",
|
|
3
|
-
"title": "{{model}}",
|
|
4
|
-
"model": "{{model}}",
|
|
5
|
-
"provider": "openai",
|
|
6
|
-
"apiKey": "{{apiKey}}"
|
|
7
|
-
}`}},antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",modelAliases:["claude-opus-4-5-thinking","claude-sonnet-4-5-thinking","claude-sonnet-4-5","gemini-3-pro-high"],defaultModels:[{id:"claude-opus-4-5-thinking",name:"Claude Opus 4.5 Thinking",alias:"claude-opus-4-5-thinking"},{id:"claude-sonnet-4-5-thinking",name:"Claude Sonnet 4.5 Thinking",alias:"claude-sonnet-4-5-thinking"},{id:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4-5"},{id:"gemini-3-pro-high",name:"Gemini 3 Pro High",alias:"gemini-3-pro-high"},{id:"gemini-3-flash",name:"Gemini 3 Flash",alias:"gemini-3-flash"}]}};var n=s(81135),o=s(5772);function c({effectiveConfigStatus:e,batchStatus:t}){let s=e||t?.configStatus||null;if(!s)return null;let l={configured:{dotClass:"bg-green-500",badgeClass:"bg-green-500/10 text-green-600 dark:text-green-400",text:"Configured"},not_configured:{dotClass:"bg-yellow-500",badgeClass:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",text:"Not configured"},not_installed:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:"Not installed"},other:{dotClass:"bg-blue-500",badgeClass:"bg-blue-500/10 text-blue-600 dark:text-blue-400",text:"Custom"},unknown:{dotClass:"bg-zinc-400 dark:bg-zinc-500",badgeClass:"bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",text:"Unknown"}},r=l[s]||l.unknown;return(0,a.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full ${r.badgeClass}`,children:[(0,a.jsx)("span",{className:`size-1.5 rounded-full ${r.dotClass}`}),r.text]})}let d=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function x({tool:e,isExpanded:t,onToggle:s,activeProviders:i,modelMappings:n,onModelMappingChange:x,baseUrl:m,hasActiveProviders:p,apiKeys:u,cloudEnabled:h,batchStatus:g}){let y,f,b,[j,N]=(0,l.useState)(null),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)(null),[E,I]=(0,l.useState)(!1),[P,$]=(0,l.useState)(!1),[T,L]=(0,l.useState)(null),[R,M]=(0,l.useState)(""),[z,U]=(0,l.useState)({}),[K,F]=(0,l.useState)(!1),[D,B]=(0,l.useState)(""),H=(0,l.useRef)(!1),[J,q]=(0,l.useState)([]),[W,G]=(0,l.useState)(!1),[Z,V]=(0,l.useState)(null),X=!!(j?.installed&&j?.runnable),Y=(()=>{if(!X)return null;let e=j.settings?.env?.ANTHROPIC_BASE_URL;if(!e)return"not_configured";let t=e.includes("localhost")||e.includes("127.0.0.1"),s=h&&d&&e.startsWith(d);return t||s?"configured":"other"})()||g?.configStatus||null;(0,l.useEffect)(()=>{u?.length>0&&!R&&M(u[0].key)},[u,R]),(0,l.useEffect)(()=>{t&&!j&&(ee(),Q(),el())},[t,j]);let Q=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&U(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(j?.installed&&!H.current){H.current=!0;let t=j.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&x(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&u?.some(e=>e.key===s)&&M(s)}},[j,u,e.defaultModels,x]);let ee=async()=>{k(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();N(t)}catch(e){N({installed:!1,error:e.message})}finally{k(!1)}},et=()=>{let e=D||m;return e.endsWith("/v1")?e:`${e}/v1`},es=async()=>{C(!0),A(null);try{let t={ANTHROPIC_BASE_URL:et()},s=R?.trim()||(u?.length>0?u[0].key:null)||(h?null:"sk_omniroute");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=n[e.alias];s&&e.envKey&&(t[e.envKey]=s)});let a=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})}),l=await a.json();a.ok?(A({type:"success",text:"Settings applied successfully!"}),N(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):A({type:"error",text:l.error||"Failed to apply settings"})}catch(e){A({type:"error",text:e.message})}finally{C(!1)}},ea=async()=>{_(!0),A(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(A({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>x(e.alias,e.defaultValue||"")),M("")):A({type:"error",text:s.error||"Failed to reset settings"})}catch(e){A({type:"error",text:e.message})}finally{_(!1)}},el=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=claude"),t=await e.json();e.ok&&q(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},er=async e=>{V(e),A(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"claude",backupId:e})}),s=await t.json();t.ok?(A({type:"success",text:"Backup restored!"}),ee(),el()):A({type:"error",text:s.error||"Failed to restore"})}catch(e){A({type:"error",text:e.message})}finally{V(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(c,{effectiveConfigStatus:Y,batchStatus:g})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Claude CLI..."})]}),!v&&j&&!X&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:j.installed?"Claude CLI not runnable":"Claude CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j.installed?`Claude CLI was found but failed runtime healthcheck${j.reason?` (${j.reason})`:""}.`:"Please install Claude CLI to use this feature."})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>I(!E),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:E?"expand_less":"help"}),E?"Hide":"How to Install"]})]}),E&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:["After installation, run"," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!v&&X&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[j?.settings?.env?.ANTHROPIC_BASE_URL&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:j.settings.env.ANTHROPIC_BASE_URL})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(y=D||m).endsWith("/v1")?y:`${y}/v1`,onChange:e=>B(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),D&&D!==m&&(0,a.jsx)("button",{onClick:()=>B(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),u.length>0?(0,a.jsx)("select",{value:R,onChange:e=>M(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:u.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:h?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:n[e.alias]||"",onChange:t=>x(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{L(e.alias),$(!0)},disabled:!p,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${p?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),n[e.alias]&&(0,a.jsx)("button",{onClick:()=>x(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias))]}),O&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===O.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===O.type?"check_circle":"error"}),(0,a.jsx)("span",{children:O.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:es,disabled:!p,loading:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ea,disabled:!j?.hasOmniRoute,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{G(!W),W||el()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",J.length>0&&` (${J.length})`]})]}),W&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===J.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:J.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>er(e.id),disabled:Z===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:Z===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:P,onClose:()=>$(!1),onSelect:e=>{T&&x(T,e.value)},selectedModel:T?n[T]:null,activeProviders:i,modelAliases:z,title:`Select model for ${T}`}),(0,a.jsx)(r.uR,{isOpen:K,onClose:()=>F(!1),title:"Claude CLI - Manual Configuration",configs:(f=R&&R.trim()?R:h?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",b={ANTHROPIC_BASE_URL:et(),ANTHROPIC_AUTH_TOKEN:f},e.defaultModels.forEach(e=>{let t=n[e.alias];t&&e.envKey&&(b[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:b},null,2)}])})]})}function m({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:d,cloudEnabled:x,batchStatus:m}){let p,u,h,[g,y]=(0,l.useState)(null),[f,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(!1),[v,k]=(0,l.useState)(!1),[w,C]=(0,l.useState)(null),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)(""),[E,I]=(0,l.useState)(""),[P,$]=(0,l.useState)(!1),[T,L]=(0,l.useState)({}),[R,M]=(0,l.useState)(!1),[z,U]=(0,l.useState)(""),[K,F]=(0,l.useState)([]),[D,B]=(0,l.useState)(!1),[H,J]=(0,l.useState)(""),[q,W]=(0,l.useState)(!1),[G,Z]=(0,l.useState)(null),[V,X]=(0,l.useState)([]),[Y,Q]=(0,l.useState)(!1),[ee,et]=(0,l.useState)(null),es=!!(g?.installed&&g?.runnable);(0,l.useEffect)(()=>{n?.length>0&&!O&&A(n[0].key)},[n,O]),(0,l.useEffect)(()=>{t&&!g&&(ei(),ea(),ec(),ep())},[t,g]);let ea=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(g?.config){let e=g.config.match(/^model\s*=\s*"([^"]+)"/m);e&&I(e[1])}},[g]);let el=(es?g.config?g.config.includes(i)||g.config.includes("localhost")||g.config.includes("127.0.0.1")?"configured":"other":"not_configured":null)||m?.configStatus||null,er=()=>{let e=z||`${i}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},ei=async()=>{b(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();y(t)}catch(e){y({installed:!1,error:e.message})}finally{b(!1)}},en=async()=>{N(!0),C(null);try{let e=O&&O.trim()||x?O:"sk_omniroute",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:er(),apiKey:e,model:E})}),s=await t.json();t.ok?(C({type:"success",text:"Settings applied successfully!"}),ei()):C({type:"error",text:s.error||"Failed to apply settings"})}catch(e){C({type:"error",text:e.message})}finally{N(!1)}},eo=async()=>{k(!0),C(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(C({type:"success",text:"Settings reset successfully!"}),I(""),ei()):C({type:"error",text:t.error||"Failed to reset settings"})}catch(e){C({type:"error",text:e.message})}finally{k(!1)}},ec=async()=>{try{let e=await fetch("/api/cli-tools/codex-profiles"),t=await e.json();e.ok&&F(t.profiles||[])}catch(e){console.log("Error fetching profiles:",e)}},ed=async()=>{if(H.trim()){W(!0),C(null);try{let e=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:H.trim()})}),t=await e.json();e.ok?(C({type:"success",text:`Profile "${H}" saved!`}),J(""),ec()):C({type:"error",text:t.error||"Failed to save profile"})}catch(e){C({type:"error",text:e.message})}finally{W(!1)}}},ex=async e=>{Z(e),C(null);try{let t=await fetch("/api/cli-tools/codex-profiles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})}),s=await t.json();t.ok?(C({type:"success",text:s.message||"Profile activated!"}),ei(),ep()):C({type:"error",text:s.error||"Failed to activate profile"})}catch(e){C({type:"error",text:e.message})}finally{Z(null)}},em=async e=>{try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e})})).ok&&ec()}catch(e){console.log("Error deleting profile:",e)}},ep=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=codex"),t=await e.json();e.ok&&X(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},eu=async e=>{et(e),C(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"codex",backupId:e})}),s=await t.json();t.ok?(C({type:"success",text:"Backup restored!"}),ei(),ep()):C({type:"error",text:s.error||"Failed to restore"})}catch(e){C({type:"error",text:e.message})}finally{et(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(c,{effectiveConfigStatus:el,batchStatus:m})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[f&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Codex CLI..."})]}),!f&&g&&!es&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:g.installed?"Codex CLI not runnable":"Codex CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g.installed?`Codex CLI was found but failed runtime healthcheck${g.reason?` (${g.reason})`:""}.`:"Please install Codex CLI to use auto-apply feature."})]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>_(!S),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:S?"expand_less":"help"}),S?"Hide":"How to Install"]})]}),S&&(0,a.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,a.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:["After installation, run"," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,a.jsx)("div",{className:"pt-2 border-t border-border",children:(0,a.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses"," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," ","with"," ",(0,a.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!f&&es&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[g?.config&&((u=(p=g.config.match(/base_url\s*=\s*"([^"]+)"/))?p[1]:null)?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:u})]}):null),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:z||`${i}/v1`,onChange:e=>U(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),z&&z!==`${i}/v1`&&(0,a.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:O,onChange:e=>A(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:E,onChange:e=>I(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>$(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),E&&(0,a.jsx)("button",{onClick:()=>I(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),w&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,a.jsx)("span",{children:w.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:en,disabled:!O||!E,loading:j,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eo,disabled:!g.hasOmniRoute,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{B(!D),D||ec()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"manage_accounts"}),"Profiles"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{Q(!Y),Y||ep()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",V.length>0&&` (${V.length})`]})]}),D&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"manage_accounts"}),"Saved Profiles"]}),0===K.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No profiles saved yet. Save current config as a profile below."}):(0,a.jsx)("div",{className:"space-y-1.5 mb-3",children:K.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"person"}),(0,a.jsx)("span",{className:"font-medium flex-1 truncate",children:e.name}),(0,a.jsx)("span",{className:"text-text-muted truncate max-w-[140px]",title:e.authLabel,children:e.authLabel}),(0,a.jsx)("button",{onClick:()=>ex(e.id),disabled:G===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:G===e.id?"...":"Activate"}),(0,a.jsx)("button",{onClick:()=>em(e.id),className:"p-0.5 text-text-muted hover:text-red-500 transition-colors",title:"Delete profile",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]},e.id))}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:H,onChange:e=>J(e.target.value),placeholder:"Profile name (e.g. Personal Account)",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:e=>"Enter"===e.key&&ed()}),(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ed,disabled:!H.trim(),loading:q,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Current"]})]})]}),Y&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===V.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:V.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>eu(e.id),disabled:ee===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:ee===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:P,onClose:()=>$(!1),onSelect:e=>{I(e.value),$(!1)},selectedModel:E,activeProviders:d,modelAliases:T,title:"Select Model for Codex"}),(0,a.jsx)(r.uR,{isOpen:R,onClose:()=>M(!1),title:"Codex CLI - Manual Configuration",configs:(h=O&&O.trim()?O:x?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.codex/config.toml",content:`# OmniRoute Configuration for Codex CLI
|
|
8
|
-
model = "${E}"
|
|
9
|
-
model_provider = "omniroute"
|
|
10
|
-
|
|
11
|
-
[model_providers.omniroute]
|
|
12
|
-
name = "OmniRoute"
|
|
13
|
-
base_url = "${er()}"
|
|
14
|
-
wire_api = "responses"
|
|
15
|
-
`},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:h},null,2)}])})]})}let p=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function u({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:x,cloudEnabled:m,batchStatus:u}){let h,g,y,f,[b,j]=(0,l.useState)(null),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[_,O]=(0,l.useState)(null),[A,E]=(0,l.useState)(""),[I,P]=(0,l.useState)(""),[$,T]=(0,l.useState)(!1),[L,R]=(0,l.useState)({}),[M,z]=(0,l.useState)(!1),[U,K]=(0,l.useState)(""),F=(0,l.useRef)(!1),[D,B]=(0,l.useState)([]),[H,J]=(0,l.useState)(!1),[q,W]=(0,l.useState)(null),G=!!(b?.installed&&b?.runnable),Z=(()=>{if(!G)return null;let e=b.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=m&&p&&e.baseUrl?.startsWith(p);return t||s?"configured":"other"})()||u?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!A&&E(d[0].key)},[d,A]),(0,l.useEffect)(()=>{t&&!b&&(X(),V(),et())},[t,b]);let V=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&R(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(b?.installed&&!F.current){F.current=!0;let e=b.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id);e&&(e.model&&P(e.model),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&E(e.apiKey))}},[b,d]);let X=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();j(t)}catch(e){j({installed:!1,error:e.message})}finally{v(!1)}},Y=()=>{let e=U||i;return e.endsWith("/v1")?e:`${e}/v1`},Q=async()=>{w(!0),O(null);try{let e=A?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_omniroute"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Y(),apiKey:e,model:I})}),s=await t.json();t.ok?(O({type:"success",text:"Settings applied successfully!"}),X()):O({type:"error",text:s.error||"Failed to apply settings"})}catch(e){O({type:"error",text:e.message})}finally{w(!1)}},ee=async()=>{S(!0),O(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(O({type:"success",text:"Settings reset successfully!"}),P(""),E(""),X()):O({type:"error",text:t.error||"Failed to reset settings"})}catch(e){O({type:"error",text:e.message})}finally{S(!1)}},et=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=droid"),t=await e.json();e.ok&&B(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},es=async e=>{W(e),O(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:e})}),s=await t.json();t.ok?(O({type:"success",text:"Backup restored!"}),X(),et()):O({type:"error",text:s.error||"Failed to restore"})}catch(e){O({type:"error",text:e.message})}finally{W(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(c,{effectiveConfigStatus:Z,batchStatus:u})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[N&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!N&&b&&!G&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:b.installed?"Factory Droid CLI not runnable":"Factory Droid CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:b.installed?`Factory Droid CLI was found but failed runtime healthcheck${b.reason?` (${b.reason})`:""}.`:"Please install Factory Droid CLI to use this feature."})]})]}),!N&&G&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[b?.settings?.customModels?.find(e=>"custom:OmniRoute-0"===e.id)?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:b.settings.customModels.find(e=>"custom:OmniRoute-0"===e.id).baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(h=U||i).endsWith("/v1")?h:`${h}/v1`,onChange:e=>K(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),U&&U!==i&&(0,a.jsx)("button",{onClick:()=>K(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:A,onChange:e=>E(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:I,onChange:e=>P(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>T(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),I&&(0,a.jsx)("button",{onClick:()=>P(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),_&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,a.jsx)("span",{children:_.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:Q,disabled:!I,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ee,disabled:!b?.hasOmniRoute,loading:C,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>z(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{J(!H),H||et()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",D.length>0&&` (${D.length})`]})]}),H&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===D.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:D.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>es(e.id),disabled:q===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:q===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:$,onClose:()=>T(!1),onSelect:e=>{P(e.value),T(!1)},selectedModel:I,activeProviders:x,modelAliases:L,title:"Select Model for Factory Droid"}),(0,a.jsx)(r.uR,{isOpen:M,onClose:()=>z(!1),title:"Factory Droid - Manual Configuration",configs:(g=A&&A.trim()?A:m?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",y={customModels:[{model:I||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:Y(),apiKey:g,displayName:I||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},f="u">typeof navigator&&navigator.platform,[{filename:f?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(y,null,2)}])})]})}let h=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function g({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:x,cloudEnabled:m,batchStatus:p}){let u,g,[y,f]=(0,l.useState)(null),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[_,O]=(0,l.useState)(""),[A,E]=(0,l.useState)(""),[I,P]=(0,l.useState)(!1),[$,T]=(0,l.useState)({}),[L,R]=(0,l.useState)(!1),[M,z]=(0,l.useState)(""),U=(0,l.useRef)(!1),[K,F]=(0,l.useState)([]),[D,B]=(0,l.useState)(!1),[H,J]=(0,l.useState)(null),q=!!(y?.installed&&y?.runnable),W=(()=>{if(!q)return null;let e=y.settings?.models?.providers?.omniroute;if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=m&&h&&e.baseUrl?.startsWith(h);return t||s?"configured":"other"})()||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!_&&O(d[0].key)},[d,_]),(0,l.useEffect)(()=>{t&&!y&&(Z(),G(),Q())},[t,y]);let G=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&T(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,l.useEffect)(()=>{if(y?.installed&&!U.current){U.current=!0;let e=y.settings?.models?.providers?.omniroute;if(e){let t=y.settings?.agents?.defaults?.model?.primary;t&&E(t.replace("omniroute/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&O(e.apiKey)}}},[y,d]);let Z=async()=>{j(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();f(t)}catch(e){f({installed:!1,error:e.message})}finally{j(!1)}},V=()=>{let e=M||i;return e.endsWith("/v1")?e:`${e}/v1`},X=async()=>{v(!0),S(null);try{let e=_?.trim()||(d?.length>0?d[0].key:null)||(m?null:"sk_omniroute"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:V(),apiKey:e,model:A})}),s=await t.json();t.ok?(S({type:"success",text:"Settings applied successfully!"}),Z()):S({type:"error",text:s.error||"Failed to apply settings"})}catch(e){S({type:"error",text:e.message})}finally{v(!1)}},Y=async()=>{w(!0),S(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(S({type:"success",text:"Settings reset successfully!"}),E(""),O(""),Z()):S({type:"error",text:t.error||"Failed to reset settings"})}catch(e){S({type:"error",text:e.message})}finally{w(!1)}},Q=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=openclaw"),t=await e.json();e.ok&&F(t.backups||[])}catch(e){console.log("Error fetching backups:",e)}},ee=async e=>{J(e),S(null);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:e})}),s=await t.json();t.ok?(S({type:"success",text:"Backup restored!"}),Z(),Q()):S({type:"error",text:s.error||"Failed to restore"})}catch(e){S({type:"error",text:e.message})}finally{J(null)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(c,{effectiveConfigStatus:W,batchStatus:p})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[b&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!b&&y&&!q&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.installed?"Open Claw CLI not runnable":"Open Claw CLI not installed"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:y.installed?`Open Claw CLI was found but failed runtime healthcheck${y.reason?` (${y.reason})`:""}.`:"Please install Open Claw CLI to use this feature."})]})]}),!b&&q&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.settings?.models?.providers?.omniroute?.baseUrl&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.settings.models.providers.omniroute.baseUrl})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:(u=M||i).endsWith("/v1")?u:`${u}/v1`,onChange:e=>z(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),M&&M!==i&&(0,a.jsx)("button",{onClick:()=>z(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,a.jsx)("select",{value:_,onChange:e=>O(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:m?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:A,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>P(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),A&&(0,a.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),C&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===C.type?"check_circle":"error"}),(0,a.jsx)("span",{children:C.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:X,disabled:!A,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Y,disabled:!y?.hasOmniRoute,loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>R(!0),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{B(!D),D||Q()},children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),"Backups",K.length>0&&` (${K.length})`]})]}),D&&(0,a.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),"Config Backups"]}),0===K.length?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No backups yet. Backups are created automatically before each Apply or Reset."}):(0,a.jsx)("div",{className:"space-y-1.5",children:K.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,a.jsx)("span",{className:"flex-1 truncate font-mono",title:e.id,children:e.id}),(0,a.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()}),(0,a.jsx)("button",{onClick:()=>ee(e.id),disabled:H===e.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:H===e.id?"...":"Restore"})]},e.id))})]})]})]}),(0,a.jsx)(r.rq,{isOpen:I,onClose:()=>P(!1),onSelect:e=>{E(e.value),P(!1)},selectedModel:A,activeProviders:x,modelAliases:$,title:"Select Model for Open Claw"}),(0,a.jsx)(r.uR,{isOpen:L,onClose:()=>R(!1),title:"Open Claw - Manual Configuration",configs:(g=_&&_.trim()?_:m?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`omniroute/${A||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:V(),apiKey:g,api:"openai-completions",models:[{id:A||"provider/model-id",name:(A||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let y=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function f({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:x,cloudEnabled:m,batchStatus:p}){let[u,h]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),[N,v]=(0,l.useState)(!1),[k,w]=(0,l.useState)(null),[C,S]=(0,l.useState)(""),[_,O]=(0,l.useState)(""),[A,E]=(0,l.useState)(!1),[I,P]=(0,l.useState)({}),[$,T]=(0,l.useState)(!1),[L,R]=(0,l.useState)(""),M=(0,l.useRef)(!1),[z,U]=(0,l.useState)([]),[K,F]=(0,l.useState)(!1),[D,B]=(0,l.useState)(null),H=!!(u?.installed&&u?.runnable),J=(()=>{if(!H)return null;if(!u.hasOmniRoute)return"not_configured";let e=u.settings?.openAiBaseUrl||"",t=e.includes("localhost")||e.includes("127.0.0.1"),s=m&&y&&e.startsWith(y);return t||s?"configured":"other"})(),q=J||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!C&&S(d[0].key)},[d,C]),(0,l.useEffect)(()=>{t&&!u&&(V(),W(),G())},[t,u]),(0,l.useEffect)(()=>{if(u?.settings&&!M.current){let e=u.settings.openAiModelId;e&&(O(e),M.current=!0)}},[u]);let W=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();P(t.aliases||{})}}catch{}},G=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=cline");if(e.ok){let t=await e.json();U(t.backups||[])}}catch{}},Z=async e=>{B(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"cline",backupId:e})});if(t.ok)w({type:"success",text:"Backup restored! Reloading status..."}),await V(),await G();else{let e=await t.json();w({type:"error",text:e.error||"Failed to restore backup"})}}catch(e){w({type:"error",text:e.message})}finally{B(null)}},V=async()=>{f(!0);try{let e=await fetch("/api/cli-tools/cline-settings"),t=await e.json();h(t)}catch(e){h({error:e.message})}finally{f(!1)}},X=async()=>{j(!0),w(null);try{let e=L||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:C||"sk_omniroute",model:_})}),a=await s.json();s.ok?(w({type:"success",text:a.message||"Applied!"}),await V(),await G()):w({type:"error",text:a.error||"Failed"})}catch(e){w({type:"error",text:e.message})}finally{j(!1)}},Y=async()=>{v(!0),w(null);try{let e=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),t=await e.json();e.ok?(w({type:"success",text:t.message||"Reset!"}),O(""),M.current=!1,await V(),await G()):w({type:"error",text:t.error||"Failed"})}catch(e){w({type:"error",text:e.message})}finally{v(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(c,{effectiveConfigStatus:q,batchStatus:p})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[g&&(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-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Cline CLI..."})]}),u&&!g&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${H?"text-green-500":"text-yellow-500"}`,children:H?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:H?"Cline CLI detected and ready":u.installed?"Cline CLI installed but not runnable":"Cline CLI not detected"}),u.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.commandPath})]}),u.globalStatePath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Config:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.globalStatePath})]})]})]}),H&&(0,a.jsxs)(a.Fragment,{children:["configured"===J&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:"OmniRoute is configured as OpenAI-compatible provider"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Provider: ",(0,a.jsx)("strong",{children:"openai"})," • Model:"," ",(0,a.jsx)("strong",{children:u.settings?.openAiModelId||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"Model"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:_,onChange:e=>O(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>E(!0),disabled:!n,children:"Select"}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>T(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"API Key"}),d&&d.length>0?(0,a.jsx)("select",{value:C,onChange:e=>S(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:m?"No API keys available":"Using default: sk_omniroute"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:X,disabled:!_,loading:b,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===J?"Update Config":"Apply Config"]}),"configured"===J&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Y,loading:N,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),"Reset"]})]}),k&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===k.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===k.type?"check_circle":"error"}),(0,a.jsx)("span",{children:k.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>F(!K),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${K?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),"Backups ",z.length>0&&`(${z.length})`]}),K&&z.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:z.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Z(e.id),loading:D===e.id,children:"Restore"})]},e.id))}),K&&0===z.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:"No backups available."})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:A,onClose:()=>E(!1),onSelect:e=>{O(e.value),E(!1)},selectedModel:_,activeProviders:x,title:"Select Model for Cline"}),$&&(0,a.jsx)(r.uR,{isOpen:$,onClose:()=>T(!1),title:"Cline Manual Configuration",onApply:e=>{e.model&&O(e.model),e.apiKey&&S(e.apiKey),e.baseUrl&&R(e.baseUrl),T(!1)},currentConfig:{model:_,apiKey:C,baseUrl:L||i}})]})}function b({tool:e,isExpanded:t,onToggle:s,baseUrl:i,hasActiveProviders:n,apiKeys:d,activeProviders:x,cloudEnabled:m,batchStatus:p}){let[u,h]=(0,l.useState)(null),[g,y]=(0,l.useState)(!1),[f,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(!1),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)(""),[S,_]=(0,l.useState)(""),[O,A]=(0,l.useState)(!1),[E,I]=(0,l.useState)({}),[P,$]=(0,l.useState)(!1),[T,L]=(0,l.useState)(""),R=(0,l.useRef)(!1),[M,z]=(0,l.useState)([]),[U,K]=(0,l.useState)(!1),[F,D]=(0,l.useState)(null),B=!!(u?.installed&&u?.runnable),H=B?u.hasOmniRoute?"configured":"not_configured":null,J=H||p?.configStatus||null;(0,l.useEffect)(()=>{d?.length>0&&!w&&C(d[0].key)},[d,w]),(0,l.useEffect)(()=>{t&&!u&&(Z(),q(),W())},[t,u]);let q=async()=>{try{let e=await fetch("/api/models/alias");if(e.ok){let t=await e.json();I(t.aliases||{})}}catch{}},W=async()=>{try{let e=await fetch("/api/cli-tools/backups?tool=kilo");if(e.ok){let t=await e.json();z(t.backups||[])}}catch{}},G=async e=>{D(e);try{let t=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"kilo",backupId:e})});if(t.ok)k({type:"success",text:"Backup restored! Reloading status..."}),await Z(),await W();else{let e=await t.json();k({type:"error",text:e.error||"Failed to restore backup"})}}catch(e){k({type:"error",text:e.message})}finally{D(null)}},Z=async()=>{y(!0);try{let e=await fetch("/api/cli-tools/kilo-settings"),t=await e.json();h(t)}catch(e){h({error:e.message})}finally{y(!1)}},V=async()=>{b(!0),k(null);try{let e=T||i||"http://localhost:20128",t=e.endsWith("/v1")?e:`${e}/v1`,s=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:t,apiKey:w||"sk_omniroute",model:S})}),a=await s.json();s.ok?(k({type:"success",text:a.message||"Applied!"}),await Z(),await W()):k({type:"error",text:a.error||"Failed"})}catch(e){k({type:"error",text:e.message})}finally{b(!1)}},X=async()=>{N(!0),k(null);try{let e=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),t=await e.json();e.ok?(k({type:"success",text:t.message||"Reset!"}),_(""),R.current=!1,await Z(),await W()):k({type:"error",text:t.error||"Failed"})}catch(e){k({type:"error",text:e.message})}finally{N(!1)}};return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:e.image?(0,a.jsx)(o.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:e.color},children:"terminal"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)(c,{effectiveConfigStatus:J,batchStatus:p})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[g&&(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-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking Kilo Code CLI..."})]}),u&&!g&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${B?"text-green-500":"text-yellow-500"}`,children:B?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:B?"Kilo Code CLI detected and ready":u.installed?"Kilo Code CLI installed but not runnable":"Kilo Code CLI not detected"}),u.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.commandPath})]}),u.authPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Auth:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.authPath})]})]})]}),B&&(0,a.jsxs)(a.Fragment,{children:["configured"===H&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:"OmniRoute is configured as OpenAI-compatible provider"}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Providers: ",(0,a.jsx)("strong",{children:u.settings?.auth?.join(", ")||"—"})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"Model"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:S,onChange:e=>_(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)(r.$n,{variant:"outline",size:"sm",onClick:()=>A(!0),disabled:!n,children:"Select"}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>$(!0),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm text-text-muted",children:"API Key"}),d&&d.length>0?(0,a.jsx)("select",{value:w,onChange:e=>C(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:m?"No API keys available":"Using default: sk_omniroute"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:V,disabled:!S,loading:f,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===H?"Update Config":"Apply Config"]}),"configured"===H&&(0,a.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:X,loading:j,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),"Reset"]})]}),v&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===v.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===v.type?"check_circle":"error"}),(0,a.jsx)("span",{children:v.text})]}),(0,a.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,a.jsxs)("button",{onClick:()=>K(!U),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${U?"rotate-90":""}`,children:"chevron_right"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),"Backups ",M.length>0&&`(${M.length})`]}),U&&M.length>0&&(0,a.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:M.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-medium",children:e.originalFile}),(0,a.jsx)("span",{className:"text-text-muted",children:new Date(e.createdAt).toLocaleString()})]}),(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>G(e.id),loading:F===e.id,children:"Restore"})]},e.id))}),U&&0===M.length&&(0,a.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:"No backups available."})]})]})]})]}),(0,a.jsx)(r.rq,{isOpen:O,onClose:()=>A(!1),onSelect:e=>{_(e.value),A(!1)},selectedModel:S,activeProviders:x,title:"Select Model for Kilo Code"}),P&&(0,a.jsx)(r.uR,{isOpen:P,onClose:()=>$(!1),title:"Kilo Code Manual Configuration",onApply:e=>{e.model&&_(e.model),e.apiKey&&C(e.apiKey),e.baseUrl&&L(e.baseUrl),$(!1)},currentConfig:{model:S,apiKey:w,baseUrl:T||i}})]})}function j({toolId:e,tool:t,isExpanded:s,onToggle:i,baseUrl:n,apiKeys:c,activeProviders:d=[],cloudEnabled:x=!1,batchStatus:m}){let p,u,h,[g,y]=(0,l.useState)(null),[f,b]=(0,l.useState)(!1),[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)(null),[S,_]=(0,l.useState)(!1),O=(0,l.useRef)(!1),[A,E]=(0,l.useState)(()=>c?.length>0?c[0].key:"");(0,l.useEffect)(()=>{let t=localStorage.getItem(`omniroute-cli-model-${e}`);t&&N(t);let s=localStorage.getItem(`omniroute-cli-key-${e}`);s&&c?.some(e=>e.key===s)&&E(s)},[e,c]);let I=(0,l.useCallback)(t=>{N(t),t?localStorage.setItem(`omniroute-cli-model-${e}`,t):localStorage.removeItem(`omniroute-cli-model-${e}`)},[e]),P=(0,l.useCallback)(t=>{E(t),t&&localStorage.setItem(`omniroute-cli-key-${e}`,t)},[e]);(0,l.useEffect)(()=>{!s||v||O.current||(O.current=!0,fetch(`/api/cli-tools/runtime/${e}`).then(e=>e.json()).then(e=>k(e)).catch(e=>k({error:e?.message||"runtime_check_failed"})))},[s,v,e]);let $=e=>{let t=A&&A.trim()?A:x?"your-api-key":"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,a).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,j||"provider/model-id")},T=async(e,t)=>{await navigator.clipboard.writeText($(e)),y(t),setTimeout(()=>y(null),2e3)},L=d.length>0,R=s&&null===v,M=async()=>{_(!0),C(null);try{let t=A&&A.trim()?A:x?"":"sk_omniroute",s=n||"http://localhost:20128",a=s.endsWith("/v1")?s:`${s}/v1`,l=await fetch(`/api/cli-tools/guide-settings/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:t,model:j})}),r=await l.json();l.ok?C({type:"success",text:r.message||"Configuration saved!"}):C({type:"error",text:r.error||"Failed to save"})}catch(e){C({type:"error",text:e.message})}finally{_(!1)}},z=["continue"].includes(e),U=()=>!t.requiresCloud||!!x;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:i,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,a.jsx)(o.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}}):t.icon?(0,a.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,a.jsx)(o.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(p=v?.reason==="not_required"||"guide"===t.configType,u=v?v.installed&&v.runnable:m?.installed&&m?.runnable,h=v?v.installed:m?.installed,p?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),"Guide"]}):u?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-green-500/10 text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-green-500"}),"Detected"]}):!1===h&&(v||m)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-zinc-400 dark:bg-zinc-500"}),"Not installed"]}):h&&!u&&(v||m)?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,a.jsx)("span",{className:"size-1.5 rounded-full bg-yellow-500"}),"Not ready"]}):null)]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[R&&(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-base",children:"progress_activity"}),(0,a.jsx)("span",{children:"Checking runtime..."})]}),!R&&v&&!v.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===v.reason?"info":v.installed&&v.runnable?"check_circle":"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===v.reason?"Guide-only integration: no local binary required":v.installed&&v.runnable?"CLI runtime detected and healthy":v.installed?`CLI found but not runnable${v.reason?` (${v.reason})`:""}`:"CLI runtime not detected"}),v.commandPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Binary:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:v.commandPath})]}),v.configPath&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Config path:"," ",(0,a.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:v.configPath})]})]})]}),!R&&v?.error&&(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:"Failed to check runtime status."})]}),t.notes&&0!==t.notes.length?(0,a.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&x)return null;let s="warning"===e.type,l="cloudCheck"===e.type&&!x,r="bg-blue-500/10 border-blue-500/30",i="text-blue-600 dark:text-blue-400",n="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",i="text-yellow-600 dark:text-yellow-400",n="text-yellow-500",o="warning"):l&&(r="bg-red-500/10 border-red-500/30",i="text-red-600 dark:text-red-400",n="text-red-500",o="error"),(0,a.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-lg ${n}`,children:o}),(0,a.jsx)("p",{className:`text-sm ${i}`,children:e.text})]},t)})}):null,U()&&t.guideSteps.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,a.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2",children:c&&c.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("select",{value:A,onChange:e=>P(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:c.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,a.jsx)("button",{onClick:()=>T(A,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===g?"check":"content_copy"})})]}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:x?"No API keys - Create one in Keys page":"sk_omniroute"})}),"modelSelector"===e.type&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",value:j,onChange:e=>I(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>b(!0),disabled:!L,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${L?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),j&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>T(j,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===g?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>I(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:$(e.value)}),e.copyable&&(0,a.jsx)("button",{onClick:()=>T(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:g===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),U()&&t.codeBlock&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,a.jsxs)("button",{onClick:()=>T(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===g?"check":"content_copy"}),"codeblock"===g?"Copied!":"Copy"]})]}),(0,a.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,a.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:$(t.codeBlock.code)})})]}),U()&&(0,a.jsxs)("div",{className:"mt-2",children:[w&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,a.jsx)("span",{children:w.text})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[z&&(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:M,disabled:!j,loading:S,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Config"]}),t.codeBlock&&(0,a.jsxs)(r.$n,{variant:z?"outline":"primary",size:"sm",onClick:()=>T(t.codeBlock.code,"codeblock"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===g?"check":"content_copy"}),"codeblock"===g?"Copied!":"Copy Config"]}),j&&(0,a.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),"Selection saved"]})]})]})]}):(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,a.jsx)(r.rq,{isOpen:f,onClose:()=>b(!1),onSelect:e=>{I(e.value)},selectedModel:j,activeProviders:d,title:"Select Model"})]})}function N({tool:e,isExpanded:t,onToggle:s,baseUrl:i,apiKeys:n,activeProviders:c,hasActiveProviders:d,cloudEnabled:x}){let[m,p]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[g,y]=(0,l.useState)(!1),[f,b]=(0,l.useState)(""),[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(null),[w,C]=(0,l.useState)({}),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)(null);(0,l.useEffect)(()=>{n?.length>0&&!j&&N(n[0].key)},[n,j]),(0,l.useEffect)(()=>{t&&!m&&(I(),E())},[t,m]);let E=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias?tool=antigravity");if(e.ok){let t=(await e.json()).aliases||{};Object.keys(t).length>0&&C(t)}}catch(e){console.log("Error loading saved mappings:",e)}},I=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();p(t)}}catch(e){console.log("Error fetching status:",e),p({running:!1})}},P="u">typeof navigator&&navigator.userAgent?.includes("Windows"),$=async e=>{h(!0),k(null);try{let t=j?.trim()||(n?.length>0?n[0].key:null)||(x?null:"sk_omniroute"),s=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:e})}),a=await s.json();s.ok?(k({type:"success",text:"MITM started"}),y(!1),b(""),I()):k({type:"error",text:a.error||"Failed to start"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},T=async e=>{h(!0),k(null);try{let t=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e})}),s=await t.json();t.ok?(k({type:"success",text:"MITM stopped"}),y(!1),b(""),I()):k({type:"error",text:s.error||"Failed to stop"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},L=()=>{f.trim()?m?.running?T(f):$(f):k({type:"error",text:"Sudo password is required"})},R=(e,t)=>{C(s=>({...s,[e]:t}))},M=async()=>{h(!0),k(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"antigravity",mappings:w})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to save mappings")}k({type:"success",text:"Mappings saved!"})}catch(e){k({type:"error",text:e.message})}finally{h(!1)}},z=m?.running;return(0,a.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(o.default,{src:"/providers/antigravity.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),z?(0,a.jsx)(r.Ex,{variant:"success",size:"sm",children:"Active"}):(0,a.jsx)(r.Ex,{variant:"default",size:"sm",children:"Inactive"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:z?(0,a.jsxs)("button",{onClick:()=>{P||m?.hasCachedPassword?T(""):(y(!0),k(null))},disabled:u,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),"Stop MITM"]}):(0,a.jsxs)("button",{onClick:()=>{P||m?.hasCachedPassword?$(""):(y(!0),k(null))},disabled:u||!d,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),"Start MITM"]})}),v?.type==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:v.text})]}),z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),n.length>0?(0,a.jsx)("select",{value:j,onChange:e=>N(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(e=>(0,a.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,a.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_omniroute (default)"})]}),e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:w[e.alias]||"",onChange:t=>R(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,a.jsx)("button",{onClick:()=>{A(e.alias),_(!0)},disabled:!d,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),w[e.alias]&&(0,a.jsx)("button",{onClick:()=>R(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:M,disabled:u||0===Object.keys(w).length,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Mappings"]})})]}),!z&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Intercepts Antigravity traffic via DNS redirect, letting you reroute models through OmniRoute."]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,a.jsx)("span",{children:"1. Generates SSL cert & adds to system keychain"}),(0,a.jsxs)("span",{children:["2. Redirects"," ",(0,a.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:"daily-cloudcode-pa.googleapis.com"})," ","→ localhost"]}),(0,a.jsx)("span",{children:"3. Maps Antigravity models to any provider via OmniRoute"})]})]})]}),(0,a.jsx)(r.aF,{isOpen:g,onClose:()=>{y(!1),b(""),k(null)},title:"Sudo Password Required",size:"sm",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and DNS configuration"})]}),(0,a.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:f,onChange:e=>b(e.target.value),onKeyDown:e=>{"Enter"!==e.key||u||L()}}),v&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===v.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===v.type?"check_circle":"error"}),(0,a.jsx)("span",{children:v.text})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{y(!1),b(""),k(null)},disabled:u,children:"Cancel"}),(0,a.jsx)(r.$n,{variant:"primary",size:"sm",onClick:L,loading:u,children:"Confirm"})]})]})}),(0,a.jsx)(r.rq,{isOpen:S,onClose:()=>_(!1),onSelect:e=>{O&&C(t=>({...t,[O]:e.value}))},selectedModel:O?w[O]:null,activeProviders:c,title:`Select model for ${O}`})]})}s(41463).env.NEXT_PUBLIC_CLOUD_URL;let v=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function k({machineId:e}){let t,s,o,[c,d]=(0,l.useState)([]),[p,h]=(0,l.useState)(!0),[y,k]=(0,l.useState)(null),[w,C]=(0,l.useState)({}),[S,_]=(0,l.useState)(!1),[O,A]=(0,l.useState)([]),[E,I]=(0,l.useState)({});(0,l.useEffect)(()=>{L(),P(),$(),T()},[]);let P=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let t=await e.json();_(t.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},$=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();A(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},T=async()=>{try{let e=await fetch("/api/cli-tools/status");if(e.ok){let t=await e.json();I(t||{})}}catch(e){console.log("Error fetching CLI tool statuses:",e)}},L=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&d(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{h(!1)}},R=()=>c.filter(e=>!1!==e.isActive),M=(0,l.useCallback)((e,t,s)=>{C(a=>a[e]?.[t]===s?a:{...a,[e]:{...a[e],[t]:s}})},[]);if(p)return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]})});let z=(t=R(),s=[],o=new Set,t.forEach(e=>{let t=n.Xg[e.provider]||e.provider;(0,n.KC)(e.provider).forEach(a=>{let l=`${t}/${a.id}`;o.has(l)||(o.add(l),s.push({value:l,label:`${t}/${a.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:a.id}))})}),s).length>0;return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[!z&&(0,a.jsx)(r.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"No active providers"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Please add and connect providers first to configure CLI tools."})]})]})}),(0,a.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(i).map(([e,t])=>((e,t)=>{let s={tool:t,isExpanded:y===e,onToggle:()=>k(y===e?null:e),baseUrl:S&&v?v:window.location.origin,apiKeys:O,batchStatus:E[e]||null};switch(e){case"claude":return(0,a.jsx)(x,{...s,activeProviders:R(),modelMappings:w[e]||{},onModelMappingChange:(t,s)=>M(e,t,s),hasActiveProviders:z,cloudEnabled:S},e);case"codex":return(0,a.jsx)(m,{...s,activeProviders:R(),cloudEnabled:S},e);case"droid":return(0,a.jsx)(u,{...s,activeProviders:R(),hasActiveProviders:z,cloudEnabled:S},e);case"openclaw":return(0,a.jsx)(g,{...s,activeProviders:R(),hasActiveProviders:z,cloudEnabled:S},e);case"antigravity":return(0,a.jsx)(N,{...s,activeProviders:R(),hasActiveProviders:z,cloudEnabled:S},e);case"cline":return(0,a.jsx)(f,{...s,activeProviders:R(),hasActiveProviders:z,cloudEnabled:S},e);case"kilo":return(0,a.jsx)(b,{...s,activeProviders:R(),hasActiveProviders:z,cloudEnabled:S},e);default:return(0,a.jsx)(j,{toolId:e,...s,activeProviders:R(),cloudEnabled:S},e)}})(e,t))})]})}}},e=>{e.O(0,[8500,9751,782,7013,5846,993,8441,3794,7358],()=>e(e.s=33782)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8192],{32424:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>x});var a=t(95155),l=t(12115),r=t(40993),n=t(20909);function i(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}let c={CLOSED:{bg:"bg-green-500/10",text:"text-green-500",label:"Healthy"},OPEN:{bg:"bg-red-500/10",text:"text-red-500",label:"Open"},HALF_OPEN:{bg:"bg-amber-500/10",text:"text-amber-500",label:"Half-Open"}};function x(){var e;let s,t,x,d,m,o,[p,h]=(0,l.useState)(null),[u,j]=(0,l.useState)(null),[b,N]=(0,l.useState)(null),[g,f]=(0,l.useState)(null),[y,v]=(0,l.useState)(null),[w,$]=(0,l.useState)(null),S=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/monitoring/health");if(!e.ok)throw Error(`HTTP ${e.status}`);let s=await e.json();h(s),j(null),N(new Date)}catch(e){j(e.message)}},[]),k=(0,l.useCallback)(async()=>{let e=await Promise.allSettled([fetch("/api/telemetry/summary").then(e=>e.json()),fetch("/api/cache/stats").then(e=>e.json()),fetch("/api/rate-limits").then(e=>e.json())]);"fulfilled"===e[0].status&&f(e[0].value),"fulfilled"===e[1].status&&v(e[1].value),"fulfilled"===e[2].status&&e[2].value.cacheStats&&$(e[2].value.cacheStats)},[]);(0,l.useEffect)(()=>{S(),k();let e=setInterval(()=>{S(),k()},15e3);return()=>clearInterval(e)},[S,k]);let C=e=>null!=e?`${Math.round(e)}ms`:"—";if(!p&&!u)return(0,a.jsx)("div",{className:"p-6 flex items-center justify-center min-h-[400px]",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),(0,a.jsx)("p",{className:"text-text-muted mt-4",children:"Loading health data..."})]})});if(u&&!p)return(0,a.jsx)("div",{className:"p-6",children:(0,a.jsxs)("div",{className:"bg-red-500/10 border border-red-500/30 rounded-xl p-6 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-500 text-[32px] mb-2",children:"error"}),(0,a.jsxs)("p",{className:"text-red-400",children:["Failed to load health data: ",u]}),(0,a.jsx)("button",{onClick:S,className:"mt-4 px-4 py-2 rounded-lg bg-primary/10 text-primary text-sm hover:bg-primary/20 transition-colors",children:"Retry"})]})});let{system:O,providerHealth:E,rateLimitStatus:L,lockouts:z}=p,D=Object.entries(E||{}),_=Object.entries(z||{});return(0,a.jsxs)("div",{className:"p-6 space-y-6 max-w-6xl mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"System Health"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Real-time monitoring of your OmniRoute instance"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[b&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Updated ",b.toLocaleTimeString()]}),(0,a.jsx)("button",{onClick:()=>{S(),k()},className:"p-2 rounded-lg bg-surface hover:bg-surface/80 text-text-muted hover:text-text-main transition-colors",title:"Refresh",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"refresh"})})]})]}),(0,a.jsxs)("div",{role:"status","aria-live":"polite",className:`rounded-xl p-4 flex items-center gap-3 ${"healthy"===p.status?"bg-green-500/10 border border-green-500/20":"bg-red-500/10 border border-red-500/20"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${"healthy"===p.status?"text-green-500":"text-red-500"}`,children:"healthy"===p.status?"check_circle":"error"}),(0,a.jsx)("span",{className:"healthy"===p.status?"text-green-400":"text-red-400",children:"healthy"===p.status?"All systems operational":"System issues detected"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"timer"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Uptime"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:(s=Math.floor((e=O.uptime)/86400),t=Math.floor(e%86400/3600),x=Math.floor(e%3600/60),s>0?`${s}d ${t}h ${x}m`:t>0?`${t}h ${x}m`:`${x}m`)})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"info"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Version"})]}),(0,a.jsxs)("p",{className:"text-xl font-semibold text-text-main",children:["v",O.version]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Node ",O.nodeVersion]})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"memory"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Memory (RSS)"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:i(O.memoryUsage?.rss||0)}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Heap: ",i(O.memoryUsage?.heapUsed||0)," /"," ",i(O.memoryUsage?.heapTotal||0)]})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"dns"})}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Providers"})]}),(0,a.jsx)("p",{className:"text-xl font-semibold text-text-main",children:D.length}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:[D.filter(([,e])=>"CLOSED"===e.state).length," healthy"]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"speed"}),"Latency"]}),g?(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p50"}),(0,a.jsx)("span",{className:"font-mono",children:C(g.p50)})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p95"}),(0,a.jsx)("span",{className:"font-mono",children:C(g.p95)})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"p99"}),(0,a.jsx)("span",{className:"font-mono",children:C(g.p99)})]}),(0,a.jsxs)("div",{className:"flex justify-between border-t border-border pt-2 mt-2",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Total requests"}),(0,a.jsx)("span",{className:"font-mono",children:g.totalRequests??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"cached"}),"Prompt Cache"]}),y?(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Entries"}),(0,a.jsxs)("span",{className:"font-mono",children:[y.size,"/",y.maxSize]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Hit Rate"}),(0,a.jsxs)("span",{className:"font-mono",children:[y.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Hits / Misses"}),(0,a.jsxs)("span",{className:"font-mono",children:[y.hits??0," / ",y.misses??0]})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]}),(0,a.jsxs)(r.Zp,{className:"p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold text-text-muted mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"database"}),"Signature Cache"]}),w?(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Defaults",value:w.defaultCount,color:"text-text-muted"},{label:"Tool",value:`${w.tool.entries}/${w.tool.patterns}`,color:"text-blue-400"},{label:"Family",value:`${w.family.entries}/${w.family.patterns}`,color:"text-purple-400"},{label:"Session",value:`${w.session.entries}/${w.session.patterns}`,color:"text-cyan-400"}].map(({label:e,value:s,color:t})=>(0,a.jsxs)("div",{className:"text-center p-2 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:`text-lg font-bold tabular-nums ${t}`,children:s}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:e})]},e))}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No data yet"})]})]}),(0,a.jsxs)(r.Zp,{className:"p-5",role:"region","aria-label":"Provider health status",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-primary",children:"health_and_safety"}),"Provider Health"]}),D.length>0&&(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," Healthy"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-amber-500"})," Recovering"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-red-500"})," Down"]})]})]}),0===D.length?(0,a.jsx)("p",{className:"text-sm text-text-muted text-center py-4",children:"No circuit breaker data available. Make some requests first."}):(d=D.filter(([,e])=>"CLOSED"!==e.state),m=D.filter(([,e])=>"CLOSED"===e.state),(0,a.jsxs)("div",{className:"space-y-4",children:[d.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-red-400 uppercase tracking-wide",children:"Issues Detected"}),d.map(([e,s])=>{let t=c[s.state]||c.OPEN,l=n.Q2[e],r=l?.name||e;return(0,a.jsxs)("div",{className:`rounded-lg p-3 ${t.bg} border border-white/5 flex items-center gap-3`,children:[(0,a.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0 text-xs font-bold",style:{backgroundColor:`${l?.color||"#888"}15`,color:l?.color||"#888"},children:l?.textIcon||e.slice(0,2).toUpperCase()}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main truncate",children:r}),(0,a.jsx)("span",{className:`text-xs font-semibold px-1.5 py-0.5 rounded ${t.bg} ${t.text}`,children:t.label})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted mt-0.5",children:[s.failures," failure",1!==s.failures?"s":"",s.lastFailure&&(0,a.jsxs)("span",{className:"ml-2",children:["\xb7 Last: ",new Date(s.lastFailure).toLocaleTimeString()]})]})]})]},e)})]}),m.length>0&&(0,a.jsxs)("div",{children:[d.length>0&&(0,a.jsx)("p",{className:"text-xs font-medium text-green-400 uppercase tracking-wide mb-2",children:"Operational"}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-2",children:m.map(([e])=>{let s=n.Q2[e],t=s?.name||e;return(0,a.jsxs)("div",{className:"rounded-lg p-2.5 bg-green-500/5 border border-white/5 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-green-500 shrink-0"}),(0,a.jsx)("span",{className:"text-xs font-medium text-text-main truncate",title:t,children:t})]},e)})})]})]}))]}),L&&Object.keys(L).length>0&&((o=Object.entries(L).map(([e,s])=>({key:e,...(e=>{let s,t=e.split(":"),a=t[0],l=t[1]||"",r=t.slice(2).join(":")||null,i=n.Q2[a];if(a.startsWith("openai-compatible-")){let e=a.replace("openai-compatible-","");s="OpenAI Compatible",i={color:"#10A37F",textIcon:"OC"},e.length>12?s+=` (${e.slice(0,8)}…)`:e&&(s+=` (${e})`)}else if(a.startsWith("anthropic-compatible-")){let e=a.replace("anthropic-compatible-","");s="Anthropic Compatible",i={color:"#D97757",textIcon:"AC"},e.length>12?s+=` (${e.slice(0,8)}…)`:e&&(s+=` (${e})`)}else s=i?.name||a;return{providerId:a,displayName:s,providerInfo:i,connectionId:l,model:r}})(e),status:s}))).sort((e,s)=>{let t=(e.status.queued||0)+(e.status.running||0),a=(s.status.queued||0)+(s.status.running||0);return t!==a?a-t:e.displayName.localeCompare(s.displayName)}),(0,a.jsxs)(r.Zp,{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-amber-500",children:"speed"}),"Rate Limit Status"]}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[o.length," active limiter",1!==o.length?"s":""]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:o.map(({key:e,displayName:s,providerInfo:t,connectionId:l,model:r,status:n})=>{let i=(n.queued||0)+(n.running||0)>0,c=(n.queued||0)>0;return(0,a.jsxs)("div",{className:`rounded-lg p-3 border transition-colors ${c?"bg-amber-500/5 border-amber-500/20":i?"bg-blue-500/5 border-blue-500/15":"bg-surface/30 border-white/5"}`,title:e,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 mb-2",children:[(0,a.jsx)("div",{className:"size-7 rounded-md flex items-center justify-center shrink-0 text-[10px] font-bold",style:{backgroundColor:`${t?.color||"#888"}15`,color:t?.color||"#888"},children:t?.textIcon||s.slice(0,2).toUpperCase()}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main truncate",children:s}),l&&(0,a.jsxs)("p",{className:"text-[10px] text-text-muted font-mono truncate",children:[l.length>12?l.slice(0,8)+"…":l,r&&(0,a.jsxs)("span",{className:"ml-1 text-text-muted/60",children:["\xb7 ",r]})]})]}),(0,a.jsx)("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold ${c?"bg-amber-500/15 text-amber-400":i?"bg-blue-500/15 text-blue-400":"bg-green-500/10 text-green-400"}`,children:c?"Queued":i?"Active":"OK"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-[11px] text-text-muted",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"schedule"}),n.queued||0," queued"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"play_arrow"}),n.running||0," running"]})]})]},e)})})]})),_.length>0&&(0,a.jsxs)(r.Zp,{className:"p-5",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-text-main mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-red-500",children:"lock"}),"Active Lockouts"]}),(0,a.jsx)("div",{className:"space-y-2",children:_.map(([e,s])=>(0,a.jsxs)("div",{className:"rounded-lg p-3 bg-red-500/5 border border-red-500/10 flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-sm font-medium text-text-main",children:e}),s.reason&&(0,a.jsxs)("span",{className:"text-xs text-text-muted ml-2",children:["(",s.reason,")"]})]}),s.until&&(0,a.jsxs)("span",{className:"text-xs text-red-400",children:["Until ",new Date(s.until).toLocaleTimeString()]})]},e))})]})]})}},39449:(e,s,t)=>{Promise.resolve().then(t.bind(t,32424))}},e=>{e.O(0,[8500,9751,782,7013,5846,993,8441,3794,7358],()=>e(e.s=39449)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{7153:(e,s,t)=>{Promise.resolve().then(t.bind(t,49433))},49433:(e,s,t)=>{"use strict";t.d(s,{default:()=>h});var r=t(95155),l=t(12115),a=t(14051),i=t.n(a),n=t(5772),o=t(98500),d=t.n(o),c=t(73321),x=t(40993),m=t(20909),u=t(67671);function h({machineId:e}){let[s,t]=(0,l.useState)([]),[a,i]=(0,l.useState)([]),[n,o]=(0,l.useState)(!0),[c,u]=(0,l.useState)("/v1"),[h,f]=(0,l.useState)(null),[g,j]=(0,l.useState)({});(0,l.useEffect)(()=>{u(`${window.location.origin}/v1`)},[]);let v=(0,l.useCallback)(async()=>{try{let[e,s,r]=await Promise.all([fetch("/api/providers"),fetch("/api/models"),fetch("/api/provider-metrics")]);if(e.ok){let s=await e.json();t(s.connections||[])}if(s.ok){let e=await s.json();i(e.models||[])}if(r.ok){let e=await r.json();j(e.metrics||{})}}catch(e){console.log("Error fetching data:",e)}finally{o(!1)}},[]);(0,l.useEffect)(()=>{v()},[v]);let N=(0,l.useMemo)(()=>Object.entries(m.Q2).map(([e,t])=>{let r=s.filter(s=>s.provider===e),l=r.filter(e=>!1!==e.isActive&&("active"===e.testStatus||"success"===e.testStatus||"unknown"===e.testStatus)).length,i=r.filter(e=>!1!==e.isActive&&("error"===e.testStatus||"expired"===e.testStatus||"unavailable"===e.testStatus)).length,n=new Set([e,t.alias].filter(Boolean)),o=a.filter(e=>n.has(e.provider)),d=m.IS[e]?"free":m.zN[e]?"oauth":"apikey";return{id:e,provider:t,total:r.length,connected:l,errors:i,modelCount:o.length,authType:d}}),[s,a]),y=(0,l.useMemo)(()=>{if(!h)return[];let e=new Set([h.id,h.provider?.alias].filter(Boolean));return a.filter(s=>e.has(s.provider))},[h,a]);return n?(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(x.Qv,{}),(0,r.jsx)(x.Qv,{})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,r.jsx)(x.Zp,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Quick Start"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Get up and running in 4 steps. Connect providers, route models, monitor everything."})]}),(0,r.jsxs)(d(),{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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"menu_book"}),"Full Docs"]})]}),(0,r.jsxs)("ol",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10 text-primary shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"key"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"1. Create API key"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Go to"," ",(0,r.jsx)(d(),{href:"/dashboard/settings",className:"text-primary hover:underline",children:"Settings"})," ","→ API Keys. Generate one key per environment."]})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-green-500/10 text-green-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"dns"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"2. Connect providers"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Add accounts in"," ",(0,r.jsx)(d(),{href:"/dashboard/providers",className:"text-primary hover:underline",children:"Providers"}),". Supports OAuth, API Key, and free tiers."]})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-blue-500/10 text-blue-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"link"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"3. Point your client"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Set base URL to"," ",(0,r.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-surface text-xs font-mono",children:c})," ","in your IDE or API client."]})]})]}),(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-bg-subtle p-4 flex gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center size-8 rounded-lg bg-amber-500/10 text-amber-500 shrink-0",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"analytics"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"4. Monitor & optimize"}),(0,r.jsxs)("p",{className:"text-text-muted mt-0.5",children:["Track tokens, cost and errors in"," ",(0,r.jsx)(d(),{href:"/dashboard/usage",className:"text-primary hover:underline",children:"Usage"})," ","and"," ",(0,r.jsx)(d(),{href:"/dashboard/analytics",className:"text-primary hover:underline",children:"Analytics"}),"."]})]})]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:[{label:"Documentation",href:"/docs",icon:"menu_book"},{label:"Providers",href:"/dashboard/providers",icon:"dns"},{label:"Combos",href:"/dashboard/combos",icon:"layers"},{label:"Analytics",href:"/dashboard/analytics",icon:"analytics"},{label:"Health Monitor",href:"/dashboard/health",icon:"health_and_safety"},{label:"CLI Tools",href:"/dashboard/cli-tools",icon:"terminal"},{label:"Report issue",href:"https://github.com/diegosouzapw/OmniRoute/issues",external:!0,icon:"bug_report"}].map(e=>(0,r.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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon||(e.external?"open_in_new":"arrow_forward")}),e.label]},e.href))})]})}),(0,r.jsxs)(x.Zp,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Providers Overview"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:[N.filter(e=>e.total>0).length," configured of"," ",N.length," available providers"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"hidden sm:flex items-center gap-3 text-[11px] text-text-muted",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-green-500"})," Free"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-blue-500"})," OAuth"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"size-2 rounded-full bg-amber-500"})," API Key"]})]}),(0,r.jsxs)(d(),{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,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"settings"}),"Manage"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:N.map(e=>(0,r.jsx)(p,{item:e,metrics:g[e.provider.alias]||g[e.id],onClick:()=>f(e)},e.id))})]}),h&&(0,r.jsx)(b,{provider:h,models:y,onClose:()=>f(null)})]})}function p({item:e,metrics:s,onClick:t}){let[a,i]=(0,l.useState)(!1),o=e.errors>0?"text-red-500":e.connected>0?"text-green-500":"text-text-muted",d={free:{color:"bg-green-500",label:"Free"},oauth:{color:"bg-blue-500",label:"OAuth"},apikey:{color:"bg-amber-500",label:"API Key"}},c=d[e.authType]||d.apikey;return(0,r.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,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.provider.color||"#888"}15`},children:a?(0,r.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,r.jsx)(n.default,{src:`/providers/${e.provider.id}.png`,alt:e.provider.name,width:26,height:26,className:"object-contain rounded-lg",sizes:"26px",onError:()=>i(!0)})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("p",{className:"text-sm font-semibold truncate",children:e.provider.name}),(0,r.jsx)("span",{className:`size-2 rounded-full ${c.color} shrink-0`,title:c.label})]}),(0,r.jsx)("p",{className:`text-xs ${o}`,children:0===e.total?"Not configured":`${e.connected} active \xb7 ${e.errors} error`}),s&&s.totalRequests>0&&(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,r.jsx)("span",{className:"text-emerald-500",children:s.totalSuccesses}),"/",s.totalRequests," reqs"]}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:[s.successRate,"%"]}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",s.avgLatencyMs,"ms"]})]})]}),(0,r.jsxs)("div",{className:"text-right shrink-0",children:[(0,r.jsx)("p",{className:"text-xs font-medium text-text-main",children:e.modelCount}),(0,r.jsx)("p",{className:"text-[10px] text-text-muted",children:"models"})]})]})})}function b({provider:e,models:s,onClose:t}){let[a,i]=(0,l.useState)(null),n=(0,u.i)(),o=(0,c.useRouter)(),d=e=>{t(),o.push(e)};return(0,r.jsx)(x.aF,{isOpen:!0,title:`${e.provider.name} — Models`,onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"token"}),s.length," model",1!==s.length?"s":""," available",e.total>0&&(0,r.jsxs)("span",{className:"ml-auto text-xs text-green-500",children:["● ",e.connected," connection",1!==e.connected?"s":""," active"]})]}),0===s.length?(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[32px] text-text-muted mb-2",children:"search_off"}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"No models available for this provider."}),(0,r.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Configure a connection first in"," ",(0,r.jsx)("button",{onClick:()=>d("/dashboard/providers"),className:"text-primary hover:underline cursor-pointer",children:"Providers"})]})]}):(0,r.jsx)("div",{className:"flex flex-col gap-1 max-h-[400px] overflow-y-auto",children:s.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg hover:bg-surface/50 transition-colors group",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-mono text-sm text-text-main truncate",children:e.fullModel}),e.alias!==e.model&&(0,r.jsxs)("p",{className:"text-[10px] text-text-muted",children:["alias: ",e.alias]})]}),(0,r.jsx)("button",{onClick:()=>{var s;return s=e.fullModel,void(navigator.clipboard.writeText(s),i(s),n.success(`Copied: ${s}`),setTimeout(()=>i(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:"Copy model name",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a===e.fullModel?"check":"content_copy"})})]},e.fullModel))}),(0,r.jsxs)("div",{className:"flex gap-2 pt-2 border-t border-border",children:[(0,r.jsxs)(x.$n,{variant:"secondary",fullWidth:!0,size:"sm",onClick:()=>d(`/dashboard/providers/${e.id}`),className:"flex-1",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"settings"}),"Configure Provider"]}),(0,r.jsx)(x.$n,{variant:"ghost",size:"sm",onClick:t,children:"Close"})]})]})})}h.propTypes={machineId:i().string},p.propTypes={item:i().shape({id:i().string.isRequired,provider:i().shape({id:i().string.isRequired,name:i().string.isRequired,color:i().string,textIcon:i().string,alias:i().string}).isRequired,total:i().number.isRequired,connected:i().number.isRequired,errors:i().number.isRequired,modelCount:i().number.isRequired,authType:i().string.isRequired}).isRequired,metrics:i().shape({totalRequests:i().number,totalSuccesses:i().number,successRate:i().number,avgLatencyMs:i().number}),onClick:i().func.isRequired},b.propTypes={provider:i().object.isRequired,models:i().array.isRequired,onClose:i().func.isRequired}}},e=>{e.O(0,[8500,9751,782,7013,5846,993,8441,3794,7358],()=>e(e.s=7153)),_N_E=e.O()}]);
|
package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a9c594cf56c3465e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{56411:(e,t,i)=>{Promise.resolve().then(i.bind(i,88618))},88618:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>h});var s=i(95155),a=i(12115),r=i(14051),l=i.n(r),n=i(73321),o=i(98500),d=i.n(o),c=i(5772),p=i(40993),m=i(20909),u=i(81135),x=i(30949);function h(){let e=(0,n.useParams)(),t=(0,n.useRouter)(),i=e.id,[r,l]=(0,a.useState)([]),[o,h]=(0,a.useState)(!0),[b,j]=(0,a.useState)(null),[N,S]=(0,a.useState)(!1),[T,$]=(0,a.useState)(!1),[R,E]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[_,P]=(0,a.useState)(null),[q,U]=(0,a.useState)(null),[D,K]=(0,a.useState)({}),[L,M]=(0,a.useState)(!1),{copied:F,copy:z}=(0,x.C)(),J=(0,a.useRef)(!1),V=(0,a.useRef)(!1),[B,W]=(0,a.useState)(null),[Z,G]=(0,a.useState)(null),[Q,H]=(0,a.useState)(!1),X=b?{id:b.id,name:b.name||("anthropic-compatible"===b.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===b.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===b.type?"AC":"OC",apiType:b.apiType,baseUrl:b.baseUrl,type:b.type}:m.IS[i]||m.zN[i]||m.fg[i],Y=!!m.IS[i]||!!m.zN[i],ee=(0,u.KC)(i),et=(0,m.wG)(i),ei=(0,m.mq)(i),es=(0,m.gb)(i),ea=ei||es,er=ea?i:et,el=ea?b?.prefix||i:et,en=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&K(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),eo=(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===i);l(e)}if(t.ok){let e=(a.nodes||[]).find(e=>e.id===i)||null;if(!e&&ea)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===i)||null))break}j(e)}}catch(e){console.log("Error fetching connections:",e)}finally{h(!1)}},[i,ea]),ed=async e=>{try{let t=await fetch(`/api/provider-nodes/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(j(s.node),await eo(),O(!1))}catch(e){console.log("Error updating provider node:",e)}};(0,a.useEffect)(()=>{eo(),en(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>G(e)).catch(()=>{})},[eo,en]),(0,a.useEffect)(()=>{o||0!==r.length||!X||ea||J.current||V.current||(J.current=!0,Y?S(!0):$(!0))},[o]);let ec=async(e,t,i=et)=>{let s=`${i}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await en();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},ep=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await en()}catch(e){console.log("Error deleting alias:",e)}},em=async e=>{if(confirm("Delete this connection?"))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&l(r.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},eu=(0,a.useCallback)(()=>{eo(),S(!1)},[eo]),ex=async e=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,...e})})).ok&&(await eo(),$(!1))}catch(e){console.log("Error saving connection:",e)}},eh=async e=>{try{(await fetch(`/api/providers/${_.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eo(),E(!1))}catch(e){console.log("Error updating connection:",e)}},ef=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&l(i=>i.map(i=>i.id===e?{...i,isActive:t}:i))}catch(e){console.log("Error updating connection status:",e)}},ey=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(i=>i.map(i=>i.id===e?{...i,rateLimitProtection:t}:i))}catch(e){console.error("Error toggling rate limit:",e)}},eb=async e=>{if(e&&!q){U(e);try{let t=await fetch(`/api/providers/${e}/test`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>({}));alert(e.error||"Failed to retest connection");return}await eo()}catch(e){console.error("Error retesting connection:",e)}finally{U(null)}}},ev=async(e,t)=>{if(e&&t)try{let i=t.priority,s=e.priority;i===s&&(i=r.indexOf(e)>r.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:i})}),fetch(`/api/providers/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:s})})]),await eo()}catch(e){console.log("Error swapping priority:",e)}},eg=async()=>{if(Q)return;let e=r.find(e=>!1!==e.isActive);if(e){H(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let r=0;for(let e of a){let t=e.id||e.name||e.model;if(!t)continue;let s=t.split("/"),a=s[s.length-1];await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,modelId:t,modelName:e.name||t,source:"imported"})}),D[a]||await ec(t,a,er),r+=1}0===r&&alert("No new models were added (all already exist)."),await en()}catch(e){console.log("Error importing models:",e)}finally{H(!1)}}},ej=r.some(e=>!1!==e.isActive);return o?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(p.Qv,{}),(0,s.jsx)(p.Qv,{})]}):X?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(d(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"rounded-lg flex items-center justify-center",style:{backgroundColor:`${X.color}15`},children:L?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:X.color},children:X.textIcon||X.id.slice(0,2).toUpperCase()}):(0,s.jsx)(c.default,{src:ei&&X.apiType?"responses"===X.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":es?"/providers/anthropic-m.png":`/providers/${X.id}.png`,alt:X.name,width:48,height:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",sizes:"48px",onError:()=>M(!0)})}),(0,s.jsxs)("div",{children:[X.website?(0,s.jsxs)("a",{href:X.website,target:"_blank",rel:"noopener noreferrer",className:"text-3xl font-semibold tracking-tight hover:underline inline-flex items-center gap-2",style:{color:X.color},children:[X.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:X.name}),(0,s.jsxs)("p",{className:"text-text-muted",children:[r.length," connection",1===r.length?"":"s"]})]})]})]}),ea&&b&&(0,s.jsxs)(p.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:es?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:[es?"Messages API":"responses"===b.apiType?"Responses API":"Chat Completions"," ","\xb7 ",(b.baseUrl||"").replace(/\/$/,""),"/",es?"messages":"responses"===b.apiType?"responses":"chat/completions"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>$(!0),disabled:r.length>0,children:"Add"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>O(!0),children:"Edit"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(`Delete this ${es?"Anthropic":"OpenAI"} Compatible node?`))try{(await fetch(`/api/provider-nodes/${i}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},children:"Delete"})]})]}),r.length>0&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Only one connection is allowed per compatible node. Add another node if you need more connections."})]}),(0,s.jsxs)(p.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),!ea&&(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:()=>Y?S(!0):$(!0),children:"Add"})]}),0===r.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:Y?"lock":"key"})}),(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No connections yet"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Add your first connection to get started"}),!ea&&(0,s.jsx)(p.$n,{icon:"add",onClick:()=>Y?S(!0):$(!0),children:"Add Connection"})]}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:r.sort((e,t)=>(e.priority||0)-(t.priority||0)).map((e,t)=>(0,s.jsx)(C,{connection:e,isOAuth:Y,isFirst:0===t,isLast:t===r.length-1,onMoveUp:()=>ev(e,r[t-1]),onMoveDown:()=>ev(e,r[t+1]),onToggleActive:t=>ef(e.id,t),onToggleRateLimit:t=>ey(e.id,t),onRetest:()=>eb(e.id),isRetesting:q===e.id,onEdit:()=>{P(e),E(!0)},onDelete:()=>em(e.id),onReauth:Y?()=>S(!0):void 0,onProxy:()=>W({level:"key",id:e.id,label:e.name||e.email||e.id}),hasProxy:!!Z?.keys?.[e.id]},e.id))})]}),(0,s.jsxs)(p.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Available Models"}),(()=>{if(ea)return(0,s.jsx)(g,{providerStorageAlias:er,providerDisplayAlias:el,modelAliases:D,copied:F,onCopy:z,onSetAlias:ec,onDeleteAlias:ep,connections:r,isAnthropic:es});if(X.passthroughModels)return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eg,disabled:!ej||Q,children:Q?"Importing...":"Import from /models"}),!ej&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Add a connection to enable importing."})]}),(0,s.jsx)(y,{providerAlias:et,modelAliases:D,copied:F,onCopy:z,onSetAlias:ec,onDeleteAlias:ep})]});let e=(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eg,disabled:!ej||Q,children:Q?"Importing...":"Import from /models"}),!ej&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Add a connection to enable importing."})]});return 0===ee.length?(0,s.jsxs)("div",{children:[e,(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No models configured"})]}):(0,s.jsxs)("div",{children:[e,(0,s.jsx)("div",{className:"flex flex-wrap gap-3",children:ee.map(e=>{let t=`${er}/${e.id}`,a=`${i}/${e.id}`,r=Object.entries(D).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(f,{model:e,fullModel:`${el}/${e.id}`,alias:r,copied:F,onCopy:z,onSetAlias:t=>ec(e.id,t,er),onDeleteAlias:()=>ep(r)},e.id)})})]})})(),!ea&&(0,s.jsx)(v,{providerId:i,providerAlias:el,copied:F,onCopy:z})]}),"kiro"===i?(0,s.jsx)(p.Mh,{isOpen:N,providerInfo:X,onSuccess:eu,onClose:()=>{V.current=!0,S(!1)}}):"cursor"===i?(0,s.jsx)(p.G9,{isOpen:N,onSuccess:eu,onClose:()=>{V.current=!0,S(!1)}}):(0,s.jsx)(p.LF,{isOpen:N,provider:i,providerInfo:X,onSuccess:eu,onClose:()=>{V.current=!0,S(!1)}}),(0,s.jsx)(k,{isOpen:T,provider:i,providerName:X.name,isCompatible:ea,isAnthropic:es,onSave:ex,onClose:()=>$(!1)}),(0,s.jsx)(w,{isOpen:R,connection:_,onSave:eh,onClose:()=>E(!1)}),ea&&(0,s.jsx)(A,{isOpen:I,node:b,onSave:ed,onClose:()=>O(!1),isAnthropic:es}),B&&(0,s.jsx)(p.KN,{isOpen:!!B,onClose:()=>W(null),level:B.level,levelId:B.id,levelLabel:B.label})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,s.jsx)(d(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}function f({model:e,fullModel:t,alias:i,copied:a,onCopy:r,onSetAlias:l,onDeleteAlias:n}){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:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})})]})}function y({providerAlias:e,modelAliases:t,copied:i,onCopy:r,onSetAlias:l,onDeleteAlias:n}){let[o,d]=(0,a.useState)(""),[c,m]=(0,a.useState)(!1),u=Object.entries(t).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,i])=>({modelId:i.replace(`${e}/`,""),fullModel:i,alias:t})),x=async()=>{let e;if(!o.trim()||c)return;let i=o.trim(),s=(e=i.split("/"))[e.length-1];if(t[s])return void alert(`Alias "${s}" already exists. Please use a different model or edit existing alias.`);m(!0);try{await l(i,s),d("")}catch(e){console.log("Error adding model:",e)}finally{m(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"OpenRouter supports any model. Add models and create aliases for quick access."}),(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:"Model ID (from OpenRouter)"}),(0,s.jsx)("input",{id:"new-model-input",type:"text",value:o,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&x(),placeholder:"anthropic/claude-3-opus",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:x,disabled:!o.trim()||c,children:c?"Adding...":"Add"})]}),u.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:u.map(({modelId:e,fullModel:t,alias:a})=>(0,s.jsx)(b,{modelId:e,fullModel:t,copied:i,onCopy:r,onDeleteAlias:()=>n(a)},t))})]})}function b({modelId:e,fullModel:t,copied:i,onCopy:a,onDeleteAlias:r}){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:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e}`?"check":"content_copy"})})]})]}),(0,s.jsx)("button",{onClick:r,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function v({providerId:e,providerAlias:t,copied:i,onCopy:r}){let[l,n]=(0,a.useState)([]),[o,d]=(0,a.useState)(""),[c,m]=(0,a.useState)(""),[u,x]=(0,a.useState)(!1),[h,f]=(0,a.useState)(!0),y=(0,a.useCallback)(async()=>{try{let t=await fetch(`/api/provider-models?provider=${e}`);if(t.ok){let e=await t.json();n(e.models||[])}}catch(e){console.error("Failed to fetch custom models:",e)}finally{f(!1)}},[e]);(0,a.useEffect)(()=>{y()},[y]);let b=async()=>{if(o.trim()&&!u){x(!0);try{(await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:o.trim(),modelName:c.trim()||void 0})})).ok&&(d(""),m(""),await y())}catch(e){console.error("Failed to add custom model:",e)}finally{x(!1)}}},v=async t=>{try{await fetch(`/api/provider-models?provider=${e}&model=${encodeURIComponent(t)}`,{method:"DELETE"}),await y()}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"}),"Custom Models"]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-3",children:"Add model IDs not in the default list. These will be available for routing."}),(0,s.jsxs)("div",{className:"flex items-end gap-2 mb-3",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:"Model ID"}),(0,s.jsx)("input",{id:"custom-model-id",type:"text",value:o,onChange:e=>d(e.target.value),onKeyDown:e=>"Enter"===e.key&&b(),placeholder:"e.g. gpt-4.5-turbo",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:"Display Name"}),(0,s.jsx)("input",{id:"custom-model-name",type:"text",value:c,onChange:e=>m(e.target.value),onKeyDown:e=>"Enter"===e.key&&b(),placeholder:"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)(p.$n,{size:"sm",icon:"add",onClick:b,disabled:!o.trim()||u,children:u?"Adding...":"Add"})]}),h?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Loading..."}):l.length>0?(0,s.jsx)("div",{className:"flex flex-col gap-2",children:l.map(e=>{let a=`${t}/${e.id}`,l=`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",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:()=>r(a,l),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:"Copy model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===l?"check":"content_copy"})})]})]}),(0,s.jsx)("button",{onClick:()=>v(e.id),className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove custom model",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:"No custom models added yet."})]})}function g({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:i,copied:r,onCopy:l,onSetAlias:n,onDeleteAlias:o,connections:d,isAnthropic:c}){let[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),v=Object.entries(i).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,i])=>({modelId:i.replace(`${e}/`,""),fullModel:i,alias:t})),g=e=>{let s,a=(s=e.split("/"))[s.length-1];if(!i[a])return a;let r=`${t}-${a}`;return i[r]?null:r},j=async()=>{if(!m.trim()||x)return;let t=m.trim(),i=g(t);if(!i)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await n(t,i,e),u("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},N=async()=>{if(f)return;let t=d.find(e=>!1!==e.isActive);if(t){y(!0);try{let i=await fetch(`/api/providers/${t.id}/models`),s=await i.json();if(!i.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let r=0;for(let t of a){let i=t.id||t.name||t.model;if(!i)continue;let s=g(i);s&&(await n(i,s,e),r+=1)}0===r&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{y(!1)}}},C=d.some(e=>!1!==e.isActive);return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",c?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:m,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&j(),placeholder:c?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(p.$n,{size:"sm",icon:"add",onClick:j,disabled:!m.trim()||x,children:x?"Adding...":"Add"}),(0,s.jsx)(p.$n,{size:"sm",variant:"secondary",icon:"download",onClick:N,disabled:!C||f,children:f?"Importing...":"Import from /models"})]}),!C&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),v.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:v.map(({modelId:e,fullModel:i,alias:a})=>(0,s.jsx)(b,{modelId:e,fullModel:`${t}/${e}`,copied:r,onCopy:l,onDeleteAlias:()=>o(a)},i))})]})}function j({until:e}){let[t,i]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void i("");let s=Math.floor(t/1e3);if(s<60)i(`${s}s`);else if(s<3600)i(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);i(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}f.propTypes={model:l().shape({id:l().string.isRequired}).isRequired,fullModel:l().string.isRequired,alias:l().string,copied:l().string,onCopy:l().func.isRequired},y.propTypes={providerAlias:l().string.isRequired,modelAliases:l().object.isRequired,copied:l().string,onCopy:l().func.isRequired,onSetAlias:l().func.isRequired,onDeleteAlias:l().func.isRequired},b.propTypes={modelId:l().string.isRequired,fullModel:l().string.isRequired,copied:l().string,onCopy:l().func.isRequired,onDeleteAlias:l().func.isRequired},v.propTypes={providerId:l().string.isRequired,providerAlias:l().string.isRequired,copied:l().string,onCopy:l().func.isRequired},g.propTypes={providerStorageAlias:l().string.isRequired,providerDisplayAlias:l().string.isRequired,modelAliases:l().object.isRequired,copied:l().string,onCopy:l().func.isRequired,onSetAlias:l().func.isRequired,onDeleteAlias:l().func.isRequired,connections:l().arrayOf(l().shape({id:l().string,isActive:l().bool})).isRequired,isAnthropic:l().bool},j.propTypes={until:l().string.isRequired};let N={runtime_error:{label:"Local runtime",variant:"warning"},upstream_auth_error:{label:"Upstream auth",variant:"error"},auth_missing:{label:"Missing credential",variant:"warning"},token_refresh_failed:{label:"Refresh failed",variant:"warning"},token_expired:{label:"Token expired",variant:"warning"},upstream_rate_limited:{label:"Rate limited",variant:"warning"},upstream_unavailable:{label:"Upstream unavailable",variant:"error"},network_error:{label:"Network error",variant:"warning"},unsupported:{label:"Test unsupported",variant:"default"},upstream_error:{label:"Upstream error",variant:"error"}};function C({connection:e,isOAuth:t,isFirst:i,isLast:r,onMoveUp:l,onMoveDown:n,onToggleActive:o,onToggleRateLimit:d,onRetest:c,isRetesting:m,onEdit:u,onDelete:x,onReauth:h,onProxy:f,hasProxy:y}){let b=t?e.name||e.email||e.displayName||"OAuth Account":e.name,[v,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=()=>{g(e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now())};t();let i=e.rateLimitedUntil?setInterval(t,1e3):null;return()=>{i&&clearInterval(i)}},[e.rateLimitedUntil]);let C="unavailable"!==e.testStatus||v?e.testStatus:"active",k=function(e,t,i){if(!1===e.isActive)return{statusVariant:"default",statusLabel:"disabled",errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};if("active"===t||"success"===t)return{statusVariant:"success",statusLabel:"connected",errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};let s=function(e,t){if(t)return"upstream_rate_limited";if(e.lastErrorType)return e.lastErrorType;let i=Number(e.errorCode);if(401===i||403===i)return"upstream_auth_error";if(429===i)return"upstream_rate_limited";if(i>=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,i),a=s&&N[s]||null;return"runtime_error"===s?{statusVariant:"warning",statusLabel:"runtime issue",errorType:s,errorBadge:a,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"upstream_auth_error"===s||"auth_missing"===s||"token_refresh_failed"===s||"token_expired"===s?{statusVariant:"error",statusLabel:"auth failed",errorType:s,errorBadge:a,errorTextClass:"text-red-500"}:"upstream_rate_limited"===s?{statusVariant:"warning",statusLabel:"rate limited",errorType:s,errorBadge:a,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"network_error"===s?{statusVariant:"warning",statusLabel:"network issue",errorType:s,errorBadge:a,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"unsupported"===s?{statusVariant:"default",statusLabel:"test unsupported",errorType:s,errorBadge:a,errorTextClass:"text-text-muted"}:{statusVariant:"error",statusLabel:t||"error",errorType:s,errorBadge:a,errorTextClass:"text-red-500"}}(e,C,v),w=!!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: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_up"})}),(0,s.jsx)("button",{onClick:n,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_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:b}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[(0,s.jsx)(p.Ex,{variant:k.statusVariant,size:"sm",dot:!0,children:k.statusLabel}),v&&!1!==e.isActive&&(0,s.jsx)(j,{until:e.rateLimitedUntil}),k.errorBadge&&!1!==e.isActive&&(0,s.jsx)(p.Ex,{variant:k.errorBadge.variant,size:"sm",children:k.errorBadge.label}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:`text-xs truncate max-w-[300px] ${k.errorTextClass}`,title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),(0,s.jsx)("span",{className:"text-text-muted/30 select-none",children:"|"}),(0,s.jsxs)("button",{onClick:()=>d(!w),className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium transition-all cursor-pointer ${w?"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:w?"Click to disable rate limit protection":"Click to enable rate limit protection",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"shield"}),w?"Protected":"Unprotected"]}),y&&(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 bg-primary/15 text-primary",title:"Proxy configured",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"vpn_lock"}),"Proxy"]})]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.$n,{size:"sm",variant:"ghost",icon:"refresh",loading:m,disabled:!1===e.isActive,onClick:c,className:"!h-7 !px-2 text-xs",title:"Retest authentication",children:"Retest"}),(0,s.jsx)(p.lM,{size:"sm",checked:e.isActive??!0,onChange:o,title:e.isActive??!0?"Disable connection":"Enable connection"}),(0,s.jsxs)("div",{className:"flex gap-1 ml-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h&&(0,s.jsx)("button",{onClick:h,className:"p-2 hover:bg-amber-500/10 rounded text-amber-600 hover:text-amber-500",title:"Re-authenticate this connection",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"passkey"})}),(0,s.jsx)("button",{onClick:u,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:f,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",title:"Proxy config",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:x,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 k({isOpen:e,provider:t,providerName:i,isCompatible:r,isAnthropic:l,onSave:n,onClose:o}){let[d,c]=(0,a.useState)({name:"",apiKey:"",priority:1}),[m,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),b=async()=>{u(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})}),i=await e.json();h(i.valid?"success":"failed")}catch{h("failed")}finally{u(!1)}},v=async()=>{if(t&&d.apiKey){y(!0);try{let e=!1;try{u(!0),h(null);let i=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:d.apiKey})});e=!!(await i.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{u(!1)}await n({name:d.name,apiKey:d.apiKey,priority:d.priority,testStatus:e?"active":"unknown"})}finally{y(!1)}}};return t?(0,s.jsx)(p.aF,{isOpen:e,title:`Add ${i||t} API Key`,onClose:o,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:d.name,onChange:e=>c({...d,name:e.target.value}),placeholder:"Production Key"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key",type:"password",value:d.apiKey,onChange:e=>c({...d,apiKey:e.target.value}),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:b,disabled:!d.apiKey||m||f,variant:"secondary",children:m?"Checking...":"Check"})})]}),x&&(0,s.jsx)(p.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),r&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:l?`Validation checks ${i||"Anthropic Compatible"} by verifying the API key.`:`Validation checks ${i||"OpenAI Compatible"} via /models on your base URL.`}),(0,s.jsx)(p.pd,{label:"Priority",type:"number",value:d.priority,onChange:e=>c({...d,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:v,fullWidth:!0,disabled:!d.name||!d.apiKey||f,children:f?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:o,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({isOpen:e,connection:t,onSave:i,onClose:r}){let[l,n]=(0,a.useState)({name:"",priority:1,apiKey:"",healthCheckInterval:60}),[o,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(null),[b,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t&&(n({name:t.name||"",priority:t.priority||1,apiKey:"",healthCheckInterval:t.healthCheckInterval??60}),u(null),y(null))},[t]);let g=async()=>{if(t?.provider){d(!0),u(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),i=await e.json();u({valid:!!i.valid,diagnosis:i.diagnosis||null,message:i.error||null})}catch{u({valid:!1,diagnosis:{type:"network_error"},message:"Failed to test connection"})}finally{d(!1)}}},j=async()=>{if(t?.provider&&l.apiKey){h(!0),y(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:l.apiKey})}),i=await e.json();y(i.valid?"success":"failed")}catch{y("failed")}finally{h(!1)}}},C=async()=>{v(!0);try{let e={name:l.name,priority:l.priority,healthCheckInterval:l.healthCheckInterval};if(!k&&l.apiKey){e.apiKey=l.apiKey;let i="success"===f;if(!i)try{h(!0),y(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:l.apiKey})});i=!!(await e.json()).valid,y(i?"success":"failed")}catch{y("failed")}finally{h(!1)}i&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null,e.lastErrorType=null,e.lastErrorSource=null,e.errorCode=null,e.rateLimitedUntil=null)}await i(e)}finally{v(!1)}};if(!t)return null;let k="oauth"===t.authType,w=(0,m.mq)(t.provider)||(0,m.gb)(t.provider),A=!c?.valid&&c?.diagnosis?.type&&N[c.diagnosis.type]||null;return(0,s.jsx)(p.aF,{isOpen:e,title:"Edit Connection",onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:l.name,onChange:e=>n({...l,name:e.target.value}),placeholder:k?"Account name":"Production Key"}),k&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),k&&(0,s.jsx)(p.pd,{label:"Health Check (min)",type:"number",value:l.healthCheckInterval,onChange:e=>n({...l,healthCheckInterval:Math.max(0,Number.parseInt(e.target.value)||0)}),hint:"Proactive token refresh interval. 0 = disabled."}),(0,s.jsx)(p.pd,{label:"Priority",type:"number",value:l.priority,onChange:e=>n({...l,priority:Number.parseInt(e.target.value)||1})}),!k&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key",type:"password",value:l.apiKey,onChange:e=>n({...l,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:j,disabled:!l.apiKey||x||b,variant:"secondary",children:x?"Checking...":"Check"})})]}),f&&(0,s.jsx)(p.Ex,{variant:"success"===f?"success":"error",children:"success"===f?"Valid":"Invalid"})]}),!w&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(p.$n,{onClick:g,variant:"secondary",disabled:o,children:o?"Testing...":"Test Connection"}),c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.Ex,{variant:c.valid?"success":"error",children:c.valid?"Valid":"Failed"}),A&&(0,s.jsx)(p.Ex,{variant:A.variant,children:A.label})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:C,fullWidth:!0,disabled:b,children:b?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function A({isOpen:e,node:t,onSave:i,onClose:r,isAnthropic:l}){let[n,o]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,a.useState)(!1),[m,u]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[f,y]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&o({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 b=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){c(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};l||(e.apiType=n.apiType),await i(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:n.baseUrl,apiKey:m,type:l?"anthropic-compatible":"openai-compatible"})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{h(!1)}};return t?(0,s.jsx)(p.aF,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(p.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,s.jsx)(p.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,s.jsx)(p.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,s.jsx)(p.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.pd,{label:"API Key (for Check)",type:"password",value:m,onChange:e=>u(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(p.$n,{onClick:v,disabled:!m||x||!n.baseUrl.trim(),variant:"secondary",children:x?"Checking...":"Check"})})]}),f&&(0,s.jsx)(p.Ex,{variant:"success"===f?"success":"error",children:"success"===f?"Valid":"Invalid"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(p.$n,{onClick:b,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,s.jsx)(p.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}C.propTypes={connection:l().shape({id:l().string,name:l().string,email:l().string,displayName:l().string,rateLimitedUntil:l().string,rateLimitProtection:l().bool,testStatus:l().string,isActive:l().bool,priority:l().number,lastError:l().string,lastErrorType:l().string,lastErrorSource:l().string,errorCode:l().oneOfType([l().string,l().number]),globalPriority:l().number}).isRequired,isOAuth:l().bool.isRequired,isFirst:l().bool.isRequired,isLast:l().bool.isRequired,onMoveUp:l().func.isRequired,onMoveDown:l().func.isRequired,onToggleActive:l().func.isRequired,onToggleRateLimit:l().func.isRequired,onRetest:l().func.isRequired,isRetesting:l().bool,onEdit:l().func.isRequired,onDelete:l().func.isRequired,onReauth:l().func},k.propTypes={isOpen:l().bool.isRequired,provider:l().string,providerName:l().string,isCompatible:l().bool,isAnthropic:l().bool,onSave:l().func.isRequired,onClose:l().func.isRequired},w.propTypes={isOpen:l().bool.isRequired,connection:l().shape({id:l().string,name:l().string,email:l().string,priority:l().number,authType:l().string,provider:l().string}),onSave:l().func.isRequired,onClose:l().func.isRequired},A.propTypes={isOpen:l().bool.isRequired,node:l().shape({id:l().string,name:l().string,prefix:l().string,apiType:l().string,baseUrl:l().string}),onSave:l().func.isRequired,onClose:l().func.isRequired,isAnthropic:l().bool}}},e=>{e.O(0,[8500,9751,782,7013,5846,993,8441,3794,7358],()=>e(e.s=56411)),_N_E=e.O()}]);
|