import{ih as W,jh as B}from"./cli-0.5.12-63mc4ryd.mjs";import{BZ as U,DZ as J}from"./cli-0.5.12-c6whkxmz.mjs";import{D0 as N,E0 as _,F3 as Q,K3 as R,d4 as $}from"./cli-0.5.12-pycnjaeg.mjs";import{C4 as V,D4 as v}from"./cli-0.5.12-cbevkwg4.mjs";import{Bca as K,Jca as Z}from"./cli-0.5.12-g4wb8mj2.mjs";import{aoa as Y}from"./cli-0.5.12-xzeb7mtb.mjs";async function w(y,X){try{if(R()){let q=Q(),z=!1;if(q?.subscriptionType&&q?.rateLimitTier)z=q.subscriptionType==="max"&&q.rateLimitTier==="default_claude_max_20x";else if(q?.accessToken){let H=await N(q.accessToken);z=H?.organization?.organization_type==="claude_max"&&H?.organization?.rate_limit_tier==="default_claude_max_20x"}if(z)return setTimeout(y,0,"You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account."),null}return await V("https://claude.ai/upgrade/max"),U(W,{startingMessage:"Starting new login following /upgrade. Exit with Ctrl-C to use existing account.",onDone:(q)=>{X.onChangeAPIKey(),y(q?"Login successful":"Login interrupted")}})}catch(G){K(G),setTimeout(y,0,"Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.")}return null}var E=Y(()=>{_();$();v();Z();B();J()});
export{w as Ob,E as Pb};
