import{nh as H,ph as C}from"./cli-0.5.12-d158qgn4.mjs";import{qh as k,rh as y}from"./cli-0.5.12-bxsvvg0q.mjs";import{SZ as X,UZ as Y,ZZ as R}from"./cli-0.5.12-khvy67r3.mjs";import{Q3 as B,d4 as f,x0 as w,y0 as E}from"./cli-0.5.12-pycnjaeg.mjs";import{C4 as G,D4 as m}from"./cli-0.5.12-cbevkwg4.mjs";import{Bca as Q,Jaa as S,Jca as D,Maa as j,eba as x}from"./cli-0.5.12-g4wb8mj2.mjs";import{bfa as V,cfa as b}from"./cli-0.5.12-k1crwtdc.mjs";import{Dna as I,lna as W}from"./cli-0.5.12-495d826j.mjs";import{aoa as Z}from"./cli-0.5.12-xzeb7mtb.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}));H();let L=B(),N=L==="team"||L==="enterprise";if(!w()&&N){let J;try{J=(await k())?.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 G(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();C();y();f();E();m();x();D()});
export{i as kh,A as lh};
