import{c as d}from"./chunk-LATCUF53.js";import{a as H}from"./chunk-Z5MXFWJM.js";import{C as a,S,Uc as m,Yc as l,Z as h,ba as i,dg as f,jf as u,jg as R}from"./chunk-ZXQQIUTT.js";import{i as s}from"./chunk-RE7RSUSQ.js";var c=class c{authHttp=i(l);restExtractor=i(f);restService=i(R);videoService=i(d);list(r,t){let o=this.restService.componentToRestPagination(r),e=new m;return e=this.restService.addRestGetParams(e,o),t&&(e=e.append("search",t)),this.authHttp.get(c.BASE_USER_VIDEOS_HISTORY_URL,{params:e}).pipe(S(p=>this.videoService.extractVideos(p)),a(p=>this.restExtractor.handleError(p)))}deleteElement(r){return this.authHttp.delete(c.BASE_USER_VIDEOS_HISTORY_URL+"/"+r.id).pipe(a(t=>this.restExtractor.handleError(t)))}clearAll(){return this.authHttp.post(c.BASE_USER_VIDEOS_HISTORY_URL+"/remove",{}).pipe(a(r=>this.restExtractor.handleError(r)))}};s(c,"BASE_USER_VIDEOS_HISTORY_URL",u.apiUrl+"/api/v1/users/me/history/videos"),s(c,"\u0275fac",function(t){return new(t||c)}),s(c,"\u0275prov",h({token:c,factory:c.\u0275fac}));var I=c;var n=class n{authHttp=i(l);restService=i(R);restExtractor=i(f);changeOwnership(r,t){let o=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+r+"/give-ownership",e={username:t};return this.authHttp.post(o,e).pipe(a(p=>this.restExtractor.handleError(p)))}getOwnershipChanges(r,t){let o=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership",e=new m;return e=this.restService.addRestGetParams(e,r,t),this.authHttp.get(o,{params:e}).pipe(a(p=>this.restExtractor.handleError(p)))}acceptOwnership(r,t){let o=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership/"+r+"/accept";return this.authHttp.post(o,t).pipe(a(e=>this.restExtractor.handleError(e)))}refuseOwnership(r){let t=n.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership/"+r+"/refuse";return this.authHttp.post(t,{}).pipe(a(o=>this.restExtractor.handleError(o)))}};s(n,"BASE_VIDEO_CHANGE_OWNERSHIP_URL",u.apiUrl+"/api/v1/videos/"),s(n,"\u0275fac",function(t){return new(t||n)}),s(n,"\u0275prov",h({token:n,factory:n.\u0275fac}));var v=n;var E=class E{authHttp=i(l);restExtractor=i(f);restService=i(R);listAccountVideoChannelsSyncs(r){let{pagination:t,sort:o,account:e}=r,p=new m;p=this.restService.addRestGetParams(p,t,o);let _=H.BASE_ACCOUNT_URL+e.nameWithHost+"/video-channel-syncs";return this.authHttp.get(_,{params:p}).pipe(a(x=>this.restExtractor.handleError(x)))}createSync(r){return this.authHttp.post(E.BASE_VIDEO_CHANNEL_URL,r).pipe(a(t=>this.restExtractor.handleError(t)))}deleteSync(r){let t=`${E.BASE_VIDEO_CHANNEL_URL}/${r}`;return this.authHttp.delete(t).pipe(a(o=>this.restExtractor.handleError(o)))}};s(E,"BASE_VIDEO_CHANNEL_URL",u.apiUrl+"/api/v1/video-channel-syncs"),s(E,"\u0275fac",function(t){return new(t||E)}),s(E,"\u0275prov",h({token:E,factory:E.\u0275fac,providedIn:"root"}));var O=E;export{I as a,v as b,O as c};
/**i18n:4ea3d52b0fe89d1d8e6fff59c182aeadbd7786f17ffe9a1efa1c7ed627997eaf*/
//# sourceMappingURL=chunk-H3L6CQ5M.js.map
