import{Ah as I,B as s,Hh as R,Q as h,Re as f,Y as l,Zc as d,aa as c,ai as x,bd as E,bh as v,n as m,vh as u,wg as S}from"./chunk-EWB56PWF.js";import{i as n}from"./chunk-2T7OYDCL.js";var e=class e{authHttp=c(E);restService=c(I);restExtractor=c(u);serverService=c(R);importVideo(t){let r=e.BASE_VIDEO_IMPORT_URL,a=v(t);return this.authHttp.post(r,a).pipe(s(p=>this.restExtractor.handleError(p)))}getMyVideoImports(t){let{pagination:r,sort:a,search:p}=t,i=new d;if(i=this.restService.addRestGetParams(i,r,a),p){let o=this.restService.parseQueryStringFilter(p,{videoChannelSyncId:{prefix:"videoChannelSyncId:"},targetUrl:{prefix:"targetUrl:"}});i=this.restService.addObjectParams(i,o)}return this.authHttp.get(x.BASE_USERS_URL+"me/videos/imports",{params:i}).pipe(h(o=>this.extractVideoImports(o)),s(o=>this.restExtractor.handleError(o)))}deleteVideoImport(t){return this.authHttp.delete(e.BASE_VIDEO_IMPORT_URL+t.id).pipe(s(r=>this.restExtractor.handleError(r)))}cancelVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/cancel",{}).pipe(s(r=>this.restExtractor.handleError(r)))}extractVideoImports(t){return this.serverService.getServerLocale().pipe(m(r=>(t.data.forEach(a=>a.state.label=f(a.state.label,r)),t)))}};n(e,"BASE_VIDEO_IMPORT_URL",S.apiUrl+"/api/v1/videos/imports/"),n(e,"\u0275fac",function(r){return new(r||e)}),n(e,"\u0275prov",l({token:e,factory:e.\u0275fac}));var U=e;export{U as a};
/**i18n:85d030b7fdd36d163c6d41dcef9178681a6baa573eb199e8b12fe27dbb057a98*/
//# sourceMappingURL=chunk-6JWYCZQ5.js.map
