import{a}from"./chunk-XVNXWB4L.js";import{K as t,ga as n,la as c,q as s}from"./chunk-I3FGJX2C.js";var R=(()=>{let r=class r{constructor(e){this._roleServiceApi=e}getRoles(e){return this._roleServiceApi.getRoles(e).pipe(t(1))}getRolesForDropdown(){return this._roleServiceApi.getRoles({take:50,orderBy:"id",skip:0,criteria:null,isAscending:!0}).pipe(s(e=>e.data),t(1))}createRole(e){return this._roleServiceApi.createRole(this._toRequestForm(e)).pipe(t(1))}getRoleById(e){return this._roleServiceApi.getRoleById(e).pipe(t(1))}updateRoleById(e,i){return this._roleServiceApi.updateRoleById(this._toRequestForm(e),i).pipe(t(1))}removeRoleById(e){return this._roleServiceApi.removeRoleById(e).pipe(t(1))}_toRequestForm(e){return{nameKk:e.name,nameRu:e.name,permissions:e.groups.reduce((i,l)=>[...i,...l.permissions.filter(p=>p.checked).map(p=>p.id)],[])}}};r.\u0275fac=function(i){return new(i||r)(c(a))},r.\u0275prov=n({token:r,factory:r.\u0275fac});let o=r;return o})();export{R as a};
//# sourceMappingURL=chunk-WULKAQZ4.js.map
