import{B as s,Ch as R,Me as f,Q as h,Wc as d,Xh as x,Y as l,Yg as v,_c as E,aa as c,n as m,qh as u,rg as S,vh as I}from"./chunk-2GYONVCW.js";import{i as n}from"./chunk-6PUAHDUH.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:7c691147a9ded88b46d9cd2285c6afa220006ce26eb0d02eb4522192723b6cd8*/
//# sourceMappingURL=chunk-YKKQP2RN.js.map
