import{B}from'./chunk-hXR2OK-Q.js';import{s}from'./chunk-nfSA6zwi.js';import{g as g$1,P as Pc,aQ as Ze,dG as ze,b as Pa,s as sp,v as vV,d as lb,f as Pp,cq as E$,k as w2,W as WB,a3 as H0,cr as T$,o as x2,S as SV}from'./main-DEZ5cZzu.js';function g(i,E){if(i&1&&(sp(0,"div",5)(1,"div",3),vV(2,1),lb(),Pp(3,"my-progress-bar",4),E$(4,"bytes"),lb()),i&2){let e=SV();WB(3),H0("label",e.labelQuotaDaily())("max",e.user?.videoQuotaDaily||0)("value",e.userVideoQuotaUsedDaily)("valueFormatted",T$(4,5,e.userVideoQuotaUsedDaily,1))("maxFormatted",e.userVideoQuotaDaily);}}var b=(()=>{class i{userService=g$1(Pc);auth=g$1(Ze);userVideoQuota="0";userVideoQuotaUsed=0;userVideoQuotaPercentage=15;userVideoQuotaDaily="0";userVideoQuotaUsedDaily=0;userVideoQuotaDailyPercentage=15;get user(){return this.auth.getUser();}ngOnInit(){this.auth.userInformationLoaded.pipe(ze()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new s().transform(this.user.videoQuota,0).toString():this.userVideoQuota="\u041D\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u043E",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new s().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="\u041D\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u043E";}),this.userService.getMyVideoQuotaUsed().subscribe(e=>{this.userVideoQuotaUsed=e.videoQuotaUsed,this.userVideoQuotaPercentage=this.userVideoQuotaUsed*100/this.user.videoQuota,this.userVideoQuotaUsedDaily=e.videoQuotaUsedDaily,this.userVideoQuotaDailyPercentage=this.userVideoQuotaUsedDaily*100/this.user.videoQuotaDaily;});}hasDailyQuota(){return this.user.videoQuotaDaily!==-1;}labelQuota(){return`Total video quota: ${new s().transform(this.userVideoQuotaUsed,0).toString()} / ${this.userVideoQuota}`;}labelQuotaDaily(){return`Total daily video quota: ${new s().transform(this.userVideoQuotaUsedDaily,0).toString()} / ${this.userVideoQuotaDaily}`;}static ɵfac=function(o){return new(o||i)();};static ɵcmp=Pa({type:i,selectors:[["my-user-quota"]],decls:7,vars:9,consts:()=>{let e;e="\u041E\u0431\u0449\u0430\u044F \u043A\u0432\u043E\u0442\u0430 \u0432\u0438\u0434\u0435\u043E";let o;return o="\u0421\u0443\u0442\u043E\u0447\u043D\u0430\u044F \u043A\u0432\u043E\u0442\u0430 \u0432\u0438\u0434\u0435\u043E",[e,o,[1,"user-quota","mb-3"],[1,"label"],["height","2rem",3,"label","max","value","valueFormatted","maxFormatted"],[1,"mt-3"]];},template:function(o,t){o&1&&(sp(0,"div",2)(1,"div")(2,"div",3),vV(3,0),lb(),Pp(4,"my-progress-bar",4),E$(5,"bytes"),lb(),w2(6,g,5,8,"div",5),lb()),o&2&&(WB(4),H0("label",t.labelQuota())("max",t.user?.videoQuota||0)("value",t.userVideoQuotaUsed)("valueFormatted",T$(5,6,t.userVideoQuotaUsed,1))("maxFormatted",t.userVideoQuota),WB(2),x2(t.hasDailyQuota()?6:-1));},dependencies:[B,s],encapsulation:2,changeDetection:1});}return i;})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{b};//# sourceMappingURL=chunk-BuKyUwX2.js.map