zevairouter 1.0.91 → 1.0.93
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/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +5 -5
- package/cli/app/.next-cli-build/build-manifest.json +2 -2
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/input/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/resize/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/[id]/stream/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/terminal/session/route.js.nft.json +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/aggregate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback.html +1 -1
- package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.html +1 -1
- package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/landing.html +1 -1
- package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/login.html +1 -1
- package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app-paths-manifest.json +5 -5
- package/cli/app/.next-cli-build/server/chunks/3155.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3407.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3831.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5681.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/6896.js +1 -1
- package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/pages/404.html +1 -1
- package/cli/app/.next-cli-build/server/pages/500.html +1 -1
- package/cli/app/.next-cli-build/static/chunks/{3702-30e147d7f8aa1b1e.js → 3702-a9d48ed3afa2d5fd.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f3b77e4749e85bd8.js +1 -0
- package/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/src/lib/terminal/ptyBridge.py +163 -0
- package/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/src/lib/terminal/ptyBridge.py +163 -0
- package/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/cli/app/src/lib/terminal/ptyBridge.py +163 -0
- package/cli/app/package.json +1 -1
- package/cli/package.json +1 -1
- package/open-sse/services/usage.js +108 -2
- package/package.json +1 -1
- package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderLimitCard.js +9 -11
- package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaProgressBar.js +10 -10
- package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js +4 -2
- package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.js +41 -9
- package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.js +47 -8
- package/src/app/api/usage/aggregate/route.js +16 -1
- package/src/shared/constants/providers.js +3 -0
- package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-c58270853707170e.js +0 -1
- /package/cli/app/.next-cli-build/static/{DeYkfR7AtoBKt2sT-D-8h → cHK1E1W2f05Bp9LKjAKXv}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{DeYkfR7AtoBKt2sT-D-8h → cHK1E1W2f05Bp9LKjAKXv}/_ssgManifest.js +0 -0
|
@@ -131,6 +131,8 @@ export async function getUsageForProvider(connection, proxyOptions = null) {
|
|
|
131
131
|
return await getMiniMaxUsage(apiKey, provider, proxyOptions);
|
|
132
132
|
case "grok-cli":
|
|
133
133
|
return await getGrokCliUsage(accessToken, providerSpecificData, proxyOptions);
|
|
134
|
+
case "cloudflare-ai":
|
|
135
|
+
return await getCloudflareAiUsage(apiKey || accessToken, providerSpecificData, proxyOptions);
|
|
134
136
|
case "xai":
|
|
135
137
|
return await getXaiUsage(accessToken || apiKey, providerSpecificData, proxyOptions);
|
|
136
138
|
case "cline":
|
|
@@ -1814,6 +1816,97 @@ async function getAutoclawUsage(accessToken, proxyOptions = null, connection = n
|
|
|
1814
1816
|
}
|
|
1815
1817
|
}
|
|
1816
1818
|
|
|
1819
|
+
// ─── Cloudflare Workers AI ──────────────────────────────────────────────────
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* Cloudflare does not expose remaining free-tier "neurons" via a public API.
|
|
1823
|
+
* Verify the token + account and surface a clear "Workers AI free tier" row so
|
|
1824
|
+
* the quota page is not blank for cloudflare-ai connections.
|
|
1825
|
+
*/
|
|
1826
|
+
export async function getCloudflareAiUsage(apiKey, providerSpecificData = null, proxyOptions = null) {
|
|
1827
|
+
const token = String(apiKey || "").trim();
|
|
1828
|
+
const accountId = String(providerSpecificData?.accountId || "").trim();
|
|
1829
|
+
if (!token) {
|
|
1830
|
+
return { message: "Cloudflare API token not available." };
|
|
1831
|
+
}
|
|
1832
|
+
if (!accountId) {
|
|
1833
|
+
return { message: "Cloudflare account ID missing. Re-import or edit the connection." };
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
try {
|
|
1837
|
+
const verifyRes = await proxyAwareFetch(
|
|
1838
|
+
"https://api.cloudflare.com/client/v4/user/tokens/verify",
|
|
1839
|
+
{
|
|
1840
|
+
method: "GET",
|
|
1841
|
+
headers: {
|
|
1842
|
+
Authorization: `Bearer ${token}`,
|
|
1843
|
+
Accept: "application/json",
|
|
1844
|
+
},
|
|
1845
|
+
},
|
|
1846
|
+
proxyOptions,
|
|
1847
|
+
);
|
|
1848
|
+
|
|
1849
|
+
if (verifyRes.status === 401 || verifyRes.status === 403) {
|
|
1850
|
+
return { message: "Cloudflare API token invalid or expired. Re-import the account." };
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
if (!verifyRes.ok) {
|
|
1854
|
+
const errText = await verifyRes.text().catch(() => "");
|
|
1855
|
+
return {
|
|
1856
|
+
message: `Cloudflare token verify failed (${verifyRes.status})${errText ? `: ${errText.slice(0, 160)}` : ""}`,
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
const verifyBody = await verifyRes.json().catch(() => null);
|
|
1861
|
+
const status = verifyBody?.result?.status || (verifyBody?.success ? "active" : "unknown");
|
|
1862
|
+
|
|
1863
|
+
// Bulk-harvested tokens are often scoped to Workers AI only — they may 403
|
|
1864
|
+
// on GET /accounts/{id}. Do not treat that as dead; verify is enough.
|
|
1865
|
+
let accountName = providerSpecificData?.accountName || "";
|
|
1866
|
+
try {
|
|
1867
|
+
const acctRes = await proxyAwareFetch(
|
|
1868
|
+
`https://api.cloudflare.com/client/v4/accounts/${encodeURIComponent(accountId)}`,
|
|
1869
|
+
{
|
|
1870
|
+
method: "GET",
|
|
1871
|
+
headers: {
|
|
1872
|
+
Authorization: `Bearer ${token}`,
|
|
1873
|
+
Accept: "application/json",
|
|
1874
|
+
},
|
|
1875
|
+
},
|
|
1876
|
+
proxyOptions,
|
|
1877
|
+
);
|
|
1878
|
+
if (acctRes?.ok) {
|
|
1879
|
+
const acctBody = await acctRes.json().catch(() => null);
|
|
1880
|
+
accountName = acctBody?.result?.name || accountName;
|
|
1881
|
+
}
|
|
1882
|
+
} catch {
|
|
1883
|
+
/* optional */
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
const shortId = accountId.length > 10 ? `${accountId.slice(0, 8)}…` : accountId;
|
|
1887
|
+
return {
|
|
1888
|
+
plan: accountName
|
|
1889
|
+
? `Workers AI · ${accountName}`
|
|
1890
|
+
: `Workers AI · ${shortId}`,
|
|
1891
|
+
quotas: {
|
|
1892
|
+
"Workers AI": {
|
|
1893
|
+
used: 0,
|
|
1894
|
+
total: 0,
|
|
1895
|
+
remainingPercentage: 100,
|
|
1896
|
+
resetAt: null,
|
|
1897
|
+
unlimited: true,
|
|
1898
|
+
},
|
|
1899
|
+
},
|
|
1900
|
+
message:
|
|
1901
|
+
status && status !== "active"
|
|
1902
|
+
? `Token status: ${status}. Cloudflare does not publish remaining free-tier neurons via API.`
|
|
1903
|
+
: "Token valid. CF does not expose remaining free-tier neurons via API — model rate limits still apply.",
|
|
1904
|
+
};
|
|
1905
|
+
} catch (error) {
|
|
1906
|
+
return { message: `Cloudflare usage error: ${error.message}` };
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1817
1910
|
// ─── Grok CLI / Grok Build usage (cli-chat-proxy.grok.com) ─────────────────
|
|
1818
1911
|
|
|
1819
1912
|
function unwrapGrokCliVal(value, fallback = 0) {
|
|
@@ -1931,8 +2024,21 @@ export function parseGrokCliBilling(billing, user = null) {
|
|
|
1931
2024
|
const hasIncludedAccess =
|
|
1932
2025
|
user?.hasGrokCodeAccess === true || config?.isUnifiedBillingUser === true;
|
|
1933
2026
|
|
|
1934
|
-
|
|
1935
|
-
|
|
2027
|
+
// Always surface Grok Code / included access when the account still has it —
|
|
2028
|
+
// even if On-demand/Prepaid rows also exist. Previously we only added this
|
|
2029
|
+
// when quotas was empty, so free Grok Code looked like "no quota data".
|
|
2030
|
+
if (hasIncludedAccess) {
|
|
2031
|
+
quotas["Grok Code"] = {
|
|
2032
|
+
used: 0,
|
|
2033
|
+
total: 0,
|
|
2034
|
+
remainingPercentage: 100,
|
|
2035
|
+
resetAt: periodEnd,
|
|
2036
|
+
unlimited: true,
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
// Soft fallback when billing returns nothing usable (no caps, no access flags).
|
|
2041
|
+
if (Object.keys(quotas).length === 0) {
|
|
1936
2042
|
quotas["Included"] = {
|
|
1937
2043
|
used: 0,
|
|
1938
2044
|
total: 0,
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import Card from "@/shared/components/Card";
|
|
|
5
5
|
import ProviderIcon from "@/shared/components/ProviderIcon";
|
|
6
6
|
import Badge from "@/shared/components/Badge";
|
|
7
7
|
import QuotaProgressBar from "./QuotaProgressBar";
|
|
8
|
-
import {
|
|
8
|
+
import { getRemainingPercentage } from "./utils";
|
|
9
9
|
|
|
10
10
|
const planVariants = {
|
|
11
11
|
free: "default",
|
|
@@ -145,16 +145,14 @@ export default function ProviderLimitCard({
|
|
|
145
145
|
</div>
|
|
146
146
|
)}
|
|
147
147
|
|
|
148
|
-
{/* Quota Progress Bars */}
|
|
149
|
-
{!loading && !error &&
|
|
148
|
+
{/* Quota Progress Bars — show even when a soft info message is present */}
|
|
149
|
+
{!loading && !error && quotas?.length > 0 && (
|
|
150
150
|
<div className="space-y-4">
|
|
151
151
|
{quotas.map((quota, index) => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
: calculatePercentage(quota.used, quota.total);
|
|
157
|
-
const unlimited = quota.total === 0 || quota.total === null;
|
|
152
|
+
const unlimited =
|
|
153
|
+
quota.unlimited === true || quota.total === 0 || quota.total === null;
|
|
154
|
+
// Never recompute from used/total when total is 0 (NaN) — use remainingPercentage.
|
|
155
|
+
const percentage = getRemainingPercentage(quota);
|
|
158
156
|
|
|
159
157
|
return (
|
|
160
158
|
<QuotaProgressBar
|
|
@@ -162,7 +160,7 @@ export default function ProviderLimitCard({
|
|
|
162
160
|
label={quota.name}
|
|
163
161
|
used={quota.used}
|
|
164
162
|
total={quota.total}
|
|
165
|
-
percentage={percentage}
|
|
163
|
+
percentage={Number.isFinite(percentage) ? percentage : unlimited ? 100 : 0}
|
|
166
164
|
unlimited={unlimited}
|
|
167
165
|
resetTime={quota.resetAt}
|
|
168
166
|
/>
|
|
@@ -172,7 +170,7 @@ export default function ProviderLimitCard({
|
|
|
172
170
|
)}
|
|
173
171
|
|
|
174
172
|
{/* Empty State */}
|
|
175
|
-
{!loading && !error && !message && quotas
|
|
173
|
+
{!loading && !error && !message && (!quotas || quotas.length === 0) && (
|
|
176
174
|
<div className="text-center py-8 text-text-muted">
|
|
177
175
|
<span className="material-symbols-outlined text-[48px] opacity-20">
|
|
178
176
|
data_usage
|
|
@@ -93,20 +93,20 @@ export default function QuotaProgressBar({
|
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
|
-
{/* Progress bar */}
|
|
97
|
-
{
|
|
98
|
-
<div
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</div>
|
|
104
|
-
)}
|
|
96
|
+
{/* Progress bar — unlimited pools still show a full green bar so quota is visible */}
|
|
97
|
+
<div className={cn("h-2 rounded-full overflow-hidden", colors.bgLight)}>
|
|
98
|
+
<div
|
|
99
|
+
className={cn("h-full transition-all duration-300", colors.bg)}
|
|
100
|
+
style={{ width: `${Math.min(Math.max(remaining, unlimited ? 100 : 0), 100)}%` }}
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
105
103
|
|
|
106
104
|
{/* Usage details and countdown */}
|
|
107
105
|
<div className="flex items-center justify-between text-xs text-text-muted">
|
|
108
106
|
<span>
|
|
109
|
-
{
|
|
107
|
+
{unlimited
|
|
108
|
+
? "Included / unlimited"
|
|
109
|
+
: `${used.toLocaleString()} / ${total > 0 ? total.toLocaleString() : "∞"}`}
|
|
110
110
|
</span>
|
|
111
111
|
{countdown !== "-" && (
|
|
112
112
|
<div className="flex items-center gap-1">
|
|
@@ -181,10 +181,12 @@ export default function QuotaTable({
|
|
|
181
181
|
|
|
182
182
|
<div className={`flex items-center justify-between ${compact ? "text-[10px]" : "text-xs"}`}>
|
|
183
183
|
<span className="text-text-muted">
|
|
184
|
-
{quota.
|
|
184
|
+
{quota.unlimited === true || !(quota.total > 0)
|
|
185
|
+
? (quota.unlimited === true ? "Included / ∞" : `${quota.used.toLocaleString()} / ∞`)
|
|
186
|
+
: `${quota.used.toLocaleString()} / ${quota.total.toLocaleString()}`}
|
|
185
187
|
</span>
|
|
186
188
|
<span className={`font-medium ${colors.text}`}>
|
|
187
|
-
{quota.remaining}
|
|
189
|
+
{Number.isFinite(quota.remaining) ? `${quota.remaining}%` : "—"}
|
|
188
190
|
</span>
|
|
189
191
|
</div>
|
|
190
192
|
</div>
|
|
@@ -38,10 +38,20 @@ function mergeQuotaRows(rows = []) {
|
|
|
38
38
|
used: 0,
|
|
39
39
|
total: 0,
|
|
40
40
|
resetAt: quota.resetAt || null,
|
|
41
|
+
remainingPercentage: null,
|
|
42
|
+
unlimited: false,
|
|
43
|
+
_pctSum: 0,
|
|
44
|
+
_pctCount: 0,
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
current.used += Number(quota.used) || 0;
|
|
44
48
|
current.total += Number(quota.total) || 0;
|
|
49
|
+
if (quota.unlimited === true) current.unlimited = true;
|
|
50
|
+
|
|
51
|
+
if (quota.remainingPercentage != null && Number.isFinite(Number(quota.remainingPercentage))) {
|
|
52
|
+
current._pctSum += Number(quota.remainingPercentage);
|
|
53
|
+
current._pctCount += 1;
|
|
54
|
+
}
|
|
45
55
|
|
|
46
56
|
if (quota.resetAt) {
|
|
47
57
|
if (!current.resetAt || new Date(quota.resetAt).getTime() < new Date(current.resetAt).getTime()) {
|
|
@@ -52,7 +62,20 @@ function mergeQuotaRows(rows = []) {
|
|
|
52
62
|
merged.set(quota.name, current);
|
|
53
63
|
});
|
|
54
64
|
|
|
55
|
-
return [...merged.values()]
|
|
65
|
+
return [...merged.values()].map((row) => {
|
|
66
|
+
const { _pctSum, _pctCount, ...rest } = row;
|
|
67
|
+
if (rest.unlimited) {
|
|
68
|
+
rest.remainingPercentage = 100;
|
|
69
|
+
rest.total = 0;
|
|
70
|
+
} else if (rest.total > 0) {
|
|
71
|
+
rest.remainingPercentage = ((rest.total - rest.used) / rest.total) * 100;
|
|
72
|
+
} else if (_pctCount > 0) {
|
|
73
|
+
rest.remainingPercentage = _pctSum / _pctCount;
|
|
74
|
+
} else {
|
|
75
|
+
rest.remainingPercentage = 0;
|
|
76
|
+
}
|
|
77
|
+
return rest;
|
|
78
|
+
});
|
|
56
79
|
}
|
|
57
80
|
|
|
58
81
|
function getProviderDisplayName(provider) {
|
|
@@ -1311,19 +1334,28 @@ export default function ProviderLimits() {
|
|
|
1311
1334
|
</span>
|
|
1312
1335
|
<p className="mt-1.5 text-xs text-text-muted">{error}</p>
|
|
1313
1336
|
</div>
|
|
1337
|
+
) : (quota?.quotas?.length > 0) ? (
|
|
1338
|
+
<div className="space-y-2">
|
|
1339
|
+
<QuotaTable
|
|
1340
|
+
quotas={quota.quotas}
|
|
1341
|
+
compact
|
|
1342
|
+
sortMode="default"
|
|
1343
|
+
showSortLabel={
|
|
1344
|
+
conn.provider === "codex" && quotaSortMode !== "default"
|
|
1345
|
+
}
|
|
1346
|
+
/>
|
|
1347
|
+
{quota?.message ? (
|
|
1348
|
+
<p className="px-1 text-[10px] text-text-muted">{quota.message}</p>
|
|
1349
|
+
) : null}
|
|
1350
|
+
</div>
|
|
1314
1351
|
) : quota?.message ? (
|
|
1315
1352
|
<div className="text-center py-5">
|
|
1316
1353
|
<p className="text-xs text-text-muted">{quota.message}</p>
|
|
1317
1354
|
</div>
|
|
1318
1355
|
) : (
|
|
1319
|
-
<
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
sortMode="default"
|
|
1323
|
-
showSortLabel={
|
|
1324
|
-
conn.provider === "codex" && quotaSortMode !== "default"
|
|
1325
|
-
}
|
|
1326
|
-
/>
|
|
1356
|
+
<div className="text-center py-5 text-text-muted">
|
|
1357
|
+
<p className="text-xs">No quota data available</p>
|
|
1358
|
+
</div>
|
|
1327
1359
|
)}
|
|
1328
1360
|
</div>
|
|
1329
1361
|
</Card>
|
|
@@ -81,12 +81,27 @@ export function calculatePercentage(used, total) {
|
|
|
81
81
|
* @returns {number} Remaining percentage (0-100)
|
|
82
82
|
*/
|
|
83
83
|
export function getRemainingPercentage(quota) {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
// Unlimited / included pools (Grok Code, etc.) — never treat total:0 as 0% empty.
|
|
85
|
+
if (quota?.unlimited === true) {
|
|
86
|
+
if (quota?.remainingPercentage !== undefined && Number.isFinite(Number(quota.remainingPercentage))) {
|
|
87
|
+
return Math.max(0, Math.min(100, Math.round(Number(quota.remainingPercentage))));
|
|
88
|
+
}
|
|
89
|
+
return 100;
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
if (quota?.remainingPercentage !== undefined) {
|
|
89
|
-
return Math.round(quota.remainingPercentage);
|
|
92
|
+
if (quota?.remainingPercentage !== undefined && Number.isFinite(Number(quota.remainingPercentage))) {
|
|
93
|
+
return Math.max(0, Math.min(100, Math.round(Number(quota.remainingPercentage))));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Legacy: some providers stuffed a 0-100 value into `remaining`.
|
|
97
|
+
// Only trust it when it looks like a percentage (0–100), not an absolute credit count.
|
|
98
|
+
if (quota?.remaining !== undefined && Number.isFinite(Number(quota.remaining))) {
|
|
99
|
+
const r = Number(quota.remaining);
|
|
100
|
+
if (r >= 0 && r <= 100 && !(quota.total > 100 && r <= 100 && quota.used != null)) {
|
|
101
|
+
// Prefer used/total when total is a real allotment
|
|
102
|
+
if (quota.total > 0) return calculatePercentage(quota.used, quota.total);
|
|
103
|
+
return Math.round(r);
|
|
104
|
+
}
|
|
90
105
|
}
|
|
91
106
|
|
|
92
107
|
return calculatePercentage(quota?.used, quota?.total);
|
|
@@ -225,16 +240,40 @@ export function parseQuotaData(provider, data) {
|
|
|
225
240
|
break;
|
|
226
241
|
|
|
227
242
|
case "grok-cli":
|
|
228
|
-
// Grok Build billing: On-demand / Prepaid /
|
|
243
|
+
// Grok Build billing: On-demand / Prepaid / Grok Code (unlimited included)
|
|
229
244
|
if (data.quotas) {
|
|
230
245
|
Object.entries(data.quotas).forEach(([name, quota]) => {
|
|
246
|
+
const unlimited =
|
|
247
|
+
quota.unlimited === true || (!(quota.total > 0) && quota.remainingPercentage > 0);
|
|
231
248
|
normalizedQuotas.push({
|
|
232
249
|
name,
|
|
233
250
|
used: quota.used || 0,
|
|
234
|
-
total: quota.total || 0,
|
|
251
|
+
total: unlimited ? 0 : (quota.total || 0),
|
|
235
252
|
resetAt: quota.resetAt || null,
|
|
236
|
-
remainingPercentage:
|
|
237
|
-
|
|
253
|
+
remainingPercentage:
|
|
254
|
+
quota.remainingPercentage != null
|
|
255
|
+
? quota.remainingPercentage
|
|
256
|
+
: unlimited
|
|
257
|
+
? 100
|
|
258
|
+
: undefined,
|
|
259
|
+
unlimited,
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
break;
|
|
264
|
+
|
|
265
|
+
case "cloudflare-ai":
|
|
266
|
+
if (data.quotas) {
|
|
267
|
+
Object.entries(data.quotas).forEach(([name, quota]) => {
|
|
268
|
+
const unlimited = quota.unlimited === true || !(quota.total > 0);
|
|
269
|
+
normalizedQuotas.push({
|
|
270
|
+
name,
|
|
271
|
+
used: quota.used || 0,
|
|
272
|
+
total: unlimited ? 0 : (quota.total || 0),
|
|
273
|
+
resetAt: quota.resetAt || null,
|
|
274
|
+
remainingPercentage:
|
|
275
|
+
quota.remainingPercentage != null ? quota.remainingPercentage : unlimited ? 100 : 0,
|
|
276
|
+
unlimited,
|
|
238
277
|
});
|
|
239
278
|
});
|
|
240
279
|
}
|
|
@@ -63,11 +63,18 @@ export async function GET(request) {
|
|
|
63
63
|
displayName: quota.displayName || modelKey,
|
|
64
64
|
remainingPercentage: null, // Will compute after summing
|
|
65
65
|
unlimited: false,
|
|
66
|
+
_pctSum: 0,
|
|
67
|
+
_pctCount: 0,
|
|
66
68
|
};
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
aggregated[modelKey].used += Number(quota.used) || 0;
|
|
70
72
|
aggregated[modelKey].total += Number(quota.total) || 0;
|
|
73
|
+
if (quota.unlimited === true) aggregated[modelKey].unlimited = true;
|
|
74
|
+
if (quota.remainingPercentage != null && Number.isFinite(Number(quota.remainingPercentage))) {
|
|
75
|
+
aggregated[modelKey]._pctSum += Number(quota.remainingPercentage);
|
|
76
|
+
aggregated[modelKey]._pctCount += 1;
|
|
77
|
+
}
|
|
71
78
|
|
|
72
79
|
// Use the earliest resetAt across all accounts
|
|
73
80
|
if (quota.resetAt) {
|
|
@@ -81,11 +88,19 @@ export async function GET(request) {
|
|
|
81
88
|
|
|
82
89
|
// Compute remaining percentage from aggregated used/total
|
|
83
90
|
for (const quota of Object.values(aggregated)) {
|
|
84
|
-
if (quota.
|
|
91
|
+
if (quota.unlimited) {
|
|
92
|
+
// Grok Code / included pools have total:0 — do NOT collapse to 0%.
|
|
93
|
+
quota.remainingPercentage = 100;
|
|
94
|
+
quota.total = 0;
|
|
95
|
+
} else if (quota.total > 0) {
|
|
85
96
|
quota.remainingPercentage = ((quota.total - quota.used) / quota.total) * 100;
|
|
97
|
+
} else if (quota._pctCount > 0) {
|
|
98
|
+
quota.remainingPercentage = quota._pctSum / quota._pctCount;
|
|
86
99
|
} else {
|
|
87
100
|
quota.remainingPercentage = 0;
|
|
88
101
|
}
|
|
102
|
+
delete quota._pctSum;
|
|
103
|
+
delete quota._pctCount;
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
return NextResponse.json({
|
|
@@ -426,6 +426,8 @@ export const USAGE_SUPPORTED_PROVIDERS = [
|
|
|
426
426
|
"iflow",
|
|
427
427
|
// Wave 2: Grok CLI / Grok Build billing
|
|
428
428
|
"grok-cli",
|
|
429
|
+
// Cloudflare Workers AI (API token + accountId)
|
|
430
|
+
"cloudflare-ai",
|
|
429
431
|
// Multi-account quota expansion
|
|
430
432
|
"xai",
|
|
431
433
|
"cline",
|
|
@@ -442,6 +444,7 @@ export const USAGE_APIKEY_PROVIDERS = [
|
|
|
442
444
|
"minimax-cn",
|
|
443
445
|
"codebuddy",
|
|
444
446
|
"codebuddy-cn",
|
|
447
|
+
"cloudflare-ai",
|
|
445
448
|
"xai",
|
|
446
449
|
"clinepass",
|
|
447
450
|
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{5498:(e,t,a)=>{Promise.resolve().then(a.bind(a,75095)),Promise.resolve().then(a.bind(a,25086))},75095:(e,t,a)=>{"use strict";a.d(t,{default:()=>A});var r=a(95155),s=a(12115),n=a(57250),l=a(42793);function i(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function o(e,t){if(!t||"object"!=typeof t)return[];let a=[];try{switch(e.toLowerCase()){case"github":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{("organization"!==e||t&&0!==(Number(t.total)||0))&&a.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"autoclaw":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:"points"===e?"Points":e,used:t.used||0,total:t.total||0,unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?a.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,unlimited:!0===t.unlimited})});break;default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{a.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,...null!=t.remainingPercentage?{remainingPercentage:t.remainingPercentage}:{},...!0===t.unlimited?{unlimited:!0}:{}})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let r=(0,l.KC)(e);if(r.length>0){let e=new Map(r.map((e,t)=>[e.id,t]));a.sort((t,a)=>{let r=t.modelKey||t.name,s=a.modelKey||a.name;return(e.get(r)??999)-(e.get(s)??999)})}return a}function c({quotas:e=[],compact:t=!1,sortMode:a="default",showSortLabel:n=!1}){let[l,o]=(0,s.useState)(1),d=(0,s.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):i(e?.used,e?.total)})),[e]),u=(0,s.useMemo)(()=>"remaining-asc"===a?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===a?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,a]),m=Math.max(1,Math.ceil(u.length/10));if((0,s.useEffect)(()=>{o(1)},[a,e]),(0,s.useEffect)(()=>{o(e=>Math.min(e,m))},[m]),!e||0===e.length)return null;let h=u.slice((l-1)*10,10*l),x=0===u.length?0:(l-1)*10+1,b=Math.min(10*l,u.length),p=t?"py-1 px-1.5":"py-2 px-3",g=t?"text-[11px]":"text-sm",f=t?"text-[11px]":"text-sm",v=t?"text-[10px] leading-tight":"text-xs";return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"text-[10px] text-text-muted",children:[u.length," quota",u.length>1?"s":""]}),n&&(0,r.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsx)("table",{className:"w-full table-fixed text-left",children:(0,r.jsx)("tbody",{children:h.map(e=>{var a;let s=(a=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:a>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},n=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,a=new Date,r=t-a;if(r<=0)return"-";let s=Math.ceil(r/6e4);if(s<60)return`${s}m`;let n=Math.floor(s/60),l=s%60;if(n<24)return`${n}h ${l}m`;let i=Math.floor(n/24);return`${i}d ${n%24}h ${l}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),a=new Date,r=new Date(a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(r);s.setDate(s.getDate()+1);let n="";n=t>=r&&t<s?"Today":t>=s&&t<new Date(s.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let l=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${n}, ${l}`}catch{return null}}(e.resetAt);return(0,r.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,r.jsx)("td",{className:`${p} w-[30%]`,children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"text-[10px] shrink-0",children:s.emoji}),(0,r.jsx)("span",{className:`${g} font-medium text-text-primary truncate`,children:e.name})]})}),(0,r.jsx)("td",{className:`${p} w-[45%]`,children:(0,r.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,r.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${s.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,r.jsx)("div",{className:`h-full transition-all duration-300 ${s.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,r.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,r.jsxs)("span",{className:"text-text-muted",children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]}),(0,r.jsxs)("span",{className:`font-medium ${s.text}`,children:[e.remaining,"%"]})]})]})}),(0,r.jsx)("td",{className:`${p} w-[25%]`,children:"-"!==n||l?t?(0,r.jsx)("div",{className:`${f} text-text-primary font-medium truncate`,title:l||"",children:"-"!==n?`in ${n}`:l}):(0,r.jsxs)("div",{className:"space-y-0.5",children:["-"!==n&&(0,r.jsxs)("div",{className:`${f} text-text-primary font-medium`,children:["in ",n]}),l&&(0,r.jsx)("div",{className:`${v} text-text-muted`,children:l})]}):(0,r.jsx)("div",{className:`${f} text-text-muted italic`,children:"N/A"})})]},`${e.name}-${e.index}`)})})})}),m>1&&(0,r.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,r.jsxs)("span",{children:["Showing ",x,"-",b," of ",u.length]}),(0,r.jsxs)("span",{children:["Page ",l," / ",m]})]}),(0,r.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,r.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(m,e+1)),disabled:l===m,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var d=a(98542),u=a(84588),m=a(35497),h=a(52679);function x(e){let t=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);return t(e.email)?e.email:(t(e.name),e.name)}function b(e,t){let a=t[e.id]?.quotas?.[0];return a&&"number"==typeof a.remaining?a.remaining:1/0}function p(e){return h.Q2[e]?.name||e}function g(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function f(e,t){let a=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>a.has(e)))}async function v(e,t){return await e(t)}let y="quotaCacheData";function k(){try{let e=window.localStorage.getItem(y);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function w(e,t){try{let a=k();a[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(y,JSON.stringify(a))}catch(e){console.error("Error writing quota cache:",e)}}let j="quotaAutoRefresh",N=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],S=[{value:"single",label:"Satuan",icon:"account_circle"},{value:"bulk",label:"Bulk",icon:"stacks"}],C=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}],$=[10,20,50,100];function A(){let[e,t]=(0,s.useState)([]),[a,l]=(0,s.useState)({}),[A,q]=(0,s.useState)({}),[E,P]=(0,s.useState)({}),[M,D]=(0,s.useState)(!0),[O,I]=(0,s.useState)(null),[T,L]=(0,s.useState)(!1),[_,z]=(0,s.useState)(!1),[F,U]=(0,s.useState)(60),[R,J]=(0,s.useState)(!0),[K,B]=(0,s.useState)(null),[Q,W]=(0,s.useState)(null),[G,H]=(0,s.useState)(!1),[Y,V]=(0,s.useState)(null),[X,Z]=(0,s.useState)([]),[ee,et]=(0,s.useState)("all"),[ea,er]=(0,s.useState)([]),[es,en]=(0,s.useState)("single"),[el,ei]=(0,s.useState)("all"),[eo,ec]=(0,s.useState)("default"),[ed,eu]=(0,s.useState)(!1),[em,eh]=(0,s.useState)(!1),[ex,eb]=(0,s.useState)(!1),[ep,eg]=(0,s.useState)({}),[ef,ev]=(0,s.useState)({}),[ey,ek]=(0,s.useState)(1),[ew,ej]=(0,s.useState)(20),[eN,eS]=(0,s.useState)(String(20)),[eC,e$]=(0,s.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eA,eq]=(0,s.useState)({eligibleConnections:0,providerFilteredConnections:0}),eE=(0,s.useRef)(null),eP=(0,s.useRef)(null),eM=(0,s.useCallback)(async(e=ey)=>{try{var a,r;let s=new URLSearchParams({page:String(e),pageSize:String(ew),accountStatus:el,sort:"priority"});"all"!==ee&&s.set("provider",ee);let n=await fetch(`/api/providers/client?${s.toString()}`);if(!n.ok)throw Error("Failed to fetch connections");let l=await n.json(),i=l.connections||[],o=(a=l.pagination,a||{page:1,pageSize:ew,total:0,totalPages:1}),c=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(l.totals,i.length);return t(i),er(l.providerOptions||[]),e$(o),eq(c),ek((r=l.pagination,r?.page||e)),i}catch(e){return console.error("Error fetching connections:",e),t([]),er([]),e$({page:1,pageSize:ew,total:0,totalPages:1}),eq({eligibleConnections:0,providerFilteredConnections:0}),[]}},[el,ey,ew,ee]),eD=(0,s.useCallback)(async(e,t,a=!1)=>{q(t=>({...t,[e]:!0})),P(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let r=await fetch(`/api/usage/${e}${a?"?refresh=1":""}`);if(!r.ok){let a=(await r.json().catch(()=>({}))).error||r.statusText;if(404===r.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===r.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,a);let r={quotas:[],message:a};l(t=>({...t,[e]:r})),w(e,r);return}throw Error(`HTTP ${r.status}: ${a}`)}let s=await r.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let n={quotas:o(t,s),plan:s.plan||null,message:s.message||null,raw:s};l(t=>({...t,[e]:n})),w(e,n)}catch(a){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,a),P(t=>({...t,[e]:a.message||"Failed to fetch quota"}))}finally{q(t=>({...t,[e]:!1}))}},[]),eO=(0,s.useCallback)(async(e,t)=>{await eD(e,t),I(new Date)},[eD]),eI=(0,s.useCallback)(async(e,t=!1)=>{if(e&&"all"!==e){ev(t=>({...t,[e]:!0}));try{let a=`/api/usage/aggregate?provider=${encodeURIComponent(e)}${t?"&refresh=1":""}`,r=await fetch(a);if(!r.ok)throw Error("Failed to fetch aggregate");let s=await r.json(),n=o(e,s);eg(t=>({...t,[e]:{quotas:n,plan:s.plan||null,accountCount:s.accountCount||0,accountsWithQuota:s.accountsWithQuota||0,deadCount:s.deadCount||0}}))}catch(t){console.error(`[ProviderLimits] Aggregate fetch error for ${e}:`,t)}finally{ev(t=>({...t,[e]:!1}))}}},[]),eT=(0,s.useCallback)(async(e,t)=>{if("bulk"===es&&t){await eI(t,!0),I(new Date);return}e?.length&&(q(t=>({...t,...Object.fromEntries(e.map(e=>[e,!0]))})),await Promise.all(e.map(e=>eD(e,t))),I(new Date))},[eD,es,eI]),eL=(0,s.useCallback)(async e=>{if(confirm("Delete this connection?")){B(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){l(t=>{let a={...t};return delete a[e],a}),q(t=>{let a={...t};return delete a[e],a}),P(t=>{let a={...t};return delete a[e],a});try{let t=k();t[e]&&(delete t[e],window.localStorage.setItem(y,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await v(eM,ey)}}catch(e){console.error("Error deleting connection:",e)}finally{B(null)}}},[eM,ey]),e_=(0,s.useCallback)(async(e,t)=>{W(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(l(e=>({...e})),await v(eM,ey))}catch(e){console.error("Error updating connection status:",e)}finally{W(null)}},[eM,ey]),ez=(0,s.useCallback)(async e=>{if(!Y?.id)return;let t=Y.id,a=Y.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eM(),H(!1),V(null),h.wb.includes(a)&&await eD(t,a))}catch(e){console.error("Error saving connection:",e)}},[Y,eM,eD]);(0,s.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&Z(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let eF=(0,s.useCallback)(async()=>{if(!_){z(!0),U(60);try{let e=await eM(ey);q(g(e)),P(t=>f(t,e)),l(t=>f(t,e)),await Promise.all(e.map(e=>eD(e.id,e.provider,!0))),"bulk"===es&&("all"!==ee?[ee]:ea.map(e=>e.value||e).filter(e=>"all"!==e)).forEach(e=>eI(e,!0)),I(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{z(!1)}}},[_,eM,eD,ey,es,ee,ea,eI]);(0,s.useEffect)(()=>{(async()=>{J(!0);let e=await eM(ey);J(!1),q(g(e)),P(t=>f(t,e)),l(t=>f(t,e)),await Promise.all(e.map(e=>eD(e.id,e.provider))),I(new Date)})()},[eM,eD,ey]),(0,s.useEffect)(()=>{"bulk"!==es||("all"!==ee?[ee]:ea.map(e=>e.value||e).filter(e=>"all"!==e)).forEach(e=>eI(e))},[es,ee,ea,eI]),(0,s.useEffect)(()=>{let e=window.localStorage.getItem(j);D(null===e||"true"===e),L(!0)},[]),(0,s.useEffect)(()=>{T&&window.localStorage.setItem(j,String(M))},[M,T]),(0,s.useEffect)(()=>{if(!T||!M){eE.current&&(clearInterval(eE.current),eE.current=null),eP.current&&(clearInterval(eP.current),eP.current=null);return}return eE.current=setInterval(()=>{eF()},6e4),eP.current=setInterval(()=>{U(e=>e<=1?60:e-1)},1e3),()=>{eE.current&&clearInterval(eE.current),eP.current&&clearInterval(eP.current)}},[M,eF,T]),(0,s.useEffect)(()=>{let e=()=>{document.hidden?(eE.current&&(clearInterval(eE.current),eE.current=null),eP.current&&(clearInterval(eP.current),eP.current=null)):M&&T&&(eE.current=setInterval(eF,6e4),eP.current=setInterval(()=>{U(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[M,eF,T]);let eU=(0,s.useMemo)(()=>(function(e,t,a,r,s){if("codex"===r&&"default"!==s)return[...e].sort((e,a)=>{let r=b(e,t),n=b(a,t),l="remaining-asc"===s?r-n:n-r;return 0!==l?l:(x(e)||"").localeCompare(x(a)||"")});if(!a)return e;let n=e=>{let a=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return a.length>0?Math.min(...a):1/0};return[...e].sort((e,t)=>{let a=n(e)-n(t);return 0!==a?a:(e.provider||"").localeCompare(t.provider||"")||(x(e)||"").localeCompare(x(t)||"")})})(e,a,ed,ee,eo),[e,a,ed,ee,eo]),eR=(0,s.useMemo)(()=>{let e;return e=new Map,eU.forEach(t=>{t.provider&&(e.has(t.provider)||e.set(t.provider,[]),e.get(t.provider).push(t))}),[...e.entries()].map(([e,t])=>(function(e,t,a,r,s){if(!t.length)return null;let n=[],l=[],i=null,o=!1;return t.forEach(e=>{let t=a[e.id];Array.isArray(t?.quotas)&&n.push(...t.quotas),t?.message&&!i&&(i=t.message),s[e.id]&&l.push(s[e.id]),r[e.id]&&(o=!0)}),{id:`${e}-aggregate`,provider:e,name:p(e),email:`${t.length} accounts`,isActive:t.some(e=>e.isActive??!0),isAggregate:!0,quota:{quotas:function(e=[]){let t=new Map;return e.forEach(e=>{if(!e?.name)return;let a=t.get(e.name)||{name:e.name,used:0,total:0,resetAt:e.resetAt||null};a.used+=Number(e.used)||0,a.total+=Number(e.total)||0,e.resetAt&&(!a.resetAt||new Date(e.resetAt).getTime()<new Date(a.resetAt).getTime())&&(a.resetAt=e.resetAt),t.set(e.name,a)}),[...t.values()]}(n),message:0===n.length&&i||null},isLoading:o,error:!n.length&&l.length>0?l[0]:null,connectionIds:t.map(e=>e.id)}})(e,t,a,A,E)).filter(Boolean)},[eU,a,A,E]),eJ=(0,s.useMemo)(()=>Object.keys(ep).length?eR.map(e=>{let t=ep[e.provider];return t&&t.quotas?.length?{...e,email:`${t.accountCount||e.connectionIds?.length||0} accounts`,quota:{...e.quota,quotas:t.quotas,message:null},isLoading:ef[e.provider]||!1}:e}):eR,[eR,ep,ef]),eK=(0,s.useMemo)(()=>"bulk"===es?eJ:eU,[es,eJ,eU]),eB=e=>{let t=a[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=i(e.used,e.total))},eQ=(0,s.useCallback)(async(e,t)=>{if(e.length&&!ex){eb(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await v(eM,ey)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eb(!1)}}},[ex,eM,ey]),eW="all"===ee?"All providers":ee,eG=eA.eligibleConnections>0,eH=eK.length>0,eY=eA.eligibleConnections?eA.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===ee?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===el?"turned off":"active"===el?"active":"matching"} accounts found for ${ee}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},eV=function(e){var t;let{start:a,end:r}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${a}-${r} of ${e.total}`}(eC),eX=!$.includes(ew);return R||eG?R||eH?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>eh(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":em,title:"Filter quota providers",children:[(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===ee?(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,r.jsx)(n.A,{src:`/providers/${ee}.png`,alt:ee,size:18,className:"size-[18px] rounded object-contain",fallbackText:ee.slice(0,2).toUpperCase()}),(0,r.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:eW})]}),(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),em&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eh(!1)}),(0,r.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{"all"!==ee&&ek(1),et("all"),eh(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===ee?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,r.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===ee&&(0,r.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,r.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,r.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:ea.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>{ee!==e&&ek(1),et(e),eh(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${ee===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,r.jsx)(n.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,r.jsx)("span",{className:"font-medium capitalize",children:e}),ee===e&&(0,r.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,r.jsx)("div",{className:"inline-flex h-8 overflow-hidden rounded-lg border border-black/10 bg-black/[0.02] dark:border-white/10 dark:bg-white/[0.03]",children:S.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>en(e.value),"aria-pressed":es===e.value,className:`flex h-full items-center gap-1.5 px-2 text-xs transition-colors ${es===e.value?"bg-primary text-white":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,title:`Show quota in ${e.label} mode`,children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e.icon}),(0,r.jsx)("span",{className:"hidden sm:inline",children:e.label})]},e.value))}),(0,r.jsx)("select",{value:el,onChange:e=>{let t=e.target.value;el!==t&&ek(1),ei(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:N.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===ee&&(0,r.jsx)("select",{value:eo,onChange:e=>ec(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:C.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,r.jsxs)("button",{type:"button",onClick:()=>eu(e=>!e),"aria-pressed":ed,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${ed?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{eQ(eU.filter(e=>(e.isActive??!0)&&eB(e)).map(e=>e.id),!1)},disabled:ex,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{eQ(eU.filter(e=>!(e.isActive??!0)&&!eB(e)).map(e=>e.id),!0)},disabled:ex,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,r.jsxs)("button",{onClick:()=>D(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:M?"Disable auto-refresh":"Enable auto-refresh",children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px] ${M?"text-primary":"text-text-muted"}`,children:M?"toggle_on":"toggle_off"}),(0,r.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),M&&(0,r.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",F,"s)"]})]}),(0,r.jsx)("button",{type:"button",onClick:eF,disabled:_,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,r.jsx)("span",{className:`material-symbols-outlined text-[14px] ${_?"animate-spin":""}`,children:"refresh"})})]})}),ed&&(0,r.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:eK.map(e=>{let t=!0===e.isAggregate,s=t?e.quota:a[e.id],l=t?e.isLoading:A[e.id],i=t?e.error:E[e.id],o=!1===e.isActive,m=!t&&(K===e.id||Q===e.id);return(0,r.jsxs)(u.default,{padding:"none",className:`min-w-0 ${o?"opacity-60":""}`,children:[(0,r.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,r.jsx)(n.A,{src:`/providers/${e.provider}.png`,alt:e.provider,size:32,className:"object-contain",fallbackText:e.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:e.name||p(e.provider)}),x(e)?(0,r.jsx)("p",{className:"text-xs text-text-muted truncate",children:x(e)}):null]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,r.jsx)("button",{type:"button",onClick:()=>t?eT(e.connectionIds,e.provider):eO(e.id,e.provider),disabled:l||m,"aria-label":"Refresh quota",className:"p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",title:"Refresh quota",children:(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${l?"animate-spin":""}`,children:"refresh"})}),!t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>{V(e),H(!0)},disabled:m,"aria-label":"Edit connection",className:"p-1.5 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",title:"Edit connection",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,r.jsx)("button",{type:"button",onClick:()=>eL(e.id),disabled:m,"aria-label":"Delete connection",className:"p-1.5 rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",title:"Delete connection",children:(0,r.jsx)("span",{className:`material-symbols-outlined text-[18px] ${K===e.id?"animate-pulse":""}`,children:"delete"})}),(0,r.jsx)("div",{className:"inline-flex items-center pl-0.5",title:e.isActive??!0?"Disable connection":"Enable connection",children:(0,r.jsx)(d.default,{size:"sm",checked:e.isActive??!0,disabled:m,onChange:t=>e_(e.id,t)})})]})]})]})}),(0,r.jsx)("div",{className:"px-2 py-1.5",children:l?(0,r.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):i?(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,r.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:i})]}):s?.message?(0,r.jsx)("div",{className:"text-center py-5",children:(0,r.jsx)("p",{className:"text-xs text-text-muted",children:s.message})}):(0,r.jsx)(c,{quotas:s?.quotas,compact:!0,sortMode:"default",showSortLabel:"codex"===e.provider&&"default"!==eo})})]},e.id)})}),(0,r.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-text-muted",children:eV}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)("select",{value:eX?"custom":String(ew),onChange:e=>{let t=e.target.value;if("custom"===t)return;let a=Number.parseInt(t,10);Number.isFinite(a)&&(ek(1),ej(a),eS(String(a)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[$.map(e=>(0,r.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,r.jsx)("option",{value:"custom",children:"Custom"})]}),(0,r.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eN,onChange:e=>eS(e.target.value),onBlur:()=>{let e=Number.parseInt(eN,10);if(!Number.isFinite(e))return void eS(String(ew));let t=Math.min(500,Math.max(1,e));ek(1),ej(t),eS(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eN,10);if(!Number.isFinite(t))return void eS(String(ew));let a=Math.min(500,Math.max(1,t));ek(1),ej(a),eS(String(a))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,r.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",eC.page," / ",eC.totalPages]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>ek(1),disabled:eC.page<=1||R||_,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,r.jsx)("button",{type:"button",onClick:()=>ek(e=>Math.max(1,e-1)),disabled:eC.page<=1||R||_,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,r.jsx)("button",{type:"button",onClick:()=>ek(e=>Math.min(eC.totalPages,e+1)),disabled:eC.page>=eC.totalPages||R||_,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,r.jsx)("button",{type:"button",onClick:()=>ek(eC.totalPages),disabled:eC.page>=eC.totalPages||R||_,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,r.jsx)(m.wI,{isOpen:G,connection:Y,proxyPools:X,onSave:ez,onClose:()=>{H(!1),V(null)}})]}):(0,r.jsx)(u.default,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:eY.icon}),(0,r.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:eY.title}),(0,r.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:eY.description})]})}):(0,r.jsx)(u.default,{padding:"lg",children:(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,r.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[2574,3862,4343,3702,5497,8441,3794,7358],()=>e(e.s=5498)),_N_E=e.O()}]);
|
|
File without changes
|
|
File without changes
|