import{Bc as zn,Gi as ar,Hs as se,Wa as g,Wt as Jn,_r as Se,fr as S,ha as cf,or as Rg,pc as vn,ro as he}from"./chunk-B_pj7Jpm.js";var O=class n{authHttp=g(zn);restService=g(Rg);restExtractor=g(Jn);static BASE_VIDEO_CHANGE_OWNERSHIP_URL=se.apiUrl+`/api/v1/videos/`;static BASE_CHANNEL_CHANGE_OWNERSHIP_URL=se.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(ar(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(ar(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(ar(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(ar(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=8235230d-d91a-5572-8358-6921439d1e63
//# sourceMappingURL=chunk-sRRTHa8X2.js.map