import{b as a}from"./router-D53qV9Zg.js";import{l as d}from"./fetch-DQISYrhY.js";import{E as p}from"./tables-nYEEmE6H.js";import"./jwt-decode.esm-BYfS37aG.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="19316c70-6060-424e-b365-387a1e513126",s._sentryDebugIdIdentifier="sentry-dbid-19316c70-6060-424e-b365-387a1e513126")}catch{}})();class i{record;constructor(t){this.record=p.from(t)}get id(){return this.record.get("id")}get name(){return this.record.get("name")}get description(){return this.record.get("description")||""}set description(t){this.record.set("description",t)}get projectId(){return this.record.get("projectId")}static from(t){return new i(t)}commit(){this.record.commit()}hasChanges(){return this.record.hasChanges()}get changes(){return this.record.changes}update(t){this.record.update(t)}}class h{urlPath="roles";async create(t,e){return a.post(`projects/${t}/${this.urlPath}`,e)}async delete(t,e){await a.delete(`projects/${t}/${this.urlPath}/${e}`)}async list(t,{limit:e,offset:r}){const o={};e&&(o.limit=e.toString()),r&&(o.offset=r.toString());const c=new URLSearchParams(o);return a.get(`projects/${t}/${this.urlPath}?${c.toString()}`)}async update(t,e,r){return a.patch(`projects/${t}/${this.urlPath}/${e}`,r)}}const n=new h;class y{constructor(t){this.projectId=t}async list(t,e){return(await n.list(this.projectId,{limit:t,offset:e})).map(i.from)}async create(t){await n.create(this.projectId,t)}async update(t,e){await n.update(this.projectId,t,e)}async delete(t){await n.delete(this.projectId,t)}}class w{constructor(t=d){this.fetch=t}async list(t,e){const r={};t&&(r.limit=t.toString()),e&&(r.offset=e.toString());const o=new URLSearchParams(r);return(await(await this.fetch(`/_editor/api/roles?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})).json()).map(i.from)}}export{y as C,w as E};
//# sourceMappingURL=repository-C3dOl4Tm.js.map
