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