import{kh as G,mh as m}from"./cli-0.5.3-q7rc4gf8.mjs";import{nh as H,oh as C}from"./cli-0.5.3-swre5s9y.mjs";import{cZ as X,eZ as Y,jZ as R}from"./cli-0.5.3-e58xste9.mjs";import{lZ as k,mZ as y}from"./cli-0.5.3-6163zevg.mjs";import{QZ as w,RZ as E,k3 as B,z3 as f}from"./cli-0.5.3-1vt6twff.mjs";import{D5 as W,V5 as I}from"./cli-0.5.3-vpcrbd8n.mjs";import{Caa as S,Faa as j,H6 as x,Yaa as D,z6 as Q}from"./cli-0.5.3-t65dek0m.mjs";import{Jea as V,Kea as b}from"./cli-0.5.3-66650sba.mjs";import{Xma as Z}from"./cli-0.5.3-0df3r78b.mjs";async function _(L){let{accessToken:N,orgUUID:P}=await X(),K={...Y(N),"x-organization-uuid":P},J=`${V().BASE_API_URL}/api/oauth/organizations/${P}/admin_requests`;return(await W.post(J,L,{headers:K})).data}async function $(L,N){let{accessToken:P,orgUUID:K}=await X(),J={...Y(P),"x-organization-uuid":K},F=`${V().BASE_API_URL}/api/oauth/organizations/${K}/admin_requests/me?request_type=${L}`;for(let v of N)F+=`&statuses=${v}`;return(await W.get(F,{headers:J})).data}async function z(L){let{accessToken:N,orgUUID:P}=await X(),K={...Y(N),"x-organization-uuid":P},J=`${V().BASE_API_URL}/api/oauth/organizations/${P}/admin_requests/eligibility?request_type=${L}`;return(await W.get(J,{headers:K})).data}var M=Z(()=>{I();b();R()});async function i(){if(!j().hasVisitedExtraUsage)S((J)=>({...J,hasVisitedExtraUsage:!0}));G();let L=B(),N=L==="team"||L==="enterprise";if(!w()&&N){let J;try{J=(await H())?.extra_usage}catch(F){Q(F)}if(J?.is_enabled&&J.monthly_limit===null)return{type:"message",value:"Your organization already has unlimited extra usage. No request needed."};try{if((await z("limit_increase"))?.is_allowed===!1)return{type:"message",value:"Please contact your admin to manage extra usage settings."}}catch(F){Q(F)}try{let F=await $("limit_increase",["pending","dismissed"]);if(F&&F.length>0)return{type:"message",value:"You have already submitted a request for extra usage to your admin."}}catch(F){Q(F)}try{return await _({request_type:"limit_increase",details:null}),{type:"message",value:J?.is_enabled?"Request sent to your admin to increase extra usage.":"Request sent to your admin to enable extra usage."}}catch(F){Q(F)}return{type:"message",value:"Please contact your admin to manage extra usage settings."}}let K=N?"https://claude.ai/admin-settings/usage":"https://claude.ai/settings/usage";try{let J=await k(K);return{type:"browser-opened",url:K,opened:J}}catch(J){return Q(J),{type:"message",value:`Failed to open browser. Please visit ${K} to manage extra usage.`}}}var A=Z(()=>{M();m();C();f();E();y();D();x()});
export{i as hh,A as ih};
