import{fh as V,gh as v}from"./cli-0.5.4-cx8fgzcf.mjs";import{PY as U,RY as J}from"./cli-0.5.4-mn22gk7g.mjs";import{nZ as W,oZ as B}from"./cli-0.5.4-6xmgebmk.mjs";import{B3 as $,YZ as N,ZZ as _,b3 as Q,g3 as R}from"./cli-0.5.4-jqt00ywx.mjs";import{B6 as K,J6 as Z}from"./cli-0.5.4-cbq01zg3.mjs";import{Zma as Y}from"./cli-0.5.4-aacw1src.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 W("https://claude.ai/upgrade/max"),U(V,{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(()=>{_();$();B();Z();v();J()});
export{w as Ib,E as Jb};
