import{Af as S,C as o,Ph as U,R as d,Z as l,ba as s,hf as R,hg as f,hh as v,mh as O,nd as u,o as E,qd as I,uh as x}from"./chunk-RKSLYOIW.js";import{c as h,i as p}from"./chunk-QQ7SJNXU.js";var e=class e{authHttp=s(I);restService=s(O);restExtractor=s(v);serverService=s(x);importVideo(t){let r=e.BASE_VIDEO_IMPORT_URL,a=f(t);return this.authHttp.post(r,a).pipe(o(c=>this.restExtractor.handleError(c)))}listMyVideoImports(t){let m=t,{pagination:r,sort:a}=m,c=h(m,["pagination","sort"]),i=new u;return i=this.restService.addRestGetParams(i,r,a),i=this.restService.addObjectParams(i,c),this.authHttp.get(U.BASE_USERS_URL+"me/videos/imports",{params:i}).pipe(d(n=>this.extractVideoImports(n)),o(n=>this.restExtractor.handleError(n)))}deleteVideoImport(t){return this.authHttp.delete(e.BASE_VIDEO_IMPORT_URL+t.id).pipe(o(r=>this.restExtractor.handleError(r)))}cancelVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/cancel",{}).pipe(o(r=>this.restExtractor.handleError(r)))}retryVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/retry",{}).pipe(o(r=>this.restExtractor.handleError(r)))}extractVideoImports(t){return this.serverService.getServerLocale().pipe(E(r=>(t.data.forEach(a=>a.state.label=R(a.state.label,r)),t)))}};p(e,"BASE_VIDEO_IMPORT_URL",S.apiUrl+"/api/v1/videos/imports/"),p(e,"\u0275fac",function(r){return new(r||e)}),p(e,"\u0275prov",l({token:e,factory:e.\u0275fac}));var V=e;export{V as a};
/**i18n:5a85df092a135682c90bae008e37ec28160e04e5f445e29af2927333ba91ffa1*/
//# sourceMappingURL=chunk-A65B3ZJO.js.map
