import{Dr as Rg,Fa as er,Ja as g,Lr as Se,Mr as S,ea as ae,fc as vn,pi as Wn,ro as he,va as cf,xa as cr}from"./chunk-b0nJCs5_.js";var O=class n{authHttp=g(Wn);restService=g(Rg);restExtractor=g(er);static BASE_VIDEO_CHANGE_OWNERSHIP_URL=ae.apiUrl+`/api/v1/videos/`;static BASE_CHANNEL_CHANGE_OWNERSHIP_URL=ae.apiUrl+`/api/v1/video-channels/`;sendVideoChangeRequest(r,t){let e=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+r+`/give-ownership`,s={username:t};return this.authHttp.post(e,s).pipe(he(i=>this.restExtractor.handleError(i)))}listOfVideos(r,t){let e=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+`ownership`,s=new vn;return s=this.restService.addRestGetParams(s,r,t),this.authHttp.get(e,{params:s}).pipe(he(i=>this.restExtractor.handleError(i)))}listFromVideo(r,t){let e=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+r+`/ownership`,s=new vn;return s=s.set(`state`,t),this.authHttp.get(e,{params:s}).pipe(he(i=>this.restExtractor.handleError(i)))}acceptVideo(r,t){return Se(r).pipe(cr(e=>{let s=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+`ownership/`+e+`/accept`;return this.authHttp.post(s,t)}),cf(),he(e=>this.restExtractor.handleError(e)))}rejectVideo(r){return Se(r).pipe(cr(t=>{let e=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+`ownership/`+t+`/refuse`;return this.authHttp.post(e,{})}),cf(),he(t=>this.restExtractor.handleError(t)))}cancelVideo(r){let t=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+`ownership/`+r;return this.authHttp.delete(t).pipe(he(e=>this.restExtractor.handleError(e)))}sendChannelChangeRequest(r,t){let e=n.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+r+`/give-ownership`,s={username:t};return this.authHttp.post(e,s).pipe(he(i=>this.restExtractor.handleError(i)))}listOfChannels(r,t){let e=n.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+`ownership`,s=new vn;return s=this.restService.addRestGetParams(s,r,t),this.authHttp.get(e,{params:s}).pipe(he(i=>this.restExtractor.handleError(i)))}listFromChannel(r,t){let e=n.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+r+`/ownership`,s=new vn;return s=s.set(`state`,t),this.authHttp.get(e,{params:s}).pipe(he(i=>this.restExtractor.handleError(i)))}acceptChannel(r){return Se(r).pipe(cr(t=>{let e=n.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+`ownership/`+t+`/accept`;return this.authHttp.post(e,{})}),cf(),he(t=>this.restExtractor.handleError(t)))}rejectChannel(r){return Se(r).pipe(cr(t=>{let e=n.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+`ownership/`+t+`/refuse`;return this.authHttp.post(e,{})}),cf(),he(t=>this.restExtractor.handleError(t)))}cancelChannel(r){let t=n.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+`ownership/`+r;return this.authHttp.delete(t).pipe(he(e=>this.restExtractor.handleError(e)))}static ɵfac=function(t){return new(t||n)};static ɵprov=S({token:n,factory:n.ɵfac})};export{O as t};
//# debugId=3f0bbb96-60f5-5dfd-bad1-ee7b8e3ad44e
//# sourceMappingURL=chunk-CnYI1CZp2.js.map