import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";function r(){if(process.env.USER_TYPE===`ant`){if(n(process.env.USE_LOCAL_OAUTH))return`local`;if(n(process.env.USE_STAGING_OAUTH))return`staging`}return`prod`}function i(){if(process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL)return`-custom-oauth`;switch(r()){case`local`:return`-local-oauth`;case`staging`:return`-staging-oauth`;case`prod`:return``}}function a(){let e=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,``)??`http://localhost:8000`,t=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,``)??`http://localhost:4000`,n=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,``)??`http://localhost:3000`;return{BASE_API_URL:e,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${t}/oauth/authorize`,CLAUDE_AI_ORIGIN:t,TOKEN_URL:`${e}/v1/oauth/token`,API_KEY_URL:`${e}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${e}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,CLIENT_ID:`22422756-60c9-4084-8eb7-27705fd5cf9a`,OAUTH_FILE_SUFFIX:`-local-oauth`,MCP_PROXY_URL:`http://localhost:8205`,MCP_PROXY_PATH:`/v1/toolbox/shttp/mcp/{server_id}`}}function o(){let e=(()=>{switch(r()){case`local`:return a();case`staging`:return g??m;case`prod`:return m}})(),t=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(t){let n=t.replace(/\/$/,``);if(!_.includes(n))throw Error(`CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.`);e={...e,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:`-custom-oauth`}}let n=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return n&&(e={...e,CLIENT_ID:n}),e}var s,c,l,u,d,f,p,m,h,g,_,v=e((()=>{t(),s=`user:inference`,c=`user:profile`,l=`org:create_api_key`,u=`oauth-2025-04-20`,d=[l,c],f=[c,s,`user:sessions:claude_code`,`user:mcp_servers`,`user:file_upload`],p=Array.from(new Set([...d,...f])),m={BASE_API_URL:`https://api.anthropic.com`,CONSOLE_AUTHORIZE_URL:`https://platform.claude.com/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`https://claude.com/cai/oauth/authorize`,CLAUDE_AI_ORIGIN:`https://claude.ai`,TOKEN_URL:`https://platform.claude.com/v1/oauth/token`,API_KEY_URL:`https://api.anthropic.com/api/oauth/claude_cli/create_api_key`,ROLES_URL:`https://api.anthropic.com/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`https://platform.claude.com/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`https://platform.claude.com/oauth/code/callback`,CLIENT_ID:`9d1c250a-e61b-44d9-88ed-5944d1962f5e`,OAUTH_FILE_SUFFIX:``,MCP_PROXY_URL:`https://mcp-proxy.anthropic.com`,MCP_PROXY_PATH:`/v1/mcp/{server_id}`},h=`https://claude.ai/oauth/claude-code-client-metadata`,g=process.env.USER_TYPE===`ant`?{BASE_API_URL:`https://api-staging.anthropic.com`,CONSOLE_AUTHORIZE_URL:`https://platform.staging.ant.dev/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`https://claude-ai.staging.ant.dev/oauth/authorize`,CLAUDE_AI_ORIGIN:`https://claude-ai.staging.ant.dev`,TOKEN_URL:`https://platform.staging.ant.dev/v1/oauth/token`,API_KEY_URL:`https://api-staging.anthropic.com/api/oauth/claude_cli/create_api_key`,ROLES_URL:`https://api-staging.anthropic.com/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`https://platform.staging.ant.dev/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`https://platform.staging.ant.dev/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`https://platform.staging.ant.dev/oauth/code/callback`,CLIENT_ID:`22422756-60c9-4084-8eb7-27705fd5cf9a`,OAUTH_FILE_SUFFIX:`-staging-oauth`,MCP_PROXY_URL:`https://mcp-proxy-staging.anthropic.com`,MCP_PROXY_PATH:`/v1/mcp/{server_id}`}:void 0,_=[`https://beacon.claude-ai.staging.ant.dev`,`https://claude.fedstart.com`,`https://claude-staging.fedstart.com`]}));export{d as a,i as c,c as i,o as l,s as n,h as o,f as r,u as s,p as t,v as u};