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