import{a as ee,b as ie,c as te,d as _,f as re,g as ae,h as ne}from"./chunk-CM7G6JGE.js";import{a as Z}from"./chunk-3E2AMUHN.js";import"./chunk-EFBHXRDR.js";import{a as p}from"./chunk-KRDAZURJ.js";import"./chunk-6DMVJQHR.js";import"./chunk-BKT2PYEI.js";import"./chunk-MDSSJT3M.js";import"./chunk-F5VSJKNH.js";import"./chunk-GOGFBC7H.js";import"./chunk-4JY44LTS.js";import"./chunk-AWUVKEOI.js";import"./chunk-TIXNA2EB.js";import"./chunk-NEQNDP4X.js";import"./chunk-7SZZZYED.js";import"./chunk-7EM7F5HG.js";import"./chunk-VEI43OJM.js";import"./chunk-C3QARLMM.js";import"./chunk-3C5XQKFL.js";import"./chunk-L2TBMWNE.js";import"./chunk-SQUGPRYV.js";import{a as oe}from"./chunk-NOTEUKRB.js";import"./chunk-DEVNJA25.js";import{a as X}from"./chunk-QRSSOSSE.js";import"./chunk-AXRJHBTM.js";import"./chunk-CUM6EJCK.js";import"./chunk-RFQGMFNI.js";import{b as q,c as K}from"./chunk-7T4LIDV5.js";import"./chunk-36HZBC22.js";import"./chunk-VDLGCIJ4.js";import"./chunk-RKCRS6MC.js";import"./chunk-JVF7SXRU.js";import"./chunk-D47LWG56.js";import"./chunk-LYGPBVAF.js";import"./chunk-AUMGG4VE.js";import"./chunk-VCCY44XO.js";import"./chunk-OH4LRFJW.js";import"./chunk-VOWWAETK.js";import"./chunk-72QYE45F.js";import"./chunk-KSMXYE2L.js";import"./chunk-YGIKG7MC.js";import"./chunk-AVYEW24G.js";import"./chunk-75XCCDXA.js";import"./chunk-VN3YPA5O.js";import"./chunk-HWLEL4TN.js";import{C as W,D as B}from"./chunk-B5LZ35ZT.js";import"./chunk-UNKOZF3E.js";import{Ab as y,Bb as H,Cc as R,Dg as z,Dh as J,Ea as L,Ga as x,Nc as j,Q as D,Ra as T,Uh as Y,Wb as O,Xa as F,Y as P,Zg as G,_d as N,aa as t,db as A,ga as b,ha as I,j as c,kd as k,mb as C,n as m,nb as V,oh as Q,r as w,sb as E,xh as $,zh as v}from"./chunk-WHTWCQ62.js";import{i as n,j as M}from"./chunk-AI7IVZV2.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("Video g\xFCncellendi.");}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:1cf7c077143c4c267fdafbe5508f191afcef21bad6aba22a3a8dc180e1003753*///# sourceMappingURL=chunk-OXZGCQ6O.js.map