import{b as a}from"./router-W58Zb32N.js";import"./jwt-decode.esm-CzNJpMna.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="49bf4dee-cbee-4cd7-83c1-b53f0fe02e24",n._sentryDebugIdIdentifier="sentry-dbid-49bf4dee-cbee-4cd7-83c1-b53f0fe02e24")}catch{}})();class c{urlPath="organizations";async create(t){return a.post(`${this.urlPath}`,t)}async delete(t){await a.delete(`${this.urlPath}/${t}`)}async rename(t,e){await a.patch(`${this.urlPath}/${t}`,{name:e})}async list(){return a.get(`${this.urlPath}`)}async get(t){return a.get(`${this.urlPath}/${t}`)}async getUsageReportUrl(t){return a.get(`${this.urlPath}/${t}/usage-report`)}async getConsumption(t,e,i){return a.get(`${this.urlPath}/${t}/consumption?month=${e}&year=${i}`)}}const s=new c;class r{constructor(t){this.dto=t}static async list(){return(await s.list()).map(e=>new r(e))}static async create(t){const e=await s.create({name:t});return new r(e)}static async get(t){const e=await s.get(t);return new r(e)}static async rename(t,e){return s.rename(t,e)}get id(){return this.dto.id}get name(){return this.dto.name}set name(t){this.dto.name=t}get featureFlags(){return this.dto.featureFlags}get billingMetadata(){return this.dto.billingMetadata}get coalescedPlan(){return this.billingMetadata.plan??"No active plan"}get hasUsageReport(){return["Business","Abstra"].includes(this.coalescedPlan)}async getUsageReportUrl(){return s.getUsageReportUrl(this.id)}static async getConsumption(t,e,i){return s.getConsumption(t,e,i)}}export{r as O,c as a};
//# sourceMappingURL=organization-Dv2gjYZs.js.map
