tokenhop 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +7 -7
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/react-loadable-manifest.json +43 -43
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/[...missing]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/[...missing]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/[...missing]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/ui-kit/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/ui-kit/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/ui-kit/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tool-settings/[toolId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tool-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/headroom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/headroom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/gateway/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/home/live-routes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/home/quota/route.js +1 -1
- package/app/.next-cli-build/server/app/api/home/quota/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/home/summary/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/config/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/config/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/config/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/environment/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shell/savings-milestone/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shell/summary/route.js +1 -1
- package/app/.next-cli-build/server/app/api/shell/summary/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/last-activity/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/savings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +2 -2
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/media-providers.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/media-providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/settings.segments/!KGRhc2hib2FyZCk/dashboard/settings/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/settings.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/settings.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/ui-kit.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/ui-kit.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/ui-kit.segments/!KGRhc2hib2FyZCk/dashboard/ui-kit/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/ui-kit.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/ui-kit.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +10 -10
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/skills/[...slug]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +7 -7
- package/app/.next-cli-build/server/chunks/1152.js +1 -1
- package/app/.next-cli-build/server/chunks/1336.js +1 -1
- package/app/.next-cli-build/server/chunks/1432.js +1 -1
- package/app/.next-cli-build/server/chunks/1533.js +1 -1
- package/app/.next-cli-build/server/chunks/1764.js +1 -1
- package/app/.next-cli-build/server/chunks/1854.js +1 -0
- package/app/.next-cli-build/server/chunks/2380.js +7 -7
- package/app/.next-cli-build/server/chunks/24.js +1 -1
- package/app/.next-cli-build/server/chunks/2460.js +1 -1
- package/app/.next-cli-build/server/chunks/2592.js +1 -1
- package/app/.next-cli-build/server/chunks/318.js +10 -9
- package/app/.next-cli-build/server/chunks/3558.js +1 -1
- package/app/.next-cli-build/server/chunks/3593.js +1 -1
- package/app/.next-cli-build/server/chunks/3676.js +1 -1
- package/app/.next-cli-build/server/chunks/368.js +1 -0
- package/app/.next-cli-build/server/chunks/3919.js +1 -1
- package/app/.next-cli-build/server/chunks/3943.js +1 -1
- package/app/.next-cli-build/server/chunks/4037.js +1 -1
- package/app/.next-cli-build/server/chunks/4123.js +1 -1
- package/app/.next-cli-build/server/chunks/4125.js +1 -1
- package/app/.next-cli-build/server/chunks/4199.js +1 -1
- package/app/.next-cli-build/server/chunks/4334.js +1 -1
- package/app/.next-cli-build/server/chunks/4406.js +2 -2
- package/app/.next-cli-build/server/chunks/4521.js +1 -1
- package/app/.next-cli-build/server/chunks/4730.js +1 -1
- package/app/.next-cli-build/server/chunks/4780.js +1 -1
- package/app/.next-cli-build/server/chunks/4903.js +1 -0
- package/app/.next-cli-build/server/chunks/5055.js +1 -0
- package/app/.next-cli-build/server/chunks/5260.js +1 -0
- package/app/.next-cli-build/server/chunks/5335.js +1 -0
- package/app/.next-cli-build/server/chunks/5765.js +1 -0
- package/app/.next-cli-build/server/chunks/5827.js +1 -0
- package/app/.next-cli-build/server/chunks/6000.js +1 -0
- package/app/.next-cli-build/server/chunks/620.js +1 -0
- package/app/.next-cli-build/server/chunks/6252.js +1 -1
- package/app/.next-cli-build/server/chunks/6328.js +1 -0
- package/app/.next-cli-build/server/chunks/6403.js +1 -0
- package/app/.next-cli-build/server/chunks/6496.js +1 -1
- package/app/.next-cli-build/server/chunks/6565.js +1 -0
- package/app/.next-cli-build/server/chunks/6734.js +1 -1
- package/app/.next-cli-build/server/chunks/7211.js +1 -1
- package/app/.next-cli-build/server/chunks/7616.js +1 -1
- package/app/.next-cli-build/server/chunks/7716.js +1 -1
- package/app/.next-cli-build/server/chunks/7819.js +1 -1
- package/app/.next-cli-build/server/chunks/7828.js +1 -1
- package/app/.next-cli-build/server/chunks/7901.js +1 -1
- package/app/.next-cli-build/server/chunks/8171.js +1 -1
- package/app/.next-cli-build/server/chunks/8255.js +1 -1
- package/app/.next-cli-build/server/chunks/8372.js +1 -1
- package/app/.next-cli-build/server/chunks/8416.js +1 -1
- package/app/.next-cli-build/server/chunks/8895.js +12 -12
- package/app/.next-cli-build/server/chunks/8988.js +1 -0
- package/app/.next-cli-build/server/chunks/9219.js +1 -0
- package/app/.next-cli-build/server/chunks/9243.js +1 -0
- package/app/.next-cli-build/server/chunks/9326.js +1 -0
- package/app/.next-cli-build/server/chunks/9343.js +1 -1
- package/app/.next-cli-build/server/chunks/9489.js +3 -0
- package/app/.next-cli-build/server/chunks/9578.js +1 -1
- package/app/.next-cli-build/server/chunks/9594.js +1 -0
- package/app/.next-cli-build/server/chunks/965.js +1 -1
- package/app/.next-cli-build/server/chunks/9899.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{198-145d0ed2ec3c54f5.js → 198-0c7f5eadfd257db1.js} +1 -1
- package/app/.next-cli-build/static/chunks/{3670-e7a22341025498f8.js → 3670-90f5cd325f460eb5.js} +1 -1
- package/app/.next-cli-build/static/chunks/5014-a5d960f4c6bc6297.js +1 -0
- package/app/.next-cli-build/static/chunks/{6174.18e2c57e892d721a.js → 6174.f1da2912aec81c15.js} +1 -1
- package/app/.next-cli-build/static/chunks/6448-71a8c2ac8d9ecc09.js +1 -0
- package/app/.next-cli-build/static/chunks/7899-83edd7bbf1a98c4a.js +1 -0
- package/app/.next-cli-build/static/chunks/8105-bdd81b911fed8537.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-8147ae8fa9c04381.js → page-42bfc760fbea3b96.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-9cbf62f78701882a.js → page-084fc21b1dbae00d.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-5f91e148400a241b.js → page-59ee0b412f972940.js} +3 -3
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-dac4ab98fc595054.js → page-de53f51d191eec46.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-463f9fa33be9426a.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-06f4e52ee3b63f82.js → page-243d3da0a2c6cbe9.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/ui-kit/{page-6c982cc50b6af101.js → page-998f8c5a36dac961.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-923f864ec0be0fc8.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-dd9d1e49b2f69197.js → layout-96ebd2b46f1f8d39.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/landing/{page-02b7bfebd65c41f1.js → page-bcaea5febe1c68c0.js} +1 -1
- package/app/.next-cli-build/static/chunks/webpack-8693ccf029e9af63.js +1 -0
- package/app/custom-server.js +0 -37
- package/app/package.json +1 -1
- package/app/src/lib/db/adapters/sqljsAdapter.js +39 -4
- package/app/src/lib/oauth/services/xai.js +19 -12
- package/app/src/shared/services/quotaAutoPing.js +43 -8
- package/app/src/shared/services/quotaSnapshotPoller.js +2 -1
- package/app/src/sse/services/backgroundTokenRefresh.js +13 -1
- package/package.json +1 -1
- package/src/cli/menus/combos.js +3 -1
- package/app/.next-cli-build/server/chunks/1026.js +0 -1
- package/app/.next-cli-build/server/chunks/2384.js +0 -1
- package/app/.next-cli-build/server/chunks/3093.js +0 -1
- package/app/.next-cli-build/server/chunks/331.js +0 -1
- package/app/.next-cli-build/server/chunks/3414.js +0 -1
- package/app/.next-cli-build/server/chunks/3586.js +0 -1
- package/app/.next-cli-build/server/chunks/4278.js +0 -1
- package/app/.next-cli-build/server/chunks/6158.js +0 -1
- package/app/.next-cli-build/server/chunks/6354.js +0 -1
- package/app/.next-cli-build/server/chunks/6769.js +0 -1
- package/app/.next-cli-build/server/chunks/7261.js +0 -1
- package/app/.next-cli-build/server/chunks/8635.js +0 -3
- package/app/.next-cli-build/server/chunks/994.js +0 -1
- package/app/.next-cli-build/static/chunks/5014-a441cde708542153.js +0 -1
- package/app/.next-cli-build/static/chunks/6448-4eabf683083596e6.js +0 -1
- package/app/.next-cli-build/static/chunks/7899-e6a70cb9d3684f7f.js +0 -1
- package/app/.next-cli-build/static/chunks/8105-5c7e7c73b4bd532d.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-9fadf2c38665c20c.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-7571538830147099.js +0 -1
- package/app/.next-cli-build/static/chunks/webpack-187fa25c98ba99f3.js +0 -1
- /package/app/.next-cli-build/static/{3Qm_WgU2xvFJ9U_G7SKhT → J4xdfHpBUAMOCO5dsemSj}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{3Qm_WgU2xvFJ9U_G7SKhT → J4xdfHpBUAMOCO5dsemSj}/_ssgManifest.js +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{10185:(e,i,o)=>{"use strict";o.d(i,{default:()=>d});var t=o(95155),r=o(14051),s=o.n(r),l=o(12115),n=o(31474),a=o(4650);function d({value:e,copyValue:i,label:o="Copy to clipboard",showCopyButton:r=!0,className:s,...c}){let[u,p]=(0,l.useState)(null),f=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>clearTimeout(f.current),[]);let m=e=>{p(e),clearTimeout(f.current),f.current=setTimeout(()=>p(null),2e3)},h=async()=>{try{await (0,a.eM)(i??e),m("copied")}catch{m("error")}};return(0,t.jsxs)("div",{className:(0,n.cn)("flex h-11 items-center gap-2 rounded-lg border border-line bg-raised ps-3 pe-1.5 transition-colors","focus-within:border-coral focus-within:shadow-focus",s),...c,children:[(0,t.jsx)("code",{title:String(i??e),className:"min-w-0 flex-1 truncate font-mono text-sm text-text",children:e}),r?(0,t.jsx)("button",{type:"button","aria-label":o,onClick:h,className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-muted transition-colors hover:bg-line/60 hover:text-text focus-visible:shadow-focus",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:"copied"===u?"check":"error"===u?"error":"content_copy"})}):null,r?(0,t.jsx)("span",{"aria-live":"polite",className:"sr-only",children:"copied"===u?"Copied":"error"===u?"Copy failed":""}):null]})}d.propTypes={value:s().oneOfType([s().string,s().number]).isRequired,copyValue:s().string,label:s().string,showCopyButton:s().bool,className:s().string}},28915:(e,i,o)=>{"use strict";o.d(i,{E2:()=>t,gs:()=>r});function t(e){if(!e)return null;let i=e.match(/\b([45]\d{2})\b/);return i?i[1]:"ERR"}function r(e){if(!e)return"";let i=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;let o=Math.floor(i/60);if(o<24)return`${o}h ago`;let t=Math.floor(o/24);return`${t}d ago`}o(8247)},52024:(e,i,o)=>{"use strict";o.d(i,{default:()=>a});var t=o(95155),r=o(14051),s=o.n(r),l=o(31474),n=o(98582);function a({label:e,placeholder:i,value:o,onChange:r,error:s,hint:d,disabled:c=!1,required:u=!1,rows:p=3,className:f,textareaClassName:m,id:h,...x}){return(0,t.jsx)(n.default,{id:h,label:e,hint:d,error:s,required:u,className:f,children:({inputId:e,describedBy:s,invalid:n})=>(0,t.jsx)("textarea",{...x,id:e,placeholder:i,value:o,onChange:r,disabled:c,rows:p,"aria-describedby":s,"aria-invalid":n||void 0,className:(0,l.cn)("w-full px-3 py-2.5 text-sm text-text bg-raised rounded-lg","border border-line placeholder:text-subtle resize-y","focus:outline-none focus:border-coral focus:shadow-focus","transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",n&&"border-err focus:border-err",m)})})}a.propTypes={label:s().node,placeholder:s().string,value:s().oneOfType([s().string,s().number]),onChange:s().func,error:s().node,hint:s().node,disabled:s().bool,required:s().bool,rows:s().number,className:s().string,textareaClassName:s().string,id:s().string,"aria-label":s().string}},54268:(e,i,o)=>{"use strict";o.d(i,{HR:()=>h,HX:()=>a,Rw:()=>s,UP:()=>u,e_:()=>m,f7:()=>p,h6:()=>c,nb:()=>l,ob:()=>f,s6:()=>n,sf:()=>d});var t=o(28915),r=o(53956);let s={ALL:"all",CONNECTED:"connected",NEEDS_ATTENTION:"needs-attention",OAUTH:"oauth",FREE:"free",APIKEY:"apikey"},l=[{value:s.ALL,label:"All"},{value:s.CONNECTED,label:"Connected"},{value:s.NEEDS_ATTENTION,label:"Needs attention"},{value:s.OAUTH,label:"OAuth"},{value:s.FREE,label:"Free tier"},{value:s.APIKEY,label:"API key"}];function n(e){return(0,r.Gy)(e)}function a(e,i,o){let s=Array.isArray(o)?o:[o],l=e.filter(e=>e.provider===i&&s.includes(e.authType)),n=(0,r.SB)(l),a=n.counts.ok+n.counts.warn+n.counts.err,d=l.filter(e=>["err","warn"].includes((0,r.tT)(e).status)),c=n.counts.err+n.counts.warn,u=l.length,p=u>0&&n.counts.off===u,f=l.some(e=>"Cooling down"===(0,r.tT)(e).reason),m=d.sort((e,i)=>new Date(i.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:a,error:c,total:u,errorCode:m?function(e){if(!e)return null;let i=e.lastErrorType;if("runtime_error"===i)return"RUNTIME";if("upstream_auth_error"===i||"auth_missing"===i||"token_refresh_failed"===i||"token_expired"===i)return"AUTH";if("upstream_rate_limited"===i)return"429";if("upstream_unavailable"===i)return"5XX";if("network_error"===i)return"NET";let o=Number(e.errorCode);if(Number.isFinite(o)&&o>=400)return String(o);let r=(0,t.E2)(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let s=(e.lastError||"").toLowerCase();return s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")?"RUNTIME":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.includes("unauthorized")||s.includes("no access token")||s.includes("missing access token")||s.includes("auth")||s.includes("sign in")||s.includes("signin")||s.includes("expired")?"AUTH":"ERR"}(m):null,errorTime:m?.lastErrorAt?(0,t.gs)(m.lastErrorAt):null,allDisabled:p,hasCooldown:f}}function d(e){return e&&0!==e.length?e.map((e,i)=>{let o=e.name||e.email||`Account ${i+1}`,t=(0,r.tT)(e);return"off"===t.status?{value:0,kind:"none",label:o}:"warn"===t.status?{value:50,kind:"warn",label:o}:"err"===t.status?{value:100,kind:"err",label:o}:{value:100,kind:"ok",label:o}}):[{value:0,kind:"none",label:"No accounts"}]}function c(e){return new URLSearchParams(e||"").get("provider")||null}function u(e,i){let o=new URLSearchParams(e||"");i?o.set("provider",i):o.delete("provider");let t=o.toString();return t?`/dashboard/providers?${t}`:"/dashboard/providers"}function p(e,i,o=!1,t=null,r){return e===s.ALL||(e===s.CONNECTED?!o&&(i?.connected||0)>0:e===s.NEEDS_ATTENTION?m(i,o,r):e===s.OAUTH?"oauth"===t:e===s.FREE?"free"===t:e!==s.APIKEY||"apikey"===t||"compatible"===t)}function f(e){let i={[s.ALL]:e.length,[s.CONNECTED]:0,[s.NEEDS_ATTENTION]:0,[s.OAUTH]:0,[s.FREE]:0,[s.APIKEY]:0};for(let o of e){let{stats:e,isNoAuth:t,authGroup:r}=o;p(s.CONNECTED,e,t)&&(i[s.CONNECTED]+=1),p(s.NEEDS_ATTENTION,e,t,r,o.hasCooldown)&&(i[s.NEEDS_ATTENTION]+=1),"oauth"===r?i[s.OAUTH]+=1:"free"===r?i[s.FREE]+=1:("apikey"===r||"compatible"===r)&&(i[s.APIKEY]+=1)}return i}function m(e,i=!1,o){return!i&&((e?.error||0)>0||(o??e?.hasCooldown)===!0)}function h(e){return`${e} ${1===e?"needs":"need"} a look`}},77302:(e,i,o)=>{Promise.resolve().then(o.bind(o,94535))},94535:(e,i,o)=>{"use strict";o.d(i,{default:()=>eu});var t=o(95155),r=o(12115),s=o(17081),l=o(73321),n=o(98500),a=o.n(n),d=o(25086),c=o(56006),u=o(92542),p=o(4823),f=o(65921),m=o(55415);let h={key:null,models:[],error:null};async function x(e,{refresh:i=!1}={}){let o=await fetch(`/api/providers/${e}/models${i?"?refresh=1":""}`,{cache:"no-store"}),t=await o.json().catch(()=>null);if(!o.ok)throw Error(t?.error||`Failed to fetch models (HTTP ${o.status})`);return{models:Array.isArray(t?.models)?t.models:[],warning:t?.warning||null}}function y(e,{models:i,warning:o}){return{key:e,models:i,error:o||(i.length>0?null:"No live models returned.")}}var b=o(16047),v=o(55558),g=o(37368),C=o(75782),k=o(14051),A=o.n(k),j=o(96975),N=o(19301),w=o(19123),T=o(10185),R=o(54268);function S({providerId:e,providerInfo:i,connections:o,authLabel:r,authVariant:s,modelSnippet:l,loading:n}){let a=o.filter(e=>!1!==e.isActive).length,c=o.filter(e=>(0,R.s6)(e)).length,u=o.filter(e=>["error","expired"].includes(e.testStatus)).length,p=0===o.length?{variant:"neutral",label:"No accounts"}:u>0?{variant:"err",label:`${u} error${1===u?"":"s"}`}:c>0?{variant:"warn",label:`${c} cooling down`}:{variant:"ok",label:`${a} active`},f=i?.notice?.apiKeyUrl||i?.notice?.signupUrl||i?.website;return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-start gap-3.5",children:[(0,t.jsx)(j.default,{providerId:e,size:"lg",status:"neutral"===p.variant?void 0:p.variant}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,t.jsx)(N.A,{children:i?.name||e}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","aria-live":"polite",children:[(0,t.jsx)(w.default,{variant:s,children:r}),(0,t.jsx)(w.default,{variant:p.variant,dot:"neutral"!==p.variant,children:p.label}),f?(0,t.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-h-11 items-center gap-1 px-1 text-xs font-semibold text-coral-ink hover:text-coral focus-visible:shadow-focus focus-visible:outline-none",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"open_in_new"}),i?.notice?.apiKeyUrl?"Get API key":"Sign up / Learn more"]}):null]})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 rounded-2xl bg-raised p-3.5",children:[(0,t.jsx)("span",{className:"text-[13px] text-muted",children:"Point any client at your endpoint and ask for"}),n?(0,t.jsx)(d.Skeleton,{className:"h-11 w-full"}):(0,t.jsx)(T.default,{value:`"model": "${l}"`,copyValue:l,label:"Copy model id snippet"})]})]})}function E(e){return String(e||"").replace(/^\s*(?:\u26A0\uFE0F?\s*)?(?:risk notice:\s*)?/i,"").trim()}function O({providerInfo:e}){return e?.deprecated?(0,t.jsx)(c.default,{variant:"warn",title:"Risk notice",children:E(e.deprecationNotice)}):e?.notice?.text?(0,t.jsx)(c.default,{variant:"info",title:"Provider notice",icon:"info",children:(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[e.notice.text,e.notice.apiKeyUrl?(0,t.jsx)(u.default,{size:"sm",variant:"secondary",iconRight:"open_in_new",onClick:()=>window.open(e.notice.apiKeyUrl,"_blank","noopener"),children:"Get API key"}):null]})}):null}S.propTypes={providerId:A().string.isRequired,providerInfo:A().object,connections:A().array.isRequired,authLabel:A().string.isRequired,authVariant:A().string.isRequired,modelSnippet:A().string.isRequired,loading:A().bool},O.propTypes={providerInfo:A().object};var q=o(84588);function I({isAnthropic:e,apiType:i,baseUrl:o,onAddKey:r,onEdit:s,onDelete:l}){return(0,t.jsx)(q.default,{title:e?"Anthropic Compatible Details":"OpenAI Compatible Details",subtitle:(0,t.jsxs)("span",{className:"break-all font-mono text-[13px]",children:[e?"Messages API":"responses"===i?"Responses API":"Chat Completions"," \xb7 ",(o||"").replace(/\/$/,""),"/",e?"messages":"responses"===i?"responses":"chat/completions"]}),action:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(u.default,{size:"sm",icon:"add",onClick:r,children:"Add API key"}),(0,t.jsx)(u.default,{size:"sm",variant:"secondary",icon:"edit",onClick:s,children:"Edit"}),(0,t.jsx)(u.default,{size:"sm",variant:"secondary",icon:"delete",onClick:l,children:"Delete"})]})})}I.propTypes={isAnthropic:A().bool.isRequired,apiType:A().string,baseUrl:A().string,onAddKey:A().func.isRequired,onEdit:A().func.isRequired,onDelete:A().func.isRequired};var P=o(11090),$=o(3196),_=o(11910),D=o(99312),M=o(73006),U=o(81231),K=o(50934),F=o(11059);function J({isFreeNoAuth:e,storageAlias:i,displayAlias:o,isAnthropic:s,connections:l,models:n,actions:a}){let{copied:d,error:c,copy:p}=(0,F.C)(),[f,m]=(0,r.useState)(""),[h,x]=(0,r.useState)(!1),[y,b]=(0,r.useState)(!1),[v,g]=(0,r.useState)(null),[C,k]=(0,r.useState)({}),A=(0,U.R)({customModels:n.customModels,modelAliases:n.modelAliases,providerAlias:i,type:"llm"}),j=l.some(e=>!1!==e.isActive),N=async e=>{if(!v){g(e);try{let o=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${i}/${e}`})}),t=await o.json().catch(()=>({})),r=o.ok&&t.ok;k(i=>({...i,[e]:r?"ok":"error"})),r||a.notifyError(t.error||"Model not reachable")}catch{k(i=>({...i,[e]:"error"})),a.notifyError("Network error")}finally{g(null)}}},w=async()=>{let e=f.trim();if(e&&!h){if(A.some(i=>i.id===e))return void a.notifyError("Model already exists for this provider.");x(!0);try{await n.addCustomModel(e,"llm",i)&&m("")}finally{x(!1)}}},T=async()=>{if(y)return;let e=l.find(e=>!1!==e.isActive);if(e){b(!0);try{let o=await fetch(`/api/providers/${e.id}/models`),t=await o.json().catch(()=>({}));if(!o.ok)return void a.notifyError(t.error||"Failed to import models");let r=t.models||[];if(0===r.length)return void a.notifyError("No models returned from /models.");let s=0;for(let e of r){let o=e.id||e.name||e.model;o&&!A.some(e=>e.id===o)&&await n.addCustomModel(o,"llm",i)&&(s+=1)}0===s?a.notifyError("No new models were added."):a.notifySuccess(`Imported ${s} model${1===s?"":"s"}.`)}catch(e){a.notifyError(e instanceof Error?e.message:"Failed to import models")}finally{b(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("p",{className:"text-sm text-muted",children:s?(0,M.Tl)("Add Anthropic-compatible models manually or import them from the /models endpoint."):(0,M.Tl)("Add OpenAI-compatible models manually or import them from the /models endpoint.")}),(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,t.jsx)(_.default,{label:"Model ID",id:"new-compatible-model-input",value:f,onChange:e=>m(e.target.value),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:s?"claude-3-opus-20240229":"gpt-4o",className:"min-w-60 flex-1"}),(0,t.jsx)(u.default,{size:"sm",icon:"add",onClick:w,disabled:!f.trim()||h,children:h?"Adding…":"Add"}),(0,t.jsx)(u.default,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!j||y,loading:y,children:y?"Importing…":"Import from /models"})]}),j?null:(0,t.jsx)("p",{className:"text-xs text-muted",children:"Add a connection to enable importing models."}),A.length>0?(0,t.jsx)("ul",{className:"flex min-w-0 flex-col gap-2",children:A.map(({id:r,alias:s,source:a})=>(0,t.jsx)(K.A,{model:{id:r},fullModel:`${o}/${r}`,copied:d,copyError:c,onCopy:p,onDeleteAlias:()=>"custom"===a?n.deleteCustomModel(r,"llm",i):n.deleteAlias(s),onTest:l.length>0||e?()=>N(r):void 0,testStatus:C[r],isTesting:v===r,isCustom:!0},`${a}-${i}/${r}`))}):(0,t.jsx)(D.default,{icon:"smart_toy",title:"No models yet",body:"Add a model id above or import the provider /models catalog."})]})}J.propTypes={isFreeNoAuth:A().bool.isRequired,storageAlias:A().string.isRequired,displayAlias:A().string.isRequired,isAnthropic:A().bool.isRequired,connections:A().array.isRequired,models:A().object.isRequired,actions:A().shape({notifyError:A().func.isRequired,notifySuccess:A().func.isRequired}).isRequired};var L=o(62899),B=o(30815),z=o(95088),G=o(91348),H=o(40684),X=o(23936),W=o(71252),V=o(81127),Y=o(47199),Z=o(99380),Q=o(56061);function ee({isOpen:e,node:i,onSave:o,onClose:s,isAnthropic:l}){let[n,a]=(0,r.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,r.useState)(!1),[p,f]=(0,r.useState)(""),[m,h]=(0,r.useState)(""),[x,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(null);(0,r.useEffect)(()=>{i&&a({name:i.name||"",prefix:i.prefix||"",apiType:i.apiType||"chat",baseUrl:i.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[i,l]);let g=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){c(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};l||(e.apiType=n.apiType),await o(e)}finally{c(!1)}}},C=async()=>{y(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:p,type:l?"anthropic-compatible":"openai-compatible",modelId:m.trim()||void 0})}),i=await e.json();v(i.valid?"success":"failed")}catch{v("failed")}finally{y(!1)}};return i?(0,t.jsx)(V.default,{isOpen:e,title:`Edit ${l?"Anthropic":"OpenAI"} Compatible`,onClose:s,children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(_.default,{label:"Name",value:n.name,onChange:e=>a({...n,name:e.target.value}),placeholder:`${l?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,t.jsx)(_.default,{label:"Prefix",value:n.prefix,onChange:e=>a({...n,prefix:e.target.value}),placeholder:l?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!l&&(0,t.jsx)(Z.default,{label:"API type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>a({...n,apiType:e.target.value})}),(0,t.jsx)(_.default,{label:"Base URL",value:n.baseUrl,onChange:e=>a({...n,baseUrl:e.target.value}),placeholder:l?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${l?"Anthropic":"OpenAI"}-compatible API.`}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(_.default,{label:"API key (for check)",type:"password",value:p,onChange:e=>f(e.target.value),className:"flex-1"}),(0,t.jsx)("div",{className:"pt-6",children:(0,t.jsx)(u.default,{onClick:C,disabled:!p||x||!n.baseUrl.trim(),variant:"secondary",children:x?"Checking...":"Check"})})]}),(0,t.jsx)(_.default,{label:"Model ID (optional)",value:m,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),b&&(0,t.jsx)(Q.default,{variant:"success"===b?"success":"error",children:"success"===b?"Valid":"Invalid"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.default,{onClick:g,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,t.jsx)(u.default,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}ee.propTypes={isOpen:A().bool.isRequired,node:A().shape({id:A().string,name:A().string,prefix:A().string,apiType:A().string,baseUrl:A().string}),onSave:A().func.isRequired,onClose:A().func.isRequired,isAnthropic:A().bool};var ei=o(69909);let eo=`[
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{10185:(e,i,o)=>{"use strict";o.d(i,{default:()=>d});var t=o(95155),r=o(14051),s=o.n(r),n=o(12115),l=o(31474),a=o(4650);function d({value:e,copyValue:i,label:o="Copy to clipboard",showCopyButton:r=!0,className:s,...c}){let[u,p]=(0,n.useState)(null),f=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>clearTimeout(f.current),[]);let m=e=>{p(e),clearTimeout(f.current),f.current=setTimeout(()=>p(null),2e3)},h=async()=>{try{await (0,a.eM)(i??e),m("copied")}catch{m("error")}};return(0,t.jsxs)("div",{className:(0,l.cn)("flex h-11 items-center gap-2 rounded-lg border border-line bg-raised ps-3 pe-1.5 transition-colors","focus-within:border-coral focus-within:shadow-focus",s),...c,children:[(0,t.jsx)("code",{title:String(i??e),className:"min-w-0 flex-1 truncate font-mono text-sm text-text",children:e}),r?(0,t.jsx)("button",{type:"button","aria-label":o,onClick:h,className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-muted transition-colors hover:bg-line/60 hover:text-text focus-visible:shadow-focus",children:(0,t.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:"copied"===u?"check":"error"===u?"error":"content_copy"})}):null,r?(0,t.jsx)("span",{"aria-live":"polite",className:"sr-only",children:"copied"===u?"Copied":"error"===u?"Copy failed":""}):null]})}d.propTypes={value:s().oneOfType([s().string,s().number]).isRequired,copyValue:s().string,label:s().string,showCopyButton:s().bool,className:s().string}},28915:(e,i,o)=>{"use strict";o.d(i,{E2:()=>t,gs:()=>r});function t(e){if(!e)return null;let i=e.match(/\b([45]\d{2})\b/);return i?i[1]:"ERR"}function r(e){if(!e)return"";let i=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;let o=Math.floor(i/60);if(o<24)return`${o}h ago`;let t=Math.floor(o/24);return`${t}d ago`}o(8247)},52024:(e,i,o)=>{"use strict";o.d(i,{default:()=>a});var t=o(95155),r=o(14051),s=o.n(r),n=o(31474),l=o(98582);function a({label:e,placeholder:i,value:o,onChange:r,error:s,hint:d,disabled:c=!1,required:u=!1,rows:p=3,className:f,textareaClassName:m,id:h,...x}){return(0,t.jsx)(l.default,{id:h,label:e,hint:d,error:s,required:u,className:f,children:({inputId:e,describedBy:s,invalid:l})=>(0,t.jsx)("textarea",{...x,id:e,placeholder:i,value:o,onChange:r,disabled:c,rows:p,"aria-describedby":s,"aria-invalid":l||void 0,className:(0,n.cn)("w-full px-3 py-2.5 text-sm text-text bg-raised rounded-lg","border border-line placeholder:text-subtle resize-y","focus:outline-none focus:border-coral focus:shadow-focus","transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",l&&"border-err focus:border-err",m)})})}a.propTypes={label:s().node,placeholder:s().string,value:s().oneOfType([s().string,s().number]),onChange:s().func,error:s().node,hint:s().node,disabled:s().bool,required:s().bool,rows:s().number,className:s().string,textareaClassName:s().string,id:s().string,"aria-label":s().string}},54268:(e,i,o)=>{"use strict";o.d(i,{HR:()=>h,HX:()=>a,Rw:()=>s,UP:()=>u,e_:()=>m,f7:()=>p,h6:()=>c,nb:()=>n,ob:()=>f,s6:()=>l,sf:()=>d});var t=o(28915),r=o(53956);let s={ALL:"all",CONNECTED:"connected",NEEDS_ATTENTION:"needs-attention",OAUTH:"oauth",FREE:"free",APIKEY:"apikey"},n=[{value:s.ALL,label:"All"},{value:s.CONNECTED,label:"Connected"},{value:s.NEEDS_ATTENTION,label:"Needs attention"},{value:s.OAUTH,label:"OAuth"},{value:s.FREE,label:"Free tier"},{value:s.APIKEY,label:"API key"}];function l(e){return(0,r.Gy)(e)}function a(e,i,o){let s=Array.isArray(o)?o:[o],n=e.filter(e=>e.provider===i&&s.includes(e.authType)),l=(0,r.SB)(n),a=l.counts.ok+l.counts.warn+l.counts.err,d=n.filter(e=>["err","warn"].includes((0,r.tT)(e).status)),c=l.counts.err+l.counts.warn,u=n.length,p=u>0&&l.counts.off===u,f=n.some(e=>"Cooling down"===(0,r.tT)(e).reason),m=d.sort((e,i)=>new Date(i.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:a,error:c,total:u,errorCode:m?function(e){if(!e)return null;let i=e.lastErrorType;if("runtime_error"===i)return"RUNTIME";if("upstream_auth_error"===i||"auth_missing"===i||"token_refresh_failed"===i||"token_expired"===i)return"AUTH";if("upstream_rate_limited"===i)return"429";if("upstream_unavailable"===i)return"5XX";if("network_error"===i)return"NET";let o=Number(e.errorCode);if(Number.isFinite(o)&&o>=400)return String(o);let r=(0,t.E2)(e.lastError);if("401"===r||"403"===r)return"AUTH";if(r&&"ERR"!==r)return r;let s=(e.lastError||"").toLowerCase();return s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")?"RUNTIME":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.includes("unauthorized")||s.includes("no access token")||s.includes("missing access token")||s.includes("auth")||s.includes("sign in")||s.includes("signin")||s.includes("expired")?"AUTH":"ERR"}(m):null,errorTime:m?.lastErrorAt?(0,t.gs)(m.lastErrorAt):null,allDisabled:p,hasCooldown:f}}function d(e){return e&&0!==e.length?e.map((e,i)=>{let o=e.name||e.email||`Account ${i+1}`,t=(0,r.tT)(e);return"off"===t.status?{value:0,kind:"none",label:o}:"warn"===t.status?{value:50,kind:"warn",label:o}:"err"===t.status?{value:100,kind:"err",label:o}:{value:100,kind:"ok",label:o}}):[{value:0,kind:"none",label:"No accounts"}]}function c(e){return new URLSearchParams(e||"").get("provider")||null}function u(e,i){let o=new URLSearchParams(e||"");i?o.set("provider",i):o.delete("provider");let t=o.toString();return t?`/dashboard/providers?${t}`:"/dashboard/providers"}function p(e,i,o=!1,t=null,r){return e===s.ALL||(e===s.CONNECTED?!o&&(i?.connected||0)>0:e===s.NEEDS_ATTENTION?m(i,o,r):e===s.OAUTH?"oauth"===t:e===s.FREE?"free"===t:e!==s.APIKEY||"apikey"===t||"compatible"===t)}function f(e){let i={[s.ALL]:e.length,[s.CONNECTED]:0,[s.NEEDS_ATTENTION]:0,[s.OAUTH]:0,[s.FREE]:0,[s.APIKEY]:0};for(let o of e){let{stats:e,isNoAuth:t,authGroup:r}=o;p(s.CONNECTED,e,t)&&(i[s.CONNECTED]+=1),p(s.NEEDS_ATTENTION,e,t,r,o.hasCooldown)&&(i[s.NEEDS_ATTENTION]+=1),"oauth"===r?i[s.OAUTH]+=1:"free"===r?i[s.FREE]+=1:("apikey"===r||"compatible"===r)&&(i[s.APIKEY]+=1)}return i}function m(e,i=!1,o){return!i&&((e?.error||0)>0||(o??e?.hasCooldown)===!0)}function h(e){return`${e} ${1===e?"needs":"need"} a look`}},77302:(e,i,o)=>{Promise.resolve().then(o.bind(o,94535))},94535:(e,i,o)=>{"use strict";o.d(i,{default:()=>eu});var t=o(95155),r=o(12115),s=o(17081),n=o(73321),l=o(98500),a=o.n(l),d=o(25086),c=o(56006),u=o(92542),p=o(4823),f=o(65921),m=o(55415);let h={key:null,models:[],error:null};async function x(e,{refresh:i=!1}={}){let o=await fetch(`/api/providers/${e}/models${i?"?refresh=1":""}`,{cache:"no-store"}),t=await o.json().catch(()=>null);if(!o.ok)throw Error(t?.error||`Failed to fetch models (HTTP ${o.status})`);return{models:Array.isArray(t?.models)?t.models:[],warning:t?.warning||null}}function y(e,{models:i,warning:o}){return{key:e,models:i,error:o||(i.length>0?null:"No live models returned.")}}var b=o(16047),v=o(55558),g=o(37368),C=o(75782),k=o(14051),A=o.n(k),j=o(96975),N=o(19301),w=o(19123),T=o(10185),R=o(54268);function S({providerId:e,providerInfo:i,connections:o,authLabel:r,authVariant:s,modelSnippet:n,loading:l}){let a=o.filter(e=>!1!==e.isActive).length,c=o.filter(e=>(0,R.s6)(e)).length,u=o.filter(e=>["error","expired"].includes(e.testStatus)).length,p=0===o.length?{variant:"neutral",label:"No accounts"}:u>0?{variant:"err",label:`${u} error${1===u?"":"s"}`}:c>0?{variant:"warn",label:`${c} cooling down`}:{variant:"ok",label:`${a} active`},f=i?.notice?.apiKeyUrl||i?.notice?.signupUrl||i?.website;return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-start gap-3.5",children:[(0,t.jsx)(j.default,{providerId:e,size:"lg",status:"neutral"===p.variant?void 0:p.variant}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,t.jsx)(N.A,{children:i?.name||e}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","aria-live":"polite",children:[(0,t.jsx)(w.default,{variant:s,children:r}),(0,t.jsx)(w.default,{variant:p.variant,dot:"neutral"!==p.variant,children:p.label}),f?(0,t.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-h-11 items-center gap-1 px-1 text-xs font-semibold text-coral-ink hover:text-coral focus-visible:shadow-focus focus-visible:outline-none",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"open_in_new"}),i?.notice?.apiKeyUrl?"Get API key":"Sign up / Learn more"]}):null]})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-2 rounded-2xl bg-raised p-3.5",children:[(0,t.jsx)("span",{className:"text-[13px] text-muted",children:"Point any client at your endpoint and ask for"}),l?(0,t.jsx)(d.Skeleton,{className:"h-11 w-full"}):(0,t.jsx)(T.default,{value:`"model": "${n}"`,copyValue:n,label:"Copy model id snippet"})]})]})}function E(e){return String(e||"").replace(/^\s*(?:\u26A0\uFE0F?\s*)?(?:risk notice:\s*)?/i,"").trim()}function O({providerInfo:e}){return e?.deprecated?(0,t.jsx)(c.default,{variant:"warn",title:"Risk notice",children:E(e.deprecationNotice)}):e?.notice?.text?(0,t.jsx)(c.default,{variant:"info",title:"Provider notice",icon:"info",children:(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[e.notice.text,e.notice.apiKeyUrl?(0,t.jsx)(u.default,{size:"sm",variant:"secondary",iconRight:"open_in_new",onClick:()=>window.open(e.notice.apiKeyUrl,"_blank","noopener"),children:"Get API key"}):null]})}):null}S.propTypes={providerId:A().string.isRequired,providerInfo:A().object,connections:A().array.isRequired,authLabel:A().string.isRequired,authVariant:A().string.isRequired,modelSnippet:A().string.isRequired,loading:A().bool},O.propTypes={providerInfo:A().object};var q=o(84588);function I({isAnthropic:e,apiType:i,baseUrl:o,onAddKey:r,onEdit:s,onDelete:n}){return(0,t.jsx)(q.default,{title:e?"Anthropic Compatible Details":"OpenAI Compatible Details",subtitle:(0,t.jsxs)("span",{className:"break-all font-mono text-[13px]",children:[e?"Messages API":"responses"===i?"Responses API":"Chat Completions"," \xb7 ",(o||"").replace(/\/$/,""),"/",e?"messages":"responses"===i?"responses":"chat/completions"]}),action:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(u.default,{size:"sm",icon:"add",onClick:r,children:"Add API key"}),(0,t.jsx)(u.default,{size:"sm",variant:"secondary",icon:"edit",onClick:s,children:"Edit"}),(0,t.jsx)(u.default,{size:"sm",variant:"secondary",icon:"delete",onClick:n,children:"Delete"})]})})}I.propTypes={isAnthropic:A().bool.isRequired,apiType:A().string,baseUrl:A().string,onAddKey:A().func.isRequired,onEdit:A().func.isRequired,onDelete:A().func.isRequired};var P=o(11090),$=o(3196),_=o(11910),D=o(99312),M=o(73006),U=o(81231),K=o(50934),F=o(11059);function J({isFreeNoAuth:e,storageAlias:i,displayAlias:o,isAnthropic:s,connections:n,models:l,actions:a}){let{copied:d,error:c,copy:p}=(0,F.C)(),[f,m]=(0,r.useState)(""),[h,x]=(0,r.useState)(!1),[y,b]=(0,r.useState)(!1),[v,g]=(0,r.useState)(()=>new Set),C=(0,r.useRef)(new Set),[k,A]=(0,r.useState)({}),j=(0,U.R)({customModels:l.customModels,modelAliases:l.modelAliases,providerAlias:i,type:"llm"}),N=n.some(e=>!1!==e.isActive),w=async e=>{if(!C.current.has(e)){C.current.add(e),g(new Set(C.current));try{let o=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${i}/${e}`})}),t=await o.json().catch(()=>({})),r=o.ok&&t.ok;A(i=>({...i,[e]:r?"ok":"error"})),r||a.notifyError(t.error||"Model not reachable")}catch{A(i=>({...i,[e]:"error"})),a.notifyError("Network error")}finally{C.current.delete(e),g(new Set(C.current))}}},T=async()=>{let e=f.trim();if(e&&!h){if(j.some(i=>i.id===e))return void a.notifyError("Model already exists for this provider.");x(!0);try{await l.addCustomModel(e,"llm",i)&&m("")}finally{x(!1)}}},R=async()=>{if(y)return;let e=n.find(e=>!1!==e.isActive);if(e){b(!0);try{let o=await fetch(`/api/providers/${e.id}/models`),t=await o.json().catch(()=>({}));if(!o.ok)return void a.notifyError(t.error||"Failed to import models");let r=t.models||[];if(0===r.length)return void a.notifyError("No models returned from /models.");let s=0;for(let e of r){let o=e.id||e.name||e.model;o&&!j.some(e=>e.id===o)&&await l.addCustomModel(o,"llm",i)&&(s+=1)}0===s?a.notifyError("No new models were added."):a.notifySuccess(`Imported ${s} model${1===s?"":"s"}.`)}catch(e){a.notifyError(e instanceof Error?e.message:"Failed to import models")}finally{b(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("p",{className:"text-sm text-muted",children:s?(0,M.Tl)("Add Anthropic-compatible models manually or import them from the /models endpoint."):(0,M.Tl)("Add OpenAI-compatible models manually or import them from the /models endpoint.")}),(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,t.jsx)(_.default,{label:"Model ID",id:"new-compatible-model-input",value:f,onChange:e=>m(e.target.value),onKeyDown:e=>"Enter"===e.key&&T(),placeholder:s?"claude-3-opus-20240229":"gpt-4o",className:"min-w-60 flex-1"}),(0,t.jsx)(u.default,{size:"sm",icon:"add",onClick:T,disabled:!f.trim()||h,children:h?"Adding…":"Add"}),(0,t.jsx)(u.default,{size:"sm",variant:"secondary",icon:"download",onClick:R,disabled:!N||y,loading:y,children:y?"Importing…":"Import from /models"})]}),N?null:(0,t.jsx)("p",{className:"text-xs text-muted",children:"Add a connection to enable importing models."}),j.length>0?(0,t.jsx)("ul",{className:"flex min-w-0 flex-col gap-2",children:j.map(({id:r,alias:s,source:a})=>(0,t.jsx)(K.A,{model:{id:r},fullModel:`${o}/${r}`,copied:d,copyError:c,onCopy:p,onDeleteAlias:()=>"custom"===a?l.deleteCustomModel(r,"llm",i):l.deleteAlias(s),onTest:n.length>0||e?()=>w(r):void 0,testStatus:k[r],isTesting:v.has(r),isCustom:!0},`${a}-${i}/${r}`))}):(0,t.jsx)(D.default,{icon:"smart_toy",title:"No models yet",body:"Add a model id above or import the provider /models catalog."})]})}J.propTypes={isFreeNoAuth:A().bool.isRequired,storageAlias:A().string.isRequired,displayAlias:A().string.isRequired,isAnthropic:A().bool.isRequired,connections:A().array.isRequired,models:A().object.isRequired,actions:A().shape({notifyError:A().func.isRequired,notifySuccess:A().func.isRequired}).isRequired};var L=o(62899),B=o(30815),z=o(95088),G=o(91348),H=o(40684),X=o(23936),W=o(71252),V=o(81127),Y=o(47199),Z=o(99380),Q=o(56061);function ee({isOpen:e,node:i,onSave:o,onClose:s,isAnthropic:n}){let[l,a]=(0,r.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[d,c]=(0,r.useState)(!1),[p,f]=(0,r.useState)(""),[m,h]=(0,r.useState)(""),[x,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(null);(0,r.useEffect)(()=>{i&&a({name:i.name||"",prefix:i.prefix||"",apiType:i.apiType||"chat",baseUrl:i.baseUrl||(n?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[i,n]);let g=async()=>{if(l.name.trim()&&l.prefix.trim()&&l.baseUrl.trim()){c(!0);try{let e={name:l.name,prefix:l.prefix,baseUrl:l.baseUrl};n||(e.apiType=l.apiType),await o(e)}finally{c(!1)}}},C=async()=>{y(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:l.baseUrl,apiKey:p,type:n?"anthropic-compatible":"openai-compatible",modelId:m.trim()||void 0})}),i=await e.json();v(i.valid?"success":"failed")}catch{v("failed")}finally{y(!1)}};return i?(0,t.jsx)(V.default,{isOpen:e,title:`Edit ${n?"Anthropic":"OpenAI"} Compatible`,onClose:s,children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(_.default,{label:"Name",value:l.name,onChange:e=>a({...l,name:e.target.value}),placeholder:`${n?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,t.jsx)(_.default,{label:"Prefix",value:l.prefix,onChange:e=>a({...l,prefix:e.target.value}),placeholder:n?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!n&&(0,t.jsx)(Z.default,{label:"API type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:l.apiType,onChange:e=>a({...l,apiType:e.target.value})}),(0,t.jsx)(_.default,{label:"Base URL",value:l.baseUrl,onChange:e=>a({...l,baseUrl:e.target.value}),placeholder:n?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${n?"Anthropic":"OpenAI"}-compatible API.`}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(_.default,{label:"API key (for check)",type:"password",value:p,onChange:e=>f(e.target.value),className:"flex-1"}),(0,t.jsx)("div",{className:"pt-6",children:(0,t.jsx)(u.default,{onClick:C,disabled:!p||x||!l.baseUrl.trim(),variant:"secondary",children:x?"Checking...":"Check"})})]}),(0,t.jsx)(_.default,{label:"Model ID (optional)",value:m,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),b&&(0,t.jsx)(Q.default,{variant:"success"===b?"success":"error",children:"success"===b?"Valid":"Invalid"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.default,{onClick:g,fullWidth:!0,disabled:!l.name.trim()||!l.prefix.trim()||!l.baseUrl.trim()||d,children:d?"Saving...":"Save"}),(0,t.jsx)(u.default,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}ee.propTypes={isOpen:A().bool.isRequired,node:A().shape({id:A().string,name:A().string,prefix:A().string,apiType:A().string,baseUrl:A().string}),onSave:A().func.isRequired,onClose:A().func.isRequired,isAnthropic:A().bool};var ei=o(69909);let eo=`[
|
|
2
2
|
{
|
|
3
3
|
"accessToken": "eyJhbGc...",
|
|
4
4
|
"refreshToken": "rt_...",
|
|
5
5
|
"idToken": "eyJhbGc...",
|
|
6
6
|
"email": "user@example.com"
|
|
7
7
|
}
|
|
8
|
-
]`;function et({isOpen:e,onClose:i,onSuccess:o}){let[s,
|
|
8
|
+
]`;function et({isOpen:e,onClose:i,onSuccess:o}){let[s,n]=(0,r.useState)(""),[l,a]=(0,r.useState)(!1),[d,c]=(0,r.useState)(""),[p,f]=(0,r.useState)(null),m=()=>{l||(n(""),c(""),f(null),i())},h=async()=>{var e;let i;c(""),f(null);let t=s.trim();if(!t)return;try{i=JSON.parse(t)}catch(e){c(`${(0,M.Tl)("Invalid JSON")}: ${e.message}`);return}let r=Array.isArray(e=i)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!r||0===r.length)return void c((0,M.Tl)("No accounts found in input"));a(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:r})}),i=await e.json();if(!e.ok)return void c(i?.error||`Request failed: ${e.status}`);f(i),i.success>0&&"function"==typeof o&&o()}catch(e){c(e.message||(0,M.Tl)("Request failed"))}finally{a(!1)}},x=p?.results?.filter(e=>!e.ok)||[];return(0,t.jsx)(V.default,{isOpen:e,title:(0,M.Tl)("Bulk add Codex accounts"),onClose:m,children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("p",{className:"text-xs text-muted",children:(0,M.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,t.jsx)("textarea",{className:"w-full rounded border border-coral/30 bg-panel p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-coral",placeholder:eo,value:s,onChange:e=>n(e.target.value),disabled:l}),d&&(0,t.jsx)("p",{className:"text-xs text-red-500 break-words",children:d}),p&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:[p.success," ",(0,M.Tl)("added"),p.failed>0?`, ${p.failed} ${(0,M.Tl)("failed")}`:""]}),x.length>0&&(0,t.jsx)("ul",{className:"rounded border border-coral/20 bg-raised p-2 text-xs font-mono max-h-40 overflow-y-auto",children:x.map(e=>(0,t.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.default,{onClick:h,fullWidth:!0,disabled:l||!s.trim(),children:l?(0,M.Tl)("Importing..."):(0,M.Tl)("Import all")}),(0,t.jsx)(u.default,{onClick:m,variant:"ghost",fullWidth:!0,disabled:l,children:(0,M.Tl)("Close")})]})]})})}et.propTypes={isOpen:A().bool.isRequired,onClose:A().func.isRequired,onSuccess:A().func};let er=`[
|
|
9
9
|
{
|
|
10
10
|
"access_token": "eyJ0eXAiOiJhdCtqd3Qi...",
|
|
11
11
|
"refresh_token": "LZhriF9bf88pPykpXCuZ9...",
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
"id_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
|
|
19
19
|
"email": "account2@example.com"
|
|
20
20
|
}
|
|
21
|
-
]`;function es(e){let i,o=e.trim();if(!o)return[];try{i=JSON.parse(o)}catch(e){try{let e=o;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),i=JSON.parse(e)}catch{throw e}}if(Array.isArray(i))return i;if(i&&"object"==typeof i)return Array.isArray(i.accounts)?i.accounts:[i];throw Error("Input must be a JSON object or array of objects")}function el({isOpen:e,onClose:i,onSuccess:o}){let[s,l]=(0,r.useState)(""),[n,a]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[f,m]=(0,r.useState)(null),[h,x]=(0,r.useState)(!1),[y,b]=(0,r.useState)(null),v=(0,r.useRef)(null),g=()=>{n||(l(""),p(""),m(null),b(null),x(!1),i())},C=async e=>{if(!e||0===e.length)return;p("");let i=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===i.length)return void p((0,M.Tl)("Please select valid .json files"));try{let e=[];for(let o of i){let i=await o.text(),t=es(i);Array.isArray(t)?e.push(...t):t&&e.push(t)}if(0===e.length)return void p((0,M.Tl)("No accounts found in selected files"));l(JSON.stringify(e,null,2)),b({filesCount:i.length,accountsCount:e.length})}catch(e){p(`${(0,M.Tl)("Error reading files")}: ${e.message}`)}},k=async()=>{let e;p(""),m(null);try{e=es(s)}catch(e){p(`${(0,M.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void p((0,M.Tl)("No accounts found in input"));a(!0);try{let i=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),t=await i.json();if(!i.ok)return void p(t?.error||`Request failed: ${i.status}`);m(t),t.success>0&&"function"==typeof o&&o()}catch(e){p(e.message||(0,M.Tl)("Request failed"))}finally{a(!1)}},A=f?.results?.filter(e=>!e.ok)||[];return(0,t.jsx)(V.default,{isOpen:e,title:(0,M.Tl)("Bulk add Grok CLI accounts"),onClose:g,children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted",children:(0,M.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,t.jsx)("input",{ref:v,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{C(e.target.files),e.target&&(e.target.value="")}}),(0,t.jsx)(u.default,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>v.current?.click(),disabled:n,children:(0,M.Tl)("Upload JSON files")})]}),(0,t.jsxs)("div",{onDragOver:e=>{e.preventDefault(),x(!0)},onDragLeave:e=>{e.preventDefault(),x(!1)},onDrop:e=>{e.preventDefault(),x(!1),e.dataTransfer?.files?.length>0&&C(e.dataTransfer.files)},className:`relative rounded border transition-colors ${h?"border-coral bg-coral-bg ring-2 ring-coral/30":"border-coral/30 bg-panel"}`,children:[(0,t.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-coral",placeholder:er,value:s,onChange:e=>{l(e.target.value),b(null)},disabled:n}),h&&(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-panel/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-3xl text-coral-ink mb-1",children:"upload_file"}),(0,t.jsx)("span",{className:"text-sm font-medium text-coral-ink",children:(0,M.Tl)("Drop .json files here")})]})]}),y&&(0,t.jsxs)(c.default,{variant:"ok",className:"p-2 text-xs",children:[(0,M.Tl)("Loaded")," ",y.accountsCount," ",(0,M.Tl)("account(s) from")," ",y.filesCount," ",(0,M.Tl)("file(s)")]}),d&&(0,t.jsx)(c.default,{variant:"err",className:"break-words",children:d}),f&&f.failed>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)(w.default,{variant:"warn",className:"self-start",children:[f.failed," ",(0,M.Tl)("failed")]}),A.length>0&&(0,t.jsx)("ul",{className:"rounded border border-coral/20 bg-raised p-2 text-xs font-mono max-h-40 overflow-y-auto",children:A.map(e=>(0,t.jsxs)("li",{className:"text-err",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.default,{onClick:k,fullWidth:!0,disabled:n||!s.trim(),children:n?(0,M.Tl)("Importing..."):(0,M.Tl)("Import all")}),(0,t.jsx)(u.default,{onClick:g,variant:"ghost",fullWidth:!0,disabled:n,children:(0,M.Tl)("Close")})]})]})})}function en({providerId:e,isCompatible:i,hasDualAuthModes:o,labels:r,onOAuth:s,onApiKey:l,onAdd:n,onCookie:a,onBulkCodex:d,onBulkGrokCli:c}){return(0,t.jsxs)(t.Fragment,{children:["iflow"===e?(0,t.jsx)(u.default,{size:"sm",icon:"cookie",variant:"secondary",onClick:a,title:"Add connection using browser cookie",children:"Cookie"}):null,"codex"===e?(0,t.jsx)(u.default,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:d,title:"Bulk import codex accounts from JSON",children:"Bulk add"}):null,"grok-cli"===e?(0,t.jsx)(u.default,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:c,title:"Bulk import Grok CLI accounts from JSON",children:"Bulk add"}):null,o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.default,{size:"sm",icon:"lock",variant:"secondary",onClick:s,children:r.oauth}),(0,t.jsx)(u.default,{size:"sm",icon:"key",variant:"primary",onClick:l,children:r.apiKey})]}):(0,t.jsx)(u.default,{size:"sm",icon:"add",variant:"primary",onClick:n,children:i?"Add API key":"iflow"===e?"OAuth":"Add connection"})]})}function ea({providerId:e,providerInfo:i,isCompatible:o,isAnthropic:r,storageAlias:s,displayAlias:l,proxyPools:n,connectionNames:a,addConnectionError:d,selectedConnection:c,show:u,handlers:p,models:f}){return(0,t.jsxs)(t.Fragment,{children:["kiro"===e?(0,t.jsx)(L.default,{isOpen:u.oauth,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}):"cursor"===e?(0,t.jsx)(B.default,{isOpen:u.oauth,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}):"gitlab"===e?(0,t.jsx)(z.default,{isOpen:u.oauth,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}):(0,t.jsx)(G.default,{isOpen:u.oauth,provider:e,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}),(0,t.jsx)(H.default,{isOpen:u.xiaomiMimo,onSuccess:p.oauthSuccess,onClose:p.closeXiaomiMimo}),"iflow"===e?(0,t.jsx)(X.default,{isOpen:u.iflowCookie,onSuccess:p.iflowCookieSuccess,onClose:p.closeIflowCookie}):null,(0,t.jsx)(Y.A,{isOpen:u.addApiKey,provider:e,providerName:i.name,isCompatible:o,isAnthropic:r,authType:i?.authType,authHint:i?.authHint,website:i?.website,proxyPools:n,error:d,existingNames:a,onSave:p.saveApiKey,onBulkDone:p.refreshConnections,onClose:p.closeAddApiKey}),(0,t.jsx)(W.default,{isOpen:u.edit,connection:c,proxyPools:n,onSave:p.updateConnection,onClose:p.closeEdit}),o?(0,t.jsx)(ee,{isOpen:u.editNode,node:p.compatibleNode,onSave:p.updateNode,onClose:p.closeEditNode,isAnthropic:r}):null,o?null:(0,t.jsx)(ei.A,{isOpen:f.showAddCustomModel,providerAlias:s,providerDisplayAlias:l,onSave:p.saveCustomModel,onClose:p.closeAddCustomModel}),"codex"===e?(0,t.jsx)(et,{isOpen:u.bulkCodex,onClose:p.closeBulkCodex,onSuccess:p.refreshConnections}):null,"grok-cli"===e?(0,t.jsx)(el,{isOpen:u.bulkGrokCli,onClose:p.closeBulkGrokCli,onSuccess:p.refreshConnections}):null,(0,t.jsx)(V.ConfirmDialog,{isOpen:u.agRisk,onClose:p.closeAgRisk,onConfirm:p.confirmAgRisk,title:"Risk notice",message:E(i?.deprecationNotice),confirmText:"I understand, continue",cancelText:"Cancel",variant:"danger"})]})}en.propTypes={providerId:A().string.isRequired,isCompatible:A().bool.isRequired,hasDualAuthModes:A().bool.isRequired,labels:A().object.isRequired,onOAuth:A().func.isRequired,onApiKey:A().func.isRequired,onAdd:A().func.isRequired,onCookie:A().func.isRequired,onBulkCodex:A().func.isRequired,onBulkGrokCli:A().func.isRequired},ea.propTypes={providerId:A().string.isRequired,providerInfo:A().object.isRequired,isCompatible:A().bool.isRequired,isAnthropic:A().bool.isRequired,storageAlias:A().string.isRequired,displayAlias:A().string.isRequired,proxyPools:A().array.isRequired,connectionNames:A().array.isRequired,addConnectionError:A().string,selectedConnection:A().object,show:A().shape({oauth:A().bool.isRequired,xiaomiMimo:A().bool.isRequired,iflowCookie:A().bool.isRequired,addApiKey:A().bool.isRequired,edit:A().bool.isRequired,editNode:A().bool.isRequired,bulkCodex:A().bool.isRequired,bulkGrokCli:A().bool.isRequired,agRisk:A().bool.isRequired}).isRequired,handlers:A().shape({oauthSuccess:A().func.isRequired,closeOAuth:A().func.isRequired,closeXiaomiMimo:A().func.isRequired,iflowCookieSuccess:A().func.isRequired,closeIflowCookie:A().func.isRequired,saveApiKey:A().func.isRequired,refreshConnections:A().func.isRequired,closeAddApiKey:A().func.isRequired,updateConnection:A().func.isRequired,closeEdit:A().func.isRequired,compatibleNode:A().object,updateNode:A().func.isRequired,closeEditNode:A().func.isRequired,saveCustomModel:A().func.isRequired,closeAddCustomModel:A().func.isRequired,closeBulkCodex:A().func.isRequired,closeBulkGrokCli:A().func.isRequired,closeAgRisk:A().func.isRequired,confirmAgRisk:A().func.isRequired}).isRequired,models:A().object.isRequired};let ed="ag_risk_confirmed",ec={claude:"claudeAutoPing",codex:"codexAutoPing"};function eu(){let e=(0,l.useParams)(),i=(0,l.useRouter)(),o=e.id,n=(0,r.useCallback)(e=>f.i.getState().error(e),[]),k=(0,r.useCallback)(e=>f.i.getState().success(e),[]),[A,j]=(0,r.useState)(!0),[N,w]=(0,r.useState)(""),[T,R]=(0,r.useState)(null),[E,q]=(0,r.useState)({oauth:!1,xiaomiMimo:!1,iflowCookie:!1,addApiKey:!1,edit:!1,editNode:!1,bulkCodex:!1,bulkGrokCli:!1,agRisk:!1}),_=(0,r.useCallback)(e=>q(i=>({...i,[e]:!0})),[]),D=(0,r.useCallback)(e=>q(i=>({...i,[e]:!1})),[]),[M,U]=(0,r.useState)(""),[K,F]=(0,r.useState)(null),[L,B]=(0,r.useState)({enabled:!1,connections:{}}),z=(0,b.Z)({providerId:o,notifyError:n}),G=(0,v.w)({providerId:o,notifyError:n}),H=(0,C.kw)(o,T),X=(0,C.ds)(o,H),W=X.isOpenAICompatible||X.isAnthropicCompatible,{storageAlias:V,displayAlias:Y}=(0,C.mC)(o,T,W),{staticModels:Z,isLiveCatalog:Q}=(0,C.RT)(o),{liveModels:ee,liveError:ei,refresh:eo}=function({providerId:e,connections:i,enabled:o}){let t=o&&(i||[]).find(e=>!1!==e.isActive)?.id||null,s=t?`${e}:${t}`:null,[l,n]=(0,r.useState)(h);(0,r.useEffect)(()=>{if(!t)return;let e=!1;return x(t).then(i=>{e||n(y(s,i))}).catch(i=>{e||n({key:s,models:[],error:i?.message||"Failed to reach the live model catalog."})}),()=>{e=!0}},[s,t]);let a=(0,r.useCallback)(async()=>{if(!t)throw Error("No active connection");let e=await x(t,{refresh:!0});return n(y(s,e)),e},[s,t]),d=s&&l.key===s?l:h;return{liveModels:d.models,liveError:d.error,refresh:a}}({providerId:o,connections:z.connections,enabled:Q&&!W}),et=Q&&ee.length>0&&!W?(0,m.rE)(o,ee,Z):Z,er=(0,g.G)({providerId:o,storageAlias:V,staticModels:Z,catalogModels:et,notifyError:n}),es=(0,C.qR)(o),el=!W&&X.isOAuth&&X.supportsApiKey,{fetchConnections:eu}=z,{load:ep}=G,{load:ef,loadThinking:em}=er,eh=(0,r.useCallback)(async()=>{w("");try{await eu(),await Promise.all([ep(),ef(),em()]);let e=await fetch("/api/provider-nodes",{cache:"no-store"});if(e.ok){let i=((await e.json().catch(()=>({}))).nodes||[]).find(e=>e.id===o)||null;if(!i&&W)for(let e=0;e<3;e+=1){await new Promise(e=>setTimeout(e,150));let e=await fetch("/api/provider-nodes",{cache:"no-store"});if(e.ok&&(i=((await e.json().catch(()=>({}))).nodes||[]).find(e=>e.id===o)||null))break}R(i)}let i=await fetch("/api/settings",{cache:"no-store"}),t=i.ok?await i.json().catch(()=>({})):{},r=ec[o],s=r&&t[r]||{};B({enabled:!0===s.enabled,connections:s.connections||{}})}catch(e){console.log("Error fetching provider detail:",e),w("Could not load this provider. Check the gateway and try again.")}finally{j(!1)}},[eu,W,ef,ep,em,o]);(0,r.useEffect)(()=>{eh()},[eh]);let ex=()=>{"antigravity"===o&&"true"!==window.localStorage.getItem(ed)?_("agRisk"):"xiaomi-mimo"===o?_("xiaomiMimo"):X.isOAuth?_("oauth"):(U(""),_("addApiKey"))},ey=()=>{U(""),_("addApiKey")},eb=async()=>{await z.fetchConnections(),(0,s.q0)()},ev=async e=>{U("");try{let i=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o,...e})}),t=await i.json().catch(()=>null);if(i.ok){await eb(),D("addApiKey");return}U(t?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),U("Failed to save connection")}},eg=async e=>{try{let i=await fetch(`/api/providers/${K.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!i.ok)return(await i.json().catch(()=>({}))).error||"Failed to save connection";return await eb(),D("edit"),null}catch(e){return console.log("Error updating connection:",e),"Failed to save connection"}},eC=async e=>{try{let i=await fetch(`/api/provider-nodes/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await i.json().catch(()=>({}));i.ok?(R(t.node),await eb(),D("editNode")):n(t.error||"Failed to update provider.")}catch(e){console.log("Error updating provider node:",e)}},ek=(0,t.jsx)(en,{providerId:o,isCompatible:W,hasDualAuthModes:el,labels:es,onOAuth:ex,onApiKey:ey,onAdd:()=>{X.isOAuth?ex():ey()},onCookie:()=>_("iflowCookie"),onBulkCodex:()=>_("bulkCodex"),onBulkGrokCli:()=>_("bulkGrokCli")}),eA=`${Y}/${er.enabledModels[0]?.id||er.customModelRows[0]?.id||Z[0]?.id||"model-id"}`,ej=X.isOAuth?"info":X.isFreeNoAuth?"live":X.supportsApiKey?"brand":"neutral",eN=X.isOAuth?"OAuth":X.isFreeNoAuth?"Free":X.supportsApiKey?"API key":W?"Compatible":"Provider";return A?(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-5 px-1 sm:px-0","aria-busy":"true",children:[(0,t.jsx)("span",{className:"sr-only",role:"status",children:"Loading provider"}),(0,t.jsx)(d.CardSkeleton,{}),(0,t.jsx)(d.CardSkeleton,{})]}):H?(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-5 px-1 sm:px-0",children:[(0,t.jsx)(S,{providerId:o,providerInfo:H,connections:z.connections,authLabel:eN,authVariant:ej,modelSnippet:eA,loading:!1}),(0,t.jsx)(O,{providerInfo:H}),N?(0,t.jsx)(c.default,{variant:"err",title:"Could not load provider",children:(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[N,(0,t.jsx)(u.default,{size:"sm",variant:"secondary",onClick:eh,children:"Retry"})]})}):null,W&&T?(0,t.jsx)(I,{isAnthropic:X.isAnthropicCompatible,apiType:T.apiType,baseUrl:T.baseUrl,onAddKey:ey,onEdit:()=>_("editNode"),onDelete:()=>{z.setConfirmState({title:"Delete compatible node",message:`Delete this ${X.isAnthropicCompatible?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{z.setConfirmState(null);try{(await fetch(`/api/provider-nodes/${o}`,{method:"DELETE"})).ok?i.push("/dashboard/providers"):n("Failed to delete provider.")}catch(e){console.log("Error deleting provider node:",e)}}})}}):null,X.isFreeNoAuth?(0,t.jsx)(p.default,{providerId:o}):(0,t.jsx)(P.A,{providerId:o,auth:{isOAuth:X.isOAuth,hasDualAuthModes:el,labels:es},strategy:G,conn:z,autoPing:{enabled:L.enabled,connections:L.connections,toggle:(e,i)=>{let t=ec[o];if(!t)return;let r={...L,connections:{...L.connections,[e]:i}};B(r),fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:r})}).catch(e=>console.log("Error saving auto-ping config:",e))}},actions:{addButtons:ek,edit:e=>{F(e),_("edit")},notifyError:n}}),(0,t.jsx)($.A,{providerId:o,storageAlias:V,displayAlias:Y,isLiveCatalog:Q,isCompatible:W,isAnthropic:X.isAnthropicCompatible,isFreeNoAuth:X.isFreeNoAuth,connections:z.connections,catalogModels:et,staticModels:Z,liveError:ei,refreshLive:eo,models:er,onDisableAll:e=>z.setConfirmState(e),compatibleSection:(0,t.jsx)(J,{isFreeNoAuth:X.isFreeNoAuth,storageAlias:V,displayAlias:Y,isAnthropic:X.isAnthropicCompatible,connections:z.connections,models:er,actions:{notifyError:n,notifySuccess:k}})}),(0,t.jsx)(ea,{providerId:o,providerInfo:H,isCompatible:W,isAnthropic:X.isAnthropicCompatible,storageAlias:V,displayAlias:Y,proxyPools:z.proxyPools,connectionNames:z.connections.map(e=>e.name).filter(Boolean),addConnectionError:M,selectedConnection:K,show:E,handlers:{oauthSuccess:()=>{eb(),D("oauth")},closeOAuth:()=>D("oauth"),closeXiaomiMimo:()=>D("xiaomiMimo"),iflowCookieSuccess:()=>{eb(),D("iflowCookie")},closeIflowCookie:()=>D("iflowCookie"),saveApiKey:ev,refreshConnections:eb,closeAddApiKey:()=>{U(""),D("addApiKey")},updateConnection:eg,closeEdit:()=>D("edit"),compatibleNode:T,updateNode:eC,closeEditNode:()=>D("editNode"),saveCustomModel:async(e,i)=>{let o=await er.addCustomModel(e,"llm",V,i);return o&&er.setShowAddCustomModel(!1),o},closeAddCustomModel:()=>er.setShowAddCustomModel(!1),closeBulkCodex:()=>D("bulkCodex"),closeBulkGrokCli:()=>D("bulkGrokCli"),closeAgRisk:()=>D("agRisk"),confirmAgRisk:()=>{window.localStorage.setItem(ed,"true"),D("agRisk"),X.isOAuth?_("oauth"):ey()}},models:er})]}):(0,t.jsxs)("div",{className:"flex min-w-0 flex-col items-center gap-3 px-1 py-20 text-center sm:px-0",children:[(0,t.jsx)("p",{className:"text-muted",children:"Provider not found"}),(0,t.jsx)(a(),{href:"/dashboard/providers",className:"inline-flex min-h-11 items-center text-sm font-semibold text-coral-ink hover:text-coral focus-visible:shadow-focus focus-visible:outline-none",children:"Back to providers"})]})}}},e=>{e.O(0,[1610,6474,9671,4685,2903,7899,1863,8105,7505,4588,3343,6055,6448,1388,8441,3794,7358],()=>e(e.s=77302)),_N_E=e.O()}]);
|
|
21
|
+
]`;function es(e){let i,o=e.trim();if(!o)return[];try{i=JSON.parse(o)}catch(e){try{let e=o;e.startsWith("[")||((e=e.replace(/\}\s*,\s*\{/g,"},{").replace(/\}\s*\{/g,"},{")).endsWith(",")&&(e=e.slice(0,-1)),e=`[${e}]`),i=JSON.parse(e)}catch{throw e}}if(Array.isArray(i))return i;if(i&&"object"==typeof i)return Array.isArray(i.accounts)?i.accounts:[i];throw Error("Input must be a JSON object or array of objects")}function en({isOpen:e,onClose:i,onSuccess:o}){let[s,n]=(0,r.useState)(""),[l,a]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[f,m]=(0,r.useState)(null),[h,x]=(0,r.useState)(!1),[y,b]=(0,r.useState)(null),v=(0,r.useRef)(null),g=()=>{l||(n(""),p(""),m(null),b(null),x(!1),i())},C=async e=>{if(!e||0===e.length)return;p("");let i=Array.from(e).filter(e=>e.name.endsWith(".json")||"application/json"===e.type||""===e.type);if(0===i.length)return void p((0,M.Tl)("Please select valid .json files"));try{let e=[];for(let o of i){let i=await o.text(),t=es(i);Array.isArray(t)?e.push(...t):t&&e.push(t)}if(0===e.length)return void p((0,M.Tl)("No accounts found in selected files"));n(JSON.stringify(e,null,2)),b({filesCount:i.length,accountsCount:e.length})}catch(e){p(`${(0,M.Tl)("Error reading files")}: ${e.message}`)}},k=async()=>{let e;p(""),m(null);try{e=es(s)}catch(e){p(`${(0,M.Tl)("Invalid JSON")}: ${e.message}`);return}if(!e||0===e.length)return void p((0,M.Tl)("No accounts found in input"));a(!0);try{let i=await fetch("/api/oauth/grok-cli/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:e})}),t=await i.json();if(!i.ok)return void p(t?.error||`Request failed: ${i.status}`);m(t),t.success>0&&"function"==typeof o&&o()}catch(e){p(e.message||(0,M.Tl)("Request failed"))}finally{a(!1)}},A=f?.results?.filter(e=>!e.ok)||[];return(0,t.jsx)(V.default,{isOpen:e,title:(0,M.Tl)("Bulk add Grok CLI accounts"),onClose:g,children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted",children:(0,M.Tl)("Upload multiple .json files or paste JSON array / object.")}),(0,t.jsx)("input",{ref:v,type:"file",accept:".json,application/json",multiple:!0,className:"hidden",onChange:e=>{C(e.target.files),e.target&&(e.target.value="")}}),(0,t.jsx)(u.default,{type:"button",size:"sm",variant:"secondary",icon:"upload_file",onClick:()=>v.current?.click(),disabled:l,children:(0,M.Tl)("Upload JSON files")})]}),(0,t.jsxs)("div",{onDragOver:e=>{e.preventDefault(),x(!0)},onDragLeave:e=>{e.preventDefault(),x(!1)},onDrop:e=>{e.preventDefault(),x(!1),e.dataTransfer?.files?.length>0&&C(e.dataTransfer.files)},className:`relative rounded border transition-colors ${h?"border-coral bg-coral-bg ring-2 ring-coral/30":"border-coral/30 bg-panel"}`,children:[(0,t.jsx)("textarea",{className:"w-full rounded bg-transparent p-2.5 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-coral",placeholder:er,value:s,onChange:e=>{n(e.target.value),b(null)},disabled:l}),h&&(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-panel/90 rounded pointer-events-none backdrop-blur-xs",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-3xl text-coral-ink mb-1",children:"upload_file"}),(0,t.jsx)("span",{className:"text-sm font-medium text-coral-ink",children:(0,M.Tl)("Drop .json files here")})]})]}),y&&(0,t.jsxs)(c.default,{variant:"ok",className:"p-2 text-xs",children:[(0,M.Tl)("Loaded")," ",y.accountsCount," ",(0,M.Tl)("account(s) from")," ",y.filesCount," ",(0,M.Tl)("file(s)")]}),d&&(0,t.jsx)(c.default,{variant:"err",className:"break-words",children:d}),f&&f.failed>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)(w.default,{variant:"warn",className:"self-start",children:[f.failed," ",(0,M.Tl)("failed")]}),A.length>0&&(0,t.jsx)("ul",{className:"rounded border border-coral/20 bg-raised p-2 text-xs font-mono max-h-40 overflow-y-auto",children:A.map(e=>(0,t.jsxs)("li",{className:"text-err",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.default,{onClick:k,fullWidth:!0,disabled:l||!s.trim(),children:l?(0,M.Tl)("Importing..."):(0,M.Tl)("Import all")}),(0,t.jsx)(u.default,{onClick:g,variant:"ghost",fullWidth:!0,disabled:l,children:(0,M.Tl)("Close")})]})]})})}function el({providerId:e,isCompatible:i,hasDualAuthModes:o,labels:r,onOAuth:s,onApiKey:n,onAdd:l,onCookie:a,onBulkCodex:d,onBulkGrokCli:c}){return(0,t.jsxs)(t.Fragment,{children:["iflow"===e?(0,t.jsx)(u.default,{size:"sm",icon:"cookie",variant:"secondary",onClick:a,title:"Add connection using browser cookie",children:"Cookie"}):null,"codex"===e?(0,t.jsx)(u.default,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:d,title:"Bulk import codex accounts from JSON",children:"Bulk add"}):null,"grok-cli"===e?(0,t.jsx)(u.default,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:c,title:"Bulk import Grok CLI accounts from JSON",children:"Bulk add"}):null,o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.default,{size:"sm",icon:"lock",variant:"secondary",onClick:s,children:r.oauth}),(0,t.jsx)(u.default,{size:"sm",icon:"key",variant:"primary",onClick:n,children:r.apiKey})]}):(0,t.jsx)(u.default,{size:"sm",icon:"add",variant:"primary",onClick:l,children:i?"Add API key":"iflow"===e?"OAuth":"Add connection"})]})}function ea({providerId:e,providerInfo:i,isCompatible:o,isAnthropic:r,storageAlias:s,displayAlias:n,proxyPools:l,connectionNames:a,addConnectionError:d,selectedConnection:c,show:u,handlers:p,models:f}){return(0,t.jsxs)(t.Fragment,{children:["kiro"===e?(0,t.jsx)(L.default,{isOpen:u.oauth,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}):"cursor"===e?(0,t.jsx)(B.default,{isOpen:u.oauth,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}):"gitlab"===e?(0,t.jsx)(z.default,{isOpen:u.oauth,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}):(0,t.jsx)(G.default,{isOpen:u.oauth,provider:e,providerInfo:i,onSuccess:p.oauthSuccess,onClose:p.closeOAuth}),(0,t.jsx)(H.default,{isOpen:u.xiaomiMimo,onSuccess:p.oauthSuccess,onClose:p.closeXiaomiMimo}),"iflow"===e?(0,t.jsx)(X.default,{isOpen:u.iflowCookie,onSuccess:p.iflowCookieSuccess,onClose:p.closeIflowCookie}):null,(0,t.jsx)(Y.A,{isOpen:u.addApiKey,provider:e,providerName:i.name,isCompatible:o,isAnthropic:r,authType:i?.authType,authHint:i?.authHint,website:i?.website,proxyPools:l,error:d,existingNames:a,onSave:p.saveApiKey,onBulkDone:p.refreshConnections,onClose:p.closeAddApiKey}),(0,t.jsx)(W.default,{isOpen:u.edit,connection:c,proxyPools:l,onSave:p.updateConnection,onClose:p.closeEdit}),o?(0,t.jsx)(ee,{isOpen:u.editNode,node:p.compatibleNode,onSave:p.updateNode,onClose:p.closeEditNode,isAnthropic:r}):null,o?null:(0,t.jsx)(ei.A,{isOpen:f.showAddCustomModel,providerAlias:s,providerDisplayAlias:n,onSave:p.saveCustomModel,onClose:p.closeAddCustomModel}),"codex"===e?(0,t.jsx)(et,{isOpen:u.bulkCodex,onClose:p.closeBulkCodex,onSuccess:p.refreshConnections}):null,"grok-cli"===e?(0,t.jsx)(en,{isOpen:u.bulkGrokCli,onClose:p.closeBulkGrokCli,onSuccess:p.refreshConnections}):null,(0,t.jsx)(V.ConfirmDialog,{isOpen:u.agRisk,onClose:p.closeAgRisk,onConfirm:p.confirmAgRisk,title:"Risk notice",message:E(i?.deprecationNotice),confirmText:"I understand, continue",cancelText:"Cancel",variant:"danger"})]})}el.propTypes={providerId:A().string.isRequired,isCompatible:A().bool.isRequired,hasDualAuthModes:A().bool.isRequired,labels:A().object.isRequired,onOAuth:A().func.isRequired,onApiKey:A().func.isRequired,onAdd:A().func.isRequired,onCookie:A().func.isRequired,onBulkCodex:A().func.isRequired,onBulkGrokCli:A().func.isRequired},ea.propTypes={providerId:A().string.isRequired,providerInfo:A().object.isRequired,isCompatible:A().bool.isRequired,isAnthropic:A().bool.isRequired,storageAlias:A().string.isRequired,displayAlias:A().string.isRequired,proxyPools:A().array.isRequired,connectionNames:A().array.isRequired,addConnectionError:A().string,selectedConnection:A().object,show:A().shape({oauth:A().bool.isRequired,xiaomiMimo:A().bool.isRequired,iflowCookie:A().bool.isRequired,addApiKey:A().bool.isRequired,edit:A().bool.isRequired,editNode:A().bool.isRequired,bulkCodex:A().bool.isRequired,bulkGrokCli:A().bool.isRequired,agRisk:A().bool.isRequired}).isRequired,handlers:A().shape({oauthSuccess:A().func.isRequired,closeOAuth:A().func.isRequired,closeXiaomiMimo:A().func.isRequired,iflowCookieSuccess:A().func.isRequired,closeIflowCookie:A().func.isRequired,saveApiKey:A().func.isRequired,refreshConnections:A().func.isRequired,closeAddApiKey:A().func.isRequired,updateConnection:A().func.isRequired,closeEdit:A().func.isRequired,compatibleNode:A().object,updateNode:A().func.isRequired,closeEditNode:A().func.isRequired,saveCustomModel:A().func.isRequired,closeAddCustomModel:A().func.isRequired,closeBulkCodex:A().func.isRequired,closeBulkGrokCli:A().func.isRequired,closeAgRisk:A().func.isRequired,confirmAgRisk:A().func.isRequired}).isRequired,models:A().object.isRequired};let ed="ag_risk_confirmed",ec={claude:"claudeAutoPing",codex:"codexAutoPing"};function eu(){let e=(0,n.useParams)(),i=(0,n.useRouter)(),o=e.id,l=(0,r.useCallback)(e=>f.i.getState().error(e),[]),k=(0,r.useCallback)(e=>f.i.getState().success(e),[]),[A,j]=(0,r.useState)(!0),[N,w]=(0,r.useState)(""),[T,R]=(0,r.useState)(null),[E,q]=(0,r.useState)({oauth:!1,xiaomiMimo:!1,iflowCookie:!1,addApiKey:!1,edit:!1,editNode:!1,bulkCodex:!1,bulkGrokCli:!1,agRisk:!1}),_=(0,r.useCallback)(e=>q(i=>({...i,[e]:!0})),[]),D=(0,r.useCallback)(e=>q(i=>({...i,[e]:!1})),[]),[M,U]=(0,r.useState)(""),[K,F]=(0,r.useState)(null),[L,B]=(0,r.useState)({enabled:!1,connections:{}}),z=(0,b.Z)({providerId:o,notifyError:l}),G=(0,v.w)({providerId:o,notifyError:l}),H=(0,C.kw)(o,T),X=(0,C.ds)(o,H),W=X.isOpenAICompatible||X.isAnthropicCompatible,{storageAlias:V,displayAlias:Y}=(0,C.mC)(o,T,W),{staticModels:Z,isLiveCatalog:Q}=(0,C.RT)(o),{liveModels:ee,liveError:ei,refresh:eo}=function({providerId:e,connections:i,enabled:o}){let t=o&&(i||[]).find(e=>!1!==e.isActive)?.id||null,s=t?`${e}:${t}`:null,[n,l]=(0,r.useState)(h);(0,r.useEffect)(()=>{if(!t)return;let e=!1;return x(t).then(i=>{e||l(y(s,i))}).catch(i=>{e||l({key:s,models:[],error:i?.message||"Failed to reach the live model catalog."})}),()=>{e=!0}},[s,t]);let a=(0,r.useCallback)(async()=>{if(!t)throw Error("No active connection");let e=await x(t,{refresh:!0});return l(y(s,e)),e},[s,t]),d=s&&n.key===s?n:h;return{liveModels:d.models,liveError:d.error,refresh:a}}({providerId:o,connections:z.connections,enabled:Q&&!W}),et=Q&&ee.length>0&&!W?(0,m.rE)(o,ee,Z):Z,er=(0,g.G)({providerId:o,storageAlias:V,staticModels:Z,catalogModels:et,notifyError:l}),es=(0,C.qR)(o),en=!W&&X.isOAuth&&X.supportsApiKey,{fetchConnections:eu}=z,{load:ep}=G,{load:ef,loadThinking:em}=er,eh=(0,r.useCallback)(async()=>{w("");try{await eu(),await Promise.all([ep(),ef(),em()]);let e=await fetch("/api/provider-nodes",{cache:"no-store"});if(e.ok){let i=((await e.json().catch(()=>({}))).nodes||[]).find(e=>e.id===o)||null;if(!i&&W)for(let e=0;e<3;e+=1){await new Promise(e=>setTimeout(e,150));let e=await fetch("/api/provider-nodes",{cache:"no-store"});if(e.ok&&(i=((await e.json().catch(()=>({}))).nodes||[]).find(e=>e.id===o)||null))break}R(i)}let i=await fetch("/api/settings",{cache:"no-store"}),t=i.ok?await i.json().catch(()=>({})):{},r=ec[o],s=r&&t[r]||{};B({enabled:!0===s.enabled,connections:s.connections||{}})}catch(e){console.log("Error fetching provider detail:",e),w("Could not load this provider. Check the gateway and try again.")}finally{j(!1)}},[eu,W,ef,ep,em,o]);(0,r.useEffect)(()=>{eh()},[eh]);let ex=()=>{"antigravity"===o&&"true"!==window.localStorage.getItem(ed)?_("agRisk"):"xiaomi-mimo"===o?_("xiaomiMimo"):X.isOAuth?_("oauth"):(U(""),_("addApiKey"))},ey=()=>{U(""),_("addApiKey")},eb=async()=>{await z.fetchConnections(),(0,s.q0)()},ev=async e=>{U("");try{let i=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o,...e})}),t=await i.json().catch(()=>null);if(i.ok){await eb(),D("addApiKey");return}U(t?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),U("Failed to save connection")}},eg=async e=>{try{let i=await fetch(`/api/providers/${K.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!i.ok)return(await i.json().catch(()=>({}))).error||"Failed to save connection";return await eb(),D("edit"),null}catch(e){return console.log("Error updating connection:",e),"Failed to save connection"}},eC=async e=>{try{let i=await fetch(`/api/provider-nodes/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await i.json().catch(()=>({}));i.ok?(R(t.node),await eb(),D("editNode")):l(t.error||"Failed to update provider.")}catch(e){console.log("Error updating provider node:",e)}},ek=(0,t.jsx)(el,{providerId:o,isCompatible:W,hasDualAuthModes:en,labels:es,onOAuth:ex,onApiKey:ey,onAdd:()=>{X.isOAuth?ex():ey()},onCookie:()=>_("iflowCookie"),onBulkCodex:()=>_("bulkCodex"),onBulkGrokCli:()=>_("bulkGrokCli")}),eA=`${Y}/${er.enabledModels[0]?.id||er.customModelRows[0]?.id||Z[0]?.id||"model-id"}`,ej=X.isOAuth?"info":X.isFreeNoAuth?"live":X.supportsApiKey?"brand":"neutral",eN=X.isOAuth?"OAuth":X.isFreeNoAuth?"Free":X.supportsApiKey?"API key":W?"Compatible":"Provider";return A?(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-5 px-1 sm:px-0","aria-busy":"true",children:[(0,t.jsx)("span",{className:"sr-only",role:"status",children:"Loading provider"}),(0,t.jsx)(d.CardSkeleton,{}),(0,t.jsx)(d.CardSkeleton,{})]}):H?(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-5 px-1 sm:px-0",children:[(0,t.jsx)(S,{providerId:o,providerInfo:H,connections:z.connections,authLabel:eN,authVariant:ej,modelSnippet:eA,loading:!1}),(0,t.jsx)(O,{providerInfo:H}),N?(0,t.jsx)(c.default,{variant:"err",title:"Could not load provider",children:(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[N,(0,t.jsx)(u.default,{size:"sm",variant:"secondary",onClick:eh,children:"Retry"})]})}):null,W&&T?(0,t.jsx)(I,{isAnthropic:X.isAnthropicCompatible,apiType:T.apiType,baseUrl:T.baseUrl,onAddKey:ey,onEdit:()=>_("editNode"),onDelete:()=>{z.setConfirmState({title:"Delete compatible node",message:`Delete this ${X.isAnthropicCompatible?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{z.setConfirmState(null);try{(await fetch(`/api/provider-nodes/${o}`,{method:"DELETE"})).ok?i.push("/dashboard/providers"):l("Failed to delete provider.")}catch(e){console.log("Error deleting provider node:",e)}}})}}):null,X.isFreeNoAuth?(0,t.jsx)(p.default,{providerId:o}):(0,t.jsx)(P.A,{providerId:o,auth:{isOAuth:X.isOAuth,hasDualAuthModes:en,labels:es},strategy:G,conn:z,autoPing:{enabled:L.enabled,connections:L.connections,toggle:(e,i)=>{let t=ec[o];if(!t)return;let r={...L,connections:{...L.connections,[e]:i}};B(r),fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:r})}).catch(e=>console.log("Error saving auto-ping config:",e))}},actions:{addButtons:ek,edit:e=>{F(e),_("edit")},notifyError:l}}),(0,t.jsx)($.A,{providerId:o,storageAlias:V,displayAlias:Y,isLiveCatalog:Q,isCompatible:W,isAnthropic:X.isAnthropicCompatible,isFreeNoAuth:X.isFreeNoAuth,connections:z.connections,catalogModels:et,staticModels:Z,liveError:ei,refreshLive:eo,models:er,onDisableAll:e=>z.setConfirmState(e),compatibleSection:(0,t.jsx)(J,{isFreeNoAuth:X.isFreeNoAuth,storageAlias:V,displayAlias:Y,isAnthropic:X.isAnthropicCompatible,connections:z.connections,models:er,actions:{notifyError:l,notifySuccess:k}})}),(0,t.jsx)(ea,{providerId:o,providerInfo:H,isCompatible:W,isAnthropic:X.isAnthropicCompatible,storageAlias:V,displayAlias:Y,proxyPools:z.proxyPools,connectionNames:z.connections.map(e=>e.name).filter(Boolean),addConnectionError:M,selectedConnection:K,show:E,handlers:{oauthSuccess:()=>{eb(),D("oauth")},closeOAuth:()=>D("oauth"),closeXiaomiMimo:()=>D("xiaomiMimo"),iflowCookieSuccess:()=>{eb(),D("iflowCookie")},closeIflowCookie:()=>D("iflowCookie"),saveApiKey:ev,refreshConnections:eb,closeAddApiKey:()=>{U(""),D("addApiKey")},updateConnection:eg,closeEdit:()=>D("edit"),compatibleNode:T,updateNode:eC,closeEditNode:()=>D("editNode"),saveCustomModel:async(e,i)=>{let o=await er.addCustomModel(e,"llm",V,i);return o&&er.setShowAddCustomModel(!1),o},closeAddCustomModel:()=>er.setShowAddCustomModel(!1),closeBulkCodex:()=>D("bulkCodex"),closeBulkGrokCli:()=>D("bulkGrokCli"),closeAgRisk:()=>D("agRisk"),confirmAgRisk:()=>{window.localStorage.setItem(ed,"true"),D("agRisk"),X.isOAuth?_("oauth"):ey()}},models:er})]}):(0,t.jsxs)("div",{className:"flex min-w-0 flex-col items-center gap-3 px-1 py-20 text-center sm:px-0",children:[(0,t.jsx)("p",{className:"text-muted",children:"Provider not found"}),(0,t.jsx)(a(),{href:"/dashboard/providers",className:"inline-flex min-h-11 items-center text-sm font-semibold text-coral-ink hover:text-coral focus-visible:shadow-focus focus-visible:outline-none",children:"Back to providers"})]})}}},e=>{e.O(0,[1610,6474,9671,4685,2903,7899,1863,8105,7505,4588,3343,6055,6448,1388,8441,3794,7358],()=>e(e.s=77302)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{4650:(e,r,t)=>{"use strict";async function n(e){if("u">typeof navigator&&navigator?.clipboard?.writeText)try{await navigator.clipboard.writeText(String(e));return}catch{}if("u"<typeof document)throw Error("copyTextToClipboard: clipboard API unavailable");let r=document.createElement("textarea");r.value=String(e),r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();let t=!1;try{t=document.execCommand("copy")}finally{document.body.removeChild(r)}if(!t)throw Error("copyTextToClipboard: execCommand('copy') failed")}function a(e,{min:r,max:t}={}){if(""===e||null==e)return e;let n=Number(e);if(!Number.isFinite(n))return e;let s=n;return Number.isFinite(r)&&(s=Math.max(r,s)),Number.isFinite(t)&&(s=Math.min(t,s)),s}function s(e,{min:r,max:t,step:n=1,direction:i}={}){let l=""===e||null==e?NaN:Number(a(e,{min:r,max:t})),o=Number.isFinite(l)?l:Number.isFinite(r)?r:0,d=Math.max(String(n).split(".")[1]?.length??0,String(o).split(".")[1]?.length??0);return a(Number((o+i*n).toFixed(Math.min(d,10))),{min:r,max:t})}function i(e,r,{length:t,rtl:n=!1}={}){if(!Number.isInteger(t)||t<=0)return e;let a=(e%t+t)%t;switch(r){case"ArrowRight":return(a+(n?-1:1)+t)%t;case"ArrowLeft":return(a+(n?1:-1)+t)%t;case"ArrowDown":return(a+1)%t;case"ArrowUp":return(a-1+t)%t;case"Home":return 0;case"End":return t-1;default:return a}}function l(e){return["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(e)}t.d(r,{CD:()=>s,Ck:()=>o,Ec:()=>c,GO:()=>d,Gc:()=>m,JF:()=>l,N:()=>a,V7:()=>u,eM:()=>n,lZ:()=>i,qM:()=>p});let o={primary:"bg-lime text-on-lime border border-transparent shadow-[inset_0_0_0_1px_rgba(0,0,0,0.14)] hover:brightness-95",secondary:"bg-raised text-text border border-line hover:bg-line/60",ghost:"bg-transparent text-text border border-line hover:bg-raised",danger:"bg-err-bg text-err border border-transparent hover:bg-err/15",outline:"bg-transparent text-muted border border-line hover:bg-raised hover:text-text",success:"bg-ok-bg text-ok border border-transparent hover:bg-ok/15"},d={sm:"h-10 px-3 text-sm rounded-lg",md:"h-11 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"},c={sm:"h-9 text-xs",md:"h-9 text-sm",lg:"h-11 text-sm"};function u(e="primary",r="md"){let t=o[e];if(!t)throw Error(`buttonClasses: unknown variant "${e}"`);let n=d[r];if(!n)throw Error(`buttonClasses: unknown size "${r}"`);return`${t} ${n}`}function m(e,{hint:r,error:t}={}){return t?`${e}-error`:r?`${e}-hint`:void 0}function p(e){return null!=e&&!1!==e&&""!==e}},11910:(e,r,t)=>{"use strict";t.d(r,{default:()=>o});var n=t(95155),a=t(14051),s=t.n(a),i=t(31474),l=t(98582);function o({label:e,type:r="text",placeholder:t,value:a,onChange:s,error:d,hint:c,icon:u,disabled:m=!1,required:p=!1,className:h,inputClassName:b,id:x,ref:f,...g}){return(0,n.jsx)(l.default,{id:x,label:e,hint:c,error:d,required:p,className:h,children:({inputId:e,describedBy:l,invalid:o})=>(0,n.jsxs)("div",{className:"relative",children:[u&&(0,n.jsx)("div",{className:"absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none text-muted","aria-hidden":"true",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:u})}),(0,n.jsx)("input",{...g,ref:f,id:e,type:r,placeholder:t,value:a,onChange:s,disabled:m,"aria-describedby":l,"aria-invalid":o||void 0,className:(0,i.cn)("w-full py-2.5 px-3 text-sm text-text bg-raised rounded-lg","border border-line placeholder:text-subtle","focus:outline-none focus:border-coral focus:shadow-focus","transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",u&&"ps-10",o&&"border-err focus:border-err",b)})]})})}o.propTypes={label:s().node,type:s().string,placeholder:s().string,value:s().oneOfType([s().string,s().number]),onChange:s().func,error:s().node,hint:s().node,icon:s().string,disabled:s().bool,required:s().bool,className:s().string,inputClassName:s().string,id:s().string,"aria-label":s().string}},15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>f});var n=t(95155),a=t(12115),s=t(73321),i=t(98500),l=t.n(i),o=t(84588),d=t(99380),c=t(11910),u=t(92542),m=t(98542),p=t(56006),h=t(27693);let b=Object.values(h.Q2).map(e=>({value:e.id,label:e.name})),x=Object.values(h.MA).map(e=>({value:e.id,label:e.name}));function f(){let e=(0,s.useRouter)(),[r,t]=(0,a.useState)(!1),[i,f]=(0,a.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[g,v]=(0,a.useState)({}),y=(e,r)=>{f(t=>({...t,[e]:r})),g[e]&&v(r=>({...r,[e]:null}))},N=async r=>{let n;if(r.preventDefault(),n={},i.provider||(n.provider="Please select a provider"),"api_key"!==i.authMethod||i.apiKey||(n.apiKey="API key is required"),v(n),0===Object.keys(n).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();v({submit:e.error||"Failed to create provider"})}}catch(e){v({submit:"An error occurred. Please try again."})}finally{t(!1)}}},j=h.Q2[i.provider];return(0,n.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,n.jsx)("div",{className:"mb-8",children:(0,n.jsxs)(l(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-muted hover:text-coral-ink transition-colors mb-4",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to providers"]})}),(0,n.jsx)(o.default,{children:(0,n.jsxs)("form",{onSubmit:N,className:"flex flex-col gap-6",children:[(0,n.jsx)(d.default,{label:"Provider",options:b,value:i.provider,onChange:e=>y("provider",e.target.value),placeholder:"Select a provider",error:g.provider,required:!0}),j&&(0,n.jsxs)(o.default.Section,{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-panel border border-line",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:j.color},children:j.icon})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-medium",children:j.name}),(0,n.jsx)("p",{className:"text-sm text-muted",children:"Selected provider"})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsxs)("label",{className:"text-sm font-medium",children:["Authentication method ",(0,n.jsx)("span",{className:"text-err",children:"*"})]}),(0,n.jsx)("div",{className:"flex gap-3",children:x.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>y("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${i.authMethod===e.value?"border-coral bg-coral-bg text-coral-ink":"border-line hover:border-coral/50"}`,children:[(0,n.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,n.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===i.authMethod&&(0,n.jsx)(c.default,{label:"API key",type:"password",placeholder:"Enter your API key",value:i.apiKey,onChange:e=>y("apiKey",e.target.value),error:g.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===i.authMethod&&(0,n.jsxs)(o.default.Section,{children:[(0,n.jsx)("p",{className:"text-sm text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,n.jsx)(u.default,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,n.jsx)(c.default,{label:"Display name",placeholder:"e.g., production API, dev environment",value:i.displayName,onChange:e=>y("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,n.jsx)(m.default,{checked:i.isActive,onChange:e=>y("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),g.submit&&(0,n.jsx)(p.default,{variant:"err",children:g.submit}),(0,n.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-line",children:[(0,n.jsx)(l(),{href:"/dashboard/providers",className:"flex-1",children:(0,n.jsx)(u.default,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,n.jsx)(u.default,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create provider"})]})]})})]})}},27693:(e,r,t)=>{"use strict";t.d(r,{MA:()=>a.MA,Q2:()=>a.Q2,UY:()=>n.UY,h0:()=>n.h0});var n=t(28745),a=t(88105);t(28777)},28745:(e,r,t)=>{"use strict";t.d(r,{vQ:()=>s,UY:()=>d,Nu:()=>i,B2:()=>o,h0:()=>l});var n=t(4553),a=t(41463);let s={name:`${n.Hc.name} Proxy`,description:"AI infrastructure management",version:"1.0.0",build:{channel:a.env.NEXT_PUBLIC_BUILD_CHANNEL||"",sha:a.env.NEXT_PUBLIC_BUILD_SHA||""}},i={changelogUrl:"https://raw.githubusercontent.com/tokenhop/tokenhop/refs/heads/master/CHANGELOG.md"},l={appPort:20128},o={storageKey:"theme",defaultTheme:"dark"},d={maxLines:200,pollIntervalMs:1e3}},28777:(e,r,t)=>{"use strict";t.d(r,{CP:()=>a,KC:()=>n.KC,Xg:()=>n.Xg,bs:()=>s});var n=t(2378);Object.entries(t(88105).Q2).filter(([,e])=>e.passthroughModels).map(([e])=>e),Object.entries(n.vq).flatMap(([e,r])=>r.map(r=>({provider:e,model:r.id,name:r.name})));let a=(e,r=null)=>e?.kind||e?.type||r,s={vision:{icon:"visibility",label:"Vision",desc:"Supports image input",color:"text-blue-500"},reasoning:{icon:"neurology",label:"Reasoning",desc:"Supports reasoning / thinking",color:"text-amber-500"}}},54642:e=>{var r;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(r={}).endianness=function(){return"LE"},r.hostname=function(){return"u">typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"u">typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n",r.homedir=function(){return"/"},e.exports=r},59100:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))},73321:(e,r,t)=>{"use strict";var n=t(74645);t.o(n,"notFound")&&t.d(r,{notFound:function(){return n.notFound}}),t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},84588:(e,r,t)=>{"use strict";t.d(r,{default:()=>o});var n=t(95155),a=t(14051),s=t.n(a),i=t(31474);let l={none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"};function o({children:e,title:r,subtitle:t,icon:a,action:s,as:d="h2",padding:c="md",hover:u=!1,elev:m=!1,className:p,role:h,...b}){if(void 0===l[c])throw Error(`Card: unknown padding "${c}"`);let x=h||(b["aria-label"]||b["aria-labelledby"]?"region":void 0);return(0,n.jsxs)("div",{role:x,className:(0,i.cn)("rounded-2xl border border-line bg-panel shadow-card",u&&"cursor-pointer transition-colors duration-150 hover:border-coral/40",l[c],p),...b,children:[(r||s)&&(0,n.jsx)(o.Header,{title:r,subtitle:t,icon:a,actions:s,as:d,className:"mb-4"}),e]})}o.propTypes={children:s().node,title:s().node,subtitle:s().node,icon:s().string,action:s().node,as:s().oneOf(["h2","h3","h4"]),padding:s().oneOf(Object.keys(l)),hover:s().bool,elev:s().bool,className:s().string,role:s().string},o.Header=function({title:e,subtitle:r,icon:t,actions:a,as:s="h2",className:l}){return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-wrap items-center justify-between gap-3",l),children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[t&&(0,n.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-coral-bg text-coral-ink",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:t})}),(0,n.jsxs)("div",{className:"min-w-0",children:[e&&(0,n.jsx)(s,{className:"font-display text-lg font-bold text-text",children:e}),r&&(0,n.jsx)("p",{className:"text-sm text-muted",children:r})]})]}),a&&(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})},o.Header.propTypes={title:s().node,subtitle:s().node,icon:s().string,actions:s().node,as:s().oneOf(["h2","h3","h4"]),className:s().string},o.Section=function({children:e,className:r,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("rounded-xl border border-line bg-raised p-4",r),...t,children:e})},o.Row=function({children:e,className:r,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("-mx-3 border-b border-line p-3 px-3 transition-colors last:border-b-0 hover:bg-raised",r),...t,children:e})},o.ListItem=function({children:e,actions:r,className:t,...a}){return(0,n.jsxs)("div",{className:(0,i.cn)("group -mx-3 flex items-center justify-between border-b border-line p-3 px-3 transition-colors last:border-b-0 hover:bg-raised",t),...a,children:[(0,n.jsx)("div",{className:"min-w-0 flex-1",children:e}),r&&(0,n.jsx)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",children:r})]})}},92542:(e,r,t)=>{"use strict";t.d(r,{default:()=>c});var n=t(95155),a=t(98500),s=t.n(a),i=t(14051),l=t.n(i),o=t(31474),d=t(4650);function c({children:e,variant:r="primary",size:t="md",icon:a,iconRight:i,href:l,disabled:u=!1,loading:m=!1,fullWidth:p=!1,className:h,...b}){let x=(0,o.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] focus-visible:outline-none focus-visible:shadow-focus","disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","aria-disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:active:scale-100",(0,d.V7)(r,t),p&&"w-full",h),f=(0,n.jsxs)(n.Fragment,{children:[m?(0,n.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]","aria-hidden":"true",children:"progress_activity"}):a?(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:a}):null,e,i&&!m&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px] rtl:-scale-x-100","aria-hidden":"true",children:i})]});if(l&&!(u||m)){let{type:e,...r}=b;return r.className=x,/^(https?:|mailto:|tel:|#)/.test(l)?(0,n.jsx)("a",{href:l,...r,children:f}):(0,n.jsx)(s(),{href:l,...r,children:f})}return(0,n.jsx)("button",{className:x,disabled:u||m,"aria-busy":m||void 0,...b,children:f})}c.propTypes={children:l().node,variant:l().oneOf(Object.keys(d.Ck)),size:l().oneOf(Object.keys(d.GO)),icon:l().string,iconRight:l().string,href:l().string,disabled:l().bool,loading:l().bool,fullWidth:l().bool,className:l().string}},98542:(e,r,t)=>{"use strict";t.d(r,{default:()=>d});var n=t(95155),a=t(14051),s=t.n(a),i=t(12115),l=t(31474);let o={sm:"h-[26px] w-11",md:"h-[26px] w-11",lg:"h-7 w-12"};function d({checked:e=!1,onChange:r,label:t,description:a,disabled:s=!1,size:c="md",className:u,id:m,...p}){let h=(0,i.useId)(),b=m||h,x=`${b}-label`,f=`${b}-description`;if(!o[c])throw Error(`Toggle: unknown size "${c}"`);return(0,n.jsxs)("div",{className:(0,l.cn)("flex items-center gap-3",s&&"opacity-50",u),children:[(0,n.jsx)("button",{...p,id:b,type:"button",role:"switch","aria-checked":e,"aria-labelledby":t?x:p["aria-labelledby"],"aria-describedby":a?f:p["aria-describedby"],"aria-label":t?void 0:p["aria-label"]||p.title,disabled:s,onClick:()=>r?.(!e),className:(0,l.cn)("relative inline-flex shrink-0 rounded-full border border-line transition-colors duration-200","focus-visible:outline-none focus-visible:shadow-focus disabled:cursor-not-allowed","motion-reduce:transition-none",e?"bg-toggle-on":"bg-line",o[c]),children:(0,n.jsx)("span",{"aria-hidden":"true",className:(0,l.cn)("pointer-events-none absolute top-0.5 size-5 rounded-full shadow-sm transition-transform duration-200 motion-reduce:transition-none",e?"bg-toggle-knob-on translate-x-5 rtl:-translate-x-5":"bg-muted translate-x-0.5 rtl:-translate-x-0.5","start-0")})}),(t||a)&&(0,n.jsxs)("div",{className:"flex flex-col",children:[t&&(0,n.jsx)("label",{id:x,htmlFor:b,className:"text-sm font-medium text-text cursor-pointer",children:t}),a&&(0,n.jsx)("span",{id:f,className:"text-xs text-muted",children:a})]})]})}d.propTypes={checked:s().bool,onChange:s().func,label:s().node,description:s().node,disabled:s().bool,size:s().oneOf(Object.keys(o)),className:s().string,id:s().string,title:s().string,"aria-label":s().string}},98582:(e,r,t)=>{"use strict";t.d(r,{default:()=>d});var n=t(95155),a=t(14051),s=t.n(a),i=t(12115),l=t(31474),o=t(4650);function d({id:e,label:r,hint:t,error:a,required:s=!1,className:c,children:u}){let m=(0,i.useId)(),p=e||`${m}-input`,h=`${p}-hint`,b=`${p}-error`,x=(0,o.Gc)(p,{hint:t,error:a});return(0,n.jsxs)("div",{className:(0,l.cn)("flex flex-col gap-1.5",c),children:[r&&(0,n.jsxs)("label",{htmlFor:p,className:"text-sm font-medium text-text",children:[r,s&&(0,n.jsx)("span",{className:"text-err ms-1","aria-hidden":"true",children:"*"})]}),u({inputId:p,describedBy:x,invalid:!!a}),a?(0,n.jsxs)("p",{id:b,className:"text-xs text-err flex items-center gap-1",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"error"}),a]}):t?(0,n.jsx)("p",{id:h,className:"text-xs text-muted",children:t}):null]})}d.propTypes={id:s().string,label:s().node,hint:s().node,error:s().node,required:s().bool,className:s().string,children:s().func.isRequired}},99380:(e,r,t)=>{"use strict";t.d(r,{default:()=>o});var n=t(95155),a=t(14051),s=t.n(a),i=t(31474),l=t(98582);function o({label:e,options:r=[],value:t,onChange:a,placeholder:s="Select an option",error:d,hint:c,disabled:u=!1,required:m=!1,className:p,selectClassName:h,id:b,...x}){return(0,n.jsx)(l.default,{id:b,label:e,hint:c,error:d,required:m,className:p,children:({inputId:e,describedBy:l,invalid:o})=>(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("select",{...x,id:e,value:t,onChange:a,disabled:u,"aria-describedby":l,"aria-invalid":o||void 0,className:(0,i.cn)("w-full h-11 ps-3 pe-10 text-sm text-text bg-raised rounded-lg appearance-none","border border-line focus:outline-none focus:border-coral focus:shadow-focus","transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",o&&"border-err focus:border-err",h),children:[null!==s&&(0,n.jsx)("option",{value:"",disabled:!0,children:s}),(function(e=[]){let r=[];for(let t of e){let e=t.group||null,n=r[r.length-1];n&&n.label===e?n.options.push(t):r.push({label:e,options:[t]})}return r})(r).map((e,r)=>null===e.label?e.options.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value)):(0,n.jsx)("optgroup",{label:e.label,children:e.options.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))},`${e.label}-${r}`))]}),(0,n.jsx)("div",{className:"absolute inset-y-0 end-0 flex items-center pe-3 pointer-events-none text-muted","aria-hidden":"true",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]})})}o.propTypes={label:s().node,options:s().arrayOf(s().shape({value:s().oneOfType([s().string,s().number]).isRequired,label:s().node.isRequired,group:s().string})),value:s().oneOfType([s().string,s().number]),onChange:s().func,placeholder:s().oneOfType([s().string,s().oneOf([null])]),error:s().node,hint:s().node,disabled:s().bool,required:s().bool,className:s().string,selectClassName:s().string,id:s().string}}},e=>{e.O(0,[1610,2903,8105,7505,8441,3794,7358],()=>e(e.s=59100)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9089],{4650:(e,r,t)=>{"use strict";async function n(e){if("u">typeof navigator&&navigator?.clipboard?.writeText)try{await navigator.clipboard.writeText(String(e));return}catch{}if("u"<typeof document)throw Error("copyTextToClipboard: clipboard API unavailable");let r=document.createElement("textarea");r.value=String(e),r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();let t=!1;try{t=document.execCommand("copy")}finally{document.body.removeChild(r)}if(!t)throw Error("copyTextToClipboard: execCommand('copy') failed")}function a(e,{min:r,max:t}={}){if(""===e||null==e)return e;let n=Number(e);if(!Number.isFinite(n))return e;let s=n;return Number.isFinite(r)&&(s=Math.max(r,s)),Number.isFinite(t)&&(s=Math.min(t,s)),s}function s(e,{min:r,max:t,step:n=1,direction:i}={}){let l=""===e||null==e?NaN:Number(a(e,{min:r,max:t})),o=Number.isFinite(l)?l:Number.isFinite(r)?r:0,d=Math.max(String(n).split(".")[1]?.length??0,String(o).split(".")[1]?.length??0);return a(Number((o+i*n).toFixed(Math.min(d,10))),{min:r,max:t})}function i(e,r,{length:t,rtl:n=!1}={}){if(!Number.isInteger(t)||t<=0)return e;let a=(e%t+t)%t;switch(r){case"ArrowRight":return(a+(n?-1:1)+t)%t;case"ArrowLeft":return(a+(n?1:-1)+t)%t;case"ArrowDown":return(a+1)%t;case"ArrowUp":return(a-1+t)%t;case"Home":return 0;case"End":return t-1;default:return a}}function l(e){return["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(e)}t.d(r,{CD:()=>s,Ck:()=>o,Ec:()=>c,GO:()=>d,Gc:()=>m,JF:()=>l,N:()=>a,V7:()=>u,eM:()=>n,lZ:()=>i,qM:()=>p});let o={primary:"bg-lime text-on-lime border border-transparent shadow-[inset_0_0_0_1px_rgba(0,0,0,0.14)] hover:brightness-95",secondary:"bg-raised text-text border border-line hover:bg-line/60",ghost:"bg-transparent text-text border border-line hover:bg-raised",danger:"bg-err-bg text-err border border-transparent hover:bg-err/15",outline:"bg-transparent text-muted border border-line hover:bg-raised hover:text-text",success:"bg-ok-bg text-ok border border-transparent hover:bg-ok/15"},d={sm:"h-10 px-3 text-sm rounded-lg",md:"h-11 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"},c={sm:"h-9 text-xs",md:"h-9 text-sm",lg:"h-11 text-sm"};function u(e="primary",r="md"){let t=o[e];if(!t)throw Error(`buttonClasses: unknown variant "${e}"`);let n=d[r];if(!n)throw Error(`buttonClasses: unknown size "${r}"`);return`${t} ${n}`}function m(e,{hint:r,error:t}={}){return t?`${e}-error`:r?`${e}-hint`:void 0}function p(e){return null!=e&&!1!==e&&""!==e}},11910:(e,r,t)=>{"use strict";t.d(r,{default:()=>o});var n=t(95155),a=t(14051),s=t.n(a),i=t(31474),l=t(98582);function o({label:e,type:r="text",placeholder:t,value:a,onChange:s,error:d,hint:c,icon:u,disabled:m=!1,required:p=!1,className:h,inputClassName:b,id:x,ref:f,...g}){return(0,n.jsx)(l.default,{id:x,label:e,hint:c,error:d,required:p,className:h,children:({inputId:e,describedBy:l,invalid:o})=>(0,n.jsxs)("div",{className:"relative",children:[u&&(0,n.jsx)("div",{className:"absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none text-muted","aria-hidden":"true",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:u})}),(0,n.jsx)("input",{...g,ref:f,id:e,type:r,placeholder:t,value:a,onChange:s,disabled:m,"aria-describedby":l,"aria-invalid":o||void 0,className:(0,i.cn)("w-full py-2.5 px-3 text-sm text-text bg-raised rounded-lg","border border-line placeholder:text-subtle","focus:outline-none focus:border-coral focus:shadow-focus","transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",u&&"ps-10",o&&"border-err focus:border-err",b)})]})})}o.propTypes={label:s().node,type:s().string,placeholder:s().string,value:s().oneOfType([s().string,s().number]),onChange:s().func,error:s().node,hint:s().node,icon:s().string,disabled:s().bool,required:s().bool,className:s().string,inputClassName:s().string,id:s().string,"aria-label":s().string}},15615:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>f});var n=t(95155),a=t(12115),s=t(73321),i=t(98500),l=t.n(i),o=t(84588),d=t(99380),c=t(11910),u=t(92542),m=t(98542),p=t(56006),h=t(27693);let b=Object.values(h.Q2).map(e=>({value:e.id,label:e.name})),x=Object.values(h.MA).map(e=>({value:e.id,label:e.name}));function f(){let e=(0,s.useRouter)(),[r,t]=(0,a.useState)(!1),[i,f]=(0,a.useState)({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[g,v]=(0,a.useState)({}),y=(e,r)=>{f(t=>({...t,[e]:r})),g[e]&&v(r=>({...r,[e]:null}))},N=async r=>{let n;if(r.preventDefault(),n={},i.provider||(n.provider="Please select a provider"),"api_key"!==i.authMethod||i.apiKey||(n.apiKey="API key is required"),v(n),0===Object.keys(n).length){t(!0);try{let r=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(r.ok)e.push("/dashboard/providers");else{let e=await r.json();v({submit:e.error||"Failed to create provider"})}}catch(e){v({submit:"An error occurred. Please try again."})}finally{t(!1)}}},j=h.Q2[i.provider];return(0,n.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,n.jsx)("div",{className:"mb-8",children:(0,n.jsxs)(l(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-muted hover:text-coral-ink transition-colors mb-4",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to providers"]})}),(0,n.jsx)(o.default,{children:(0,n.jsxs)("form",{onSubmit:N,className:"flex flex-col gap-6",children:[(0,n.jsx)(d.default,{label:"Provider",options:b,value:i.provider,onChange:e=>y("provider",e.target.value),placeholder:"Select a provider",error:g.provider,required:!0}),j&&(0,n.jsxs)(o.default.Section,{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"size-10 rounded-lg flex items-center justify-center bg-panel border border-line",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:j.color},children:j.icon})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-medium",children:j.name}),(0,n.jsx)("p",{className:"text-sm text-muted",children:"Selected provider"})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsxs)("label",{className:"text-sm font-medium",children:["Authentication method ",(0,n.jsx)("span",{className:"text-err",children:"*"})]}),(0,n.jsx)("div",{className:"flex gap-3",children:x.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>y("authMethod",e.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${i.authMethod===e.value?"border-coral bg-coral-bg text-coral-ink":"border-line hover:border-coral/50"}`,children:[(0,n.jsx)("span",{className:"material-symbols-outlined",children:"api_key"===e.value?"key":"lock"}),(0,n.jsx)("span",{className:"font-medium",children:e.label})]},e.value))})]}),"api_key"===i.authMethod&&(0,n.jsx)(c.default,{label:"API key",type:"password",placeholder:"Enter your API key",value:i.apiKey,onChange:e=>y("apiKey",e.target.value),error:g.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),"oauth2"===i.authMethod&&(0,n.jsxs)(o.default.Section,{children:[(0,n.jsx)("p",{className:"text-sm text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),(0,n.jsx)(u.default,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),(0,n.jsx)(c.default,{label:"Display name",placeholder:"e.g., production API, dev environment",value:i.displayName,onChange:e=>y("displayName",e.target.value),hint:"Optional. A friendly name to identify this configuration."}),(0,n.jsx)(m.default,{checked:i.isActive,onChange:e=>y("isActive",e),label:"Active",description:"Enable this provider for use in your applications"}),g.submit&&(0,n.jsx)(p.default,{variant:"err",children:g.submit}),(0,n.jsxs)("div",{className:"flex gap-3 pt-4 border-t border-line",children:[(0,n.jsx)(l(),{href:"/dashboard/providers",className:"flex-1",children:(0,n.jsx)(u.default,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),(0,n.jsx)(u.default,{type:"submit",loading:r,fullWidth:!0,className:"flex-1",children:"Create provider"})]})]})})]})}},27693:(e,r,t)=>{"use strict";t.d(r,{MA:()=>a.MA,Q2:()=>a.Q2,UY:()=>n.UY,h0:()=>n.h0});var n=t(28745),a=t(88105);t(28777)},28745:(e,r,t)=>{"use strict";t.d(r,{vQ:()=>s,UY:()=>d,Nu:()=>i,B2:()=>o,h0:()=>l});var n=t(4553),a=t(41463);let s={name:`${n.Hc.name} Proxy`,description:"AI infrastructure management",version:"1.0.1",build:{channel:a.env.NEXT_PUBLIC_BUILD_CHANNEL||"",sha:a.env.NEXT_PUBLIC_BUILD_SHA||""}},i={changelogUrl:"https://raw.githubusercontent.com/tokenhop/tokenhop/refs/heads/master/CHANGELOG.md"},l={appPort:20128},o={storageKey:"theme",defaultTheme:"dark"},d={maxLines:200,pollIntervalMs:1e3}},28777:(e,r,t)=>{"use strict";t.d(r,{CP:()=>a,KC:()=>n.KC,Xg:()=>n.Xg,bs:()=>s});var n=t(2378);Object.entries(t(88105).Q2).filter(([,e])=>e.passthroughModels).map(([e])=>e),Object.entries(n.vq).flatMap(([e,r])=>r.map(r=>({provider:e,model:r.id,name:r.name})));let a=(e,r=null)=>e?.kind||e?.type||r,s={vision:{icon:"visibility",label:"Vision",desc:"Supports image input",color:"text-blue-500"},reasoning:{icon:"neurology",label:"Reasoning",desc:"Supports reasoning / thinking",color:"text-amber-500"}}},54642:e=>{var r;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(r={}).endianness=function(){return"LE"},r.hostname=function(){return"u">typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"u">typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n",r.homedir=function(){return"/"},e.exports=r},59100:(e,r,t)=>{Promise.resolve().then(t.bind(t,15615))},73321:(e,r,t)=>{"use strict";var n=t(74645);t.o(n,"notFound")&&t.d(r,{notFound:function(){return n.notFound}}),t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},84588:(e,r,t)=>{"use strict";t.d(r,{default:()=>o});var n=t(95155),a=t(14051),s=t.n(a),i=t(31474);let l={none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"};function o({children:e,title:r,subtitle:t,icon:a,action:s,as:d="h2",padding:c="md",hover:u=!1,elev:m=!1,className:p,role:h,...b}){if(void 0===l[c])throw Error(`Card: unknown padding "${c}"`);let x=h||(b["aria-label"]||b["aria-labelledby"]?"region":void 0);return(0,n.jsxs)("div",{role:x,className:(0,i.cn)("rounded-2xl border border-line bg-panel shadow-card",u&&"cursor-pointer transition-colors duration-150 hover:border-coral/40",l[c],p),...b,children:[(r||s)&&(0,n.jsx)(o.Header,{title:r,subtitle:t,icon:a,actions:s,as:d,className:"mb-4"}),e]})}o.propTypes={children:s().node,title:s().node,subtitle:s().node,icon:s().string,action:s().node,as:s().oneOf(["h2","h3","h4"]),padding:s().oneOf(Object.keys(l)),hover:s().bool,elev:s().bool,className:s().string,role:s().string},o.Header=function({title:e,subtitle:r,icon:t,actions:a,as:s="h2",className:l}){return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-wrap items-center justify-between gap-3",l),children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[t&&(0,n.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-coral-bg text-coral-ink",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:t})}),(0,n.jsxs)("div",{className:"min-w-0",children:[e&&(0,n.jsx)(s,{className:"font-display text-lg font-bold text-text",children:e}),r&&(0,n.jsx)("p",{className:"text-sm text-muted",children:r})]})]}),a&&(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})},o.Header.propTypes={title:s().node,subtitle:s().node,icon:s().string,actions:s().node,as:s().oneOf(["h2","h3","h4"]),className:s().string},o.Section=function({children:e,className:r,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("rounded-xl border border-line bg-raised p-4",r),...t,children:e})},o.Row=function({children:e,className:r,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("-mx-3 border-b border-line p-3 px-3 transition-colors last:border-b-0 hover:bg-raised",r),...t,children:e})},o.ListItem=function({children:e,actions:r,className:t,...a}){return(0,n.jsxs)("div",{className:(0,i.cn)("group -mx-3 flex items-center justify-between border-b border-line p-3 px-3 transition-colors last:border-b-0 hover:bg-raised",t),...a,children:[(0,n.jsx)("div",{className:"min-w-0 flex-1",children:e}),r&&(0,n.jsx)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",children:r})]})}},92542:(e,r,t)=>{"use strict";t.d(r,{default:()=>c});var n=t(95155),a=t(98500),s=t.n(a),i=t(14051),l=t.n(i),o=t(31474),d=t(4650);function c({children:e,variant:r="primary",size:t="md",icon:a,iconRight:i,href:l,disabled:u=!1,loading:m=!1,fullWidth:p=!1,className:h,...b}){let x=(0,o.cn)("inline-flex items-center justify-center gap-2 font-semibold transition-all duration-150 ease-out cursor-pointer","active:scale-[0.97] focus-visible:outline-none focus-visible:shadow-focus","disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100","aria-disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:active:scale-100",(0,d.V7)(r,t),p&&"w-full",h),f=(0,n.jsxs)(n.Fragment,{children:[m?(0,n.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]","aria-hidden":"true",children:"progress_activity"}):a?(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px]","aria-hidden":"true",children:a}):null,e,i&&!m&&(0,n.jsx)("span",{className:"material-symbols-outlined text-[18px] rtl:-scale-x-100","aria-hidden":"true",children:i})]});if(l&&!(u||m)){let{type:e,...r}=b;return r.className=x,/^(https?:|mailto:|tel:|#)/.test(l)?(0,n.jsx)("a",{href:l,...r,children:f}):(0,n.jsx)(s(),{href:l,...r,children:f})}return(0,n.jsx)("button",{className:x,disabled:u||m,"aria-busy":m||void 0,...b,children:f})}c.propTypes={children:l().node,variant:l().oneOf(Object.keys(d.Ck)),size:l().oneOf(Object.keys(d.GO)),icon:l().string,iconRight:l().string,href:l().string,disabled:l().bool,loading:l().bool,fullWidth:l().bool,className:l().string}},98542:(e,r,t)=>{"use strict";t.d(r,{default:()=>d});var n=t(95155),a=t(14051),s=t.n(a),i=t(12115),l=t(31474);let o={sm:"h-[26px] w-11",md:"h-[26px] w-11",lg:"h-7 w-12"};function d({checked:e=!1,onChange:r,label:t,description:a,disabled:s=!1,size:c="md",className:u,id:m,...p}){let h=(0,i.useId)(),b=m||h,x=`${b}-label`,f=`${b}-description`;if(!o[c])throw Error(`Toggle: unknown size "${c}"`);return(0,n.jsxs)("div",{className:(0,l.cn)("flex items-center gap-3",s&&"opacity-50",u),children:[(0,n.jsx)("button",{...p,id:b,type:"button",role:"switch","aria-checked":e,"aria-labelledby":t?x:p["aria-labelledby"],"aria-describedby":a?f:p["aria-describedby"],"aria-label":t?void 0:p["aria-label"]||p.title,disabled:s,onClick:()=>r?.(!e),className:(0,l.cn)("relative inline-flex shrink-0 rounded-full border border-line transition-colors duration-200","focus-visible:outline-none focus-visible:shadow-focus disabled:cursor-not-allowed","motion-reduce:transition-none",e?"bg-toggle-on":"bg-line",o[c]),children:(0,n.jsx)("span",{"aria-hidden":"true",className:(0,l.cn)("pointer-events-none absolute top-0.5 size-5 rounded-full shadow-sm transition-transform duration-200 motion-reduce:transition-none",e?"bg-toggle-knob-on translate-x-5 rtl:-translate-x-5":"bg-muted translate-x-0.5 rtl:-translate-x-0.5","start-0")})}),(t||a)&&(0,n.jsxs)("div",{className:"flex flex-col",children:[t&&(0,n.jsx)("label",{id:x,htmlFor:b,className:"text-sm font-medium text-text cursor-pointer",children:t}),a&&(0,n.jsx)("span",{id:f,className:"text-xs text-muted",children:a})]})]})}d.propTypes={checked:s().bool,onChange:s().func,label:s().node,description:s().node,disabled:s().bool,size:s().oneOf(Object.keys(o)),className:s().string,id:s().string,title:s().string,"aria-label":s().string}},98582:(e,r,t)=>{"use strict";t.d(r,{default:()=>d});var n=t(95155),a=t(14051),s=t.n(a),i=t(12115),l=t(31474),o=t(4650);function d({id:e,label:r,hint:t,error:a,required:s=!1,className:c,children:u}){let m=(0,i.useId)(),p=e||`${m}-input`,h=`${p}-hint`,b=`${p}-error`,x=(0,o.Gc)(p,{hint:t,error:a});return(0,n.jsxs)("div",{className:(0,l.cn)("flex flex-col gap-1.5",c),children:[r&&(0,n.jsxs)("label",{htmlFor:p,className:"text-sm font-medium text-text",children:[r,s&&(0,n.jsx)("span",{className:"text-err ms-1","aria-hidden":"true",children:"*"})]}),u({inputId:p,describedBy:x,invalid:!!a}),a?(0,n.jsxs)("p",{id:b,className:"text-xs text-err flex items-center gap-1",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"error"}),a]}):t?(0,n.jsx)("p",{id:h,className:"text-xs text-muted",children:t}):null]})}d.propTypes={id:s().string,label:s().node,hint:s().node,error:s().node,required:s().bool,className:s().string,children:s().func.isRequired}},99380:(e,r,t)=>{"use strict";t.d(r,{default:()=>o});var n=t(95155),a=t(14051),s=t.n(a),i=t(31474),l=t(98582);function o({label:e,options:r=[],value:t,onChange:a,placeholder:s="Select an option",error:d,hint:c,disabled:u=!1,required:m=!1,className:p,selectClassName:h,id:b,...x}){return(0,n.jsx)(l.default,{id:b,label:e,hint:c,error:d,required:m,className:p,children:({inputId:e,describedBy:l,invalid:o})=>(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("select",{...x,id:e,value:t,onChange:a,disabled:u,"aria-describedby":l,"aria-invalid":o||void 0,className:(0,i.cn)("w-full h-11 ps-3 pe-10 text-sm text-text bg-raised rounded-lg appearance-none","border border-line focus:outline-none focus:border-coral focus:shadow-focus","transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",o&&"border-err focus:border-err",h),children:[null!==s&&(0,n.jsx)("option",{value:"",disabled:!0,children:s}),(function(e=[]){let r=[];for(let t of e){let e=t.group||null,n=r[r.length-1];n&&n.label===e?n.options.push(t):r.push({label:e,options:[t]})}return r})(r).map((e,r)=>null===e.label?e.options.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value)):(0,n.jsx)("optgroup",{label:e.label,children:e.options.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))},`${e.label}-${r}`))]}),(0,n.jsx)("div",{className:"absolute inset-y-0 end-0 flex items-center pe-3 pointer-events-none text-muted","aria-hidden":"true",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]})})}o.propTypes={label:s().node,options:s().arrayOf(s().shape({value:s().oneOfType([s().string,s().number]).isRequired,label:s().node.isRequired,group:s().string})),value:s().oneOfType([s().string,s().number]),onChange:s().func,placeholder:s().oneOfType([s().string,s().oneOf([null])]),error:s().node,hint:s().node,disabled:s().bool,required:s().bool,className:s().string,selectClassName:s().string,id:s().string}}},e=>{e.O(0,[1610,2903,8105,7505,8441,3794,7358],()=>e(e.s=59100)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931,8460],{1934:(e,t,s)=>{"use strict";s.d(t,{v:()=>i});var a=s(12115);let n=e=>{let t,s=new Set,a=(e,a)=>{let n="function"==typeof e?e(t):e;if(!Object.is(n,t)){let e=t;t=(null!=a?a:"object"!=typeof n||null===n)?n:Object.assign({},t,n),s.forEach(s=>s(t,e))}},n=()=>t,r={setState:a,getState:n,getInitialState:()=>i,subscribe:e=>(s.add(e),()=>s.delete(e))},i=t=e(a,n,r);return r},r=e=>{let t=e?n(e):n,s=e=>(function(e,t=e=>e){let s=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},i=e=>e?r(e):r},8428:(e,t,s)=>{Promise.resolve().then(s.bind(s,47928)),Promise.resolve().then(s.bind(s,96748)),Promise.resolve().then(s.bind(s,56061)),Promise.resolve().then(s.bind(s,92542)),Promise.resolve().then(s.bind(s,56006)),Promise.resolve().then(s.bind(s,29366)),Promise.resolve().then(s.bind(s,84588)),Promise.resolve().then(s.bind(s,28164)),Promise.resolve().then(s.bind(s,97556)),Promise.resolve().then(s.bind(s,9911)),Promise.resolve().then(s.bind(s,45455)),Promise.resolve().then(s.bind(s,82534)),Promise.resolve().then(s.bind(s,42755)),Promise.resolve().then(s.bind(s,26506)),Promise.resolve().then(s.bind(s,10185)),Promise.resolve().then(s.bind(s,58897)),Promise.resolve().then(s.bind(s,29155)),Promise.resolve().then(s.bind(s,30815)),Promise.resolve().then(s.bind(s,29499)),Promise.resolve().then(s.bind(s,71252)),Promise.resolve().then(s.bind(s,99312)),Promise.resolve().then(s.bind(s,98582)),Promise.resolve().then(s.bind(s,53655)),Promise.resolve().then(s.bind(s,95088)),Promise.resolve().then(s.bind(s,29480)),Promise.resolve().then(s.bind(s,80752)),Promise.resolve().then(s.bind(s,6587)),Promise.resolve().then(s.bind(s,23936)),Promise.resolve().then(s.bind(s,11910)),Promise.resolve().then(s.bind(s,15729)),Promise.resolve().then(s.bind(s,46318)),Promise.resolve().then(s.bind(s,62899)),Promise.resolve().then(s.bind(s,94230)),Promise.resolve().then(s.bind(s,21931)),Promise.resolve().then(s.bind(s,22577)),Promise.resolve().then(s.bind(s,25086)),Promise.resolve().then(s.bind(s,28815)),Promise.resolve().then(s.bind(s,28058)),Promise.resolve().then(s.bind(s,93921)),Promise.resolve().then(s.bind(s,44863)),Promise.resolve().then(s.bind(s,81127)),Promise.resolve().then(s.bind(s,86465)),Promise.resolve().then(s.bind(s,96238)),Promise.resolve().then(s.bind(s,4823)),Promise.resolve().then(s.bind(s,61640)),Promise.resolve().then(s.bind(s,91348)),Promise.resolve().then(s.bind(s,34912)),Promise.resolve().then(s.bind(s,50611)),Promise.resolve().then(s.bind(s,51825)),Promise.resolve().then(s.bind(s,96975)),Promise.resolve().then(s.bind(s,46791)),Promise.resolve().then(s.bind(s,56071)),Promise.resolve().then(s.bind(s,28067)),Promise.resolve().then(s.bind(s,99380)),Promise.resolve().then(s.bind(s,61002)),Promise.resolve().then(s.bind(s,92622)),Promise.resolve().then(s.bind(s,44807)),Promise.resolve().then(s.bind(s,45027)),Promise.resolve().then(s.bind(s,77671)),Promise.resolve().then(s.bind(s,25908)),Promise.resolve().then(s.bind(s,19123)),Promise.resolve().then(s.bind(s,20446)),Promise.resolve().then(s.bind(s,38794)),Promise.resolve().then(s.bind(s,52024)),Promise.resolve().then(s.bind(s,21110)),Promise.resolve().then(s.bind(s,38587)),Promise.resolve().then(s.bind(s,98542)),Promise.resolve().then(s.bind(s,64371)),Promise.resolve().then(s.bind(s,97677)),Promise.resolve().then(s.bind(s,50744)),Promise.resolve().then(s.bind(s,40684))},21110:(e,t,s)=>{"use strict";s.d(t,{ThemeProvider:()=>i});var a=s(95155),n=s(12115),r=s(90085);function i({children:e}){let{initTheme:t}=(0,r.A)();return(0,n.useEffect)(()=>{t()},[t]),(0,a.jsx)(a.Fragment,{children:e})}},21931:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var a=s(95155),n=s(12115),r=s(14051),i=s.n(r),l=s(93308),o=s(73006),d=s(81127);let c={en:"English",vi:"Tiếng Việt","zh-CN":"简体中文","zh-TW":"繁體中文",ja:"日本語","pt-BR":"Portugu\xeas (Brasil)","pt-PT":"Portugu\xeas (Portugal)",ko:"한국어",es:"Espa\xf1ol",de:"Deutsch",fr:"Fran\xe7ais",he:"עברית",ar:"العربية",ru:"Русский",pl:"Polski",cs:"Čeština",nl:"Nederlands",tr:"T\xfcrk\xe7e",uk:"Українська",tl:"Tagalog",id:"Indonesia",th:"ไทย",km:"ខ្មែរ",hi:"हिन्दी",bn:"বাংলা",ur:"اردو",ro:"Rom\xe2nă",sv:"Svenska",it:"Italiano",el:"Ελληνικά",hu:"Magyar",fi:"Suomi",da:"Dansk",no:"Norsk",fa:"فارسی"},u=e=>c[e]||e;function p({className:e="",isOpen:t,onClose:s,hideTrigger:r=!1}){let[i,c]=(0,n.useState)("en"),[m,f]=(0,n.useState)(!1),[h,x]=(0,n.useState)(!1),b="boolean"==typeof t,g=(e=i)=>{b?s?.(e):x(!1)};(0,n.useEffect)(()=>{c(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${l.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,l.QC)(t)}())},[]);let v=async e=>{if(e!==i&&!m){f(!0);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,o.wn)();let t=document.documentElement,s=(0,o.kk)();t.lang=s,t.dir=l.rB.includes(s)?"rtl":"ltr",c(e),g(e)}catch(e){console.error("Failed to set locale:",e)}finally{f(!1)}}};return(0,a.jsxs)("div",{className:e,children:[!r&&(0,a.jsxs)("button",{type:"button",onClick:()=>x(!h),disabled:m,className:"flex h-11 items-center gap-2 rounded-lg px-3 text-muted transition-colors hover:bg-raised hover:text-text",title:"Language",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"language"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:u(i)})]}),(0,a.jsx)(d.default,{isOpen:b?t:h,onClose:()=>g(),title:"Select language",size:"full",className:"max-w-2xl",children:(0,a.jsx)("div",{"data-i18n-skip":"true",className:"grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-2",children:l.YZ.map(e=>{let t=i===e;return(0,a.jsxs)("button",{type:"button",onClick:()=>v(e),disabled:m,"aria-current":t||void 0,title:u(e),className:`flex w-full flex-col items-center justify-start gap-1 rounded-lg px-2 py-3 text-xs font-medium transition-colors ${t?"bg-coral-bg text-coral shadow-focus":"text-text hover:bg-raised"} ${m?"cursor-wait opacity-70":""}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[26px]","aria-hidden":"true",children:t?"language":"translate"}),(0,a.jsx)("span",{className:"flex h-8 items-center overflow-hidden text-center leading-tight [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2]",children:u(e)}),t&&(0,a.jsx)("span",{className:"material-symbols-outlined text-sm","aria-hidden":"true",children:"check"})]},e)})})})]})}p.propTypes={className:i().string,isOpen:i().bool,onClose:i().func,hideTrigger:i().bool}},28164:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var a=s(95155),n=s(98500),r=s.n(n),i=s(14051),l=s.n(i),o=s(31474);function d({href:e,children:t,showArrow:s=!0,className:n}){return(0,a.jsxs)(r(),{href:e,className:(0,o.cn)(n||"text-[13px] font-semibold text-coral-ink hover:text-coral"),children:[t,s?(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("span",{"aria-hidden":"true",className:"inline-block rtl:-scale-x-100",children:"→"})]}):null]})}d.propTypes={href:l().string.isRequired,children:l().node.isRequired,showArrow:l().bool,className:l().string}},28915:(e,t,s)=>{"use strict";s.d(t,{E2:()=>a,gs:()=>n});function a(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function n(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}s(8247)},38794:(e,t,s)=>{"use strict";s.d(t,{default:()=>o});var a=s(95155),n=s(14051),r=s.n(n),i=s(12115),l=s(50770);function o({lines:e,label:t="Console output",className:s,live:n="off",onScroll:r,scrollRef:d,cursor:c=!1,row:u}){return(0,a.jsx)("div",{ref:d,role:"log","aria-label":t,"aria-live":n,dir:"ltr",onScroll:r,tabIndex:0,className:`signal-terminal custom-scrollbar m-0 overflow-auto rounded-2xl p-[18px_22px] text-start font-mono text-[13px] leading-[1.75] focus-visible:shadow-focus${s?` ${s}`:""}`,children:(0,a.jsxs)("ol",{className:"m-0 list-none p-0",children:[u?e.map((e,t)=>(0,a.jsx)(i.Fragment,{children:u(e,t)},e.key??e.id??`${e.time}-${t}`)):e.map((e,t)=>(0,a.jsxs)("li",{className:"flex gap-4 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"signal-terminal-time shrink-0",children:e.time||"--:--:--"}),(0,a.jsx)("span",{className:`w-[52px] shrink-0 font-semibold ${(0,l.pN)(e.level)}`,children:e.level}),(0,a.jsx)("span",{className:"min-w-0 flex-1 whitespace-pre",children:e.message})]},e.id??`${e.time}-${t}`)),c&&(0,a.jsxs)("li",{className:"mt-0.5 flex gap-4 whitespace-nowrap","aria-hidden":"true",children:[(0,a.jsx)("span",{className:"signal-terminal-time shrink-0",children:"--:--:--"}),(0,a.jsx)("span",{className:"signal-terminal-cursor w-[52px] shrink-0 animate-pulse font-semibold",children:"▍"})]})]})})}o.propTypes={lines:r().arrayOf(r().shape({id:r().oneOfType([r().string,r().number]),time:r().string,level:r().oneOf(["LOG","INFO","WARN","ERROR","DEBUG"]).isRequired,message:r().string.isRequired})).isRequired,label:r().string,className:r().string,live:r().oneOf(["off","polite"]),onScroll:r().func,scrollRef:r().shape({current:r().object}),cursor:r().bool,row:r().func}},47928:(e,t,s)=>{"use strict";s.d(t,{default:()=>eT});var a=s(95155),n=s(12115),r=s(17081),i=s(14051),l=s.n(i),o=s(73321),d=s(25086),c=s(92542),u=s(28067),p=s(64371),m=s(56006),f=s(99312),h=s(29499),x=s(71252),b=s(93921),g=s(28777),v=s(54268),y=s(96975),j=s(21356),N=s(28915),w=s(53956);function C({entry:e,connections:t,testing:s,onRetry:n,onRepair:r,onOpen:i,onCooldownExpired:l}){let o=t.filter(e=>!1!==e.isActive),d=(0,w.SB)(o),u=d.until||(0,w.Gy)(o.find(e=>(0,w.Gy)(e))),p=[...o].sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0],m=o.find(e=>"reconnect"===(0,w.tT)(e).action),f=!!m,h="open"===d.action;return(0,a.jsxs)("div",{className:`flex items-center gap-3.5 rounded-2xl border p-4 ${"warn"===d.status?"border-warn bg-warn-bg":"border-err bg-err-bg"}`,children:[(0,a.jsx)(y.default,{providerId:e.id,size:"md"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(e),className:"truncate text-start text-[15px] font-semibold focus-visible:outline-none focus-visible:shadow-focus",children:[e.info.name," ","warn"===d.status?"is cooling down":"needs attention"]}),(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[13px] text-muted",children:[(0,a.jsx)("span",{children:d.reason||"Requests are skipping this provider"}),u&&(0,a.jsx)(j.A,{until:u,onExpire:l}),p?.lastErrorAt&&(0,a.jsx)("span",{children:(0,N.gs)(p.lastErrorAt)})]})]}),(0,a.jsx)(c.default,{size:"sm",variant:f?"primary":"secondary",loading:s,disabled:s,onClick:f?()=>r(e,m):h?()=>i(e):()=>n(e),"aria-label":f?`Reconnect ${m.name||m.email||e.info.name}`:void 0,children:s?"Retrying…":f?"Reconnect":h?"Open provider":"Retry now"})]})}C.propTypes={entry:l().object.isRequired,connections:l().array.isRequired,testing:l().bool,onRetry:l().func.isRequired,onRepair:l().func.isRequired,onOpen:l().func.isRequired,onCooldownExpired:l().func};let k=(0,n.memo)(C);var A=s(56061),T=s(81127),P=s(11910),S=s(99380);let R={openai:{title:"Add OpenAI-compatible",type:"openai-compatible",defaultBaseUrl:"https://api.openai.com/v1",namePlaceholder:"OpenAI Compatible (Prod)",prefixPlaceholder:"oc-prod",baseUrlHint:"Use the base URL (ending in /v1) for your OpenAI-compatible API.",modelIdPlaceholder:"e.g. gpt-4, claude-3-opus",errorLabel:"OpenAI Compatible",hasApiType:!0},anthropic:{title:"Add Anthropic-compatible",type:"anthropic-compatible",defaultBaseUrl:"https://api.anthropic.com/v1",namePlaceholder:"Anthropic Compatible (Prod)",prefixPlaceholder:"ac-prod",baseUrlHint:"Use the base URL (ending in /v1) for your Anthropic-compatible API. The system will append /messages.",modelIdPlaceholder:"e.g. claude-3-opus",errorLabel:"Anthropic Compatible",hasApiType:!1}},E=[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}];function O({variant:e,isOpen:t,onClose:s,onCreated:r}){let i=R[e],l=()=>({name:"",prefix:"",...i.hasApiType?{apiType:"chat"}:{},baseUrl:i.defaultBaseUrl}),[o,d]=(0,n.useState)(l),[u,p]=(0,n.useState)(!1),[m,f]=(0,n.useState)(""),[h,x]=(0,n.useState)(""),[b,g]=(0,n.useState)(!1),[v,y]=(0,n.useState)(null);(0,n.useEffect)(()=>{i.hasApiType?d(e=>({...e,baseUrl:i.defaultBaseUrl})):t&&(y(null),f(""),x(""))},[i.hasApiType?o.apiType:t]),(0,n.useEffect)(()=>{t&&(d(l()),f(""),x(""),y(null))},[t,e]);let j=async()=>{if(o.name.trim()&&o.prefix.trim()&&o.baseUrl.trim()){p(!0);try{let e=await fetch("/api/provider-nodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o.name,prefix:o.prefix,...i.hasApiType?{apiType:o.apiType}:{},baseUrl:o.baseUrl,type:i.type})}),t=await e.json();e.ok&&(r(t.node),d(l()),f(""),y(null))}catch(e){console.log(`Error creating ${i.errorLabel} node:`,e)}finally{p(!1)}}},N=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:o.baseUrl,apiKey:m,type:i.type,modelId:h.trim()||void 0})}),t=await e.json();y(t)}catch{y({valid:!1,error:"Network error"})}finally{g(!1)}};return(0,a.jsx)(T.default,{isOpen:t,title:i.title,onClose:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(P.default,{label:"Name",value:o.name,onChange:e=>d({...o,name:e.target.value}),placeholder:i.namePlaceholder,hint:"Required. A friendly label for this node."}),(0,a.jsx)(P.default,{label:"Prefix",value:o.prefix,onChange:e=>d({...o,prefix:e.target.value}),placeholder:i.prefixPlaceholder,hint:"Required. Used as the provider prefix for model IDs."}),i.hasApiType&&(0,a.jsx)(S.default,{label:"API type",options:E,value:o.apiType,onChange:e=>d({...o,apiType:e.target.value})}),(0,a.jsx)(P.default,{label:"Base URL",value:o.baseUrl,onChange:e=>d({...o,baseUrl:e.target.value}),placeholder:i.defaultBaseUrl,hint:i.baseUrlHint}),(0,a.jsx)(P.default,{label:"API key (for check)",type:"password",value:m,onChange:e=>f(e.target.value)}),(0,a.jsx)(P.default,{label:"Model ID (optional)",value:h,onChange:e=>x(e.target.value),placeholder:i.modelIdPlaceholder,hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,a.jsx)(c.default,{onClick:N,disabled:!m||b||!o.baseUrl.trim(),variant:"secondary",className:"w-full sm:w-auto",children:b?"Checking...":"Check"}),(()=>{if(!v)return null;let{valid:e,error:t,method:s}=v;return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(A.default,{variant:"success",children:"Valid"}),"chat"===s&&(0,a.jsx)("span",{className:"text-sm text-muted",children:"(via inference test)"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)(A.default,{variant:"error",children:"Invalid"}),t&&(0,a.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(c.default,{onClick:j,fullWidth:!0,disabled:!o.name.trim()||!o.prefix.trim()||!o.baseUrl.trim()||u,children:u?"Creating...":"Create"}),(0,a.jsx)(c.default,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}O.propTypes={variant:l().oneOf(["openai","anthropic"]).isRequired,isOpen:l().bool.isRequired,onClose:l().func.isRequired,onCreated:l().func.isRequired};var q=s(98500),I=s.n(q),$=s(19123),_=s(98542),U=s(44863),F=s(6587),L=s(86465),M=s(10185),D=s(63063),z=s(88105),G=s(42271),B=s(81231),H=s(65921);let J={oauth:"info",free:"live",apikey:"brand",compatible:"neutral"},K={oauth:"OAuth",free:"Free",apikey:"API key",compatible:"Compatible"};function V({connection:e,index:t,quotaSnapshot:s,onToggle:n,onClearCooldown:r}){let i=(0,w.tT)(e),l=i.until,o=e.name||e.email||e.displayName||"Account",d=e.email&&e.name?e.email:e.email||e.displayName||"",c="off"===i.status,u={variant:{off:"neutral",ok:"ok",warn:"warn",err:"err"}[i.status],label:{off:"Off",ok:"Active",warn:"Cooldown",err:"Error"}[i.status]},p=(s?.windows||[])[0];return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2.5 border-t border-line py-3.5 first:border-t-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:`flex size-7 shrink-0 items-center justify-center rounded-full font-mono text-xs font-semibold ${c?"bg-line text-muted":"bg-text text-bg"}`,children:t+1}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,a.jsx)("span",{className:`truncate text-sm font-semibold ${c?"text-muted":""}`,children:o}),d&&(0,a.jsx)("span",{className:"truncate font-mono text-xs text-muted",children:d})]}),(0,a.jsx)($.default,{variant:u.variant,size:"sm",children:u.label}),(0,a.jsx)(_.default,{size:"sm",checked:!c,onChange:e=>n(e),"aria-label":`${o} enabled`})]}),l?(0,a.jsxs)("div",{className:"flex items-center gap-2 ps-9.5",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(U.default,{value:100,label:`${o} cooldown`,valueText:"Rate limited"})}),(0,a.jsx)(j.A,{until:l}),(0,a.jsx)("button",{type:"button",onClick:r,className:"text-xs font-semibold text-coral-ink hover:text-coral focus-visible:outline-none focus-visible:shadow-focus",children:"Retry"})]}):p?(0,a.jsxs)("div",{className:"flex items-center gap-2 ps-9.5",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(U.default,{value:Math.round((1-p.usedFraction)*100),label:`${o} quota remaining`,valueText:`${Math.round((1-p.usedFraction)*100)}% remaining`})}),(0,a.jsxs)("span",{className:"text-xs whitespace-nowrap text-muted",children:[Math.round((1-p.usedFraction)*100),"% left",p.resetsAt?` \xb7 resets ${(0,N.gs)(p.resetsAt)}`:""]})]}):null]})}function W({entry:e,connections:t,onClose:s,onChanged:r,onTestAccounts:i,onAddAccount:l,testingAccounts:o=!1,inline:p=!1}){let m=(0,H.i)(e=>e.success),f=(0,H.i)(e=>e.error),[h,x]=(0,n.useState)(null),[b,v]=(0,n.useState)("fill-first"),[j,N]=(0,n.useState)(!1),[w,C]=(0,n.useState)({}),[k,A]=(0,n.useState)([]),[T,P]=(0,n.useState)({}),[S,R]=(0,n.useState)(!0),E="compatible"===e.authGroup,O=(0,z.wG)(e.id),q=(0,n.useCallback)(async()=>{try{let[t,s,a]=await Promise.all([fetch("/api/settings",{cache:"no-store"}),fetch("/api/models/custom",{cache:"no-store"}),fetch("/api/models/alias",{cache:"no-store"})]);if(t.ok){let s=await t.json(),a=s.providerStrategies?.[e.id]||{};x(a.fallbackStrategy||null),v(s.fallbackStrategy||"fill-first")}if(s.ok){let e=await s.json();A(e.models||[])}if(a.ok){let e=await a.json();P(e.aliases||{})}!E&&e.info.modelsFetcher?.url&&(0,G.o)(e.info.modelsFetcher).catch(()=>{})}catch{}finally{R(!1)}},[e.id,e.info.modelsFetcher,E]);(0,n.useEffect)(()=>{q()},[q]),(0,n.useEffect)(()=>{let e=!1;return Promise.all(t.filter(e=>"oauth"===e.authType).map(async t=>{try{let s=await fetch(`/api/usage/${t.id}`);if(!s.ok||e)return;let a=await s.json();e||C(e=>({...e,[t.id]:a.quotaSnapshot||null}))}catch{}})),()=>{e=!0}},[t]);let _=async t=>{N(!0);try{let s={...(await fetch("/api/settings").then(e=>e.json())).providerStrategies||{}},a={...s[e.id]||{}};t?a.fallbackStrategy=t:delete a.fallbackStrategy,0===Object.keys(a).length?delete s[e.id]:s[e.id]=a;let n=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:s})});if(!n.ok){let e=await n.json().catch(()=>({}));f(e.error||"Failed to save strategy");return}x(t),m("Account strategy saved")}catch{f("Failed to save strategy")}finally{N(!1)}},U=async(e,t)=>{try{await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}),r?.()}catch{f("Failed to toggle connection")}},X=async t=>{let s=Object.keys(t).filter(e=>e.startsWith("modelLock_")&&t[e]);if(0===s.length)return;let a=s[0].slice(10);try{(await fetch("/api/models/availability",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clearCooldown",provider:e.id,model:a})})).ok?(m("Cooldown cleared"),r?.()):f("Failed to clear cooldown")}catch{f("Failed to clear cooldown")}},Y=E?[]:(0,g.KC)(e.id).filter(e=>"llm"===(e.kind||e.type||"llm")),Q=E?(0,B.R)({customModels:k,modelAliases:T,providerAlias:O}):[...Y.map(e=>({id:e.id,fullModel:`${O}/${e.id}`})),...(0,B.R)({customModels:k,modelAliases:T,providerAlias:O,builtInModels:Y})],Z=Q.slice(0,6),ee=Q.length-Z.length,et=Q[0]?.fullModel||`${O}/model-id`,es={variant:J[e.authGroup]||"neutral",label:K[e.authGroup]||e.authGroup},ea=(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3.5",children:[(0,a.jsx)(y.default,{providerId:e.id,size:"lg"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,a.jsx)("h2",{className:"font-display text-[26px] font-bold leading-[1.1] text-text",children:e.info.name}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5","aria-live":"polite",children:[(0,a.jsx)($.default,{variant:es.variant,size:"sm",children:es.label}),(0,a.jsx)($.default,{variant:t.length>0?"ok":"neutral",size:"sm",dot:t.length>0,children:t.length>0?`${t.length} ${1===t.length?"account":"accounts"}`:"No accounts"})]})]}),p&&(0,a.jsx)(F.default,{icon:"close",label:`Close ${e.info.name} details`,onClick:s})]}),(0,a.jsxs)("div",{className:"flex gap-2.5",children:[(0,a.jsx)(c.default,{size:"sm",variant:"secondary",className:"flex-1",loading:o,disabled:o||0===t.length,onClick:i,children:o?"Testing…":"Test accounts"}),(0,a.jsx)(c.default,{size:"sm",variant:"primary",icon:"add",className:"flex-1",onClick:l,children:"Add account"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsx)("span",{id:`strategy-label-${e.id}`,className:"text-xs font-semibold tracking-[0.08em] text-muted uppercase",children:"When an account runs dry"}),(0,a.jsx)(u.default,{"aria-labelledby":`strategy-label-${e.id}`,value:h||b,onChange:_,options:D.T7.map(e=>({value:e.value,label:String(e.label).split(" — ")[0]}))}),j&&(0,a.jsx)("span",{className:"text-xs text-muted","aria-live":"polite",children:"Saving…"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"mb-1 text-xs font-semibold tracking-[0.08em] text-muted uppercase",children:"Accounts"}),0===t.length?(0,a.jsx)("p",{className:"rounded-xl border border-dashed border-line px-3 py-4 text-center text-sm text-muted",children:"No accounts connected yet. Click Add account to connect."}):t.map((e,t)=>(0,a.jsx)(V,{connection:e,index:t,quotaSnapshot:w[e.id],onToggle:t=>U(e,t),onClearCooldown:()=>X(e)},e.id))]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"text-xs font-semibold tracking-[0.08em] text-muted uppercase",children:"Models"}),(0,a.jsx)(I(),{href:`/dashboard/providers/${e.id}`,className:"ms-auto text-[13px] font-semibold text-coral-ink hover:text-coral focus-visible:shadow-focus focus-visible:outline-none",children:"Manage"})]}),S?(0,a.jsx)(d.Skeleton,{className:"h-7 w-full"}):0===Q.length?(0,a.jsx)("p",{className:"text-sm text-muted",children:"No models configured for this provider."}):(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[Z.map(e=>(0,a.jsx)(L.default,{model:e.fullModel},e.fullModel)),ee>0&&(0,a.jsxs)("span",{className:"font-mono text-xs text-muted",children:["+",ee," more"]})]})]}),(0,a.jsxs)("div",{className:"mt-auto flex flex-col gap-2 rounded-[14px] bg-raised p-3.5",children:[(0,a.jsx)("span",{className:"text-[13px] text-muted",children:"Point any client at your endpoint and ask for"}),(0,a.jsx)(M.default,{value:`"model": "${et}"`,copyValue:et,label:"Copy model id snippet"})]}),(0,a.jsx)(I(),{href:`/dashboard/providers/${e.id}`,className:"text-[13px] font-semibold text-coral-ink hover:text-coral focus-visible:shadow-focus focus-visible:outline-none",children:"Open full page →"})]});return p?(0,a.jsx)("aside",{"aria-label":`${e.info.name} details`,className:"w-[400px] shrink-0 rounded-[20px] border border-line bg-panel p-6 shadow-card",children:ea}):ea}V.propTypes={connection:l().object.isRequired,index:l().number.isRequired,quotaSnapshot:l().object,onToggle:l().func.isRequired,onClearCooldown:l().func.isRequired},W.propTypes={entry:l().object.isRequired,connections:l().array.isRequired,onClose:l().func.isRequired,onChanged:l().func,onTestAccounts:l().func,onAddAccount:l().func,testingAccounts:l().bool,inline:l().bool};var X=s(62899),Y=s(30815),Q=s(95088),Z=s(40684),ee=s(23936),et=s(91348),es=s(47199);let ea="ag_risk_confirmed";function en({entry:e,proxyPools:t,error:s,existingNames:r,onSave:i,onClose:l,onChanged:o}){let[d,u]=(0,n.useState)(!1),[p,m]=(0,n.useState)(!1),[f,h]=(0,n.useState)(!1),x="oauth"===e.authGroup||"free"===e.authGroup;(0,n.useEffect)(()=>{"antigravity"===e.id&&"true"!==window.localStorage.getItem(ea)?m(!0):u(!0)},[e.id]);let b=()=>{o?.(),l()},g=async e=>{await i(e)};return x?(0,a.jsxs)(a.Fragment,{children:["kiro"===e.id?(0,a.jsx)(X.default,{isOpen:d,providerInfo:e.info,onSuccess:b,onClose:l}):"cursor"===e.id?(0,a.jsx)(Y.default,{isOpen:d,providerInfo:e.info,onSuccess:b,onClose:l}):"gitlab"===e.id?(0,a.jsx)(Q.default,{isOpen:d,providerInfo:e.info,onSuccess:b,onClose:l}):"xiaomi-mimo"===e.id?(0,a.jsx)(Z.default,{isOpen:d,providerInfo:e.info,onSuccess:b,onClose:l}):"iflow"===e.id?(0,a.jsx)(ee.default,{isOpen:d,providerInfo:e.info,onSuccess:b,onClose:l}):(0,a.jsx)(et.default,{isOpen:d,provider:e.id,providerInfo:e.info,onSuccess:b,onClose:l}),p&&(0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"ag-risk-title",className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,a.jsx)("div",{className:"signal-backdrop absolute inset-0","aria-hidden":"true",onClick:l}),(0,a.jsxs)("div",{className:"relative w-full max-w-md rounded-[20px] border border-line bg-panel p-6 shadow-card",children:[(0,a.jsx)("h2",{id:"ag-risk-title",className:"font-display text-lg font-bold",children:"Antigravity carries account risk"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-muted",children:"Unofficial OAuth for Google Antigravity can trigger account review. Continue only with a spare account."}),(0,a.jsxs)("label",{className:"mt-4 flex items-center gap-2 text-sm",children:[(0,a.jsx)("input",{type:"checkbox",checked:f,onChange:e=>h(e.target.checked),className:"size-4"}),"I understand the risk"]}),(0,a.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,a.jsx)(c.default,{size:"sm",variant:"secondary",onClick:l,children:"Cancel"}),(0,a.jsx)(c.default,{size:"sm",variant:"danger",disabled:!f,onClick:()=>{window.localStorage.setItem(ea,"true"),m(!1),u(!0)},children:"Continue"})]})]})]})]}):(0,a.jsx)(es.A,{isOpen:!0,provider:e.id,providerName:e.info.name,isCompatible:!1,isAnthropic:!1,authType:e.info.authType,authHint:e.info.authHint,website:e.info.website,proxyPools:t,error:s,existingNames:r,onSave:g,onBulkDone:o,onClose:l})}function er({isOpen:e,onClose:t,results:s}){if(!s)return null;let{summary:n,mode:r,error:i}=s,l=s.results||[];return(0,a.jsx)(T.default,{isOpen:e,onClose:t,title:"Test results",size:"lg",children:i&&!l.length?(0,a.jsxs)("div",{className:"py-6 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mb-2 block text-[32px] text-err","aria-hidden":"true",children:"error"}),(0,a.jsx)("p",{className:"text-sm text-err",children:i})]}):(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[n&&(0,a.jsxs)("div",{className:"mb-1 flex flex-wrap items-center gap-2 text-xs sm:gap-3","aria-live":"polite",children:[(0,a.jsxs)("span",{className:"text-muted",children:[{oauth:"OAuth",free:"Free",apikey:"API key",provider:"Provider",all:"All"}[r]||r," Test"]}),(0,a.jsxs)($.default,{variant:"ok",size:"sm",children:[n.passed," passed"]}),n.failed>0&&(0,a.jsxs)($.default,{variant:"err",size:"sm",children:[n.failed," failed"]}),(0,a.jsxs)("span",{className:"text-muted sm:ms-auto",children:[n.total," tested"]})]}),(0,a.jsx)("div",{className:"flex max-h-[460px] flex-col gap-2 overflow-y-auto pe-1",children:l.map((e,t)=>{let s=e.diagnosis?.type;return(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-xl border border-line bg-raised px-3.5 py-2.5 text-xs sm:flex-nowrap",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${e.valid?"text-ok":"text-err"}`,"aria-hidden":"true",children:e.valid?"check_circle":"error"}),(0,a.jsx)(y.default,{providerId:e.provider,size:"sm"}),(0,a.jsxs)("div",{className:"min-w-0 flex-[1_1_160px]",children:[(0,a.jsx)("span",{className:"block truncate font-medium text-text sm:inline",children:e.connectionName}),(0,a.jsxs)("span",{className:"block truncate text-muted sm:ms-1.5 sm:inline",children:["(",e.provider,")"]})]}),void 0!==e.latencyMs&&(0,a.jsxs)("span",{className:"shrink-0 font-mono tabular-nums text-muted",children:[e.latencyMs,"ms"]}),(0,a.jsx)($.default,{variant:e.valid?"ok":"err",size:"sm",children:e.valid?"OK":s||"ERROR"})]},e.connectionId||t)})}),0===l.length&&(0,a.jsx)("div",{className:"py-6 text-center text-sm text-muted",children:"No active connections found for this group."})]})})}en.propTypes={entry:l().object.isRequired,proxyPools:l().array,error:l().string,existingNames:l().array,onSave:l().func.isRequired,onClose:l().func.isRequired,onChanged:l().func},er.propTypes={isOpen:l().bool.isRequired,onClose:l().func.isRequired,results:l().shape({mode:l().string,results:l().array,summary:l().shape({total:l().number,passed:l().number,failed:l().number}),error:l().string})};let ei=(0,n.memo)(function({entry:e,connections:t,selected:s,testing:n,batchTesting:r,onOpen:i,onClose:l,onTest:o}){let d=t.filter(e=>!1!==e.isActive),u=(0,w.SB)(d),p=e.stats.allDisabled?"Disabled":u.reason||"Ready",m=function(e,t){if(e.stats.allDisabled)return{variant:"neutral",label:"Disabled",dot:!1};if("err"===t.status){let s=e.stats.errorCode?` (${e.stats.errorCode})`:"";return{variant:"err",label:`${t.counts.err} Error${s}`,dot:!0}}return"warn"===t.status&&t.until?{variant:"warn",label:"Cooldown",dot:!0}:"warn"===t.status&&t.reason?{variant:"warn",label:t.reason,dot:!0}:{variant:"ok",label:"Connected",dot:!0}}(e,u),f=function(e){let t=null;for(let s of e)"number"==typeof s?.quotaRemaining&&(null===t||s.quotaRemaining<t)&&(t=s.quotaRemaining);return t}(d),h=e.info.name;return(0,a.jsxs)("li",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-stretch gap-2 sm:items-center",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>s?l():i(e),"aria-expanded":s,"aria-label":s?`Close ${h} details`:`Open ${h} details`,className:`flex min-w-0 flex-col gap-2 rounded-2xl border bg-panel p-4 text-start shadow-card transition-colors hover:border-subtle focus-visible:outline-none focus-visible:shadow-focus sm:flex-row sm:items-center sm:gap-3 ${s?"border-coral shadow-[0_0_0_3px_var(--signal-coral-bg)]":"border-line"}`,children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)(y.default,{providerId:e.id,size:"md",status:e.stats.allDisabled?"neutral":"err"===u.status?"err":"warn"===u.status?"warn":u.connected?"ok":"neutral"}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"truncate text-[15px] font-semibold",children:h}),(0,a.jsxs)("span",{className:"truncate text-[13px] text-muted",children:[`${t.length} ${1===t.length?"account":"accounts"}`,null!==f&&` \xb7 ${f}% quota left`]})]})]}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 sm:justify-end",children:[(0,a.jsx)("span",{className:"min-w-0 truncate text-[13px] text-muted",children:p}),(0,a.jsx)($.default,{variant:m.variant,size:"sm",dot:m.dot,children:m.label})]})]}),(0,a.jsx)(c.default,{size:"sm",variant:"secondary",loading:n,disabled:n||r,onClick:()=>o(e),"aria-label":`Test ${h} accounts`,children:n?"Testing…":"Test"})]})});function el(){let e=(0,n.useCallback)(()=>{let e=document.getElementById("providers-catalog");if(!e)return;let t=window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;e.scrollIntoView({behavior:t?"auto":"smooth",block:"start"}),e.focus({preventScroll:!0})},[]);return(0,a.jsx)("div",{className:"rounded-2xl border border-dashed border-line bg-panel shadow-card",children:(0,a.jsx)(f.default,{icon:"link",title:"Connect your first provider",body:"Pick a provider below and sign in or paste a key. It shows up here once it's connected.",action:(0,a.jsx)(c.default,{size:"sm",variant:"secondary",onClick:e,children:"Browse providers"})})})}function eo({entries:e,total:t,connectionsFor:s,selectedProvider:n,testingMode:r,testAccountsMode:i,onOpen:l,onClose:o,onTest:d,onTestAll:u}){return 0===t?(0,a.jsx)(el,{}):0===e.length?null:(0,a.jsxs)("section",{"aria-labelledby":"providers-yours",className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,a.jsx)("h2",{id:"providers-yours",className:"font-display text-xl font-bold lg:text-[22px]",children:"Your providers"}),(0,a.jsxs)("span",{className:"text-[13px] text-muted",children:[t," ",1===t?"provider":"providers"]}),(0,a.jsx)(c.default,{size:"sm",variant:"secondary",icon:"play_arrow",className:"ms-auto",loading:"all"===r,disabled:!!r||!!i,onClick:u,title:"Test all connections",children:"all"===r?"Testing…":"Test all"})]}),(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:e.map(e=>(0,a.jsx)(ei,{entry:e,connections:s(e),selected:n===e.id,testing:i===e.id,batchTesting:!!r,onOpen:l,onClose:o,onTest:d},e.id))})]})}ei.propTypes={entry:l().object.isRequired,connections:l().array.isRequired,selected:l().bool,testing:l().bool,batchTesting:l().bool,onOpen:l().func.isRequired,onClose:l().func.isRequired,onTest:l().func.isRequired},eo.propTypes={entries:l().array.isRequired,total:l().number.isRequired,connectionsFor:l().func.isRequired,selectedProvider:l().string,testingMode:l().string,testAccountsMode:l().string,onOpen:l().func.isRequired,onClose:l().func.isRequired,onTest:l().func.isRequired,onTestAll:l().func.isRequired};let ed=(0,n.memo)(eo),ec={oauth:"info",free:"live",apikey:"brand",compatible:"neutral"},eu={oauth:"OAuth",free:"Free",apikey:"API key",compatible:"Compatible"},ep={ok:"bg-ok",warn:"bg-warn",err:"bg-err",none:"bg-line"};function em({segments:e}){return(0,a.jsx)("div",{role:"img","aria-label":`Account health: ${e.map(e=>e.label).join(", ")}`,className:"grid min-w-0 flex-1 auto-cols-fr grid-flow-col gap-1",children:e.map((e,t)=>(0,a.jsx)("span",{title:e.label,className:"h-1.5 overflow-hidden rounded-sm bg-raised shadow-[inset_0_0_0_1px_var(--signal-line)]",children:(0,a.jsx)("span",{className:`block h-full rounded-sm ${ep[e.kind]||"bg-line"}`,style:{width:`${Math.min(100,Math.max(0,e.value))}%`}})},`${e.label}-${t}`))})}em.propTypes={segments:l().arrayOf(l().shape({value:l().number.isRequired,kind:l().oneOf(["ok","warn","err","none"]).isRequired,label:l().string.isRequired})).isRequired};let ef=(0,n.memo)(function({entry:e,connections:t,selected:s=!1,modelCount:n=null,onSelect:r,onToggle:i}){let{info:l,stats:o}=e,d=(0,v.sf)(t),c=function(e,t){if(e.isNoAuth)return{variant:"ok",label:"Ready",dot:!0};if(e.stats.allDisabled)return{variant:"neutral",label:"Disabled",dot:!1};let s=(0,w.SB)(t);if("warn"===s.status&&s.until)return{variant:"warn",label:"Cooldown",dot:!0};if("err"===s.status){let t=s.counts.err;return{variant:"err",label:e.stats.errorCode?`${t} Error (${e.stats.errorCode})`:`${t} Error`,dot:!0}}return"warn"===s.status&&s.reason?{variant:"warn",label:s.reason,dot:!0}:e.stats.connected>0?{variant:"ok",label:"Connected",dot:!0}:{variant:"neutral",label:"apikey"===e.authGroup||"compatible"===e.authGroup?"Add key":"Connect",dot:!1}}(e,t),u=e.compatibleType?{variant:"neutral",label:"anthropic"===e.compatibleType?"Messages":"responses"===l.apiType?"Responses":"Chat"}:{variant:ec[e.authGroup]||"neutral",label:eu[e.authGroup]||e.authGroup};return(0,a.jsxs)("div",{className:`group relative flex min-w-0 flex-col gap-3.5 rounded-2xl border bg-panel p-4 shadow-card transition-colors hover:border-subtle focus-within:border-subtle ${s?"border-coral shadow-[0_0_0_3px_var(--signal-coral-bg)]":"border-line"}`,children:[(0,a.jsx)("button",{type:"button",onClick:r,"aria-expanded":s,"aria-label":s?`Close ${l.name} details`:`Open ${l.name} details`,className:"absolute inset-0 z-0 rounded-2xl focus-visible:outline-none focus-visible:shadow-focus"}),(0,a.jsxs)("div",{className:"pointer-events-none flex min-w-0 items-center gap-3",children:[(0,a.jsx)(y.default,{providerId:e.id,size:"md",status:function(e,t){if(e.stats.allDisabled)return"neutral";let s=(0,w.SB)(e.isNoAuth?[]:t);return"err"===s.status?"err":"warn"===s.status?"warn":s.connected?"ok":"neutral"}(e,t)}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("span",{className:"truncate text-[15px] font-semibold",children:l.name}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)($.default,{variant:u.variant,size:"sm",children:u.label}),e.compatibleLabel&&(0,a.jsx)($.default,{variant:"neutral",size:"sm",children:e.compatibleLabel})]})]}),o.total>0&&(0,a.jsx)("span",{className:"pointer-events-auto relative z-10 shrink-0 opacity-100 transition-opacity lg:opacity-0 lg:group-hover:opacity-100 lg:group-focus-within:opacity-100",children:(0,a.jsx)(_.default,{size:"sm",checked:!o.allDisabled,onChange:e=>i(e),title:o.allDisabled?"Enable provider":"Disable provider","aria-label":o.allDisabled?`Enable ${l.name}`:`Disable ${l.name}`})})]}),t.length>0&&(0,a.jsx)("div",{className:"pointer-events-none flex gap-1",children:(0,a.jsx)(em,{segments:d})}),(0,a.jsxs)("div",{className:"pointer-events-none flex min-w-0 items-center gap-1.5 text-xs text-muted",children:[(0,a.jsx)("span",{children:0===t.length?"Not connected":`${t.length} ${1===t.length?"account":"accounts"}`}),n>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":"true",children:"\xb7"}),(0,a.jsxs)("span",{children:[n," ",1===n?"model":"models"]})]}),(0,a.jsx)("span",{className:"ms-auto",children:(0,a.jsx)($.default,{variant:c.variant,size:"sm",dot:c.dot,children:c.label})})]}),o.errorTime&&o.error>0&&(0,a.jsx)("span",{className:"pointer-events-none text-xs text-muted",children:o.errorTime})]})});ef.propTypes={entry:l().shape({id:l().string.isRequired,info:l().object.isRequired,stats:l().object.isRequired,authGroup:l().string.isRequired,authTypes:l().arrayOf(l().string).isRequired,compatibleType:l().string,compatibleLabel:l().string,isNoAuth:l().bool}).isRequired,connections:l().array.isRequired,selected:l().bool,modelCount:l().number,onSelect:l().func.isRequired,onToggle:l().func.isRequired};let eh=(0,n.memo)(function({entry:e,connections:t,selected:s,modelCount:n,openProvider:r,handleToggleProvider:i}){return(0,a.jsx)(ef,{entry:e,connections:t,selected:s,modelCount:n,onSelect:()=>r(e),onToggle:t=>i(e.id,e.authTypes,t)})});function ex({section:e,collapsed:t,onToggleCollapse:s,connectionsFor:n,showAllApikey:r,setShowAllApikey:i,forceOpen:l,selectedProvider:o,modelCountFor:d,openProvider:c,handleToggleProvider:u}){let p=l||!t,m=`providers-${e.id}-grid`,f="apikey"!==e.id||r||l?e.entries:e.entries.slice(0,20);return(0,a.jsxs)("section",{"aria-labelledby":`providers-${e.id}`,className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,a.jsx)("h3",{id:`providers-${e.id}`,className:"font-display text-lg font-bold lg:text-xl",children:(0,a.jsxs)("button",{type:"button",onClick:()=>s(e.id),"aria-expanded":p,"aria-controls":m,className:"flex min-h-11 items-center gap-1.5 rounded-lg pe-1 text-start focus-visible:outline-none focus-visible:shadow-focus",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] transition-transform motion-reduce:transition-none ${p?"":"-rotate-90 rtl:rotate-90"}`,"aria-hidden":"true",children:"expand_more"}),e.title,(0,a.jsx)("span",{className:"text-[13px] font-normal text-muted",children:e.catalogCount})]})}),(0,a.jsx)("span",{className:"text-[13px] text-muted",children:e.subtitle}),"apikey"===e.id&&e.catalogCount>20&&(0,a.jsx)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":r||l,className:"ms-auto inline-flex min-h-11 items-center gap-1 px-1 text-[13px] font-semibold text-coral-ink hover:text-coral focus-visible:outline-none focus-visible:shadow-focus",children:r||l?"Show less":(0,a.jsxs)(a.Fragment,{children:[`Show all ${e.catalogCount}`,(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] rtl:-scale-x-100","aria-hidden":"true",children:"arrow_forward"})]})})]}),(0,a.jsx)("div",{id:m,className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3",children:p&&f.map(e=>(0,a.jsx)(eh,{entry:e,connections:n(e),selected:o===e.id,modelCount:d(e),openProvider:c,handleToggleProvider:u},e.id))})]})}eh.propTypes={entry:l().object.isRequired,connections:l().array.isRequired,selected:l().bool,modelCount:l().number,openProvider:l().func.isRequired,handleToggleProvider:l().func.isRequired},ex.propTypes={section:l().object.isRequired,collapsed:l().bool.isRequired,onToggleCollapse:l().func.isRequired,connectionsFor:l().func.isRequired,showAllApikey:l().bool.isRequired,setShowAllApikey:l().func.isRequired,forceOpen:l().bool,selectedProvider:l().string,modelCountFor:l().func.isRequired,openProvider:l().func.isRequired,handleToggleProvider:l().func.isRequired};let eb=(0,n.memo)(ex);function eg({entries:e,connectionsFor:t,selectedProvider:s,modelCountFor:n,openProvider:r,handleToggleProvider:i,onAddOpenAI:l,onAddAnthropic:o}){return(0,a.jsxs)("section",{"aria-label":"Bring your own endpoint",className:"flex flex-col gap-3 rounded-2xl border border-dashed border-line p-4 sm:px-4.5",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-3.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px] text-muted","aria-hidden":"true",children:"code"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-[15px] font-semibold",children:"Bring your own endpoint"}),(0,a.jsx)("span",{className:"text-[13px] text-muted",children:"Any OpenAI- or Anthropic-compatible base URL becomes a provider."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(c.default,{size:"sm",variant:"secondary",onClick:l,children:"+ OpenAI compatible"}),(0,a.jsx)(c.default,{size:"sm",variant:"secondary",onClick:o,children:"+ Anthropic compatible"})]})]}),e.length>0&&(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4 lg:grid-cols-3",children:e.map(e=>(0,a.jsx)(eh,{entry:e,connections:t(e),selected:s===e.id,modelCount:n(e),openProvider:r,handleToggleProvider:i},e.id))})]})}eg.propTypes={entries:l().array.isRequired,connectionsFor:l().func.isRequired,selectedProvider:l().string,modelCountFor:l().func.isRequired,openProvider:l().func.isRequired,handleToggleProvider:l().func.isRequired,onAddOpenAI:l().func.isRequired,onAddAnthropic:l().func.isRequired};let ev=(0,n.memo)(eg);var ey=s(4553);let ej=["oauth","apikey","api_key","cookie","access_token"];function eN(e){return!e.isNoAuth&&(e.stats?.total||0)>0}function ew(e,t){let s=+!(0,v.e_)(e.stats,e.isNoAuth),a=+!(0,v.e_)(t.stats,t.isNoAuth);return s!==a?s-a:(e.info.name||e.id).localeCompare(t.info.name||t.id)}let eC="providers:catalog-collapsed",ek=[];function eA({initialProviderId:e=null}){let{connections:t,setConnections:s,providerNodes:i,setProviderNodes:l,loading:y,fetchError:j,refreshData:N}=function(){let[e,t]=(0,n.useState)([]),[s,a]=(0,n.useState)([]),[r,i]=(0,n.useState)(!0),[l,o]=(0,n.useState)(""),d=(0,n.useCallback)(async()=>{try{let[e,s]=await Promise.all([fetch("/api/providers"),fetch("/api/provider-nodes")]),n=await e.json().catch(()=>({})),r=await s.json().catch(()=>({}));e.ok?(t(n.connections||[]),o("")):o(n.error||"Failed to load providers"),s.ok&&a(r.nodes||[])}catch(e){o(e?.message||"Failed to load providers")}finally{i(!1)}},[]);return(0,n.useEffect)(()=>{d()},[d]),{connections:e,setConnections:t,providerNodes:s,setProviderNodes:a,loading:r,fetchError:l,refreshData:d}}(),C=(0,n.useCallback)(()=>{N(),(0,r.q0)()},[N]),[A,T]=(0,n.useState)(v.Rw.ALL),[P,S]=(0,n.useState)(""),[R,E]=(0,n.useState)(!1),[q,I]=(0,n.useState)(!1),[$,_]=(0,n.useState)(!1),[U,F]=(0,n.useState)(e),[L,M]=(0,n.useState)([]),D=function(e="(max-width: 1279px)"){let[t,s]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let t=window.matchMedia(e),a=()=>s(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),t}(),G=(0,o.useRouter)(),B=(0,o.useSearchParams)(),{testingMode:J,testResults:K,isTestModalOpen:V,setIsTestModalOpen:X,testAccountsMode:Y,addAccountEntry:Q,setAddAccountEntry:Z,addConnectionError:ee,setAddConnectionError:et,repairConnection:es,setRepairConnection:ea,handleToggleProvider:ei,handleBatchTest:el,handleTestAccounts:eo,handleSaveApiKey:ec,handleRepairConnection:eu}=function({connections:e,setConnections:t,refreshData:s}){let[a,i]=(0,n.useState)(null),[l,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!1),[u,p]=(0,n.useState)(null),[m,f]=(0,n.useState)(null),[h,x]=(0,n.useState)(""),[b,g]=(0,n.useState)(null),v=(0,H.i)(e=>e.success),y=(0,H.i)(e=>e.error),j=(0,H.i)(e=>e.warning),N=(0,n.useRef)(e),w=(0,n.useRef)(null),C=(0,n.useRef)(null);(0,n.useEffect)(()=>{N.current=e},[e]);let k=(0,n.useCallback)(async(e,a,n)=>{let i=Array.isArray(a)?a:[a],l=t=>t.provider===e&&i.includes(t.authType),o=N.current,d=o.filter(l);t(e=>e.map(e=>l(e)?{...e,isActive:n}:e)),(await Promise.allSettled(d.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:n})})))).some(e=>"rejected"===e.status||!e.value.ok)&&(t(o),y("Failed to update provider. Please try again."),s()),(0,r.q0)()},[t,y,s]),A=(0,n.useCallback)(async(e,t=null)=>{if(w.current)return;let a="provider"===e?t:e;w.current=a,i(a),o(null);try{let a=await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e,providerId:t})}),n=await a.json().catch(()=>({}));if(!a.ok){o({error:n?.error||"Test request failed"}),c(!0),y("Provider test failed"),s();return}if(o(n),c(!0),n.summary){let{passed:e,failed:t,total:s}=n.summary;0===t?v(`All ${s} tests passed`):j(`${e}/${s} passed, ${t} failed`)}s()}catch{o({error:"Test request failed"}),c(!0),y("Provider test failed")}finally{w.current=null,i(null)}},[s,v,y,j]),T=(0,n.useCallback)(async e=>{if(!C.current){C.current=e.id,p(e.id);try{(await fetch("/api/providers/test-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"provider",providerId:e.id})})).ok||y("Account test failed"),s()}catch{y("Account test failed")}finally{C.current=null,p(null)}}},[s,y]),P=(0,n.useCallback)(async e=>{if(m){x("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:m.id,...e})});if(t.ok){f(null),s();return}let a=await t.json().catch(()=>({}));x(a?.error||"Failed to save connection")}catch{x("Failed to save connection")}}},[m,s]),S=(0,n.useCallback)(async e=>{if(!b)return"Nothing to repair";try{let t=await fetch(`/api/providers/${b.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)return g(null),s(),v("Connection updated. Test it to confirm."),null;return(await t.json().catch(()=>({}))).error||"Failed to save connection"}catch{return"Failed to save connection"}},[b,s,v]);return{testingMode:a,testResults:l,isTestModalOpen:d,setIsTestModalOpen:c,testAccountsMode:u,addAccountEntry:m,setAddAccountEntry:f,addConnectionError:h,setAddConnectionError:x,repairConnection:b,setRepairConnection:g,handleToggleProvider:k,handleBatchTest:A,handleTestAccounts:T,handleSaveApiKey:P,handleRepairConnection:S}}({connections:t,setConnections:s,refreshData:C}),{isCollapsed:ep,toggle:em}=function(){let[e,t]=(0,n.useState)({}),[s,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{try{let e=localStorage.getItem(eC),s=e?JSON.parse(e):null;t(s&&"object"==typeof s&&!Array.isArray(s)?s:{})}catch{t({})}a(!0)},[]),(0,n.useEffect)(()=>{if(s)try{localStorage.setItem(eC,JSON.stringify(e))}catch{}},[e,s]),{isCollapsed:(0,n.useCallback)(t=>!!e[t],[e]),toggle:(0,n.useCallback)(e=>t(t=>({...t,[e]:!t[e]})),[])}}();(0,n.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true").then(e=>e.ok?e.json():{proxyPools:[]}).then(t=>{e||M(t.proxyPools||[])}).catch(()=>{}),()=>{e=!0}},[]);let{allEntries:ef,yourProviders:eh,yourProvidersTotal:ex,catalogSections:eg,filterCounts:eT,needsAttention:eP,totals:eS,isStale:eR}=function({connections:e,providerNodes:t,query:s,filter:a}){let r=(0,n.useDeferredValue)(s);return{...(0,n.useMemo)(()=>(function({connections:e,providerNodes:t,query:s="",filter:a=v.Rw.ALL}){let n=function({connections:e,providerNodes:t,statsFor:s}){var a;let n=(t||[]).filter(e=>"openai-compatible"===e.type).map(e=>({id:e.id,info:{id:e.id,name:e.name||"OpenAI Compatible",apiType:e.apiType},stats:s(e.id,ej),authGroup:"compatible",authTypes:ej,isNoAuth:!1,compatibleType:"openai",compatibleLabel:"responses"===e.apiType?"Responses":"Chat"})),r=(t||[]).filter(e=>"anthropic-compatible"===e.type).map(e=>({id:e.id,info:{id:e.id,name:e.name||"Anthropic Compatible"},stats:s(e.id,ej),authGroup:"compatible",authTypes:ej,isNoAuth:!1,compatibleType:"anthropic",compatibleLabel:"Messages"})),i=(a=Object.entries(z.zN).filter(([,e])=>!e.hidden).map(([e,t])=>({id:e,info:t,stats:s(e,ej),authGroup:"oauth",authTypes:Array.isArray(ej)?ej:[ej],isNoAuth:!!t.noAuth})),[...a].sort((t,s)=>{let a=t.info.priority??999,n=s.info.priority??999;if(a!==n)return a-n;let r=(0,v.HX)(e,t.id,ej),i=(0,v.HX)(e,s.id,ej),l=+(r.connected>0),o=+(i.connected>0);return l!==o?o-l:(t.info.name||"").localeCompare(s.info.name||"")})),l=Object.entries(z.IS).filter(([,e])=>!e.hidden).map(([e,t])=>({id:e,info:t,stats:s(e,ej),authGroup:"free",authTypes:Array.isArray(ej)?ej:[ej],isNoAuth:!!t.noAuth})).sort((e,t)=>!!t.info.noAuth-!!e.info.noAuth),o=Object.entries(z.nJ).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")).map(([e,t])=>({id:e,info:t,stats:s(e,ej),authGroup:"free",authTypes:Array.isArray(ej)?ej:[ej],isNoAuth:!!t.noAuth})).sort((e,t)=>{let s=e.info.priority??999,a=t.info.priority??999;if(s!==a)return s-a;let n=!!t.info.noAuth-!!e.info.noAuth;if(0!==n)return n;let r=e.stats.connected>0?0:1,i=t.stats.connected>0?0:1;return r!==i?r-i:(e.info.name||"").localeCompare(t.info.name||"")}),d=Object.entries(z.fg).filter(([,e])=>!e.hidden&&(e.serviceKinds??["llm"]).includes("llm")).map(([e,t])=>({id:e,info:t,stats:s(e,ej),authGroup:"apikey",authTypes:ej,isNoAuth:!!t.noAuth})).sort((e,t)=>{let s=e.stats.total>0?0:1,a=t.stats.total>0?0:1;return s!==a?s-a:(e.info.name||"").localeCompare(t.info.name||"")}),c=new Set([...i,...l,...o,...d,...n,...r].map(e=>e.id)),u=[...new Set(e.map(e=>e.provider))].filter(e=>e&&!c.has(e)).map(e=>({id:e,info:z.Q2[e]||{id:e,name:e},stats:s(e,ej),authGroup:z.Q2[e]?.authType==="cookie"?"apikey":"oauth",authTypes:ej,isNoAuth:!1}));return[{id:"oauth",title:"Subscriptions & OAuth",subtitle:`Sign in once. ${ey.Hc.slug} refreshes tokens for you.`,entries:[...i,...u],totalCount:i.length+u.length},{id:"free",title:"Free tier providers",subtitle:"Free quotas and no-key proxies.",entries:[...l,...o],totalCount:l.length+o.length},{id:"apikey",title:"API keys & free tiers",subtitle:"Paste a key, pick models, done.",entries:d,totalCount:d.length},{id:"custom",title:"Custom providers",subtitle:"OpenAI- or Anthropic-compatible endpoints.",entries:[...n,...r],totalCount:n.length+r.length}]}({connections:e,providerNodes:t,statsFor:(t,s)=>(0,v.HX)(e,t,s)}),r=n.flatMap(e=>e.entries),i=s.trim().toLowerCase(),l=e=>(!i||(e.info.name||"").toLowerCase().includes(i))&&(0,v.f7)(a,e.stats,e.isNoAuth,e.authGroup),o=r.filter(eN).sort(ew),d=n.map(e=>{let t=e.entries.filter(e=>!eN(e));return{...e,catalogCount:t.length,entries:t.filter(l)}}).filter(e=>e.entries.length>0||"custom"===e.id),c=(0,v.ob)(r);return{allEntries:r,yourProviders:o.filter(l),yourProvidersTotal:o.length,catalogSections:d,filterCounts:c,needsAttention:r.filter(e=>(0,v.e_)(e.stats,e.isNoAuth)).slice(0,6),totals:{available:n.reduce((e,t)=>e+t.totalCount,0),connected:c[v.Rw.CONNECTED],attention:c[v.Rw.NEEDS_ATTENTION],noAuthReady:r.filter(e=>e.isNoAuth).length}}})({connections:e,providerNodes:t,query:r,filter:a}),[e,t,r,a]),isStale:s!==r}}({connections:t,providerNodes:i,query:P,filter:A}),eE=(0,n.useMemo)(()=>{let e=new Map;for(let s of t){let t=e.get(s.provider);t?t.push(s):e.set(s.provider,[s])}return e},[t]),eO=(0,n.useCallback)(e=>eE.get(e.id)||ek,[eE]),eq=ef.find(e=>e.id===U)||null,eI=(0,n.useMemo)(()=>eq?eO(eq):[],[eq,eO]),e$=A!==v.Rw.ALL,e_=P.trim().length>0,eU=e$||e_,eF=eg.filter(e=>"custom"!==e.id),eL=eg.find(e=>"custom"===e.id),eM=eL?.entries||[],eD=B?.toString()??"";(0,n.useEffect)(()=>{F((0,v.h6)(eD))},[eD]);let ez=(0,n.useCallback)(e=>{F(e.id),G.push((0,v.UP)(B?.toString(),e.id),{scroll:!1})},[G,B]),eG=(0,n.useCallback)(()=>{F(null),G.push((0,v.UP)(B?.toString(),null),{scroll:!1})},[G,B]),eB=(0,n.useCallback)(e=>{e.id===U?eG():ez(e)},[U,eG,ez]),eH=(0,n.useCallback)(e=>"compatible"===e.authGroup?null:(0,g.KC)(e.id).filter(e=>"llm"===(e.kind||e.type||"llm")).length,[]),eJ=(0,n.useCallback)(()=>el("all"),[el]),eK=(0,n.useCallback)(e=>el("provider",e.id),[el]),eV=(0,n.useCallback)((e,t)=>{let s="reconnect"!==(0,w.tT)(t).action?"open":"oauth"===t.authType?"reauthorize":"edit";"reauthorize"===s?(et(""),Z(e)):"edit"===s?ea(t):ez(e)},[ez,et,Z,ea]),eW=(0,n.useCallback)(e=>eo(e),[eo]),eX=(0,n.useCallback)(()=>eq&&eo(eq),[eq,eo]),eY=(0,n.useCallback)(()=>{eq&&(et(""),Z(eq))},[eq,Z,et]),eQ=(0,n.useCallback)(()=>I(!0),[]),eZ=(0,n.useCallback)(()=>_(!0),[]),e0=(0,n.useCallback)((e,t)=>{l(t=>[...t,e]),t(),C()},[l,C]),e1=(0,n.useCallback)(()=>{et(""),Z(null)},[Z,et]),e5=(0,n.useCallback)(()=>{T(v.Rw.ALL),S("")},[]),e2=(0,n.useCallback)(e=>S(e.target.value),[]);if(y)return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsx)(d.CardSkeleton,{}),(0,a.jsx)(d.CardSkeleton,{})]});let e9=eh.length>0||eg.some(e=>e.entries.length>0);return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-5 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[(0,a.jsxs)("p",{className:"text-sm text-muted","aria-live":"polite",children:[eS.available," available \xb7 ",eS.connected," connected",eS.noAuthReady>0&&` \xb7 ${eS.noAuthReady} ready`," \xb7"," ",(0,v.HR)(eS.attention)]}),(0,a.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:(0,a.jsxs)(b.default,{trigger:(0,a.jsx)(c.default,{size:"sm",variant:"primary",icon:"add",children:"Add provider"}),children:[(0,a.jsx)(b.MenuItem,{icon:"add",label:"Add OpenAI compatible",onSelect:()=>I(!0),children:"Add OpenAI compatible"}),(0,a.jsx)(b.MenuItem,{icon:"add",label:"Add Anthropic compatible",onSelect:()=>_(!0),children:"Add Anthropic compatible"})]})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[(0,a.jsx)(u.default,{"aria-label":"Filter providers",value:A,onChange:T,options:v.nb.map(e=>({...e,count:eT[e.value]??0}))}),(0,a.jsx)(p.default,{value:P,onChange:e2,placeholder:"Search providers",ariaLabel:"Search providers",className:"lg:ms-auto lg:w-[280px]"})]}),j&&(0,a.jsx)(m.default,{variant:"err",title:"Could not load providers",children:(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[j,(0,a.jsx)(c.default,{size:"sm",variant:"secondary",onClick:C,children:"Retry"})]})}),eP.length>0&&(0,a.jsx)("section",{"aria-label":"Needs attention",className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:eP.map(e=>(0,a.jsx)(k,{entry:e,connections:eO(e),testing:J===e.id,onRetry:eK,onRepair:eV,onCooldownExpired:C,onOpen:ez},e.id))}),e9?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 xl:flex-row xl:items-start","aria-busy":eR||void 0,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-6",children:[(0,a.jsx)(ed,{entries:eh,total:ex,connectionsFor:eO,selectedProvider:U,testingMode:J??void 0,testAccountsMode:Y??void 0,onOpen:eB,onClose:eG,onTest:eW,onTestAll:eJ}),(eF.length>0||eM.length>0)&&(0,a.jsx)("h2",{id:"providers-catalog",tabIndex:-1,className:"font-display text-xl font-bold lg:text-[22px]",children:"Add more providers"}),eF.map(e=>(0,a.jsx)(eb,{section:e,collapsed:ep(e.id),onToggleCollapse:em,connectionsFor:eO,showAllApikey:R,setShowAllApikey:E,forceOpen:eU,selectedProvider:U,modelCountFor:eH,openProvider:eB,handleToggleProvider:ei},e.id)),(0,a.jsx)(ev,{entries:eM,connectionsFor:eO,selectedProvider:U,modelCountFor:eH,openProvider:eB,handleToggleProvider:ei,onAddOpenAI:eQ,onAddAnthropic:eZ})]}),eq&&!D&&(0,a.jsx)(W,{entry:eq,connections:eI,onClose:eG,onChanged:C,onTestAccounts:eX,onAddAccount:eY,testingAccounts:Y===eq.id,inline:!0})]}):(0,a.jsx)(f.default,{icon:"search_off",title:"No providers match your search or filters",body:"Try a different search term or filter.",action:(0,a.jsx)(c.default,{variant:"secondary",onClick:e5,children:"Clear filters"})}),eq&&D&&(0,a.jsx)(h.default,{isOpen:!0,onClose:eG,title:eq.info.name,size:"lg","aria-label":`${eq.info.name} details`,children:(0,a.jsx)(W,{entry:eq,connections:eI,onClose:eG,onChanged:C,onTestAccounts:eX,onAddAccount:eY,testingAccounts:Y===eq.id})}),(0,a.jsx)(O,{variant:"openai",isOpen:q,onClose:()=>I(!1),onCreated:e=>e0(e,()=>I(!1))}),(0,a.jsx)(O,{variant:"anthropic",isOpen:$,onClose:()=>_(!1),onCreated:e=>e0(e,()=>_(!1))}),Q&&(0,a.jsx)(en,{entry:Q,proxyPools:L,error:ee,existingNames:t.map(e=>e.name).filter(Boolean),onSave:ec,onClose:e1,onChanged:C}),(0,a.jsx)(x.default,{isOpen:!!es,connection:es,proxyPools:L,onSave:eu,onClose:()=>ea(null)}),(0,a.jsx)(er,{isOpen:V,onClose:()=>X(!1),results:K})]})}eA.propTypes={initialProviderId:l().string};let eT=eA},51825:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var a=s(95155),n=s(84588);let r={mode:{label:"Mode",format:e=>e},defaultModel:{label:"Model",format:e=>e,mono:!0},baseUrl:{label:"Endpoint",format:e=>e,isLink:!0,mono:!0},costPerQuery:{label:"Cost / call",format:e=>0===e?"Free":`$${e.toFixed(4)}`},pricingUrl:{label:"Pricing",format:()=>"View pricing",isLink:!0},freeTier:{label:"Free tier",format:e=>e},freeMonthlyQuota:{label:"Free quota",format:e=>0===e?"—":e>=999999?"Unlimited":`${e.toLocaleString()} / mo`},searchTypes:{label:"Types",format:e=>e.join(", ")},formats:{label:"Formats",format:e=>e.join(", ")},maxMaxResults:{label:"Max results",format:e=>e},maxCharacters:{label:"Max chars",format:e=>e.toLocaleString()}};function i({config:e,provider:t,title:s="Provider Info"}){if(!e)return null;let l=Object.entries(r).filter(([t])=>void 0!==e[t]&&null!==e[t]&&""!==e[t]).map(([t,s])=>({key:t,label:s.label,value:s.format(e[t]),isLink:s.isLink,mono:s.mono,raw:e[t]})),o=t?.notice?.apiKeyUrl||t?.website,d=t?.notice?.text;return(0,a.jsxs)(n.default,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:s}),o&&(0,a.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-coral-ink hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API key"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2",children:[l.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)("span",{className:"text-xs text-muted w-28 shrink-0",children:e.label}),e.isLink?(0,a.jsx)("a",{href:e.raw,target:"_blank",rel:"noopener noreferrer",className:`text-sm text-coral-ink hover:underline truncate ${e.mono?"font-mono":""}`,children:e.value}):(0,a.jsx)("span",{className:`text-sm text-text truncate ${e.mono?"font-mono":""}`,children:e.value})]},e.key)),d&&(0,a.jsxs)("div",{className:"flex items-start gap-3 min-w-0 sm:col-span-2",children:[(0,a.jsx)("span",{className:"text-xs text-muted w-28 shrink-0 mt-0.5",children:"Notice"}),(0,a.jsx)("span",{className:"text-sm text-text leading-relaxed",children:d})]})]})]})}},54268:(e,t,s)=>{"use strict";s.d(t,{HR:()=>h,HX:()=>o,Rw:()=>r,UP:()=>u,e_:()=>f,f7:()=>p,h6:()=>c,nb:()=>i,ob:()=>m,s6:()=>l,sf:()=>d});var a=s(28915),n=s(53956);let r={ALL:"all",CONNECTED:"connected",NEEDS_ATTENTION:"needs-attention",OAUTH:"oauth",FREE:"free",APIKEY:"apikey"},i=[{value:r.ALL,label:"All"},{value:r.CONNECTED,label:"Connected"},{value:r.NEEDS_ATTENTION,label:"Needs attention"},{value:r.OAUTH,label:"OAuth"},{value:r.FREE,label:"Free tier"},{value:r.APIKEY,label:"API key"}];function l(e){return(0,n.Gy)(e)}function o(e,t,s){let r=Array.isArray(s)?s:[s],i=e.filter(e=>e.provider===t&&r.includes(e.authType)),l=(0,n.SB)(i),o=l.counts.ok+l.counts.warn+l.counts.err,d=i.filter(e=>["err","warn"].includes((0,n.tT)(e).status)),c=l.counts.err+l.counts.warn,u=i.length,p=u>0&&l.counts.off===u,m=i.some(e=>"Cooling down"===(0,n.tT)(e).reason),f=d.sort((e,t)=>new Date(t.lastErrorAt||0)-new Date(e.lastErrorAt||0))[0];return{connected:o,error:c,total:u,errorCode:f?function(e){if(!e)return null;let t=e.lastErrorType;if("runtime_error"===t)return"RUNTIME";if("upstream_auth_error"===t||"auth_missing"===t||"token_refresh_failed"===t||"token_expired"===t)return"AUTH";if("upstream_rate_limited"===t)return"429";if("upstream_unavailable"===t)return"5XX";if("network_error"===t)return"NET";let s=Number(e.errorCode);if(Number.isFinite(s)&&s>=400)return String(s);let n=(0,a.E2)(e.lastError);if("401"===n||"403"===n)return"AUTH";if(n&&"ERR"!==n)return n;let r=(e.lastError||"").toLowerCase();return r.includes("runtime")||r.includes("not runnable")||r.includes("not installed")?"RUNTIME":r.includes("invalid api key")||r.includes("token invalid")||r.includes("revoked")||r.includes("unauthorized")||r.includes("no access token")||r.includes("missing access token")||r.includes("auth")||r.includes("sign in")||r.includes("signin")||r.includes("expired")?"AUTH":"ERR"}(f):null,errorTime:f?.lastErrorAt?(0,a.gs)(f.lastErrorAt):null,allDisabled:p,hasCooldown:m}}function d(e){return e&&0!==e.length?e.map((e,t)=>{let s=e.name||e.email||`Account ${t+1}`,a=(0,n.tT)(e);return"off"===a.status?{value:0,kind:"none",label:s}:"warn"===a.status?{value:50,kind:"warn",label:s}:"err"===a.status?{value:100,kind:"err",label:s}:{value:100,kind:"ok",label:s}}):[{value:0,kind:"none",label:"No accounts"}]}function c(e){return new URLSearchParams(e||"").get("provider")||null}function u(e,t){let s=new URLSearchParams(e||"");t?s.set("provider",t):s.delete("provider");let a=s.toString();return a?`/dashboard/providers?${a}`:"/dashboard/providers"}function p(e,t,s=!1,a=null,n){return e===r.ALL||(e===r.CONNECTED?!s&&(t?.connected||0)>0:e===r.NEEDS_ATTENTION?f(t,s,n):e===r.OAUTH?"oauth"===a:e===r.FREE?"free"===a:e!==r.APIKEY||"apikey"===a||"compatible"===a)}function m(e){let t={[r.ALL]:e.length,[r.CONNECTED]:0,[r.NEEDS_ATTENTION]:0,[r.OAUTH]:0,[r.FREE]:0,[r.APIKEY]:0};for(let s of e){let{stats:e,isNoAuth:a,authGroup:n}=s;p(r.CONNECTED,e,a)&&(t[r.CONNECTED]+=1),p(r.NEEDS_ATTENTION,e,a,n,s.hasCooldown)&&(t[r.NEEDS_ATTENTION]+=1),"oauth"===n?t[r.OAUTH]+=1:"free"===n?t[r.FREE]+=1:("apikey"===n||"compatible"===n)&&(t[r.APIKEY]+=1)}return t}function f(e,t=!1,s){return!t&&((e?.error||0)>0||(s??e?.hasCooldown)===!0)}function h(e){return`${e} ${1===e?"needs":"need"} a look`}},54642:e=>{var t;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="//"),(t={}).endianness=function(){return"LE"},t.hostname=function(){return"u">typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"u">typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"},e.exports=t},64371:(e,t,s)=>{"use strict";s.d(t,{default:()=>u});var a=s(95155),n=s(14051),r=s.n(n),i=s(12115),l=s(11910),o=s(15729),d=s(31474),c=s(35591);function u({value:e,onChange:t,ariaLabel:s,placeholder:n,id:r,className:p,inputClassName:m}){let f=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=e=>{let t;if(t=(0,c.eS)(e,{inCodeEditor:!!e?.target?.closest?.(".monaco-editor")}),e?.key!=="/"||e.metaKey||e.ctrlKey||e.altKey||t.defaultPrevented||t.isComposing||t.inEditable||t.inCodeEditor)return;let s=f.current;s&&(e.preventDefault(),s.focus(),s.select())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[f]),(0,a.jsxs)("div",{className:(0,d.cn)("relative",p),children:[(0,a.jsx)(l.default,{ref:f,id:r,type:"search",icon:"search",value:e,onChange:t,placeholder:n,"aria-label":s,inputClassName:(0,d.cn)("min-h-10 sm:pe-10",m)}),!e&&(0,a.jsx)("span",{className:"pointer-events-none absolute inset-y-0 end-3 hidden items-center sm:flex","aria-hidden":"true",children:(0,a.jsx)(o.default,{children:"/"})})]})}u.propTypes={value:r().string.isRequired,onChange:r().func.isRequired,ariaLabel:r().string.isRequired,placeholder:r().string,id:r().string,className:r().string,inputClassName:r().string}},73321:(e,t,s)=>{"use strict";var a=s(74645);s.o(a,"notFound")&&s.d(t,{notFound:function(){return a.notFound}}),s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},86465:(e,t,s)=>{"use strict";s.d(t,{default:()=>i});var a=s(95155),n=s(14051),r=s.n(n);function i({model:e,className:t}){return(0,a.jsx)("code",{className:`inline-flex max-w-full items-center truncate rounded-md border border-line bg-raised px-2 py-0.5 font-mono text-xs text-muted${t?` ${t}`:""}`,children:e})}i.propTypes={model:r().string.isRequired,className:r().string}},96748:(e,t,s)=>{"use strict";s.d(t,{default:()=>p});var a=s(95155),n=s(12115),r=s(14051),i=s.n(r),l=s(81127),o=s(11910),d=s(92542),c=s(56061);let u="https://api.openai.com/v1";function p({isOpen:e,onClose:t,onCreated:s,onSaved:r,node:i}){let m=!!i,[f,h]=(0,n.useState)({name:"",prefix:"",baseUrl:u}),[x,b]=(0,n.useState)(!1),[g,v]=(0,n.useState)(""),[y,j]=(0,n.useState)(""),[N,w]=(0,n.useState)(!1),[C,k]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(k(null),v(""),j(""),m?h({name:i.name||"",prefix:i.prefix||"",baseUrl:i.baseUrl||u}):h({name:"",prefix:"",baseUrl:u}))},[e,m,i]);let A=async()=>{if(f.name.trim()&&f.prefix.trim()&&f.baseUrl.trim()){b(!0);try{let e=m?`/api/provider-nodes/${i.id}`:"/api/provider-nodes",t=m?"PUT":"POST",a={name:f.name,prefix:f.prefix,baseUrl:f.baseUrl};m||(a.type="custom-embedding");let n=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),l=await n.json();n.ok&&(m?r?.(l.node):s?.(l.node))}catch(e){console.log("Error saving custom embedding node:",e)}finally{b(!1)}}},T=async()=>{w(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:f.baseUrl,apiKey:g,type:"custom-embedding",modelId:y.trim()||void 0})}),t=await e.json();k(t)}catch{k({valid:!1,error:"Network error"})}finally{w(!1)}};return(0,a.jsx)(l.default,{isOpen:e,title:m?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(o.default,{label:"Name",value:f.name,onChange:e=>h({...f,name:e.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,a.jsx)(o.default,{label:"Prefix",value:f.prefix,onChange:e=>h({...f,prefix:e.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,a.jsx)(o.default,{label:"Base URL",value:f.baseUrl,onChange:e=>h({...f,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,a.jsx)(o.default,{label:"API key (for check)",type:"password",value:g,onChange:e=>v(e.target.value)}),(0,a.jsx)(o.default,{label:"Model ID (for check)",value:y,onChange:e=>j(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",hint:"Required for validation. Will send a test embeddings request."}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(d.default,{onClick:T,disabled:!g||!y.trim()||N||!f.baseUrl.trim(),variant:"secondary",children:N?"Checking...":"Check"}),(()=>{if(!C)return null;let{valid:e,error:t,dimensions:s}=C;return e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.default,{variant:"success",children:"Valid"}),s&&(0,a.jsxs)("span",{className:"text-sm text-muted",children:[s," dims"]})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)(c.default,{variant:"error",children:"Invalid"}),t&&(0,a.jsx)("span",{className:"text-sm text-err",children:t})]})})()]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.default,{onClick:A,fullWidth:!0,disabled:!f.name.trim()||!f.prefix.trim()||!f.baseUrl.trim()||x,children:x?m?"Saving...":"Creating...":m?"Save":"Create"}),(0,a.jsx)(d.default,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}p.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func,onSaved:i().func,node:i().shape({id:i().string,name:i().string,prefix:i().string,baseUrl:i().string})}},97556:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var a=s(95155),n=s(12115),r=s(14051),i=s.n(r),l=s(9233),o=s(28745),d=s(81127),c=s(77671);function u({isOpen:e,onClose:t}){let[s,r]=(0,n.useState)(""),[i,p]=(0,n.useState)(!1),[m,f]=(0,n.useState)("");return(0,n.useEffect)(()=>{e&&!s&&(p(!0),f(""),fetch(o.Nu.changelogUrl).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.text()}).then(e=>r(l.xI.parse(e))).catch(e=>f(e.message||"Failed to load")).finally(()=>p(!1)))},[e,s]),(0,a.jsxs)(d.default,{isOpen:e,onClose:t,title:"Change log",size:"full",children:[(0,a.jsxs)("div",{"aria-live":"polite",children:[i&&(0,a.jsx)(c.LoadingState,{lines:6,label:"Loading changelog",className:"py-4"}),m&&(0,a.jsxs)("p",{role:"alert",className:"py-4 text-err",children:["Failed to load changelog: ",m]})]}),!i&&!m&&s&&(0,a.jsx)("div",{className:"changelog-body text-text",dangerouslySetInnerHTML:{__html:s}})]})}l.xI.setOptions({gfm:!0,breaks:!0}),u.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired}}},e=>{e.O(0,[1610,4070,9233,9671,4685,2903,7899,1863,5014,8105,198,7505,4588,9284,4321,3343,2577,1039,6055,8441,3794,7358],()=>e(e.s=8428)),_N_E=e.O()}]);
|