import{g,aS as kn,aU as QP,aT as no,aV as oe,aW as ln,aX as le,aa as ge,ab as Qn,ac as Vd,aY as S,bS as tm}from'./main-DEZ5cZzu.js';var L=class a{authHttp=g(kn);restService=g(QP);restExtractor=g(no);static BASE_APPLICATION_URL=oe.apiUrl+"/api/v1/server";listSubscriptions(r){let{pagination:o,sort:t,search:l,state:i,actorType:n}=r,e=new ln();return e=this.restService.addRestGetParams(e,o,t),l&&(e=e.append("search",l)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(a.BASE_APPLICATION_URL+"/following",{params:e}).pipe(le(u=>this.restExtractor.handleError(u)));}listFollowers(r){let{pagination:o,sort:t,search:l,state:i,actorType:n}=r,e=new ln();return e=this.restService.addRestGetParams(e,o,t),l&&(e=e.append("search",l)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(a.BASE_APPLICATION_URL+"/followers",{params:e}).pipe(le(u=>this.restExtractor.handleError(u)));}follow(r){let o={handles:r.filter(t=>t.includes("@")),hosts:r.filter(t=>!t.includes("@"))};return this.authHttp.post(a.BASE_APPLICATION_URL+"/following",o).pipe(le(t=>this.restExtractor.handleError(t)));}unfollow(r){let o=tm(r);return ge(o).pipe(Qn(t=>{let l=t.following.name+"@"+t.following.host;return this.authHttp.delete(a.BASE_APPLICATION_URL+"/following/"+l);}),Vd(),le(t=>this.restExtractor.handleError(t)));}acceptFollower(r){let o=tm(r);return ge(o).pipe(Qn(t=>{let l=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${a.BASE_APPLICATION_URL}/followers/${l}/accept`,{});}),Vd(),le(t=>this.restExtractor.handleError(t)));}rejectFollower(r){let o=tm(r);return ge(o).pipe(Qn(t=>{let l=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${a.BASE_APPLICATION_URL}/followers/${l}/reject`,{});}),Vd(),le(t=>this.restExtractor.handleError(t)));}removeFollower(r){let o=tm(r);return ge(o).pipe(Qn(t=>{let l=t.follower.name+"@"+t.follower.host;return this.authHttp.delete(`${a.BASE_APPLICATION_URL}/followers/${l}`);}),Vd(),le(t=>this.restExtractor.handleError(t)));}buildFollowsListFilters(){return[{type:"options",key:"state",title:"Follow state",options:[{value:"all",label:"All follows"},{value:"accepted",label:"Elfogadott k\xF6vet\xE9sek"},{value:"rejected",label:"Elutas\xEDtott k\xF6vet\xE9se"},{value:"pending",label:"F\xFCgg\u0151ben l\xE9v\u0151 k\xF6vet\xE9sek"}]}];}static ɵfac=function(o){return new(o||a)();};static ɵprov=S({token:a,factory:a.ɵfac});};/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{L};//# sourceMappingURL=chunk-DklgiaH9.js.map