import{a as ee,b as ie,c as te,d as _,f as re,g as ae,h as ne}from"./chunk-U56X2EUA.js";import{a as Z}from"./chunk-7UZBGGRZ.js";import"./chunk-4R24HUVB.js";import{a as p}from"./chunk-YLVXBJFG.js";import"./chunk-LXKQAUI2.js";import"./chunk-QU7CCDUY.js";import"./chunk-B74UMGV6.js";import"./chunk-5OF7XFGH.js";import"./chunk-7UTGOWA6.js";import"./chunk-RB4KEDQH.js";import"./chunk-XFQW3XQT.js";import"./chunk-AE4SEVGN.js";import"./chunk-EADTX6YQ.js";import"./chunk-J2XE3AIY.js";import"./chunk-D75KWKVW.js";import"./chunk-F6CBG5B4.js";import"./chunk-VVZUXXVM.js";import"./chunk-ABZCLNRM.js";import"./chunk-64SWO2DW.js";import"./chunk-YXMAJXC2.js";import{a as oe}from"./chunk-22QRNJYX.js";import"./chunk-H4BWOOHI.js";import{a as X}from"./chunk-OIWB26TT.js";import"./chunk-NM6UDG3V.js";import"./chunk-5M472V2E.js";import"./chunk-TT5DGFWP.js";import{b as q,c as K}from"./chunk-QQS3O2A6.js";import"./chunk-OKEZY6F6.js";import"./chunk-LLCJTE6I.js";import"./chunk-L3JRXZHK.js";import"./chunk-FYVHH3YK.js";import"./chunk-BEGTVY6X.js";import"./chunk-N4XHT5GQ.js";import"./chunk-VPBM64EO.js";import"./chunk-SUJ6GANO.js";import"./chunk-EB3EO7XT.js";import"./chunk-GGIGI3OP.js";import"./chunk-XMNTKCWN.js";import"./chunk-E3FPDMTA.js";import"./chunk-SMO6IFQB.js";import"./chunk-CDN4D7Q7.js";import"./chunk-AHN4RUKR.js";import"./chunk-F4OQWEEK.js";import"./chunk-LN3G546W.js";import{C as W,D as B}from"./chunk-MJIAB7QL.js";import"./chunk-QBAPWXTV.js";import{Ab as y,Ah as $,Bb as H,Ch as v,Ea as L,Fc as R,Ga as x,Gg as z,Gh as J,Q as D,Qc as j,Ra as T,Xa as F,Xh as Y,Y as P,Zb as O,aa as t,ah as G,be as N,db as A,ga as b,ha as I,j as c,mb as C,n as m,nb as V,nd as k,r as w,rh as Q,sb as E}from"./chunk-2GYONVCW.js";import{i as n,j as M}from"./chunk-6PUAHDUH.js";function ve(a,o){if(a&1){let se=E();C(0,"my-video-manage-container",2),y("videoUpdated",function(){b(se);let e=H();return I(e.onVideoUpdated());}),V();}}var de=(()=>{let o=class o{route=t(k);serverService=t(v);notifier=t(G);manageController=t(_);isUpdatingVideo=!1;loaded=!1;ngOnInit(){return M(this,null,function*(){let i=this.route.snapshot.data.resolverData,{video:e,userChannels:r,captions:s,chapters:d,videoSource:l,live:u,videoPasswords:f,userQuota:g,privacies:S}=i,h=yield re.createFromAPI(this.serverService.getHTMLConfig(),{video:e,captions:s,chapters:d,live:u,videoSource:l,videoPasswords:f.map(ce=>ce.password)});this.manageController.setStore({videoEdit:h,userQuota:g,userChannels:r,privacies:S}),this.manageController.setConfig({manageType:"update",serverConfig:this.serverService.getHTMLConfig()}),this.loaded=!0;});}ngOnDestroy(){this.manageController.cancelUploadIfNeeded();}onVideoUpdated(){this.notifier.success("Vide\xF3 friss\xEDtve.");}onUnload(i){let{text:e,canDeactivate:r}=this.canDeactivate();if(!r)return i.returnValue=e,e;}canDeactivate(){return{canDeactivate:!this.manageController.hasPendingChanges(),text:"You have unsaved changes. Are you sure you want to leave?"};}};n(o,"\u0275fac",function(e){return new(e||o)();}),n(o,"\u0275cmp",T({type:o,selectors:[["my-video-manage"]],hostBindings:function(e,r){e&1&&y("beforeunload",function(d){return r.onUnload(d);},!1,L);},features:[O([_])],decls:2,vars:1,consts:[[1,"margin-content"],["canUpdate","true","canWatch","true","cancelLink","/my-library/videos",3,"videoUpdated",4,"ngIf"],["canUpdate","true","canWatch","true","cancelLink","/my-library/videos",3,"videoUpdated"]],template:function(e,r){e&1&&(C(0,"div",0),F(1,ve,1,0,"my-video-manage-container",1),V()),e&2&&(x(),A("ngIf",r.loaded));},dependencies:[j,R,W,B,ne],encapsulation:2}));let a=o;return a;})();var U=(()=>{let o=class o{videoService=t(K);liveVideoService=t(p);authService=t(Q);videoCaptionService=t(X);videoChapterService=t(oe);videoPasswordService=t(q);userService=t(Y);serverService=t(v);resolve(i){let e=i.params.uuid;return this.videoService.getVideo({videoId:e}).pipe(D(r=>w(this.buildObservables(r))),m(([r,s,d,l,u,f,g,S,h])=>({video:r,userChannels:d,captions:l,chapters:u,videoSource:s,live:f,videoPasswords:g,userQuota:S,privacies:h})));}buildObservables(i){return[c(i),this.videoService.getSource(i.id),z(this.authService),this.videoCaptionService.listCaptions(i.uuid).pipe(m(e=>e.data)),this.videoChapterService.getChapters({videoId:i.uuid}).pipe(m(({chapters:e})=>e)),i.isLive?this.liveVideoService.getVideoLive(i.id):c(void 0),i.privacy.id===N.PASSWORD_PROTECTED?this.videoPasswordService.getVideoPasswords({videoUUID:i.uuid}):c([]),this.userService.getMyVideoQuotaUsed(),this.serverService.getVideoPrivacies()];}};n(o,"\u0275fac",function(e){return new(e||o)();}),n(o,"\u0275prov",P({token:o,factory:o.ɵfac}));let a=o;return a;})();var Je=[{path:"",component:de,canActivate:[J],canDeactivate:[$],providers:[U,p,ee,ie,te,Z],resolve:{resolverData:U},children:ae}];export{Je as default};/**i18n:7c691147a9ded88b46d9cd2285c6afa220006ce26eb0d02eb4522192723b6cd8*///# sourceMappingURL=chunk-HZFGEUKH.js.map