import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{Mi as t,Pi as n}from"./control-ui-foundation-CeFMP1Ly.js";import{c as r,r as i,s as a,t as o}from"./usage-ClT4QiBm.js";function s(e){return e.ok?e.value.providerUsage:e.error.providerUsage}async function c(e,a,s){let c={startDate:a.startDate,endDate:a.endDate,...a.agentId?{agentId:a.agentId}:{agentScope:`all`},...o(a.timeZone)},l,u=r(e,s?{signal:s}:void 0).then(e=>l={state:`settled`,result:e});try{let[t,r,o]=await Promise.all([i(e,a,{signal:s}),s?e.request(`usage.cost`,c,{signal:s}):e.request(`usage.cost`,c),u]);return n({result:t,costSummary:r,providerUsage:o})}catch(e){if(s?.aborted)throw e;return t({cause:e,providerUsage:l??{state:`pending`}})}}function l(){return(l=e((()=>{a()})))()}export{s as n,c as r,l as t};
//# sourceMappingURL=request-usage-snapshot-B1FzQATD.js.map