import{Bf as P,C as s,D as c,De as f,E as h,Z as A,ba as u,ih as L,j as p,nd as w,nh as I,qd as E}from"./chunk-RB2SGB4Z.js";import{i as d}from"./chunk-IQVXR75E.js";var l=class l{authHttp=u(E);restService=u(I);restExtractor=u(L);listSubscriptions(r){let{pagination:o,sort:t,search:a,state:i,actorType:n}=r,e=new w();return e=this.restService.addRestGetParams(e,o,t),a&&(e=e.append("search",a)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(l.BASE_APPLICATION_URL+"/following",{params:e}).pipe(s(m=>this.restExtractor.handleError(m)));}listFollowers(r){let{pagination:o,sort:t,search:a,state:i,actorType:n}=r,e=new w();return e=this.restService.addRestGetParams(e,o,t),a&&(e=e.append("search",a)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(l.BASE_APPLICATION_URL+"/followers",{params:e}).pipe(s(m=>this.restExtractor.handleError(m)));}follow(r){let o={handles:r.filter(t=>t.includes("@")),hosts:r.filter(t=>!t.includes("@"))};return this.authHttp.post(l.BASE_APPLICATION_URL+"/following",o).pipe(s(t=>this.restExtractor.handleError(t)));}unfollow(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.following.name+"@"+t.following.host;return this.authHttp.delete(l.BASE_APPLICATION_URL+"/following/"+a);}),c(),s(t=>this.restExtractor.handleError(t)));}acceptFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${l.BASE_APPLICATION_URL}/followers/${a}/accept`,{});}),c(),s(t=>this.restExtractor.handleError(t)));}rejectFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${l.BASE_APPLICATION_URL}/followers/${a}/reject`,{});}),c(),s(t=>this.restExtractor.handleError(t)));}removeFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.delete(`${l.BASE_APPLICATION_URL}/followers/${a}`);}),c(),s(t=>this.restExtractor.handleError(t)));}buildFollowsListFilters(){return[{type:"options",key:"state",title:"Follow state",options:[{value:"all",label:"All follows"},{value:"accepted",label:"\u0641\u0627\u0644\u0648\u0647\u0627\u06CC \u067E\u0630\u06CC\u0631\u0641\u062A\u0647 \u0634\u062F\u0647"},{value:"rejected",label:"\u0641\u0627\u0644\u0648\u0647\u0627\u06CC \u067E\u0630\u06CC\u0631\u0641\u062A\u0647 \u0646\u0634\u062F\u0647"},{value:"pending",label:"\u0641\u0627\u0648\u0644\u0648\u0647\u0627\u06CC \u062F\u0631 \u0627\u0646\u062A\u0638\u0627\u0631"}]}];}};d(l,"BASE_APPLICATION_URL",P.apiUrl+"/api/v1/server"),d(l,"\u0275fac",function(o){return new(o||l)();}),d(l,"\u0275prov",A({token:l,factory:l.ɵfac}));var R=l;export{R as a};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-UDQTNPDB.js.map