omniroute 1.7.2 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ar.md +4 -0
- package/README.bg.md +4 -0
- package/README.da.md +4 -0
- package/README.de.md +13 -9
- package/README.es.md +13 -9
- package/README.fi.md +4 -0
- package/README.fr.md +13 -9
- package/README.he.md +29 -25
- package/README.hu.md +4 -0
- package/README.id.md +4 -0
- package/README.in.md +4 -0
- package/README.it.md +13 -9
- package/README.ja.md +4 -0
- package/README.ko.md +29 -25
- package/README.md +45 -0
- package/README.ms.md +4 -0
- package/README.nl.md +4 -0
- package/README.no.md +4 -0
- package/README.phi.md +4 -0
- package/README.pl.md +4 -0
- package/README.pt-BR.md +29 -25
- package/README.pt.md +4 -0
- package/README.ro.md +4 -0
- package/README.ru.md +13 -9
- package/README.sk.md +4 -0
- package/README.sv.md +4 -0
- package/README.th.md +16 -12
- package/README.uk-UA.md +4 -0
- package/README.vi.md +4 -0
- package/README.zh-CN.md +26 -22
- package/app/.env +122 -0
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +30 -28
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +1 -1
- package/app/.next/routes-manifest.json +12 -0
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +3 -3
- package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +4 -4
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +4 -4
- 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 +3 -3
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +2 -2
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js +1 -1
- package/app/.next/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/logout/route.js +1 -1
- package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/auth/status/route.js +1 -1
- package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/route.js +1 -1
- package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cache/stats/route.js +1 -1
- package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +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 +2 -2
- package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route.js +1 -1
- package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cli-tools/status/route.js +2 -2
- package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js +1 -1
- package/app/.next/server/app/api/cloud/auth/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route.js.nft.json +1 -1
- package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next/server/app/api/combos/[id]/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/route.js +1 -1
- package/app/.next/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/combos/test/route.js +1 -1
- package/app/.next/server/app/api/combos/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route.js +1 -1
- package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route.js +1 -1
- package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route.js +1 -1
- package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route.js +1 -1
- package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/db-backups/route.js +1 -1
- package/app/.next/server/app/api/db-backups/route.js.nft.json +1 -1
- package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route.js +1 -1
- package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/evals/route.js +1 -1
- package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/fallback/chains/route.js +2 -2
- package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/init/route.js +1 -1
- package/app/.next/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/keys/route.js +1 -1
- package/app/.next/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js +1 -1
- package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js +1 -1
- package/app/.next/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/availability/route.js +1 -1
- package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/models/catalog/route.js +2 -2
- package/app/.next/server/app/api/models/catalog/route.js.nft.json +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 +2 -2
- package/app/.next/server/app/api/models/route.js.nft.json +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.js.nft.json +1 -1
- package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
- package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/policies/route.js +2 -2
- package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
- package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/models/route.js +1 -1
- package/app/.next/server/app/api/pricing/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/pricing/route.js +1 -1
- package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-metrics/route.js +2 -2
- package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-models/route.js +1 -1
- package/app/.next/server/app/api/provider-models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/provider-nodes/route.js +2 -2
- package/app/.next/server/app/api/provider-nodes/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
- package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js +1 -1
- package/app/.next/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/route.js +2 -2
- package/app/.next/server/app/api/providers/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js +1 -1
- package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limit/route.js +1 -1
- package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js +1 -1
- package/app/.next/server/app/api/rate-limits/route.js.nft.json +1 -1
- package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route.js +1 -1
- package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/resilience/route.js +1 -1
- package/app/.next/server/app/api/resilience/route.js.nft.json +1 -1
- package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/restart/route.js +1 -1
- package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sessions/route.js +1 -1
- package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/background-degradation/route.js +1 -0
- package/app/.next/server/app/api/settings/background-degradation/route.js.nft.json +1 -0
- package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/settings/combo-defaults/route.js +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route.js +1 -1
- package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/model-aliases/route.js +1 -0
- package/app/.next/server/app/api/settings/model-aliases/route.js.nft.json +1 -0
- package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -0
- package/app/.next/server/app/api/settings/proxy/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route.js +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/route.js +1 -1
- package/app/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route.js +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route.js +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/shutdown/route.js +1 -1
- package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/storage/health/route.js +1 -1
- package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js +1 -1
- package/app/.next/server/app/api/sync/cloud/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js +1 -1
- package/app/.next/server/app/api/sync/initialize/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/tags/route.js +1 -1
- package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route.js +1 -1
- package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/token-health/route.js +1 -1
- package/app/.next/server/app/api/token-health/route.js.nft.json +1 -1
- package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/detect/route.js +1 -1
- package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/history/route.js +1 -1
- package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js +1 -1
- package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js +1 -1
- package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +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.js +1 -1
- package/app/.next/server/app/api/usage/analytics/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/budget/route.js +2 -2
- package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/call-logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js +1 -1
- package/app/.next/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js +1 -1
- package/app/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js +1 -1
- package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/models/route.js +2 -2
- package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js +1 -1
- package/app/.next/server/app/api/v1/moderations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/music/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js +1 -1
- package/app/.next/server/app/api/v1/rerank/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js +1 -1
- package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/route.js +1 -1
- package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/v1beta/models/route.js +2 -2
- package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs/page.js +3 -3
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page.js +2 -2
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page.js +2 -2
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page.js +2 -2
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page.js +2 -2
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +30 -28
- package/app/.next/server/chunks/1248.js +1 -1
- package/app/.next/server/chunks/1308.js +1 -1
- package/app/.next/server/chunks/1526.js +1 -1
- package/app/.next/server/chunks/1584.js +1 -1
- package/app/.next/server/chunks/1623.js +1 -1
- package/app/.next/server/chunks/1880.js +1 -1
- package/app/.next/server/chunks/1960.js +1 -1
- package/app/.next/server/chunks/1990.js +1 -1
- package/app/.next/server/chunks/2180.js +1 -1
- package/app/.next/server/chunks/2214.js +1 -1
- package/app/.next/server/chunks/2372.js +1 -1
- package/app/.next/server/chunks/2594.js +1 -1
- package/app/.next/server/chunks/2767.js +1 -1
- package/app/.next/server/chunks/2901.js +2 -2
- package/app/.next/server/chunks/2910.js +1 -1
- package/app/.next/server/chunks/3371.js +1 -1
- package/app/.next/server/chunks/3447.js +1 -1
- package/app/.next/server/chunks/3498.js +1 -1
- package/app/.next/server/chunks/3596.js +1 -1
- package/app/.next/server/chunks/3801.js +2 -0
- package/app/.next/server/chunks/3911.js +1 -1
- package/app/.next/server/chunks/4488.js +1 -1
- package/app/.next/server/chunks/4568.js +1 -1
- package/app/.next/server/chunks/496.js +1 -1
- package/app/.next/server/chunks/5047.js +1 -1
- package/app/.next/server/chunks/5094.js +1 -1
- package/app/.next/server/chunks/5097.js +1 -1
- package/app/.next/server/chunks/5521.js +1 -1
- package/app/.next/server/chunks/5945.js +1 -1
- package/app/.next/server/chunks/6118.js +1 -1
- package/app/.next/server/chunks/6930.js +1 -1
- package/app/.next/server/chunks/7011.js +1 -1
- package/app/.next/server/chunks/708.js +1 -1
- package/app/.next/server/chunks/7109.js +1 -1
- package/app/.next/server/chunks/7230.js +2 -2
- package/app/.next/server/chunks/7650.js +1 -1
- package/app/.next/server/chunks/8020.js +3 -3
- package/app/.next/server/chunks/8220.js +1 -1
- package/app/.next/server/chunks/8464.js +1 -1
- package/app/.next/server/chunks/8706.js +1 -1
- package/app/.next/server/chunks/8976.js +1 -1
- package/app/.next/server/chunks/9119.js +1 -1
- package/app/.next/server/chunks/944.js +1 -1
- package/app/.next/server/chunks/9548.js +1 -0
- package/app/.next/server/chunks/9679.js +1 -0
- package/app/.next/server/chunks/9824.js +2 -2
- package/app/.next/server/chunks/9837.js +1 -1
- package/app/.next/server/middleware-build-manifest.js +1 -1
- package/app/.next/server/middleware.js +3 -3
- package/app/.next/server/next-font-manifest.js +1 -1
- package/app/.next/server/next-font-manifest.json +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/a624rqqXG_QtNPqv8ZMWa/_buildManifest.js +1 -0
- package/app/.next/static/chunks/5846-1dad4fadf761e0d8.js +2 -0
- package/app/.next/static/chunks/{993-035473765d7d1871.js → 993-9f36b0b069ca090e.js} +2 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-ce5214cdf489c9df.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/{page-52f76c7c91444ec2.js → page-20786f2c7fdbab57.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-12d772841a253032.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-c9b98846b8479f3f.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-5e34630a5dc32825.js +15 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-3dce7fccfcf177dd.js → page-85a3e6a423aceded.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/costs/{page-3ed2a7685adf9b91.js → page-cdb8071441476da9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-588b8bc3c4e631e0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/health/{page-9a6519bf1468f16e.js → page-b480b3cb318782d7.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-0ae1d6cc5fc4671f.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/logs/{page-833d24f322a20f5a.js → page-ffdc1dcf074c7528.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-72b768421394b42c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/onboarding/{page-d424641c7e428be9.js → page-5378e9473a20cd6a.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-5c87e49261a22fd5.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-b38f2d03bae8166a.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{error-2f0177a2197dd556.js → error-f0730d6d62d02e82.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{loading-99ab4d478260d53b.js → loading-59cbccd6d5185ca9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-a7fb36872be60fe0.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-1f022385b812b987.js → page-40dc5ac82df708e9.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{error-e844916e39172c8b.js → error-cc85c3ff1f63aea6.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/{loading-bb068659ee679ff4.js → loading-19fc771a287bcb4c.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-1550a2460948273c.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/{page-f10a8d4bb8236913.js → page-cbe9b21b62bbc2bd.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-83b07523f81d6282.js → page-534e13a69cb60a4f.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/{page-9cc99ab874fc36e7.js → page-86a076d820931a30.js} +1 -1
- package/app/.next/static/chunks/app/(dashboard)/{layout-00d5d56af65098a9.js → layout-16302e54f9ef3d0e.js} +1 -1
- package/app/.next/static/chunks/app/_global-error/page-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/_not-found/page-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/auth/login/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/auth/logout/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/auth/status/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cache/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cache/stats/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/backups/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cli-tools/status/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/auth/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/combos/[id]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/combos/metrics/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/combos/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/combos/test/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/compliance/audit-log/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/db-backups/export/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/db-backups/exportAll/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/db-backups/import/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/db-backups/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/evals/[suiteId]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/evals/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/fallback/chains/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/init/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/keys/[id]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/keys/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/logs/console/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/models/alias/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/models/availability/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/models/catalog/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/models/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/monitoring/health/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/policies/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/defaults/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/models/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/pricing/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/provider-metrics/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/provider-models/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/providers/client/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/providers/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/providers/test-batch/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/providers/validate/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/rate-limit/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/rate-limits/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/resilience/reset/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/resilience/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/restart/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/sessions/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/background-degradation/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/combo-defaults/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/ip-filter/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/model-aliases/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/proxy/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/proxy/test/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/require-login/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/system-prompt/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/settings/thinking-budget/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/shutdown/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/storage/health/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/sync/cloud/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/sync/initialize/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/tags/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/telemetry/summary/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/token-health/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/translator/detect/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/translator/history/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/translator/load/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/translator/save/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/translator/send/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/translator/translate/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/analytics/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/budget/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/call-logs/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/history/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/logs/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/proxy-logs/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/usage/request-logs/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/api/chat/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/embeddings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/images/generations/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/messages/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/models/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/moderations/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/music/generations/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/rerank/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/responses/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1/videos/generations/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/api/v1beta/models/route-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/callback/{page-585a53f7dc6a30f1.js → page-0f0ebc0820dd18a5.js} +1 -1
- package/app/.next/static/chunks/app/docs/{page-2fe9dcbeb3f738c0.js → page-3658b3f15df3a19e.js} +1 -1
- package/app/.next/static/chunks/app/{error-0d59fc4efafbc38c.js → error-f918d9961a2368d3.js} +1 -1
- package/app/.next/static/chunks/app/forbidden/page-77657dfa95e61cd8.js +1 -0
- package/app/.next/static/chunks/app/forgot-password/page-be3bacc125c30a6b.js +1 -0
- package/app/.next/static/chunks/app/global-error-504ff9093e2a997d.js +1 -0
- package/app/.next/static/chunks/app/landing/page-75b0c988db383cfc.js +1 -0
- package/app/.next/static/chunks/app/{layout-108592eafb959363.js → layout-070972eb026af319.js} +1 -1
- package/app/.next/static/chunks/app/login/{page-121c612ee459e7c2.js → page-6c769465e407368f.js} +1 -1
- package/app/.next/static/chunks/app/not-found-11b712c853d93172.js +1 -0
- package/app/.next/static/chunks/app/page-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/app/privacy/{page-2fe9dcbeb3f738c0.js → page-3658b3f15df3a19e.js} +1 -1
- package/app/.next/static/chunks/app/terms/{page-2fe9dcbeb3f738c0.js → page-3658b3f15df3a19e.js} +1 -1
- package/app/.next/static/chunks/{main-app-c9da11a8061df107.js → main-app-ae230f6bf51a5edb.js} +1 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-6301a4ed902b878a.js +1 -0
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6301a4ed902b878a.js +1 -0
- package/app/.next/static/css/bcd1741aee9d39ab.css +1 -0
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/package.json +1 -1
- package/app/.next/server/chunks/5248.js +0 -1
- package/app/.next/server/chunks/5393.js +0 -2
- package/app/.next/static/chunks/5846-9e0f1f3afcbfb08c.js +0 -2
- package/app/.next/static/chunks/app/(dashboard)/dashboard/analytics/loading-6f1750506292c630.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/api-manager/page-1dd4d0c348a7b0a6.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/audit-log/page-e5bf8955e7b9a4f5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-77ab26722f5c56c7.js +0 -15
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-1420c3ca376f1585.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/limits/page-f4a2d6d07df5ddc4.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media/page-1d0ca9b5d3eaf7cd.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-388840686801f3f5.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9c8ffb212f855704.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/page-31cdb6e15134d8c2.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-1393d4935fc087cf.js +0 -1
- package/app/.next/static/chunks/app/_global-error/page-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/_not-found/page-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/auth/login/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/auth/logout/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/auth/status/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cache/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cache/stats/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/backups/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cli-tools/status/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/auth/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/credentials/update/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/model/resolve/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/cloud/models/alias/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/combos/[id]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/combos/metrics/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/combos/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/combos/test/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/compliance/audit-log/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/db-backups/export/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/db-backups/exportAll/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/db-backups/import/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/db-backups/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/evals/[suiteId]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/evals/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/fallback/chains/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/init/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/keys/[id]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/keys/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/logs/console/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/models/alias/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/models/availability/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/models/catalog/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/models/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/monitoring/health/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/cursor/import/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/import/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/policies/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/defaults/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/models/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/pricing/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/provider-metrics/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/provider-models/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/provider-nodes/validate/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/models/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/providers/[id]/test/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/providers/client/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/providers/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/providers/test-batch/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/providers/validate/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/rate-limit/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/rate-limits/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/resilience/reset/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/resilience/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/restart/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/sessions/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/combo-defaults/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/ip-filter/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/proxy/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/proxy/test/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/require-login/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/system-prompt/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/settings/thinking-budget/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/shutdown/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/storage/health/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/sync/cloud/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/sync/initialize/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/tags/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/telemetry/summary/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/token-health/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/translator/detect/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/translator/history/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/translator/load/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/translator/save/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/translator/send/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/translator/translate/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/[connectionId]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/analytics/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/budget/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/call-logs/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/history/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/logs/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/proxy-logs/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/usage/request-logs/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/api/chat/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/speech/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/chat/completions/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/embeddings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/images/generations/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/messages/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/models/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/moderations/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/music/generations/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/rerank/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/responses/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1/videos/generations/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/api/v1beta/models/route-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/app/forbidden/page-df886dfa2d5bd9fa.js +0 -1
- package/app/.next/static/chunks/app/forgot-password/page-2a495f0b0c653ab4.js +0 -1
- package/app/.next/static/chunks/app/global-error-41eef2a698918fc1.js +0 -1
- package/app/.next/static/chunks/app/landing/page-9d540ab1716f8e3e.js +0 -1
- package/app/.next/static/chunks/app/not-found-1dbd8c3e506fe00f.js +0 -1
- package/app/.next/static/chunks/app/page-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cab2fb7f592d3c36.js +0 -1
- package/app/.next/static/css/b77490a14619ffbb.css +0 -1
- package/app/.next/static/ozfkuTtQLl3_rnlOdkSZi/_buildManifest.js +0 -1
- /package/app/.next/static/{ozfkuTtQLl3_rnlOdkSZi → a624rqqXG_QtNPqv8ZMWa}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{3612:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>Z});var a=s(95155),l=s(12115),r=s(73321),i=s(67040),n=s(52529),d=s(50910),c=s(40993),o=s(33418);function m(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,n]=(0,l.useState)(!1),[m,x]=(0,l.useState)({type:"",message:""}),[u,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[j,y]=(0,l.useState)({type:"",message:""}),[v,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)({type:"",message:""}),[D,P]=(0,l.useState)(!1),[T,$]=(0,l.useState)(null),A=(0,l.useRef)(null),L=(0,o.Ym)(),M=(0,d.c)("settings"),E=(0,d.c)("common"),[O,K]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),_=async()=>{r(!0);try{let e=await fetch("/api/db-backups"),s=await e.json();t(s.backups||[])}catch(e){console.error("Failed to fetch backups:",e)}finally{r(!1)}},B=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();K(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},F=async()=>{f(!0),y({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?y({type:"success",message:M("backupCreated",{file:t.filename})}):y({type:"info",message:t.message||M("noChangesSinceBackup")}),await B(),i&&await _()):y({type:"error",message:t.error||M("backupFailed")})}catch{y({type:"error",message:M("errorOccurred")})}finally{f(!1)}},z=async e=>{h(e),x({type:"",message:""});try{let t=await fetch("/api/db-backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupId:e})}),s=await t.json();t.ok?(x({type:"success",message:M("restoreSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await _(),await B()):x({type:"error",message:s.error||M("restoreFailed")})}catch{x({type:"error",message:M("errorDuringRestore")})}finally{h(null),b(null)}};(0,l.useEffect)(()=>{B()},[]);let R=async()=>{N(!0);try{let e=await fetch("/api/db-backups/export");if(!e.ok){let t=await e.json();throw Error(t.error||M("exportFailed"))}let t=await e.blob(),s=URL.createObjectURL(t),a=(e.headers.get("Content-Disposition")||"").match(/filename="(.+)"/),l=a?a[1]:`omniroute-backup-${new Date().toISOString().replace(/[:.]/g,"-")}.sqlite`,r=document.createElement("a");r.href=s,r.download=l,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}catch(e){console.error("Export failed:",e),S({type:"error",message:M("exportFailedWithError",{error:e.message})})}finally{N(!1)}},I=async()=>{if(T){w(!0),S({type:"",message:""}),P(!1);try{let e=new FormData;e.append("file",T);let t=await fetch("/api/db-backups/import",{method:"POST",body:e}),s=await t.json();t.ok?(S({type:"success",message:M("importSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await B(),i&&await _()):S({type:"error",message:s.error||M("importFailed")})}catch{S({type:"error",message:M("errorDuringImport")})}finally{w(!1),$(null)}}},q=e=>e&&0!==e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"0 B";return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:M("systemStorage")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:M("allDataLocal")})]}),(0,a.jsx)(c.Ex,{variant:"success",size:"sm",children:O.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databasePath")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:O.dbPath||"~/.omniroute/storage.sqlite"})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databaseSize")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:q(O.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:R,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"download"}),M("exportDatabase")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:async()=>{N(!0);try{let e=await fetch("/api/db-backups/exportAll");if(!e.ok)throw Error(M("exportFailed"));let t=await e.blob(),s=(e.headers.get("Content-Disposition")||"").match(/filename="?([^"]+)"?/),a=s?.[1]||"omniroute-full-backup.tar.gz",l=URL.createObjectURL(t),r=document.createElement("a");r.href=l,r.download=a,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)}catch(e){S({type:"error",message:M("fullExportFailedWithError",{error:e.message})})}finally{N(!1)}},loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"folder_zip"}),M("exportAll")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>{A.current?.click()},loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"upload"}),M("importDatabase")]}),(0,a.jsx)("input",{ref:A,type:"file",accept:".sqlite",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(t){if(!t.name.endsWith(".sqlite"))return void S({type:"error",message:M("invalidFileType")});$(t),P(!0),A.current&&(A.current.value="")}}})]}),D&&T&&(0,a.jsx)("div",{className:"p-4 rounded-lg mb-4 bg-amber-500/10 border border-amber-500/30",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-amber-500 mt-0.5","aria-hidden":"true",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-500 mb-1",children:M("confirmDbImport")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:M("confirmDbImportDesc",{file:T.name})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:I,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yesImport")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{P(!1),$(null)},children:E("cancel")})]})]})]})}),C.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===C.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===C.type?"check_circle":"error"}),C.message]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"schedule"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:M("lastBackup")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:O.lastBackupAt?`${new Date(O.lastBackupAt).toLocaleString(L)} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/6e4);if(t<1)return M("justNow");if(t<60)return M("minutesAgo",{count:t});let s=Math.floor(t/60);return s<24?M("hoursAgo",{count:s}):M("daysAgo",{count:Math.floor(s/24)})})(O.lastBackupAt)})`:M("noBackupYet")})]})]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:F,loading:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),M("backupNow")]})]}),j.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===j.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===j.type?"bg-blue-500/10 text-blue-500 border border-blue-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===j.type?"check_circle":"info"===j.type?"info":"error"}),j.message]})}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500","aria-hidden":"true",children:"restore"}),(0,a.jsx)("p",{className:"font-medium",children:M("backupRestore")})]}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{n(!i),i||0!==e.length||_()},children:i?M("hide"):M("viewBackups")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:M("backupRetentionDesc")}),m.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===m.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===m.type?"check_circle":"error"}),m.message]})}),i&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px] mr-2","aria-hidden":"true",children:"progress_activity"}),M("loadingBackups")]}):0===e.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"folder_off"}),M("noBackupsYet")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:M("backupsAvailable",{count:e.length})}),(0,a.jsxs)("button",{onClick:_,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"}),M("refresh")]})]}),e.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-border/50 hover:border-border transition-colors",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"description"}),(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:new Date(e.createdAt).toLocaleString(L)}),(0,a.jsx)(c.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:"manual"===(t=e.reason)?M("backupReasonManual"):"pre-restore"===t?M("backupReasonPreRestore"):t})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsx)("span",{children:M("connectionsCount",{count:e.connectionCount})}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:q(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:p===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:M("confirm")}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:()=>z(e.id),loading:u===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yes")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(null),children:M("no")})]}):(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),M("restore")]})})]},e.id)})]})})]})]})}var x=s(20909);let u=[{value:"disabled",labelKey:"ipModeDisabled",icon:"block"},{value:"blacklist",labelKey:"ipModeBlacklist",icon:"do_not_disturb"},{value:"whitelist",labelKey:"ipModeWhitelist",icon:"verified_user"},{value:"whitelist-priority",labelKey:"ipModeWhitelistPriority",icon:"priority_high"}];function h(){let[e,t]=(0,l.useState)({enabled:!1,mode:"blacklist",blacklist:[],whitelist:[],tempBans:[]}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)("blacklist"),x=(0,d.c)("settings");(0,l.useEffect)(()=>{h()},[]);let h=async()=>{try{let e=await fetch("/api/settings/ip-filter");e.ok&&t(await e.json())}catch{}finally{r(!1)}},p=async e=>{try{let s=await fetch("/api/settings/ip-filter",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});s.ok&&t(await s.json())}catch{}},b=()=>{i.trim()&&(p({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),n(""))},g=(e,t)=>{p({["blacklist"===t?"removeBlacklist":"removeWhitelist"]:e})},f=e.enabled?e.mode:"disabled";return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-red-500/10 text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"security"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("ipAccessControl")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("ipAccessControlDesc")})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2 mb-5",children:u.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;"disabled"===(t=e.value)?p({enabled:!1}):p({enabled:!0,mode:t})},disabled:s,className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border text-center transition-all ${f===e.value?"border-red-500/50 bg-red-500/5 ring-1 ring-red-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] ${f===e.value?"text-red-400":"text-text-muted"}`,children:e.icon}),(0,a.jsx)("span",{className:`text-xs font-medium ${f===e.value?"text-red-400":"text-text-muted"}`,children:x(e.labelKey)})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:x("addIpAddress"),placeholder:x("ipAddressPlaceholder"),value:i,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&b()})}),(0,a.jsxs)("div",{className:"flex gap-1 pb-[2px]",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&b()},children:x("block")}),(0,a.jsx)(c.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&b()},children:x("allow")})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("blocked",{count:e.blacklist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.blacklist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-red-500/10 text-red-400 border border-red-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"blacklist"),className:"hover:text-red-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.whitelist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("allowed",{count:e.whitelist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.whitelist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"whitelist"),className:"hover:text-emerald-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.tempBans.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("temporaryBans",{count:e.tempBans.length})}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.tempBans.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400 shrink-0",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted truncate",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted tabular-nums",children:x("minLeft",{min:Math.ceil(e.remainingMs/6e4)})}),(0,a.jsx)("button",{onClick:()=>p({removeBan:e.ip}),className:"text-text-muted hover:text-orange-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]},e.ip))})]})]})]})}function p(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),i=(0,d.c)("settings");(0,l.useEffect)(()=>{let e=!1;return async function(){let s=sessionStorage.getItem("omniroute_login_time"),a=Date.now(),l=i("unknown");if(s){let e=a-parseInt(s,10),t=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4);l=t>0?`${t}h ${r}m`:`${r}m`}let n=!1;try{let e=await fetch("/api/auth/status",{method:"GET",cache:"no-store"});if(e.ok){let t=await e.json();n=!0===t.authenticated}}catch{}e||(t({authenticated:n,loginTime:s?new Date(parseInt(s,10)).toLocaleString():null,sessionAge:l,ipAddress:"—",userAgent:navigator.userAgent.split(" ").slice(-2).join(" ")||i("unknown")}),r(!1))}(),()=>{e=!0}},[]);let n=async()=>{try{await fetch("/api/auth/logout",{method:"POST"}),sessionStorage.removeItem("omniroute_login_time"),window.location.href="/"}catch{window.location.href="/"}};return s?(0,a.jsx)(c.Zp,{children:(0,a.jsx)("div",{className:"animate-pulse h-32 bg-black/5 dark:bg-white/5 rounded-lg"})}):(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"person"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:i("session")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",role:"list","aria-label":i("sessionDetailsAria"),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("status")}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:`w-2 h-2 rounded-full ${e?.authenticated?"bg-green-500":"bg-yellow-500"}`,"aria-hidden":"true"}),e?.authenticated?i("authenticated"):i("guest")]})]}),e?.loginTime&&(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("loginTime")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e.loginTime})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("sessionAge")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e?.sessionAge})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("browser")}),(0,a.jsx)("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e?.userAgent})]})]}),(0,a.jsxs)("div",{className:"flex gap-3 mt-4 pt-4 border-t border-border/50",children:[(0,a.jsx)(c.$n,{variant:"secondary",onClick:()=>{confirm(i("clearLocalDataConfirm"))&&(localStorage.clear(),sessionStorage.clear(),window.location.reload())},children:i("clearLocalData")}),e?.authenticated&&(0,a.jsx)(c.$n,{variant:"danger",onClick:n,children:i("logout")})]})]})}function b(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)({current:"",new:"",confirm:""}),[o,m]=(0,l.useState)({type:"",message:""}),[u,b]=(0,l.useState)(!1),g=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let f=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&t(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},j=async(e,s)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:s})})).ok&&t(t=>({...t,[e]:s}))}catch(t){console.error(`Failed to update ${e}:`,t)}},y=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:g("passwordsNoMatch")});b(!0),m({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:i.current,newPassword:i.new})}),t=await e.json();e.ok?(m({type:"success",message:g("passwordUpdated")}),n({current:"",new:"",confirm:""})):m({type:"error",message:t.error||g("failedUpdatePassword")})}catch{m({type:"error",message:g("errorOccurred")})}finally{b(!1)}},v=e.blockedProviders||[];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("security")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:g("requireLogin")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireLoginDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireLogin,onChange:()=>f(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(c.pd,{label:g("currentPassword"),type:"password",placeholder:g("enterCurrentPassword"),value:i.current,onChange:e=>n({...i,current:e.target.value}),required:!0}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)(c.pd,{label:g("newPassword"),type:"password",placeholder:g("enterNewPassword"),value:i.new,onChange:e=>n({...i,new:e.target.value}),required:!0}),(0,a.jsx)(c.pd,{label:g("confirmPassword"),type:"password",placeholder:g("confirmPasswordPlaceholder"),value:i.confirm,onChange:e=>n({...i,confirm:e.target.value}),required:!0})]}),o.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===o.type?"text-red-500":"text-green-500"}`,children:o.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(c.$n,{type:"submit",variant:"primary",loading:u,children:e.hasPassword?g("updatePassword"):g("setPassword")})})]})]})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"api"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("apiEndpointProtection")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:g("requireAuthModels")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireAuthModelsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireAuthForModels,onChange:()=>j("requireAuthForModels",!e.requireAuthForModels),disabled:s})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"font-medium",children:g("blockedProviders")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("blockedProvidersDesc")})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.values(x.Q2).map(t=>{let l=v.includes(t.id);return(0,a.jsxs)("button",{onClick:()=>{var s;let a;return s=t.id,void j("blockedProviders",(a=e.blockedProviders||[]).includes(s)?a.filter(e=>e!==s):[...a,s])},disabled:s,className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all border ${l?"bg-red-500/10 border-red-500/30 text-red-600 dark:text-red-400":"bg-black/[0.02] dark:bg-white/[0.02] border-transparent text-text-muted hover:bg-black/[0.05] dark:hover:bg-white/[0.05]"}`,title:l?g("unblockProviderTitle",{provider:t.name}):g("blockProviderTitle",{provider:t.name}),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:l?void 0:t.color},children:l?"block":t.icon}),t.name,l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] text-red-500",children:"close"})]},t.id)})}),v.length>0&&(0,a.jsxs)("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),g("providersBlocked",{count:v.length})]})]})]})]}),(0,a.jsx)(p,{}),(0,a.jsx)(h,{})]})}var g=s(67671);let f=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function j(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(!1),b=(0,g.i)(),j=(0,d.c)("settings"),y=(0,d.c)("common"),v=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/fallback/chains");if(e.ok){let s=await e.json();t(s.chains||s||{})}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{v()},[v]);let N=async()=>{if(!o.trim()||!x.trim())return void b.warning(j("fillModelAndProviders"));let e=x.split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({provider:e,priority:t+1,enabled:!0}));if(0===e.length)return void b.warning(j("addAtLeastOneProvider"));p(!0);try{(await fetch("/api/fallback/chains",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.trim(),chain:e})})).ok?(b.success(j("chainCreated",{model:o.trim()})),m(""),u(""),n(!1),await v()):b.error(j("failedCreateChain"))}catch{b.error(j("failedCreateChain"))}finally{p(!1)}},k=async e=>{if(confirm(j("deleteChainConfirm",{model:e})))try{(await fetch("/api/fallback/chains",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})})).ok?(b.success(j("chainDeleted",{model:e})),await v()):b.error(j("failedDeleteChain"))}catch{b.error(j("failedDeleteChain"))}};if(s)return(0,a.jsx)(c.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"}),j("loadingFallbackChains")]})});let w=Object.entries(e);return(0,a.jsxs)(c.Zp,{className:"mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4 p-6 pb-0",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:j("fallbackChainsTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j("fallbackChainsDesc")})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:()=>n(!i),children:i?y("cancel"):j("addChain")})]}),i&&(0,a.jsxs)("div",{className:"mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-3",children:[(0,a.jsx)(c.pd,{label:j("modelName"),placeholder:j("modelNamePlaceholder"),value:o,onChange:e=>m(e.target.value)}),(0,a.jsx)(c.pd,{label:j("providersCommaSeparated"),placeholder:j("providersCommaSeparatedPlaceholder"),value:x,onChange:e=>u(e.target.value)})]}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:N,loading:h,children:j("createChain")})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===w.length?(0,a.jsx)(c.pp,{icon:"timeline",title:j("noFallbackChains"),description:j("noFallbackChainsDesc")}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:w.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 rounded-lg border border-border/20 bg-surface/20 hover:bg-surface/40 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-text-main truncate max-w-[200px]",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("div",{className:"flex gap-1.5 flex-wrap",children:(Array.isArray(t)?t:[]).map((e,t)=>(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:`${f[t%f.length]}20`,color:f[t%f.length],border:`1px solid ${f[t%f.length]}40`},children:[t+1,". ",e.provider]},`${e.provider}-${t}`))})]}),(0,a.jsx)("button",{onClick:()=>k(e),className:"text-text-muted hover:text-red-400 transition-colors ml-2",title:j("deleteChain"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let y=[{value:"fill-first",labelKey:"fillFirst",descKey:"fillFirstDesc",icon:"vertical_align_top"},{value:"round-robin",labelKey:"roundRobin",descKey:"roundRobinDesc",icon:"loop"},{value:"p2c",labelKey:"p2c",descKey:"p2cDesc",icon:"balance"},{value:"random",labelKey:"random",descKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",descKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",descKey:"costOptDesc",icon:"savings"}];function v(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)([]),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),h=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),n(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let p=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&t(t=>({...t,...e}))}catch(e){console.error("Failed to update settings:",e)}},b=async()=>{if(!o.trim()||!x.trim())return;let e=[...i,{pattern:o.trim(),target:x.trim()}];await p({wildcardAliases:e}),n(e),m(""),u("")},g=async e=>{let t=i.filter((t,s)=>s!==e);await p({wildcardAliases:t}),n(t)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("routingStrategy")})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-2 mb-4",style:{gridAutoRows:"1fr"},children:y.map(t=>(0,a.jsxs)("button",{onClick:()=>p({fallbackStrategy:t.value}),disabled:s,className:`flex flex-col items-center gap-2 p-4 rounded-lg border text-center transition-all ${e.fallbackStrategy===t.value?"border-blue-500/50 bg-blue-500/5 ring-1 ring-blue-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${e.fallbackStrategy===t.value?"text-blue-400":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.fallbackStrategy===t.value?"text-blue-400":""}`,children:h(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:h(t.descKey)})]})]},t.value))}),"round-robin"===e.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-border/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:h("stickyLimit")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:h("stickyLimitDesc")})]}),(0,a.jsx)(c.pd,{type:"number",min:"1",max:"10",value:e.stickyRoundRobinLimit||3,onChange:e=>p({stickyRoundRobinLimit:parseInt(e.target.value)}),disabled:s,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:h({"fill-first":"fillFirstDesc","round-robin":"roundRobinDesc",p2c:"p2cDesc",random:"randomDesc","least-used":"leastUsedDesc","cost-optimized":"costOptDesc"}[e.fallbackStrategy]||"fillFirstDesc")})]}),(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"alt_route"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("modelAliases")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:h("modelAliasesDesc")})]})]}),i.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-1.5 mb-4",children:i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400 break-all",children:e.pattern}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("span",{className:"font-mono text-text-main break-all",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>g(t),className:"shrink-0 text-text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("pattern"),placeholder:h("aliasPatternPlaceholder"),value:o,onChange:e=>m(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("targetModel"),placeholder:h("aliasTargetPlaceholder"),value:x,onChange:e=>u(e.target.value)})}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:b,className:"mb-[2px] sm:w-auto w-full",children:h("add")})]})]}),(0,a.jsx)(j,{})]})}function N(){let[e,t]=(0,l.useState)({strategy:"priority",maxRetries:1,retryDelayMs:2e3,timeoutMs:12e4,healthCheckEnabled:!0,healthCheckTimeoutMs:3e3,maxComboDepth:3,trackMetrics:!0}),[s,r]=(0,l.useState)({}),[n,o]=(0,l.useState)(""),[m,x]=(0,l.useState)(!1),u=(0,d.c)("settings"),h=(0,d.c)("common"),p=[{value:"priority",label:u("priority"),icon:"sort"},{value:"weighted",label:u("weighted"),icon:"percent"},{value:"round-robin",label:u("roundRobin"),icon:"autorenew"},{value:"random",label:u("random"),icon:"shuffle"},{value:"least-used",label:u("leastUsed"),icon:"low_priority"},{value:"cost-optimized",label:u("costOpt"),icon:"savings"}],b=[{key:"maxRetries",label:u("maxRetriesLabel"),min:0,max:5},{key:"retryDelayMs",label:u("retryDelayLabel"),min:500,max:1e4,step:500},{key:"timeoutMs",label:u("timeoutLabel"),min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:u("maxNestingDepth"),min:1,max:10}];(0,l.useEffect)(()=>{fetch("/api/settings/combo-defaults").then(e=>e.json()).then(e=>{e.comboDefaults&&t(e.comboDefaults),e.providerOverrides&&r(e.providerOverrides)}).catch(e=>console.error("Failed to fetch combo defaults:",e))},[]);let g=async()=>{x(!0);try{await fetch("/api/settings/combo-defaults",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboDefaults:e,providerOverrides:s})})}catch(e){console.error("Failed to save combo defaults:",e)}finally{x(!1)}},f=()=>{let e=n.trim().toLowerCase();e&&!s[e]&&(r(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),o(""))};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"tune"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:u("comboDefaultsTitle")}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:u("globalComboConfig")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("defaultStrategy")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("defaultStrategyDesc")})]}),(0,a.jsx)("div",{role:"tablist","aria-label":u("comboStrategyAria"),className:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",children:p.map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e.strategy===s.value,onClick:()=>t(e=>({...e,strategy:s.value})),className:(0,i.cn)("px-2 py-1 rounded text-xs font-medium transition-all flex items-center justify-center gap-0.5",e.strategy===s.value?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:s.icon}),s.label]},s.value))})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:b.map(({key:s,label:l,min:r,max:i,step:n})=>(0,a.jsx)(c.pd,{label:l,type:"number",min:r,max:i,step:n||1,value:e[s]??"",onChange:e=>t(t=>({...t,[s]:parseInt(e.target.value)||0})),className:"text-sm"},s))}),"round-robin"===e.strategy&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[(0,a.jsx)(c.pd,{label:u("concurrencyPerModel"),type:"number",min:1,max:20,value:e.concurrencyPerModel??"",placeholder:"3",onChange:e=>t(t=>({...t,concurrencyPerModel:parseInt(e.target.value)||0})),className:"text-sm"}),(0,a.jsx)(c.pd,{label:u("queueTimeout"),type:"number",min:1e3,max:12e4,step:1e3,value:e.queueTimeoutMs??"",placeholder:"30000",onChange:e=>t(t=>({...t,queueTimeoutMs:parseInt(e.target.value)||0})),className:"text-sm"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("healthCheck")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("healthCheckDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.healthCheckEnabled,onChange:()=>t(e=>({...e,healthCheckEnabled:!e.healthCheckEnabled}))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("trackMetrics")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("trackMetricsDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.trackMetrics,onChange:()=>t(e=>({...e,trackMetrics:!e.trackMetrics}))})]})]}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsx)("p",{className:"font-medium text-sm mb-2",children:u("providerOverrides")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:u("providerOverridesDesc")}),Object.entries(s).map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs font-mono font-medium min-w-[80px]",children:e}),(0,a.jsx)(c.pd,{type:"number",min:"0",max:"5",value:t.maxRetries??1,onChange:t=>r(s=>({...s,[e]:{...s[e],maxRetries:parseInt(t.target.value)||0}})),className:"text-xs w-16","aria-label":u("providerMaxRetriesAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("retries")}),(0,a.jsx)(c.pd,{type:"number",min:"5000",max:"300000",step:"5000",value:t.timeoutMs??12e4,onChange:t=>r(s=>({...s,[e]:{...s[e],timeoutMs:parseInt(t.target.value)||12e4}})),className:"text-xs w-24","aria-label":u("providerTimeoutAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("ms")}),(0,a.jsx)("button",{onClick:()=>{r(t=>{let s={...t};return delete s[e],s})},className:"ml-auto text-red-400 hover:text-red-500 transition-colors","aria-label":u("removeProviderOverrideAria",{provider:e}),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]},e)),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)(c.pd,{type:"text",placeholder:u("newProviderNamePlaceholder"),value:n,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),className:"text-xs flex-1","aria-label":u("newProviderNameAria")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:f,disabled:!n.trim(),children:h("add")})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:g,loading:m,children:u("saveComboDefaults")})})]})]})}function k(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),n=(0,d.c)("settings"),o=(0,d.c)("common"),m=async()=>{try{let e=await fetch("/api/settings/proxy?level=global");if(e.ok){let t=await e.json();r(t.proxy||null)}}catch{}};return(0,l.useEffect)(()=>(i.current=!0,async function(){try{let e=await fetch("/api/settings/proxy?level=global");if(!i.current)return;if(e.ok){let t=await e.json();i.current&&r(t.proxy||null)}}catch{}}(),()=>{i.current=!1}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"vpn_lock"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:n("globalProxy")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:n("globalProxyDesc")}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded text-xs font-bold uppercase bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:[s.type,"://",s.host,":",s.port]})}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:n("noGlobalProxy")}),(0,a.jsx)(c.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{m(),t(!0)},children:s?o("edit"):n("configure")})]})]})}),(0,a.jsx)(c.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:n("globalLabel"),onSaved:m})]})}var w=s(97550);function C(){let{theme:e,setTheme:t,isDark:s}=(0,w.D)(),r=(0,d.c)("settings"),[n,o]=(0,l.useState)({}),[m,x]=(0,l.useState)(!0),u={light:r("themeLight"),dark:r("themeDark"),system:r("themeSystem")};(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>{if(!e.ok)throw Error(`HTTP error ${e.status}`);return e.json()}).then(e=>{o(e),x(!1)}).catch(()=>x(!1))},[]);let h=async(e,t)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})})).ok&&o(s=>({...s,[e]:t}))}catch(t){console.error(`Failed to update ${e}:`,t)}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:r("appearance")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:r("darkMode")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:r("switchThemes")})]}),(0,a.jsx)(c.lM,{checked:s,onChange:()=>t(s?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{role:"tablist","aria-label":r("themeSelectionAria"),className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s,onClick:()=>t(s),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{children:u[s]||s})]},s))})}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:r("hideHealthLogs")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:r("hideHealthLogsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===n.hideHealthCheckLogs,onChange:()=>h("hideHealthCheckLogs",!n.hideHealthCheckLogs),disabled:m})]})})]})]})}let S=[{value:"passthrough",labelKey:"passthrough",descKey:"passthroughDesc",icon:"arrow_forward"},{value:"auto",labelKey:"auto",descKey:"autoDesc",icon:"auto_awesome"},{value:"custom",labelKey:"custom",descKey:"customDesc",icon:"tune"},{value:"adaptive",labelKey:"adaptive",descKey:"adaptiveDesc",icon:"trending_up"}],D=[{value:"none",labelKey:"effortNone"},{value:"low",labelKey:"effortLow"},{value:"medium",labelKey:"effortMedium"},{value:"high",labelKey:"effortHigh"}];function P(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n(!0),m("");try{(await fetch("/api/settings/thinking-budget",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok?(m("saved"),setTimeout(()=>m(""),2e3)):m("error")}catch{m("error")}finally{n(!1)}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",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]","aria-hidden":"true",children:"psychology"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("thinkingBudgetTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("thinkingBudgetDesc")})]}),"saved"===o&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 mb-5",children:S.map(t=>(0,a.jsxs)("button",{onClick:()=>u({mode:t.value}),disabled:s||i,className:`flex items-start gap-3 p-3 rounded-lg border text-left transition-all ${e.mode===t.value?"border-violet-500/50 bg-violet-500/5 ring-1 ring-violet-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] mt-0.5 ${e.mode===t.value?"text-violet-500":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.mode===t.value?"text-violet-400":""}`,children:x(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:x(t.descKey)})]})]},t.value))}),"custom"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:x("tokenBudget")}),(0,a.jsxs)("span",{className:"text-sm font-mono tabular-nums text-violet-400",children:[e.customBudget.toLocaleString()," ",x("tokens")]})]}),(0,a.jsx)("input",{type:"range",min:"0",max:"131072",step:"1024",value:e.customBudget,onChange:e=>u({customBudget:parseInt(e.target.value)}),className:"w-full accent-violet-500"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-text-muted mt-1",children:[(0,a.jsx)("span",{children:x("off")}),(0,a.jsx)("span",{children:"1K"}),(0,a.jsx)("span",{children:"10K"}),(0,a.jsx)("span",{children:"64K"}),(0,a.jsx)("span",{children:"128K"})]})]}),"adaptive"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:x("baseEffortLevel")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:x("adaptiveHint")}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:D.map(t=>(0,a.jsx)("button",{onClick:()=>u({effortLevel:t.value}),disabled:s||i,className:`px-3 py-2 rounded-lg text-xs font-medium border transition-all ${e.effortLevel===t.value?"border-violet-500/50 bg-violet-500/10 text-violet-400":"border-border/50 text-text-muted hover:border-border"}`,children:x(t.labelKey)},t.value))})]})]})}function T(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(n("saved"),setTimeout(()=>n(""),2e3))}catch{n("error")}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"edit_note"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("globalSystemPrompt")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("systemPromptDesc")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["saved"===i&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]}),(0,a.jsx)(c.lM,{checked:e.enabled,onChange:()=>u({enabled:!e.enabled}),disabled:s})]})]}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("textarea",{value:e.prompt,onChange:e=>{var s;return s=e.target.value,void(t(e=>({...e,prompt:s})),o&&clearTimeout(o),m(setTimeout(()=>{u({prompt:s})},800)))},placeholder:x("systemPromptPlaceholder"),rows:5,className:"w-full px-4 py-3 rounded-lg border border-border/50 bg-surface/30 text-sm placeholder:text-text-muted/50 resize-y min-h-[120px] focus:outline-none focus:ring-1 focus:ring-amber-500/30 focus:border-amber-500/50 transition-colors",disabled:s}),(0,a.jsx)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:x("chars",{count:e.prompt.length})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted/70 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),x("systemPromptHint")]})]})]})}function $(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)({}),[i,n]=(0,l.useState)(!0),[o,m]=(0,l.useState)(!1),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/model-aliases").then(e=>e.json()).then(e=>{t(e.builtIn||{}),r(e.custom||{}),n(!1)}).catch(()=>n(!1))},[]);let j=async()=>{if(h.trim()&&b.trim()){m(!0);try{let e=await fetch("/api/settings/model-aliases",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:h.trim(),to:b.trim()})});if(e.ok){let t=await e.json();r(t.custom),p(""),g(""),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}}},y=async e=>{m(!0);try{let t=await fetch("/api/settings/model-aliases",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:e})});if(t.ok){let e=await t.json();r(e.custom),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}},v=Object.entries(e),N=Object.entries(s);return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"swap_horiz"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("modelAliasesTitle")||"Model Aliases"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("modelAliasesDesc")||"Auto-forward deprecated model IDs to their replacements"})]}),"saved"===x&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:f("addCustomAlias")||"Add Custom Alias"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:f("deprecatedModelId")||"Deprecated model ID",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("newModelId")||"New model ID",value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:j,disabled:o||!h.trim()||!b.trim(),className:"px-4 py-2 rounded-lg text-sm font-medium bg-amber-500/10 text-amber-500 hover:bg-amber-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]})]}),N.length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("customAliases")||"Custom Aliases"}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20",children:N.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/80 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/80 flex-1 truncate",children:t}),(0,a.jsx)("button",{onClick:()=>y(e),disabled:o,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("builtInAliases")||"Built-in Aliases"," (",v.length,")"]}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-60 overflow-y-auto",children:v.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 opacity-60",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/60 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/60 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"lock"})]},e))})]})]})}function A(){let[e,t]=(0,l.useState)({enabled:!1,degradationMap:{},detectionPatterns:[],stats:{detected:0,tokensSaved:0}}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/background-degradation").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let j=async s=>{let a={...e,...s};t(a),n(!0),m("");try{let{stats:e,...s}=a,l=await fetch("/api/settings/background-degradation",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(l.ok){let e=await l.json();t(e),m("saved"),setTimeout(()=>m(""),2e3)}else m("error")}catch{m("error")}finally{n(!1)}},y=Object.entries(e.degradationMap||{});return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-sky-500/10 text-sky-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"speed"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("backgroundDegradationTitle")||"Background Task Degradation"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("backgroundDegradationDesc")||"Auto-redirect background requests (titles, summaries) to cheaper models"})]}),"saved"===o&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:f("enableDegradation")||"Enable Background Degradation"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:f("enableDegradationHint")||"Automatically use cheaper models for background utility tasks"})]}),(0,a.jsx)("button",{onClick:()=>j({enabled:!e.enabled}),disabled:s||i,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e.enabled?"bg-sky-500":"bg-white/10"}`,children:(0,a.jsx)("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-6":"translate-x-1"}`})})]}),e.stats&&e.stats.detected>0&&(0,a.jsx)("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-sky-500/5 border border-sky-500/20 mb-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-sky-400",children:"analytics"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[f("tasksDetected")||"Tasks detected",":"]}),(0,a.jsx)("span",{className:"text-sm font-mono font-semibold text-sky-400",children:e.stats.detected})]})}),e.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("degradationMap")||"Model Degradation Map"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("premiumModel")||"Premium model",value:x,onChange:e=>u(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("cheapModel")||"Cheap model",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{x.trim()&&h.trim()&&(j({degradationMap:{...e.degradationMap,[x.trim()]:h.trim()}}),u(""),p(""))},disabled:i||!x.trim()||!h.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),y.length>0&&(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-48 overflow-y-auto",children:y.map(([t,s])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2",children:[(0,a.jsx)("code",{className:"text-xs text-orange-400/80 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-sky-400/80 flex-1 truncate",children:s}),(0,a.jsx)("button",{onClick:()=>{let s;return s={...e.degradationMap},void(delete s[t],j({degradationMap:s}))},disabled:i,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("detectionPatterns")||"Detection Patterns"," (",e.detectionPatterns?.length||0,")"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("newPattern")||'e.g. "generate a title"',value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{b.trim()&&(j({detectionPatterns:[...e.detectionPatterns,b.trim()]}),g(""))},disabled:i||!b.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(e.detectionPatterns||[]).map((t,s)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs bg-sky-500/10 text-sky-400 border border-sky-500/20",children:[t,(0,a.jsx)("button",{onClick:()=>{j({detectionPatterns:e.detectionPatterns.filter((e,t)=>t!==s)})},className:"hover:text-red-400 transition-colors",disabled:i,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},s))})]})]})]})}function L(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=(0,d.c)("settings"),n=()=>{fetch("/api/cache/stats").then(e=>e.json()).then(t).catch(()=>{})};(0,l.useEffect)(n,[]);let o=async()=>{r(!0);try{await fetch("/api/cache/stats",{method:"DELETE"}),n()}finally{r(!1)}};return(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"cached"}),i("promptCache")]}),(0,a.jsx)("button",{onClick:o,disabled:s,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:i(s?"flushing":"flushCache")})]}),e?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("size")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.size,"/",e.maxSize]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hitRate")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hits")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.hits??0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("evictions")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.evictions??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("loadingCacheStats")})]})}let M={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",icon:"warning"}},E={closed:{icon:"check_circle",color:"#22c55e"},"half-open":{icon:"pending",color:"#f59e0b"},open:{icon:"error",color:"#ef4444"}};function O(e,t){let s=String(e||"closed").toLowerCase().replaceAll("_","-");return t("open"===s?"breakerStateOpen":"half-open"===s?"breakerStateHalfOpen":"breakerStateClosed")}function K(e){return!e||e<=0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function _(e,t){return e instanceof Error&&e.message?e.message:t}function B({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[n,o]=(0,l.useState)(e),m=(0,d.c)("settings"),x=(0,d.c)("common");(0,l.useEffect)(()=>{o(e)},[e]);let u=e=>null==e?"—":`${e}${m("ms")}`,h=[{key:"transientCooldown",label:m("transientCooldown"),format:u},{key:"rateLimitCooldown",label:m("rateLimitCooldown"),format:u},{key:"maxBackoffLevel",label:m("maxBackoffLevel")},{key:"circuitBreakerThreshold",label:m("cbThreshold"),format:e=>null==e?"—":m("failures",{count:e})},{key:"circuitBreakerReset",label:m("cbResetTime"),format:u}];return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"tune"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:m("providerProfiles")})]}),r?(0,a.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:x("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(n),i(!1)},disabled:s,children:x("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>i(!0),children:x("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:m("providerProfilesDesc")}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["oauth","apikey"].map(t=>(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base","aria-hidden":"true",children:"oauth"===t?"lock":"key"}),"oauth"===t?m("oauthProviders"):m("apiKeyProviders")]}),(0,a.jsx)("div",{className:"space-y-2",children:h.map(({key:s,label:l,format:i})=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l}),r?(0,a.jsx)("input",{type:"number",min:"0",value:n?.[t]?.[s]??0,onChange:e=>o({...n,[t]:{...n[t],[s]:Number(e.target.value)}}),className:"w-24 px-2 py-1 text-xs rounded bg-white/10 border border-white/20 text-right"}):(0,a.jsx)("span",{className:"text-sm font-mono",children:i?i(e?.[t]?.[s]):e?.[t]?.[s]??"—"})]},s))})]},t))})]})})}function F({rateLimitStatus:e,defaults:t,onSaveDefaults:s,saving:r}){let[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(t||{}),x=(0,d.c)("settings"),u=(0,d.c)("common");return(0,l.useEffect)(()=>{t&&m(t)},[t]),(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"speed"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:x("rateLimiting")})]}),i?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>n(!1),children:u("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{s(o),n(!1)},disabled:r,children:u("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>n(!0),children:u("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:x("rateLimitingDesc")}),(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4 mb-4",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-3 text-text-muted",children:x("defaultSafetyNet")}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{key:"requestsPerMinute",label:x("rpm")},{key:"minTimeBetweenRequests",label:x("minGap"),format:K},{key:"concurrentRequests",label:x("maxConcurrent")}].map(({key:e,label:s,format:l})=>(0,a.jsxs)("div",{children:[i?(0,a.jsx)("input",{type:"number",min:"1",value:o[e]??0,onChange:t=>m(s=>({...s,[e]:parseInt(t.target.value)||0})),className:"w-full px-2 py-1 text-lg font-bold rounded bg-white/10 border border-white/20"}):(0,a.jsx)("div",{className:"text-lg font-bold",children:l?l(t?.[e]):t?.[e]??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:s})]},e))})]}),e&&e.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:x("activeLimiters")}),e.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.provider||e.key}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[null!=e.reservoir&&(0,a.jsxs)("span",{children:[x("reservoir"),": ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:[x("running"),": ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:[x("queued"),": ",e.queued]})]})]},t))]}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:x("noActiveLimiters")})]})})}function z({breakers:e,onReset:t,loading:s}){let l=e.filter(e=>"CLOSED"!==e.state),r=e.length,i=(0,d.c)("settings");return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"electrical_services"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:i("circuitBreakers")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l.length>0?i("tripped",{count:l.length}):i("healthy",{count:r})}),l.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"danger",icon:"restart_alt",onClick:t,disabled:s,children:i("resetAll")})]})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("noCircuitBreakers")}):(0,a.jsx)("div",{className:"space-y-2",children:e.map(e=>{let t=M[e.state]||M.CLOSED;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-base ${t.text}`,"aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name.replace("combo:","")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.failureCount>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:i("failures",{count:e.failureCount})}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:O(e.state,i)})]})]},e.name)})})]})})}function R(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(null),m=(0,g.i)(),x=(0,o.Ym)(),u=(0,d.c)("settings"),h=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/policies");if(e.ok){let s=await e.json();t(s)}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{h();let e=setInterval(h,15e3);return()=>clearInterval(e)},[h]);let p=async e=>{n(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(m.success(u("unlockedIdentifier",{identifier:e})),await h()):m.error(u("failedUnlock"))}catch{m.error(u("failedUnlock"))}finally{n(null)}},b=e?.circuitBreakers||[],f=e?.lockedIdentifiers||[],j=b.some(e=>"closed"!==e.state)||f.length>0;return s?(0,a.jsx)(c.Zp,{className:"p-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),u("loadingPolicies")]})}):(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"policy"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:u("policiesLocked")})]}),j&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:h,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),j?(0,a.jsxs)(a.Fragment,{children:[b.filter(e=>"closed"!==e.state).length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("circuitBreakers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:b.filter(e=>"closed"!==e.state).map((e,t)=>{let s=E[e.state]||E.open;return(0,a.jsx)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:s.color},children:s.icon}),(0,a.jsx)("span",{className:"text-sm text-text-main font-medium",children:e.name||e.provider||u("unknown")}),(0,a.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${s.color}15`,color:s.color},children:O(e.state,u)}),e.failures>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("failures",{count:e.failures})})]})},e.name||t)})})]}),f.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("lockedIdentifiers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:f.map((e,t)=>{let s="string"==typeof e?e:e.identifier||e.id;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-400",children:"lock"}),(0,a.jsx)("span",{className:"font-mono text-sm text-text-main",children:s}),"object"==typeof e&&e.lockedAt&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("sinceDate",{date:new Date(e.lockedAt).toLocaleString(x)})})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:()=>p(s),disabled:i===s,className:"text-xs",children:i===s?u("unlocking"):u("forceUnlock")})]},s||t)})})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"verified_user"})}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u("allOperational")})})]})]})})}function I(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings"),u=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(x("failedLoadWithStatus",{status:e.status}));let s=await e.json();t(s),m(null)}catch(e){m(_(e,x("failedLoadResilience")))}finally{r(!1)}},[x]);(0,l.useEffect)(()=>{u();let e=setInterval(u,1e4);return()=>clearInterval(e)},[u]);let h=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error(x("resetFailed"));await u()}catch(e){m(_(e,x("resetFailed")))}finally{r(!1)}},p=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}},b=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaults:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}};return s&&!e?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"hourglass_empty"}),x("loadingResilience")]}):o&&!e?(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"error"}),(0,a.jsx)("span",{className:"text-sm",children:o})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:u,className:"mt-3",children:x("retry")})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(B,{profiles:e?.profiles||{},onSave:p,saving:i}),(0,a.jsx)(F,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{},onSaveDefaults:b,saving:i}),(0,a.jsx)(z,{breakers:e?.circuitBreakers||[],onReset:h,loading:s}),(0,a.jsx)(R,{})]})}let q=[{id:"general",labelKey:"general",icon:"settings"},{id:"ai",labelKey:"ai",icon:"smart_toy"},{id:"security",labelKey:"security",icon:"shield"},{id:"routing",labelKey:"routing",icon:"route"},{id:"resilience",labelKey:"resilience",icon:"electrical_services"},{id:"advanced",labelKey:"advanced",icon:"tune"}];function Z(){let e=(0,d.c)("settings"),t=(0,r.useSearchParams)().get("tab"),[s,c]=(0,l.useState)(null),o=s||q.find(e=>e.id===t)?.id||"general";return(0,a.jsx)("div",{className:"max-w-2xl mx-auto min-w-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{className:"w-full overflow-x-auto pb-1",children:(0,a.jsx)("div",{role:"tablist","aria-label":e("settingsSectionsAria"),className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 min-w-max",children:q.map(t=>(0,a.jsxs)("button",{role:"tab","aria-selected":o===t.id,tabIndex:o===t.id?0:-1,onClick:()=>c(t.id),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",o===t.id?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"hidden sm:inline whitespace-nowrap",children:e(t.labelKey)})]},t.id))})}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":e(q.find(e=>e.id===o)?.labelKey||"general"),children:["general"===o&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(m,{}),(0,a.jsx)(C,{})]})}),"ai"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(P,{}),(0,a.jsx)(T,{}),(0,a.jsx)(L,{})]}),"security"===o&&(0,a.jsx)(b,{}),"routing"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(v,{}),(0,a.jsx)(N,{}),(0,a.jsx)($,{}),(0,a.jsx)(A,{})]}),"resilience"===o&&(0,a.jsx)(I,{}),"advanced"===o&&(0,a.jsx)(k,{})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[n.vQ.name," v",n.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:e("localMode")})]})]})})}},13908:(e,t,s)=>{Promise.resolve().then(s.bind(s,3612))}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=13908)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[410],{43265:(e,t,c)=>{Promise.resolve().then(c.bind(c,95204))},50910:(e,t,c)=>{"use strict";c.d(t,{c:()=>i});var a=c(33418);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let i=n(0,a.c3);n(0,a.kc)},67040:(e,t,c)=>{"use strict";function a(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}c.d(t,{cn:()=>a})},73321:(e,t,c)=>{"use strict";var a=c(74645);c.o(a,"useParams")&&c.d(t,{useParams:function(){return a.useParams}}),c.o(a,"usePathname")&&c.d(t,{usePathname:function(){return a.usePathname}}),c.o(a,"useRouter")&&c.d(t,{useRouter:function(){return a.useRouter}}),c.o(a,"useSearchParams")&&c.d(t,{useSearchParams:function(){return a.useSearchParams}})},81060:(e,t,c)=>{"use strict";c.d(t,{default:()=>i});var a=c(95155),n=c(67040);function i({children:e,title:t,subtitle:c,icon:i,action:r,padding:s="md",hover:o=!1,className:u,...d}){return(0,a.jsxs)("div",{className:(0,n.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",o&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[s],u),...d,children:[(t||r)&&(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,a.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i})}),(0,a.jsxs)("div",{children:[t&&(0,a.jsx)("h3",{className:"text-text-main font-semibold",children:t}),c&&(0,a.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),r]}),e]})}i.Section=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...c,children:e})},i.Row=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...c,children:e})},i.ListItem=function({children:e,actions:t,className:c,...i}){return(0,a.jsxs)("div",{className:(0,n.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",c),...i,children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,a.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:t})]})}},95204:(e,t,c)=>{"use strict";c.r(t),c.d(t,{default:()=>d});var a=c(95155),n=c(12115),i=c(73321),r=c(81060);let s={cc:{"claude-opus-4-5-20251101":{input:15,output:75,cached:7.5,reasoning:75,cache_creation:15},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4-5-20251001":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}},cx:{"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-codex-mini":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},gc:{"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},qw:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},if:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"deepseek-r1":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"deepseek-v3.2-chat":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"deepseek-v3.2-reasoner":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"minimax-m2":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},ag:{"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},gh:{"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"claude-4.5-sonnet":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-4.5-opus":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-4.5-haiku":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"gemini-3-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},openai:{"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},anthropic:{"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:75,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3}},gemini:{"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},openrouter:{auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},glm:{"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},kimi:{"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},minimax:{"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},groq:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b-versatile":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen/qwen3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},fireworks:{"accounts/fireworks/models/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/deepseek-v3p1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/llama-v3p3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/qwen3-235b-a22b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},cerebras:{"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-glm-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-4-scout-17b-16e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-235b-a22b-instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nvidia:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/kimi-k2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"z-ai/glm4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/deepseek-v3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"nvidia/llama-3.3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek/deepseek-r1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nebius:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},siliconflow:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-235B-A22B-Instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/Kimi-K2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-org/GLM-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"baidu/ERNIE-4.5-300B-A47B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},hyperbolic:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/QwQ-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.2-3B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-72B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-Coder-32B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"NousResearch/Hermes-3-Llama-3.1-70B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},kiro:{"claude-sonnet-4.5":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}}};function o({isOpen:e,onClose:t,onSave:c}){let[i,r]=(0,n.useState)({}),[o,u]=(0,n.useState)(!0),[d,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&l()},[e]);let l=async()=>{u(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();r(t)}else r(s)}catch(e){console.error("Failed to load pricing:",e),r(s)}finally{u(!1)}},h=async()=>{p(!0);try{let e=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.ok)c?.(),t();else{let t=await e.json();alert(`Failed to save pricing: ${t.error}`)}}catch(e){console.error("Failed to save pricing:",e),alert("Failed to save pricing")}finally{p(!1)}},g=async()=>{if(confirm("Reset all pricing to defaults? This cannot be undone."))try{(await fetch("/api/pricing",{method:"DELETE"})).ok&&r(s)}catch(e){console.error("Failed to reset pricing:",e),alert("Failed to reset pricing")}};if(!e)return null;let m=Object.keys(i).sort(),x=["input","output","cached","reasoning","cache_creation"];return(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,a.jsxs)("div",{className:"bg-bg-base border border-border rounded-lg shadow-xl max-w-6xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Pricing Configuration"}),(0,a.jsx)("button",{onClick:t,className:"text-text-muted hover:text-text text-2xl leading-none",children:"\xd7"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"Loading pricing data..."}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"bg-bg-subtle border border-border rounded-lg p-3 text-sm",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:"Pricing Rates Format"}),(0,a.jsxs)("p",{className:"text-text-muted",children:["All rates are in ",(0,a.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: Input rate of 2.50 means $2.50 per 1,000,000 input tokens."]})]}),m.map(e=>{let t=Object.keys(i[e]).sort();return(0,a.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,a.jsx)("div",{className:"bg-bg-subtle px-4 py-2 font-semibold text-sm",children:e.toUpperCase()}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-bg-hover text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Model"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Input"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Output"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cached"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Reasoning"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cache Creation"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50",children:[(0,a.jsx)("td",{className:"px-3 py-2 font-medium",children:t}),x.map(c=>(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:i[e][t][c]||0,onChange:a=>{let n;!isNaN(n=parseFloat(a.target.value))&&!(n<0)&&r(a=>{let i={...a};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={}),i[e][t][c]=n,i})},className:"w-20 px-2 py-1 text-right bg-bg-base border border-border rounded focus:outline-none focus:border-primary"})},c))]},t))})]})})]},e)}),0===m.length&&(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"No pricing data available"})]})}),(0,a.jsxs)("div",{className:"p-4 border-t border-border flex items-center justify-between gap-2",children:[(0,a.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm text-red-500 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",disabled:d,children:"Reset to Defaults"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm text-text-muted hover:text-text border border-border rounded transition-colors",disabled:d,children:"Cancel"}),(0,a.jsx)("button",{onClick:h,className:"px-4 py-2 text-sm bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:d,children:d?"Saving...":"Save Changes"})]})]})]})})}var u=c(50910);function d(){(0,i.useRouter)();let[e,t]=(0,n.useState)(!1),[c,s]=(0,n.useState)(null),[d,p]=(0,n.useState)(!0),l=(0,u.c)("settings");(0,n.useEffect)(()=>{h()},[]);let h=async()=>{p(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();s(t)}}catch(e){console.error("Failed to load pricing:",e)}finally{p(!1)}};return(0,a.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold",children:l("pricingSettingsTitle")}),(0,a.jsx)("p",{className:"text-text-muted mt-1",children:l("modelPricingDesc")})]}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary/90 transition-colors",children:l("editPricing")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("totalModels")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(()=>{if(!c)return 0;let e=0;for(let t in c)e+=Object.keys(c[t]).length;return e})()})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("providers")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(!c?[]:Object.keys(c).sort()).length})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("status")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-success",children:d?"...":l("active")})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold mb-4",children:l("howPricingWorks")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-text-muted",children:[(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[l("costCalculation"),":"]})," ",l("costCalculationDesc")]}),(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[l("pricingFormat"),":"]})," ",l("pricingFormatDesc")]}),(0,a.jsx)("p",{children:(0,a.jsxs)("strong",{children:[l("tokenTypes"),":"]})}),(0,a.jsxs)("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("input"),":"]})," ",l("inputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("output"),":"]})," ",l("outputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("cached"),":"]})," ",l("cachedTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("reasoning"),":"]})," ",l("reasoningTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("cacheCreation"),":"]})," ",l("cacheCreationTokenDesc")]})]}),(0,a.jsx)("p",{children:l("customPricingNote")})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:l("currentPricing")}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"text-primary hover:underline text-sm",children:l("viewFullDetails")})]}),d?(0,a.jsx)("div",{className:"text-center py-4 text-text-muted",children:l("loadingPricing")}):c?(0,a.jsxs)("div",{className:"space-y-3",children:[Object.keys(c).slice(0,5).map(e=>(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsxs)("span",{className:"font-semibold",children:[e.toUpperCase(),":"]})," ",(0,a.jsxs)("span",{className:"text-text-muted",children:[Object.keys(c[e]).length," ",l("models")]})]},e)),Object.keys(c).length>5&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["+ ",l("moreProviders",{count:Object.keys(c).length-5})]})]}):(0,a.jsx)("div",{className:"text-text-muted",children:l("noPricing")})]}),e&&(0,a.jsx)(o,{isOpen:e,onClose:()=>t(!1),onSave:()=>{h()}})]})}}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=43265)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[410],{50910:(e,t,c)=>{"use strict";c.d(t,{c:()=>i});var a=c(33418);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let i=n(0,a.c3);n(0,a.kc)},67040:(e,t,c)=>{"use strict";function a(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}c.d(t,{cn:()=>a})},73321:(e,t,c)=>{"use strict";var a=c(74645);c.o(a,"useParams")&&c.d(t,{useParams:function(){return a.useParams}}),c.o(a,"usePathname")&&c.d(t,{usePathname:function(){return a.usePathname}}),c.o(a,"useRouter")&&c.d(t,{useRouter:function(){return a.useRouter}}),c.o(a,"useSearchParams")&&c.d(t,{useSearchParams:function(){return a.useSearchParams}})},81060:(e,t,c)=>{"use strict";c.d(t,{default:()=>i});var a=c(95155),n=c(67040);function i({children:e,title:t,subtitle:c,icon:i,action:r,padding:s="md",hover:o=!1,className:u,...d}){return(0,a.jsxs)("div",{className:(0,n.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",o&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[s],u),...d,children:[(t||r)&&(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,a.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i})}),(0,a.jsxs)("div",{children:[t&&(0,a.jsx)("h3",{className:"text-text-main font-semibold",children:t}),c&&(0,a.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),r]}),e]})}i.Section=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...c,children:e})},i.Row=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...c,children:e})},i.ListItem=function({children:e,actions:t,className:c,...i}){return(0,a.jsxs)("div",{className:(0,n.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",c),...i,children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,a.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:t})]})}},85109:(e,t,c)=>{Promise.resolve().then(c.bind(c,95204))},95204:(e,t,c)=>{"use strict";c.r(t),c.d(t,{default:()=>d});var a=c(95155),n=c(12115),i=c(73321),r=c(81060);let s={cc:{"claude-opus-4-5-20251101":{input:15,output:75,cached:7.5,reasoning:75,cache_creation:15},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4-5-20251001":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}},cx:{"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-codex-mini":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},gc:{"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},qw:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},if:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"deepseek-r1":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"deepseek-v3.2-chat":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"deepseek-v3.2-reasoner":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"minimax-m2":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},ag:{"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},gh:{"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"claude-4.5-sonnet":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-4.5-opus":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-4.5-haiku":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"gemini-3-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},openai:{"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},anthropic:{"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:75,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3}},gemini:{"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},openrouter:{auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},glm:{"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},kimi:{"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},minimax:{"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},groq:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b-versatile":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen/qwen3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},fireworks:{"accounts/fireworks/models/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/deepseek-v3p1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/llama-v3p3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/qwen3-235b-a22b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},cerebras:{"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-glm-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-4-scout-17b-16e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-235b-a22b-instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nvidia:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/kimi-k2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"z-ai/glm4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/deepseek-v3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"nvidia/llama-3.3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek/deepseek-r1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nebius:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},siliconflow:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-235B-A22B-Instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/Kimi-K2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-org/GLM-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"baidu/ERNIE-4.5-300B-A47B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},hyperbolic:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/QwQ-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.2-3B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-72B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-Coder-32B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"NousResearch/Hermes-3-Llama-3.1-70B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},kiro:{"claude-sonnet-4.5":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}}};function o({isOpen:e,onClose:t,onSave:c}){let[i,r]=(0,n.useState)({}),[o,u]=(0,n.useState)(!0),[d,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&l()},[e]);let l=async()=>{u(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();r(t)}else r(s)}catch(e){console.error("Failed to load pricing:",e),r(s)}finally{u(!1)}},h=async()=>{p(!0);try{let e=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.ok)c?.(),t();else{let t=await e.json();alert(`Failed to save pricing: ${t.error}`)}}catch(e){console.error("Failed to save pricing:",e),alert("Failed to save pricing")}finally{p(!1)}},g=async()=>{if(confirm("Reset all pricing to defaults? This cannot be undone."))try{(await fetch("/api/pricing",{method:"DELETE"})).ok&&r(s)}catch(e){console.error("Failed to reset pricing:",e),alert("Failed to reset pricing")}};if(!e)return null;let m=Object.keys(i).sort(),x=["input","output","cached","reasoning","cache_creation"];return(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,a.jsxs)("div",{className:"bg-bg-base border border-border rounded-lg shadow-xl max-w-6xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Pricing Configuration"}),(0,a.jsx)("button",{onClick:t,className:"text-text-muted hover:text-text text-2xl leading-none",children:"\xd7"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"Loading pricing data..."}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"bg-bg-subtle border border-border rounded-lg p-3 text-sm",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:"Pricing Rates Format"}),(0,a.jsxs)("p",{className:"text-text-muted",children:["All rates are in ",(0,a.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: Input rate of 2.50 means $2.50 per 1,000,000 input tokens."]})]}),m.map(e=>{let t=Object.keys(i[e]).sort();return(0,a.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,a.jsx)("div",{className:"bg-bg-subtle px-4 py-2 font-semibold text-sm",children:e.toUpperCase()}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-bg-hover text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Model"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Input"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Output"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cached"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Reasoning"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cache Creation"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50",children:[(0,a.jsx)("td",{className:"px-3 py-2 font-medium",children:t}),x.map(c=>(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:i[e][t][c]||0,onChange:a=>{let n;!isNaN(n=parseFloat(a.target.value))&&!(n<0)&&r(a=>{let i={...a};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={}),i[e][t][c]=n,i})},className:"w-20 px-2 py-1 text-right bg-bg-base border border-border rounded focus:outline-none focus:border-primary"})},c))]},t))})]})})]},e)}),0===m.length&&(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"No pricing data available"})]})}),(0,a.jsxs)("div",{className:"p-4 border-t border-border flex items-center justify-between gap-2",children:[(0,a.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm text-red-500 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",disabled:d,children:"Reset to Defaults"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm text-text-muted hover:text-text border border-border rounded transition-colors",disabled:d,children:"Cancel"}),(0,a.jsx)("button",{onClick:h,className:"px-4 py-2 text-sm bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:d,children:d?"Saving...":"Save Changes"})]})]})]})})}var u=c(50910);function d(){(0,i.useRouter)();let[e,t]=(0,n.useState)(!1),[c,s]=(0,n.useState)(null),[d,p]=(0,n.useState)(!0),l=(0,u.c)("settings");(0,n.useEffect)(()=>{h()},[]);let h=async()=>{p(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();s(t)}}catch(e){console.error("Failed to load pricing:",e)}finally{p(!1)}};return(0,a.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold",children:l("pricingSettingsTitle")}),(0,a.jsx)("p",{className:"text-text-muted mt-1",children:l("modelPricingDesc")})]}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary/90 transition-colors",children:l("editPricing")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("totalModels")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(()=>{if(!c)return 0;let e=0;for(let t in c)e+=Object.keys(c[t]).length;return e})()})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("providers")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(!c?[]:Object.keys(c).sort()).length})]}),(0,a.jsxs)(r.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:l("status")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-success",children:d?"...":l("active")})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold mb-4",children:l("howPricingWorks")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-text-muted",children:[(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[l("costCalculation"),":"]})," ",l("costCalculationDesc")]}),(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[l("pricingFormat"),":"]})," ",l("pricingFormatDesc")]}),(0,a.jsx)("p",{children:(0,a.jsxs)("strong",{children:[l("tokenTypes"),":"]})}),(0,a.jsxs)("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("input"),":"]})," ",l("inputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("output"),":"]})," ",l("outputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("cached"),":"]})," ",l("cachedTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("reasoning"),":"]})," ",l("reasoningTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[l("cacheCreation"),":"]})," ",l("cacheCreationTokenDesc")]})]}),(0,a.jsx)("p",{children:l("customPricingNote")})]})]}),(0,a.jsxs)(r.default,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:l("currentPricing")}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"text-primary hover:underline text-sm",children:l("viewFullDetails")})]}),d?(0,a.jsx)("div",{className:"text-center py-4 text-text-muted",children:l("loadingPricing")}):c?(0,a.jsxs)("div",{className:"space-y-3",children:[Object.keys(c).slice(0,5).map(e=>(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsxs)("span",{className:"font-semibold",children:[e.toUpperCase(),":"]})," ",(0,a.jsxs)("span",{className:"text-text-muted",children:[Object.keys(c[e]).length," ",l("models")]})]},e)),Object.keys(c).length>5&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["+ ",l("moreProviders",{count:Object.keys(c).length-5})]})]}):(0,a.jsx)("div",{className:"text-text-muted",children:l("noPricing")})]}),e&&(0,a.jsx)(o,{isOpen:e,onClose:()=>t(!1),onSave:()=>{h()}})]})}}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=85109)),_N_E=e.O()}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{2824:(e,t,s)=>{"use strict";s.d(t,{default:()=>k});var a=s(95155),r=s(50910),l=s(12115),n=s(40993);function i(e){let t=e("templatePayloads.simpleChat.system"),s=e("templatePayloads.simpleChat.userGreeting"),a=e("templatePayloads.toolCalling.userWeather"),r=e("templatePayloads.toolCalling.toolDescription"),l=e("templatePayloads.toolCalling.cityNameDescription"),n=e("templatePayloads.multiTurn.system"),i=e("templatePayloads.multiTurn.userInitial"),o=e("templatePayloads.multiTurn.assistantExample"),c=e("templatePayloads.multiTurn.userFollowUp"),d=e("templatePayloads.thinking.question"),m=e("templatePayloads.systemPrompt.systemInstruction"),x=e("templatePayloads.systemPrompt.question"),p=e("templatePayloads.streaming.prompt");return[{id:"simple-chat",name:e("templateNames.simple-chat"),icon:"chat",description:e("templateDescriptions.simple-chat"),formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:t},{role:"user",content:s}],stream:!0},claude:{model:"claude-sonnet-4-20250514",system:t,max_tokens:1024,messages:[{role:"user",content:s}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:s}]}],systemInstruction:{parts:[{text:t}]}},"openai-responses":{model:"gpt-4o",input:s,instructions:t}}},{id:"tool-calling",name:e("templateNames.tool-calling"),icon:"build",description:e("templateDescriptions.tool-calling"),formats:{openai:{model:"gpt-4o",messages:[{role:"user",content:a}],tools:[{type:"function",function:{name:"get_weather",description:r,parameters:{type:"object",properties:{location:{type:"string",description:l},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}}],stream:!0},claude:{model:"claude-sonnet-4-20250514",max_tokens:1024,messages:[{role:"user",content:a}],tools:[{name:"get_weather",description:r,input_schema:{type:"object",properties:{location:{type:"string",description:l},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:a}]}],tools:[{functionDeclarations:[{name:"get_weather",description:r,parameters:{type:"object",properties:{location:{type:"string",description:l},unit:{type:"string",enum:["celsius","fahrenheit"]}},required:["location"]}}]}]}}},{id:"multi-turn",name:e("templateNames.multi-turn"),icon:"forum",description:e("templateDescriptions.multi-turn"),formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:n},{role:"user",content:i},{role:"assistant",content:o},{role:"user",content:c}],stream:!0},claude:{model:"claude-sonnet-4-20250514",system:n,max_tokens:1024,messages:[{role:"user",content:i},{role:"assistant",content:o},{role:"user",content:c}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:i}]},{role:"model",parts:[{text:o}]},{role:"user",parts:[{text:c}]}],systemInstruction:{parts:[{text:n}]}}}},{id:"thinking",name:e("templateNames.thinking"),icon:"psychology",description:e("templateDescriptions.thinking"),formats:{openai:{model:"o3-mini",messages:[{role:"user",content:d}],stream:!0},claude:{model:"claude-sonnet-4-20250514",max_tokens:16e3,thinking:{type:"enabled",budget_tokens:1e4},messages:[{role:"user",content:d}],stream:!0},gemini:{model:"gemini-2.5-flash-thinking",contents:[{role:"user",parts:[{text:d}]}],generationConfig:{thinkingConfig:{thinkingBudget:1e4}}}}},{id:"system-prompt",name:e("templateNames.system-prompt"),icon:"settings",description:e("templateDescriptions.system-prompt"),formats:{openai:{model:"gpt-4o",messages:[{role:"system",content:m},{role:"user",content:x}],temperature:.7,stream:!0},claude:{model:"claude-sonnet-4-20250514",system:m,max_tokens:2048,messages:[{role:"user",content:x}],temperature:.7,stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:x}]}],systemInstruction:{parts:[{text:m}]},generationConfig:{temperature:.7}}}},{id:"streaming",name:e("templateNames.streaming"),icon:"stream",description:e("templateDescriptions.streaming"),formats:{openai:{model:"gpt-4o",messages:[{role:"user",content:p}],stream:!0,stream_options:{include_usage:!0}},claude:{model:"claude-sonnet-4-20250514",max_tokens:1024,messages:[{role:"user",content:p}],stream:!0},gemini:{model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:p}]}]}}}]}let o={openai:{label:"OpenAI",color:"emerald",icon:"smart_toy"},"openai-responses":{label:"OpenAI Responses",color:"amber",icon:"swap_horiz"},claude:{label:"Claude",color:"orange",icon:"psychology"},gemini:{label:"Gemini",color:"blue",icon:"auto_awesome"},antigravity:{label:"Antigravity",color:"purple",icon:"rocket_launch"},kiro:{label:"Kiro",color:"cyan",icon:"terminal"},cursor:{label:"Cursor",color:"pink",icon:"edit"},codex:{label:"Codex",color:"yellow",icon:"code"}},c=Object.entries(o).map(([e,t])=>({value:e,label:t.label}));var d=s(75707),m=s.n(d);let x=m()(()=>s.e(8202).then(s.bind(s,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1});function p(){let e=(0,r.c)("translator"),t=(0,r.c)("common"),[s,d]=(0,l.useState)("claude"),[m,p]=(0,l.useState)("openai"),[u,h]=(0,l.useState)(""),[g,b]=(0,l.useState)(""),[f,j]=(0,l.useState)(null),[y,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(!1),[k,S]=(0,l.useState)(null),_=(0,l.useMemo)(()=>i(e),[e]),C=(0,l.useCallback)(async e=>{if(!e||e.trim().length<5)return void j(null);try{let t=JSON.parse(e);w(!0);let s=await fetch("/api/translator/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:t})}),a=await s.json();a.success&&(j(a.format),d(a.format))}catch{}finally{w(!1)}},[]);(0,l.useEffect)(()=>{let e=setTimeout(()=>{C(u)},600);return()=>clearTimeout(e)},[u,C]);let O=async()=>{if(u.trim()){v(!0),b("");try{let e=JSON.parse(u),t=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:s,targetFormat:m,body:e})}),a=await t.json();a.success?b(JSON.stringify(a.result,null,2)):b(JSON.stringify({error:a.error},null,2))}catch(e){b(JSON.stringify({error:e.message},null,2))}v(!1)}},T=async e=>{try{await navigator.clipboard.writeText(e)}catch{}},P=o[s]||o.openai,D=o[m]||o.openai;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("formatConverter")}),(0,a.jsx)("p",{children:e("formatConverterDescription")})]})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col sm:flex-row items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("source")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] text-${P.color}-500`,children:P.icon}),(0,a.jsx)(n.l6,{value:s,onChange:e=>{d(e.target.value),j(null)},options:c,className:"flex-1"}),f&&(0,a.jsx)(n.Ex,{variant:"primary",size:"sm",icon:"auto_awesome",children:e("auto")})]})]}),(0,a.jsx)("button",{onClick:()=>{d(m),p(s),h(g),b(""),j(null)},className:"p-2 rounded-full hover:bg-primary/10 text-text-muted hover:text-primary transition-all mt-4 sm:mt-5",title:e("swapFormats"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[24px]",children:"swap_horiz"})}),(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("target")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] text-${D.color}-500`,children:D.icon}),(0,a.jsx)(n.l6,{value:m,onChange:e=>p(e.target.value),options:c,className:"flex-1"})]})]}),(0,a.jsx)("div",{className:"pt-0 sm:pt-5",children:(0,a.jsx)(n.$n,{icon:"arrow_forward",onClick:O,loading:y,disabled:!u.trim()||y,className:"w-full sm:w-auto",children:e("translateAction")})})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"input"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("input")}),f&&(0,a.jsx)(n.Ex,{variant:"info",size:"sm",dot:!0,children:o[f]?.label||f}),N&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted animate-spin",children:"progress_activity"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>T(u),className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:t("copy"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,a.jsx)("button",{onClick:()=>{h(""),b(""),j(null),S(null)},className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:e("clear"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]}),(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(x,{height:"400px",defaultLanguage:"json",value:u,onChange:e=>h(e||""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,formatOnPaste:!0,placeholder:e("inputPlaceholder")}})})]})}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"output"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("output")}),g&&(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:o[m]?.label||m})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:(0,a.jsx)("button",{onClick:()=>T(g),className:"p-1.5 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-text-main transition-colors",title:t("copy"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})})})]}),(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(x,{height:"400px",defaultLanguage:"json",value:g,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,readOnly:!0}})})]})})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"library_books"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("exampleTemplates")}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:e("exampleTemplatesHint")})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2",children:_.map(e=>(0,a.jsxs)("button",{onClick:()=>{h(JSON.stringify(e.formats[s]||e.formats.openai,null,2)),S(e.id),b("")},className:`
|
|
2
2
|
group flex flex-col items-center gap-1.5 p-3 rounded-lg border transition-all text-center
|
|
3
3
|
${k===e.id?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/30 hover:bg-primary/5 text-text-muted hover:text-text-main"}
|
|
4
|
-
`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] ${k===e.id?"text-primary":"text-text-muted group-hover:text-primary"} transition-colors`,children:e.icon}),(0,a.jsx)("span",{className:"text-xs font-medium leading-tight",children:e.name})]},e.id))}),k&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),e("templateLoadHint",{format:o[s]?.label||s})]})]})})]})}var u=s(20909);function h(e="openai"){let t=(0,r.c)("translator"),[s,a]=(0,l.useState)(e),[n,i]=(0,l.useState)([]),[o,c]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),[r,l]=await Promise.all([e.json(),s.json()]),n=new Map((l.nodes||[]).map(e=>[e.id,e])),o=[...new Set((r.connections||[]).filter(e=>!1!==e.isActive).map(e=>e.provider))].map(e=>{let s=u.Q2[e],a=n.get(e),r=s?.name||a?.name||e;return!s&&e.startsWith(u.JH)&&(r=a?.name||t("openaiCompatibleLabel")),!s&&e.startsWith(u.DI)&&(r=a?.name||t("anthropicCompatibleLabel")),{value:e,label:r}}).sort((e,t)=>e.label.localeCompare(t.label)),c=o.length>0?o:Object.entries(u.Q2).map(([e,t])=>({value:e,label:t.name}));i(c),c.length>0&&a(e=>c.some(t=>t.value===e)?e:c[0].value)}catch{let e=Object.entries(u.Q2).map(([e,t])=>({value:e,label:t.name}));i(e),e.length>0&&a(t=>e.some(e=>e.value===t)?t:e[0].value)}finally{c(!1)}})()},[t]),{provider:s,setProvider:a,providerOptions:n,loading:o}}let g={openai:["gpt-","o1-","o3-","o4-"],"openai-responses":["gpt-","o1-","o3-","o4-"],claude:["claude-"],gemini:["gemini-"]};function b(){let[e,t]=(0,l.useState)(""),[s,a]=(0,l.useState)([]),[r,n]=(0,l.useState)(!0);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/v1/models"),t=((await e.json()).data||[]).map(e=>e.id).sort((e,t)=>e.localeCompare(t));a(t)}catch{a([])}finally{n(!1)}})()},[]);let i=(0,l.useCallback)(e=>{if(0===s.length)return"";for(let t of g[e]||[]){let e=s.find(e=>e.startsWith(t));if(e)return e}return s[0]},[s]);return{model:e,setModel:t,availableModels:s,loading:r,pickModelForFormat:i}}let f=m()(()=>s.e(8202).then(s.bind(s,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1});function j(){let e=(0,r.c)("translator"),{provider:t,setProvider:s,providerOptions:i}=h("openai"),{model:d,setModel:m,availableModels:x,pickModelForFormat:p}=b(),[u,g]=(0,l.useState)("openai"),[j,y]=(0,l.useState)(""),[v,N]=(0,l.useState)(!1),[w,k]=(0,l.useState)([]),[S,_]=(0,l.useState)(null),[C,O]=(0,l.useState)(null),T=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=p(u);e&&m(e)},[u,p,m]);let P=()=>{T.current?.scrollIntoView({behavior:"smooth"})},D=async()=>{if(!j.trim()||v)return;let s=j.trim();y(""),N(!0),k(e=>[...e,{role:"user",content:s}]);let a=[];try{let r,l=[...w.map(e=>({role:e.role,content:e.content})),{role:"user",content:s}];r="claude"===u?{model:d,max_tokens:1024,messages:l,stream:!0}:"gemini"===u?{model:d,contents:l.map(e=>({role:"assistant"===e.role?"model":"user",parts:[{text:e.content}]}))}:"openai-responses"===u?{model:d,input:l.map(e=>({type:"message",role:e.role,content:[{type:"input_text",text:e.content}]})),stream:!0}:{model:d,messages:l,stream:!0},a.push({id:1,name:e("clientRequest"),description:e("clientRequestDescription"),format:u,content:JSON.stringify(r,null,2),status:"done"});let n=await fetch("/api/translator/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:r})}),i=(await n.json()).format||u;a.push({id:2,name:e("formatDetected"),description:e("formatDetectedDescription"),format:i,content:JSON.stringify({detectedFormat:i,clientFormat:u,match:i===u},null,2),status:"done"});let o=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:i,targetFormat:"openai",body:r})}),c=await o.json();a.push({id:3,name:e("openaiIntermediate"),description:e("openaiIntermediateDescription"),format:"openai",content:JSON.stringify(c.result||c,null,2),status:c.success?"done":"error"});let m=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:"openai",provider:t,body:c.result})}),x=await m.json(),p=x.targetFormat||"openai";a.push({id:4,name:e("providerFormat"),description:e("providerFormatDescription"),format:p,content:JSON.stringify(x.result||x,null,2),status:x.success?"done":"error"});let h=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,body:x.result||c.result})});if(h.ok){let t=h.body.getReader(),s=new TextDecoder,r="";for(;;){let{done:e,value:a}=await t.read();if(e)break;r+=s.decode(a,{stream:!0})}a.push({id:5,name:e("providerResponse"),description:e("providerResponseSseDescription"),format:p,content:r.slice(0,5e3)+(r.length>5e3?"\n... (truncated)":""),status:"done"});let l=function(e){let t="";for(let s of e.split("\n")){if(!s.startsWith("data: "))continue;let e=s.slice(6).trim();if("[DONE]"===e)break;try{let s=JSON.parse(e),a=s.choices?.[0]?.delta;a?.content&&(t+=a.content),"content_block_delta"===s.type&&s.delta?.text&&(t+=s.delta.text)}catch{}}return t||e.slice(0,500)}(r);k(t=>[...t,{role:"assistant",content:l||e("noTextExtracted")}])}else{let t=await h.json().catch(()=>({error:e("requestFailed")}));a.push({id:5,name:e("providerResponse"),description:e("providerResponseRawDescription"),format:p,content:JSON.stringify(t,null,2),status:"error"}),k(s=>[...s,{role:"assistant",content:e("errorMessage",{message:t.error||e("requestFailed")})}])}}catch(t){a.push({id:a.length+1,name:e("error"),description:e("unexpectedError"),format:"error",content:JSON.stringify({error:t.message},null,2),status:"error"}),k(s=>[...s,{role:"assistant",content:e("errorMessage",{message:t.message})}])}_(a),O(a.length>0?a[a.length-1].id:null),N(!1),setTimeout(P,100)};return(0,a.jsxs)("div",{className:"space-y-4 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("pipelineDebugger")}),(0,a.jsx)("p",{children:e("chatTesterDescription")}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{className:"text-text-main",children:e("chatTesterFlow")}),"."," ",e("clickStepToInspect")]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 min-w-0",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:e("clientFormat")}),(0,a.jsx)(n.l6,{value:u,onChange:e=>g(e.target.value),options:c.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:e("provider")}),(0,a.jsx)(n.l6,{value:t,onChange:e=>s(e.target.value),options:i})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:e("model")}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:d,onChange:e=>m(e.target.value),list:"model-suggestions",placeholder:e("modelPlaceholder"),className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"model-suggestions",children:x.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),(0,a.jsxs)(n.Zp,{className:"min-h-[400px] flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 flex-1 overflow-y-auto max-h-[500px] space-y-3",children:[0===w.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"chat"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:e("sendMessageToSeePipeline")}),(0,a.jsxs)("p",{className:"text-xs text-center max-w-xs",children:[e("chatMessageHintPrefix")," ",(0,a.jsx)("strong",{children:o[u]?.label})," ",e("chatMessageHintSuffix")]})]}),w.map((t,s)=>(0,a.jsx)("div",{className:`flex ${"user"===t.role?"justify-end":"justify-start"}`,children:(0,a.jsxs)("div",{className:`max-w-[85%] rounded-lg px-3 py-2 text-sm ${"user"===t.role?"bg-primary/10 text-text-main border border-primary/20":"bg-bg-subtle text-text-main border border-border"}`,children:[(0,a.jsx)("p",{className:"text-[10px] font-semibold text-text-muted mb-1 uppercase",children:"user"===t.role?e("youWithFormat",{format:o[u]?.label}):e("assistant")}),(0,a.jsx)("p",{className:"whitespace-pre-wrap break-words",children:t.content})]})},s)),(0,a.jsx)("div",{ref:T})]}),(0,a.jsx)("div",{className:"p-3 border-t border-border",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:j,onChange:e=>y(e.target.value),onKeyDown:e=>"Enter"===e.key&&!e.shiftKey&&D(),placeholder:e("typeMessage"),className:"flex-1 bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors",disabled:v}),(0,a.jsx)(n.$n,{icon:"send",onClick:D,loading:v,disabled:!j.trim()||v,children:e("send")})]})})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"account_tree"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("translationPipeline")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("clickStepToInspect")})]})}),S?(0,a.jsx)("div",{className:"space-y-2",children:S.map((e,t)=>{let s=o[e.format]||{label:e.format,color:"gray",icon:"code"},r=C===e.id;return(0,a.jsxs)("div",{children:[t>0&&(0,a.jsx)("div",{className:"flex justify-center py-1",children:(0,a.jsx)("div",{className:"w-px h-4 bg-border"})}),(0,a.jsxs)(n.Zp,{className:"error"===e.status?"border-red-500/30":r?"border-primary/30":"",children:[(0,a.jsxs)("button",{onClick:()=>O(r?null:e.id),className:"w-full p-3 flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-7 h-7 rounded-full text-xs font-bold ${"error"===e.status?"bg-red-500/10 text-red-500":"done"===e.status?`bg-${s.color}-500/10 text-${s.color}-500`:"bg-bg-subtle text-text-muted"}`,children:"error"===e.status?"!":e.id}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-[10px] text-text-muted truncate",children:e.description})]}),(0,a.jsx)(n.Ex,{variant:"error"===e.status?"error":"default",size:"sm",children:s.label}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:r?"expand_less":"expand_more"})]}),r&&(0,a.jsx)("div",{className:"px-3 pb-3",children:(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(f,{height:"250px",defaultLanguage:"json",value:e.content,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:11,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,readOnly:!0}})})})]})]},e.id)})}):(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"account_tree"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:e("pipelineVisualization")}),(0,a.jsx)("p",{className:"text-xs text-center max-w-xs",children:e("pipelineVisualizationHint")})]})})]})]})]})}let y=[{id:"simple-chat",icon:"chat",templateId:"simple-chat"},{id:"tool-calling",icon:"build",templateId:"tool-calling"},{id:"multi-turn",icon:"forum",templateId:"multi-turn"},{id:"thinking",icon:"psychology",templateId:"thinking"},{id:"system-prompt",icon:"settings",templateId:"system-prompt"},{id:"streaming",icon:"stream",templateId:"streaming"}];function v(){let e=(0,r.c)("translator"),t={"simple-chat":e("scenarioSimpleChat"),"tool-calling":e("scenarioToolCalling"),"multi-turn":e("scenarioMultiTurn"),thinking:e("scenarioThinking"),"system-prompt":e("scenarioSystemPrompt"),streaming:e("scenarioStreaming")},s=(0,l.useMemo)(()=>i(e),[e]),[d,m]=(0,l.useState)("claude"),{provider:x,setProvider:p,providerOptions:u}=h("openai"),{model:g,setModel:f,availableModels:j,pickModelForFormat:v}=b(),[N,w]=(0,l.useState)({}),[k,S]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=v(d);e&&f(e)},[d,v,f]);let _=async t=>{w(e=>({...e,[t.id]:{status:"running"}}));let a=Date.now();try{let r=s.find(e=>e.id===t.templateId),l=r?.formats[d]||r?.formats.openai;if(!l)return void w(s=>({...s,[t.id]:{status:"error",error:e("noTemplateForFormat"),latency:0}}));let n={...l,model:g};l.contents&&(n.model=g);let i=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:d,provider:x,body:n})}),o=await i.json();if(!o.success)return void w(s=>({...s,[t.id]:{status:"error",error:e("translationFailed",{error:o.error}),latency:Date.now()-a}}));let c=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:x,body:o.result})}),m=Date.now()-a;if(!c.ok){let s=await c.json().catch(()=>({}));w(a=>({...a,[t.id]:{status:"error",error:s.error||e("errorMessage",{message:`HTTP ${c.status}`}),latency:m,httpStatus:c.status}}));return}let p=c.body.getReader(),u=0;for(;;){let{done:e}=await p.read();if(e)break;u++}w(e=>({...e,[t.id]:{status:"pass",latency:Date.now()-a,chunks:u}}))}catch(e){w(s=>({...s,[t.id]:{status:"error",error:e.message,latency:Date.now()-a}}))}},C=async()=>{for(let e of(S(!0),w({}),y))await _(e);S(!1)},O=Object.values(N).filter(e=>"pass"===e.status).length,T=Object.values(N).filter(e=>"error"===e.status).length,P=O+T,D=P>0?Math.round(O/P*100):0,E=o[d]||o.openai;return(0,a.jsxs)("div",{className:"space-y-5 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("compatibilityTester")}),(0,a.jsx)("p",{children:e("testBenchDescription")})]})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-end gap-4 min-w-0",children:[(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("source")}),(0,a.jsx)(n.l6,{value:d,onChange:e=>{m(e.target.value),w({})},options:c.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsx)("div",{className:"flex items-center justify-center px-2",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px] text-text-muted",children:"arrow_forward"})}),(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("targetProvider")}),(0,a.jsx)(n.l6,{value:x,onChange:e=>{p(e.target.value),w({})},options:u})]}),(0,a.jsx)(n.$n,{icon:"play_arrow",onClick:C,loading:k,disabled:k,className:"w-full sm:w-auto",children:e("runAllTests")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("model")}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:g,onChange:e=>f(e.target.value),list:"testbench-model-suggestions",placeholder:e("modelPlaceholder"),className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"testbench-model-suggestions",children:j.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),P>0&&(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("compatibilityReport")}),(0,a.jsxs)(n.Ex,{variant:D>=80?"success":D>=50?"warning":"error",size:"lg",children:[D,"%"]})]}),(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"})," ",O," ",e("passed")]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-red-500"})," ",T," ",e("failed")]})]})]}),(0,a.jsx)("div",{className:"w-full h-2 bg-bg-subtle rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r from-green-500 to-emerald-400 rounded-full transition-all duration-500",style:{width:`${D}%`}})})]})}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:y.map(s=>{let r=N[s.id],l=r?.status==="running";return(0,a.jsx)(n.Zp,{className:`transition-all ${r?.status==="pass"?"border-green-500/30":r?.status==="error"?"border-red-500/30":""}`,children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-9 h-9 rounded-lg ${r?.status==="pass"?"bg-green-500/10 text-green-500":r?.status==="error"?"bg-red-500/10 text-red-500":"bg-bg-subtle text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l?"progress_activity":r?.status==="pass"?"check_circle":r?.status==="error"?"error":s.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:t[s.id]||s.id}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted uppercase",children:[E.label," →"," ",u.find(e=>e.value===x)?.label||x]})]})]})}),r&&"running"!==r.status&&(0,a.jsx)("div",{className:`rounded-lg p-2 text-xs ${"pass"===r.status?"bg-green-500/5 text-green-600 dark:text-green-400":"bg-red-500/5 text-red-600 dark:text-red-400"}`,children:"pass"===r.status?(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:e("passedIconLabel")}),(0,a.jsxs)("span",{className:"text-text-muted",children:[r.latency,"ms • ",r.chunks," ",e("chunks")]})]}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:["❌ ",r.error]}),(0,a.jsxs)("p",{className:"text-text-muted mt-0.5",children:[r.latency,"ms"]})]})}),(0,a.jsx)(n.$n,{size:"sm",variant:r?.status==="pass"?"ghost":"outline",icon:l?"progress_activity":"play_arrow",onClick:()=>_(s),disabled:l||k,className:"w-full",children:l?e("running"):r?e("reRun"):e("runTest")})]})},s.id)})})]})}function N(){let e=(0,r.c)("translator"),t=(0,r.c)("common"),[s,i]=(0,l.useState)([]),[c,d]=(0,l.useState)(!0),[m,x]=(0,l.useState)(!0),p=(0,l.useRef)(null),u=e("notAvailableSymbol"),h=t=>e("millisecondsShort",{value:t}),g=async()=>{try{let e=await fetch("/api/translator/history?limit=50");if(e.ok){let t=await e.json();i(t.events||[])}}catch{}finally{d(!1)}};(0,l.useEffect)(()=>(g(),m&&(p.current=setInterval(g,3e3)),()=>{p.current&&clearInterval(p.current)}),[m]);let b=s.filter(e=>"success"===e.status).length,f=s.filter(e=>"error"===e.status).length,j=s.length>0?Math.round(s.reduce((e,t)=>e+(t.latency||0),0)/s.length):0;return(0,a.jsxs)("div",{className:"space-y-5 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0","aria-hidden":"true",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("realtime")}),(0,a.jsxs)("p",{children:[e("liveMonitorDescriptionPrefix")," ",(0,a.jsx)("strong",{className:"text-text-main",children:e("chatTester")}),","," ",(0,a.jsx)("strong",{className:"text-text-main",children:e("testBench")}),e("liveMonitorDescriptionSuffix")]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,a.jsx)(w,{icon:"translate",label:e("totalTranslations"),value:s.length,color:"blue"}),(0,a.jsx)(w,{icon:"check_circle",label:e("successful"),value:b,color:"green"}),(0,a.jsx)(w,{icon:"error",label:e("errors"),value:f,color:"red"}),(0,a.jsx)(w,{icon:"speed",label:e("avgLatency"),value:h(j),color:"purple"})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${m?"text-green-500 animate-pulse":"text-text-muted"}`,"aria-hidden":"true",children:m?"radio_button_checked":"radio_button_unchecked"}),(0,a.jsx)("button",{onClick:()=>x(!m),className:"text-sm text-text-main hover:text-primary transition-colors",children:m?e("liveAutoRefreshing"):e("paused")})]}),(0,a.jsxs)("button",{onClick:g,className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"refresh"}),t("refresh")]})]})}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main mb-3",children:e("recentTranslations")}),c?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2","aria-hidden":"true",children:"progress_activity"}),t("loading")]}):0===s.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30","aria-hidden":"true",children:"monitoring"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:e("noTranslations")}),(0,a.jsx)("p",{className:"text-xs text-center max-w-sm",children:e("eventsAppearHint")}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mt-3 text-xs",children:[(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("chatTesterTab")}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("testBenchTab")}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("externalApiCalls")}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("ideCliIntegrations")})]}),(0,a.jsx)("p",{className:"text-[10px] mt-3 text-text-muted/70",children:e("inMemoryNote")})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border",children:[(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("time")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("source")}),(0,a.jsx)("th",{className:"pb-2 pr-4"}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("target")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("model")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("status")}),(0,a.jsx)("th",{className:"pb-2 text-right",children:e("latency")})]})}),(0,a.jsx)("tbody",{children:s.map((t,s)=>{let r=o[t.sourceFormat]||{label:t.sourceFormat||"?",color:"gray"},l=o[t.targetFormat]||{label:t.targetFormat||"?",color:"gray"};return(0,a.jsxs)("tr",{className:"border-b border-border/50 hover:bg-bg-subtle/50 transition-colors",children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-xs text-text-muted whitespace-nowrap",children:t.timestamp?new Date(t.timestamp).toLocaleTimeString():u}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:r.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"arrow_forward"})}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"primary",size:"sm",children:l.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-xs font-mono text-text-muted break-all",children:t.model||u}),(0,a.jsx)("td",{className:"py-2 pr-4",children:"success"===t.status?(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:e("ok")}):(0,a.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:t.statusCode||e("errorShort")})}),(0,a.jsx)("td",{className:"py-2 text-right text-xs text-text-muted",children:t.latency?h(t.latency):u})]},t.id||s)})})]})})]})})]})}function w({icon:e,label:t,value:s,color:r}){return(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex items-center gap-3",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-${r}-500/10`,children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] text-${r}-500`,"aria-hidden":"true",children:e})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-bold text-text-main",children:s}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:t})]})]})})}function k(){let e=(0,r.c)("translator"),[t,s]=(0,l.useState)("playground"),i=[{value:"playground",label:e("playground"),icon:"code"},{value:"chat-tester",label:e("chatTester"),icon:"chat"},{value:"test-bench",label:e("testBench"),icon:"science"},{value:"live-monitor",label:e("liveMonitor"),icon:"monitoring"}],o={playground:e("modeDescriptionPlayground"),"chat-tester":e("modeDescriptionChatTester"),"test-bench":e("modeDescriptionTestBench"),"live-monitor":e("modeDescriptionLiveMonitor")};return(0,a.jsxs)("div",{className:"p-4 sm:p-8 space-y-6 min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 min-w-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"translate"}),e("playgroundTitle")]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:o[t]||e("modeDescriptionFallback")})]}),(0,a.jsx)("div",{className:"w-full sm:w-auto overflow-x-auto",children:(0,a.jsx)(n.Iz,{options:i,value:t,onChange:s,size:"md",className:"min-w-max"})})]}),"playground"===t&&(0,a.jsx)(p,{}),"chat-tester"===t&&(0,a.jsx)(j,{}),"test-bench"===t&&(0,a.jsx)(v,{}),"live-monitor"===t&&(0,a.jsx)(N,{})]})}},5214:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=s(17828)},17828:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,s(64054).createAsyncLocalStorage)()},21957:(e,t,s)=>{"use strict";function a({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return a}}),s(95155),s(47650),s(5214),s(2451),s(53887)},41112:(e,t,s)=>{"use strict";function a({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}}),s(1980)},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={bindSnapshot:function(){return o},createAsyncLocalStorage:function(){return i},createSnapshot:function(){return c}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class l{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let n="u">typeof globalThis&&globalThis.AsyncLocalStorage;function i(){return n?new n:new l}function o(e){return n?n.bind(e):l.bind(e)}function c(){return n?n.snapshot():function(e,...t){return e(...t)}}},65355:(e,t,s)=>{Promise.resolve().then(s.bind(s,2824))},68635:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let a=s(95155),r=s(12115),l=s(41112);function n(e){return{default:e&&"default"in e?e.default:e}}s(21957);let i={loader:()=>Promise.resolve(n(()=>null)),loading:null,ssr:!0},o=function(e){let t={...i,...e},s=(0,r.lazy)(()=>t.loader().then(n)),o=t.loading;function c(e){let n=o?(0,a.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?r.Suspense:r.Fragment,d=t.ssr?(0,a.jsxs)(a.Fragment,{children:[null,(0,a.jsx)(s,{...e})]}):(0,a.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(s,{...e})});return(0,a.jsx)(c,{...i?{fallback:n}:{},children:d})}return c.displayName="LoadableComponent",c}},75707:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});let a=s(73623)._(s(68635));function r(e,t){let s={};"function"==typeof e&&(s.loader=e);let r={...s,...t};return(0,a.default)({...r,modules:r.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=65355)),_N_E=e.O()}]);
|
|
4
|
+
`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] ${k===e.id?"text-primary":"text-text-muted group-hover:text-primary"} transition-colors`,children:e.icon}),(0,a.jsx)("span",{className:"text-xs font-medium leading-tight",children:e.name})]},e.id))}),k&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),e("templateLoadHint",{format:o[s]?.label||s})]})]})})]})}var u=s(20909);function h(e="openai"){let t=(0,r.c)("translator"),[s,a]=(0,l.useState)(e),[n,i]=(0,l.useState)([]),[o,c]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),[r,l]=await Promise.all([e.json(),s.json()]),n=new Map((l.nodes||[]).map(e=>[e.id,e])),o=[...new Set((r.connections||[]).filter(e=>!1!==e.isActive).map(e=>e.provider))].map(e=>{let s=u.Q2[e],a=n.get(e),r=s?.name||a?.name||e;return!s&&e.startsWith(u.JH)&&(r=a?.name||t("openaiCompatibleLabel")),!s&&e.startsWith(u.DI)&&(r=a?.name||t("anthropicCompatibleLabel")),{value:e,label:r}}).sort((e,t)=>e.label.localeCompare(t.label)),c=o.length>0?o:Object.entries(u.Q2).map(([e,t])=>({value:e,label:t.name}));i(c),c.length>0&&a(e=>c.some(t=>t.value===e)?e:c[0].value)}catch{let e=Object.entries(u.Q2).map(([e,t])=>({value:e,label:t.name}));i(e),e.length>0&&a(t=>e.some(e=>e.value===t)?t:e[0].value)}finally{c(!1)}})()},[t]),{provider:s,setProvider:a,providerOptions:n,loading:o}}let g={openai:["gpt-","o1-","o3-","o4-"],"openai-responses":["gpt-","o1-","o3-","o4-"],claude:["claude-"],gemini:["gemini-"]};function b(){let[e,t]=(0,l.useState)(""),[s,a]=(0,l.useState)([]),[r,n]=(0,l.useState)(!0);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/v1/models"),t=((await e.json()).data||[]).map(e=>e.id).sort((e,t)=>e.localeCompare(t));a(t)}catch{a([])}finally{n(!1)}})()},[]);let i=(0,l.useCallback)(e=>{if(0===s.length)return"";for(let t of g[e]||[]){let e=s.find(e=>e.startsWith(t));if(e)return e}return s[0]},[s]);return{model:e,setModel:t,availableModels:s,loading:r,pickModelForFormat:i}}let f=m()(()=>s.e(8202).then(s.bind(s,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1});function j(){let e=(0,r.c)("translator"),{provider:t,setProvider:s,providerOptions:i}=h("openai"),{model:d,setModel:m,availableModels:x,pickModelForFormat:p}=b(),[u,g]=(0,l.useState)("openai"),[j,y]=(0,l.useState)(""),[v,N]=(0,l.useState)(!1),[w,k]=(0,l.useState)([]),[S,_]=(0,l.useState)(null),[C,O]=(0,l.useState)(null),T=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=p(u);e&&m(e)},[u,p,m]);let P=()=>{T.current?.scrollIntoView({behavior:"smooth"})},D=async()=>{if(!j.trim()||v)return;let s=j.trim();y(""),N(!0),k(e=>[...e,{role:"user",content:s}]);let a=[];try{let r,l=[...w.map(e=>({role:e.role,content:e.content})),{role:"user",content:s}];r="claude"===u?{model:d,max_tokens:1024,messages:l,stream:!0}:"gemini"===u?{model:d,contents:l.map(e=>({role:"assistant"===e.role?"model":"user",parts:[{text:e.content}]}))}:"openai-responses"===u?{model:d,input:l.map(e=>({type:"message",role:e.role,content:[{type:"input_text",text:e.content}]})),stream:!0}:{model:d,messages:l,stream:!0},a.push({id:1,name:e("clientRequest"),description:e("clientRequestDescription"),format:u,content:JSON.stringify(r,null,2),status:"done"});let n=await fetch("/api/translator/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:r})}),i=(await n.json()).format||u;a.push({id:2,name:e("formatDetected"),description:e("formatDetectedDescription"),format:i,content:JSON.stringify({detectedFormat:i,clientFormat:u,match:i===u},null,2),status:"done"});let o=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:i,targetFormat:"openai",body:r})}),c=await o.json();a.push({id:3,name:e("openaiIntermediate"),description:e("openaiIntermediateDescription"),format:"openai",content:JSON.stringify(c.result||c,null,2),status:c.success?"done":"error"});let m=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:"openai",provider:t,body:c.result})}),x=await m.json(),p=x.targetFormat||"openai";a.push({id:4,name:e("providerFormat"),description:e("providerFormatDescription"),format:p,content:JSON.stringify(x.result||x,null,2),status:x.success?"done":"error"});let h=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,body:x.result||c.result})});if(h.ok){let t=h.body.getReader(),s=new TextDecoder,r="";for(;;){let{done:e,value:a}=await t.read();if(e)break;r+=s.decode(a,{stream:!0})}a.push({id:5,name:e("providerResponse"),description:e("providerResponseSseDescription"),format:p,content:r.slice(0,5e3)+(r.length>5e3?"\n... (truncated)":""),status:"done"});let l=function(e){let t="";for(let s of e.split("\n")){if(!s.startsWith("data: "))continue;let e=s.slice(6).trim();if("[DONE]"===e)break;try{let s=JSON.parse(e),a=s.choices?.[0]?.delta;a?.content&&(t+=a.content),"content_block_delta"===s.type&&s.delta?.text&&(t+=s.delta.text)}catch{}}return t||e.slice(0,500)}(r);k(t=>[...t,{role:"assistant",content:l||e("noTextExtracted")}])}else{let t=await h.json().catch(()=>({error:e("requestFailed")}));a.push({id:5,name:e("providerResponse"),description:e("providerResponseRawDescription"),format:p,content:JSON.stringify(t,null,2),status:"error"}),k(s=>[...s,{role:"assistant",content:e("errorMessage",{message:t.error||e("requestFailed")})}])}}catch(t){a.push({id:a.length+1,name:e("error"),description:e("unexpectedError"),format:"error",content:JSON.stringify({error:t.message},null,2),status:"error"}),k(s=>[...s,{role:"assistant",content:e("errorMessage",{message:t.message})}])}_(a),O(a.length>0?a[a.length-1].id:null),N(!1),setTimeout(P,100)};return(0,a.jsxs)("div",{className:"space-y-4 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("pipelineDebugger")}),(0,a.jsx)("p",{children:e("chatTesterDescription")}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{className:"text-text-main",children:e("chatTesterFlow")}),"."," ",e("clickStepToInspect")]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 min-w-0",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:e("clientFormat")}),(0,a.jsx)(n.l6,{value:u,onChange:e=>g(e.target.value),options:c.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:e("provider")}),(0,a.jsx)(n.l6,{value:t,onChange:e=>s(e.target.value),options:i})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1 uppercase tracking-wider",children:e("model")}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:d,onChange:e=>m(e.target.value),list:"model-suggestions",placeholder:e("modelPlaceholder"),className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"model-suggestions",children:x.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),(0,a.jsxs)(n.Zp,{className:"min-h-[400px] flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 flex-1 overflow-y-auto max-h-[500px] space-y-3",children:[0===w.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-text-muted py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"chat"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:e("sendMessageToSeePipeline")}),(0,a.jsxs)("p",{className:"text-xs text-center max-w-xs",children:[e("chatMessageHintPrefix")," ",(0,a.jsx)("strong",{children:o[u]?.label})," ",e("chatMessageHintSuffix")]})]}),w.map((t,s)=>(0,a.jsx)("div",{className:`flex ${"user"===t.role?"justify-end":"justify-start"}`,children:(0,a.jsxs)("div",{className:`max-w-[85%] rounded-lg px-3 py-2 text-sm ${"user"===t.role?"bg-primary/10 text-text-main border border-primary/20":"bg-bg-subtle text-text-main border border-border"}`,children:[(0,a.jsx)("p",{className:"text-[10px] font-semibold text-text-muted mb-1 uppercase",children:"user"===t.role?e("youWithFormat",{format:o[u]?.label}):e("assistant")}),(0,a.jsx)("p",{className:"whitespace-pre-wrap break-words",children:t.content})]})},s)),(0,a.jsx)("div",{ref:T})]}),(0,a.jsx)("div",{className:"p-3 border-t border-border",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:j,onChange:e=>y(e.target.value),onKeyDown:e=>"Enter"===e.key&&!e.shiftKey&&D(),placeholder:e("typeMessage"),className:"flex-1 bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors",disabled:v}),(0,a.jsx)(n.$n,{icon:"send",onClick:D,loading:v,disabled:!j.trim()||v,children:e("send")})]})})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"account_tree"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("translationPipeline")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("clickStepToInspect")})]})}),S?(0,a.jsx)("div",{className:"space-y-2",children:S.map((e,t)=>{let s=o[e.format]||{label:e.format,color:"gray",icon:"code"},r=C===e.id;return(0,a.jsxs)("div",{children:[t>0&&(0,a.jsx)("div",{className:"flex justify-center py-1",children:(0,a.jsx)("div",{className:"w-px h-4 bg-border"})}),(0,a.jsxs)(n.Zp,{className:"error"===e.status?"border-red-500/30":r?"border-primary/30":"",children:[(0,a.jsxs)("button",{onClick:()=>O(r?null:e.id),className:"w-full p-3 flex items-center gap-3 text-left",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-7 h-7 rounded-full text-xs font-bold ${"error"===e.status?"bg-red-500/10 text-red-500":"done"===e.status?`bg-${s.color}-500/10 text-${s.color}-500`:"bg-bg-subtle text-text-muted"}`,children:"error"===e.status?"!":e.id}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:e.name}),e.description&&(0,a.jsx)("p",{className:"text-[10px] text-text-muted truncate",children:e.description})]}),(0,a.jsx)(n.Ex,{variant:"error"===e.status?"error":"default",size:"sm",children:s.label}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:r?"expand_less":"expand_more"})]}),r&&(0,a.jsx)("div",{className:"px-3 pb-3",children:(0,a.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,a.jsx)(f,{height:"250px",defaultLanguage:"json",value:e.content,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:11,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,readOnly:!0}})})})]})]},e.id)})}):(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30",children:"account_tree"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:e("pipelineVisualization")}),(0,a.jsx)("p",{className:"text-xs text-center max-w-xs",children:e("pipelineVisualizationHint")})]})})]})]})]})}let y=[{id:"simple-chat",icon:"chat",templateId:"simple-chat"},{id:"tool-calling",icon:"build",templateId:"tool-calling"},{id:"multi-turn",icon:"forum",templateId:"multi-turn"},{id:"thinking",icon:"psychology",templateId:"thinking"},{id:"system-prompt",icon:"settings",templateId:"system-prompt"},{id:"streaming",icon:"stream",templateId:"streaming"}];function v(){let e=(0,r.c)("translator"),t={"simple-chat":e("scenarioSimpleChat"),"tool-calling":e("scenarioToolCalling"),"multi-turn":e("scenarioMultiTurn"),thinking:e("scenarioThinking"),"system-prompt":e("scenarioSystemPrompt"),streaming:e("scenarioStreaming")},s=(0,l.useMemo)(()=>i(e),[e]),[d,m]=(0,l.useState)("claude"),{provider:x,setProvider:p,providerOptions:u}=h("openai"),{model:g,setModel:f,availableModels:j,pickModelForFormat:v}=b(),[N,w]=(0,l.useState)({}),[k,S]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=v(d);e&&f(e)},[d,v,f]);let _=async t=>{w(e=>({...e,[t.id]:{status:"running"}}));let a=Date.now();try{let r=s.find(e=>e.id===t.templateId),l=r?.formats[d]||r?.formats.openai;if(!l)return void w(s=>({...s,[t.id]:{status:"error",error:e("noTemplateForFormat"),latency:0}}));let n={...l,model:g};l.contents&&(n.model=g);let i=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:"direct",sourceFormat:d,provider:x,body:n})}),o=await i.json();if(!o.success)return void w(s=>({...s,[t.id]:{status:"error",error:e("translationFailed",{error:o.error}),latency:Date.now()-a}}));let c=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:x,body:o.result})}),m=Date.now()-a;if(!c.ok){let s=await c.json().catch(()=>({}));w(a=>({...a,[t.id]:{status:"error",error:s.error||e("errorMessage",{message:`HTTP ${c.status}`}),latency:m,httpStatus:c.status}}));return}let p=c.body.getReader(),u=0;for(;;){let{done:e}=await p.read();if(e)break;u++}w(e=>({...e,[t.id]:{status:"pass",latency:Date.now()-a,chunks:u}}))}catch(e){w(s=>({...s,[t.id]:{status:"error",error:e.message,latency:Date.now()-a}}))}},C=async()=>{for(let e of(S(!0),w({}),y))await _(e);S(!1)},O=Object.values(N).filter(e=>"pass"===e.status).length,T=Object.values(N).filter(e=>"error"===e.status).length,P=O+T,D=P>0?Math.round(O/P*100):0,E=o[d]||o.openai;return(0,a.jsxs)("div",{className:"space-y-5 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("compatibilityTester")}),(0,a.jsx)("p",{children:e("testBenchDescription")})]})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-end gap-4 min-w-0",children:[(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("source")}),(0,a.jsx)(n.l6,{value:d,onChange:e=>{m(e.target.value),w({})},options:c.filter(e=>["openai","claude","gemini","openai-responses"].includes(e.value))})]}),(0,a.jsx)("div",{className:"flex items-center justify-center px-2",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px] text-text-muted",children:"arrow_forward"})}),(0,a.jsxs)("div",{className:"flex-1 w-full",children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("targetProvider")}),(0,a.jsx)(n.l6,{value:x,onChange:e=>{p(e.target.value),w({})},options:u})]}),(0,a.jsx)(n.$n,{icon:"play_arrow",onClick:C,loading:k,disabled:k,className:"w-full sm:w-auto",children:e("runAllTests")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1.5 uppercase tracking-wider",children:e("model")}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:g,onChange:e=>f(e.target.value),list:"testbench-model-suggestions",placeholder:e("modelPlaceholder"),className:"w-full bg-bg-subtle border border-border rounded-lg px-3 py-2 text-sm text-text-main placeholder:text-text-muted focus:outline-none focus:border-primary transition-colors"}),(0,a.jsx)("datalist",{id:"testbench-model-suggestions",children:j.map(e=>(0,a.jsx)("option",{value:e},e))})]})]})]})}),P>0&&(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:e("compatibilityReport")}),(0,a.jsxs)(n.Ex,{variant:D>=80?"success":D>=50?"warning":"error",size:"lg",children:[D,"%"]})]}),(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"})," ",O," ",e("passed")]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"size-2 rounded-full bg-red-500"})," ",T," ",e("failed")]})]})]}),(0,a.jsx)("div",{className:"w-full h-2 bg-bg-subtle rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r from-green-500 to-emerald-400 rounded-full transition-all duration-500",style:{width:`${D}%`}})})]})}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:y.map(s=>{let r=N[s.id],l=r?.status==="running";return(0,a.jsx)(n.Zp,{className:`transition-all ${r?.status==="pass"?"border-green-500/30":r?.status==="error"?"border-red-500/30":""}`,children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-9 h-9 rounded-lg ${r?.status==="pass"?"bg-green-500/10 text-green-500":r?.status==="error"?"bg-red-500/10 text-red-500":"bg-bg-subtle text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:l?"progress_activity":r?.status==="pass"?"check_circle":r?.status==="error"?"error":s.icon})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-main",children:t[s.id]||s.id}),(0,a.jsxs)("p",{className:"text-[10px] text-text-muted uppercase",children:[E.label," →"," ",u.find(e=>e.value===x)?.label||x]})]})]})}),r&&"running"!==r.status&&(0,a.jsx)("div",{className:`rounded-lg p-2 text-xs ${"pass"===r.status?"bg-green-500/5 text-green-600 dark:text-green-400":"bg-red-500/5 text-red-600 dark:text-red-400"}`,children:"pass"===r.status?(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{children:e("passedIconLabel")}),(0,a.jsxs)("span",{className:"text-text-muted",children:[r.latency,"ms • ",r.chunks," ",e("chunks")]})]}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:["❌ ",r.error]}),(0,a.jsxs)("p",{className:"text-text-muted mt-0.5",children:[r.latency,"ms"]})]})}),(0,a.jsx)(n.$n,{size:"sm",variant:r?.status==="pass"?"ghost":"outline",icon:l?"progress_activity":"play_arrow",onClick:()=>_(s),disabled:l||k,className:"w-full",children:l?e("running"):r?e("reRun"):e("runTest")})]})},s.id)})})]})}function N(){let e=(0,r.c)("translator"),t=(0,r.c)("common"),[s,i]=(0,l.useState)([]),[c,d]=(0,l.useState)(!0),[m,x]=(0,l.useState)(!0),p=(0,l.useRef)(null),u=e("notAvailableSymbol"),h=t=>e("millisecondsShort",{value:t}),g=async()=>{try{let e=await fetch("/api/translator/history?limit=50");if(e.ok){let t=await e.json();i(t.events||[])}}catch{}finally{d(!1)}};(0,l.useEffect)(()=>(g(),m&&(p.current=setInterval(g,3e3)),()=>{p.current&&clearInterval(p.current)}),[m]);let b=s.filter(e=>"success"===e.status).length,f=s.filter(e=>"error"===e.status).length,j=s.length>0?Math.round(s.reduce((e,t)=>e+(t.latency||0),0)/s.length):0;return(0,a.jsxs)("div",{className:"space-y-5 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-primary/5 border border-primary/10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px] mt-0.5 shrink-0","aria-hidden":"true",children:"info"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-text-main mb-0.5",children:e("realtime")}),(0,a.jsxs)("p",{children:[e("liveMonitorDescriptionPrefix")," ",(0,a.jsx)("strong",{className:"text-text-main",children:e("chatTester")}),","," ",(0,a.jsx)("strong",{className:"text-text-main",children:e("testBench")}),e("liveMonitorDescriptionSuffix")]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,a.jsx)(w,{icon:"translate",label:e("totalTranslations"),value:s.length,color:"blue"}),(0,a.jsx)(w,{icon:"check_circle",label:e("successful"),value:b,color:"green"}),(0,a.jsx)(w,{icon:"error",label:e("errors"),value:f,color:"red"}),(0,a.jsx)(w,{icon:"speed",label:e("avgLatency"),value:h(j),color:"purple"})]}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${m?"text-green-500 animate-pulse":"text-text-muted"}`,"aria-hidden":"true",children:m?"radio_button_checked":"radio_button_unchecked"}),(0,a.jsx)("button",{onClick:()=>x(!m),className:"text-sm text-text-main hover:text-primary transition-colors",children:m?e("liveAutoRefreshing"):e("paused")})]}),(0,a.jsxs)("button",{onClick:g,className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"refresh"}),t("refresh")]})]})}),(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main mb-3",children:e("recentTranslations")}),c?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2","aria-hidden":"true",children:"progress_activity"}),t("loading")]}):0===s.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[48px] mb-3 opacity-30","aria-hidden":"true",children:"monitoring"}),(0,a.jsx)("p",{className:"text-sm font-medium mb-1",children:e("noTranslations")}),(0,a.jsx)("p",{className:"text-xs text-center max-w-sm",children:e("eventsAppearHint")}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 mt-3 text-xs",children:[(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("chatTesterTab")}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("testBenchTab")}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("externalApiCalls")}),(0,a.jsx)("span",{className:"px-2 py-1 rounded-md bg-bg-subtle border border-border",children:e("ideCliIntegrations")})]}),(0,a.jsx)("p",{className:"text-[10px] mt-3 text-text-muted/70",children:e("inMemoryNote")})]}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border",children:[(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("time")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("source")}),(0,a.jsx)("th",{className:"pb-2 pr-4"}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("target")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("model")}),(0,a.jsx)("th",{className:"pb-2 pr-4",children:e("status")}),(0,a.jsx)("th",{className:"pb-2 text-right",children:e("latency")})]})}),(0,a.jsx)("tbody",{children:s.map((t,s)=>{let r=o[t.sourceFormat]||{label:t.sourceFormat||"?",color:"gray"},l=o[t.targetFormat]||{label:t.targetFormat||"?",color:"gray"};return(0,a.jsxs)("tr",{className:"border-b border-border/50 hover:bg-bg-subtle/50 transition-colors",children:[(0,a.jsx)("td",{className:"py-2 pr-4 text-xs text-text-muted whitespace-nowrap",children:t.timestamp?new Date(t.timestamp).toLocaleTimeString():u}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"default",size:"sm",children:r.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"arrow_forward"})}),(0,a.jsx)("td",{className:"py-2 pr-4",children:(0,a.jsx)(n.Ex,{variant:"primary",size:"sm",children:l.label})}),(0,a.jsx)("td",{className:"py-2 pr-4 text-xs font-mono text-text-muted break-all",children:t.model||u}),(0,a.jsx)("td",{className:"py-2 pr-4",children:"success"===t.status?(0,a.jsx)(n.Ex,{variant:"success",size:"sm",dot:!0,children:e("ok")}):(0,a.jsx)(n.Ex,{variant:"error",size:"sm",dot:!0,children:t.statusCode||e("errorShort")})}),(0,a.jsx)("td",{className:"py-2 text-right text-xs text-text-muted",children:t.latency?h(t.latency):u})]},t.id||s)})})]})})]})})]})}function w({icon:e,label:t,value:s,color:r}){return(0,a.jsx)(n.Zp,{children:(0,a.jsxs)("div",{className:"p-4 flex items-center gap-3",children:[(0,a.jsx)("div",{className:`flex items-center justify-center w-10 h-10 rounded-lg bg-${r}-500/10`,children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[22px] text-${r}-500`,"aria-hidden":"true",children:e})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-lg font-bold text-text-main",children:s}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:t})]})]})})}function k(){let e=(0,r.c)("translator"),[t,s]=(0,l.useState)("playground"),i=[{value:"playground",label:e("playground"),icon:"code"},{value:"chat-tester",label:e("chatTester"),icon:"chat"},{value:"test-bench",label:e("testBench"),icon:"science"},{value:"live-monitor",label:e("liveMonitor"),icon:"monitoring"}],o={playground:e("modeDescriptionPlayground"),"chat-tester":e("modeDescriptionChatTester"),"test-bench":e("modeDescriptionTestBench"),"live-monitor":e("modeDescriptionLiveMonitor")};return(0,a.jsxs)("div",{className:"p-4 sm:p-8 space-y-6 min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 min-w-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h1",{className:"text-2xl font-bold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"translate"}),e("playgroundTitle")]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:o[t]||e("modeDescriptionFallback")})]}),(0,a.jsx)("div",{className:"w-full sm:w-auto overflow-x-auto",children:(0,a.jsx)(n.Iz,{options:i,value:t,onChange:s,size:"md",className:"min-w-max"})})]}),"playground"===t&&(0,a.jsx)(p,{}),"chat-tester"===t&&(0,a.jsx)(j,{}),"test-bench"===t&&(0,a.jsx)(v,{}),"live-monitor"===t&&(0,a.jsx)(N,{})]})}},5214:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=s(17828)},17828:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,s(64054).createAsyncLocalStorage)()},21957:(e,t,s)=>{"use strict";function a({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return a}}),s(95155),s(47650),s(5214),s(2451),s(53887)},34671:(e,t,s)=>{Promise.resolve().then(s.bind(s,2824))},41112:(e,t,s)=>{"use strict";function a({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}}),s(1980)},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={bindSnapshot:function(){return o},createAsyncLocalStorage:function(){return i},createSnapshot:function(){return c}};for(var a in s)Object.defineProperty(t,a,{enumerable:!0,get:s[a]});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class l{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let n="u">typeof globalThis&&globalThis.AsyncLocalStorage;function i(){return n?new n:new l}function o(e){return n?n.bind(e):l.bind(e)}function c(){return n?n.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let a=s(95155),r=s(12115),l=s(41112);function n(e){return{default:e&&"default"in e?e.default:e}}s(21957);let i={loader:()=>Promise.resolve(n(()=>null)),loading:null,ssr:!0},o=function(e){let t={...i,...e},s=(0,r.lazy)(()=>t.loader().then(n)),o=t.loading;function c(e){let n=o?(0,a.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?r.Suspense:r.Fragment,d=t.ssr?(0,a.jsxs)(a.Fragment,{children:[null,(0,a.jsx)(s,{...e})]}):(0,a.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(s,{...e})});return(0,a.jsx)(c,{...i?{fallback:n}:{},children:d})}return c.displayName="LoadableComponent",c}},75707:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});let a=s(73623)._(s(68635));function r(e,t){let s={};"function"==typeof e&&(s.loader=e);let r={...s,...t};return(0,a.default)({...r,modules:r.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[3418,8500,9751,8055,1149,5846,993,8441,3794,7358],()=>e(e.s=34671)),_N_E=e.O()}]);
|