import{a as U}from"./chunk-G3GN3PWT.js";import{a as r}from"./chunk-LUZFQZMA.js";import{Eb as g,Fc as E,Ha as n,L as y,Og as h,Sa as D,Za as f,ba as m,gb as d,gg as c,hc as S,jc as v,pb as _,qb as u,rb as Q,zb as p}from"./chunk-3MFSOWAK.js";import{i as l}from"./chunk-ASXIZBWV.js";function V(a,i){if(a&1&&(_(0,"div",6)(1,"div",3),p(2,1),u(),Q(3,"my-progress-bar",4),S(4,"bytes"),u()),a&2){let s=g();n(3),d("label",s.labelQuotaDaily())("max",(s.user==null?null:s.user.videoQuotaDaily)||0)("value",s.userVideoQuotaUsedDaily)("valueFormatted",v(4,5,s.userVideoQuotaUsedDaily,1))("maxFormatted",s.userVideoQuotaDaily);}}var $=(()=>{let i=class i{userService=m(h);auth=m(c);userVideoQuota="0";userVideoQuotaUsed=0;userVideoQuotaPercentage=15;userVideoQuotaDaily="0";userVideoQuotaUsedDaily=0;userVideoQuotaDailyPercentage=15;get user(){return this.auth.getUser();}ngOnInit(){this.auth.userInformationLoaded.pipe(y()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new r().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 r().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(t=>{this.userVideoQuotaUsed=t.videoQuotaUsed,this.userVideoQuotaPercentage=this.userVideoQuotaUsed*100/this.user.videoQuota,this.userVideoQuotaUsedDaily=t.videoQuotaUsedDaily,this.userVideoQuotaDailyPercentage=this.userVideoQuotaUsedDaily*100/this.user.videoQuotaDaily;});}hasDailyQuota(){return this.user.videoQuotaDaily!==-1;}labelQuota(){return`Total video quota: ${new r().transform(this.userVideoQuotaUsed,0).toString()} / ${this.userVideoQuota}`;}labelQuotaDaily(){return`Total daily video quota: ${new r().transform(this.userVideoQuotaUsedDaily,0).toString()} / ${this.userVideoQuotaDaily}`;}};l(i,"\u0275fac",function(o){return new(o||i)();}),l(i,"\u0275cmp",D({type:i,selectors:[["my-user-quota"]],decls:7,vars:9,consts:()=>{let t;t="\u041E\u0431\u0449\u0430\u044F \u043A\u0432\u043E\u0442\u0430 \u0432\u0438\u0434\u0435\u043E";let o;return o="\u0414\u043D\u0435\u0432\u043D\u0430\u044F \u043A\u0432\u043E\u0442\u0430 \u0432\u0438\u0434\u0435\u043E",[t,o,[1,"user-quota","mb-3"],[1,"label"],["height","2rem",3,"label","max","value","valueFormatted","maxFormatted"],["class","mt-3",4,"ngIf"],[1,"mt-3"]];},template:function(o,e){o&1&&(_(0,"div",2)(1,"div")(2,"div",3),p(3,0),u(),Q(4,"my-progress-bar",4),S(5,"bytes"),u(),f(6,V,5,8,"div",5),u()),o&2&&(n(4),d("label",e.labelQuota())("max",(e.user==null?null:e.user.videoQuota)||0)("value",e.userVideoQuotaUsed)("valueFormatted",v(5,6,e.userVideoQuotaUsed,1))("maxFormatted",e.userVideoQuota),n(2),d("ngIf",e.hasDailyQuota()));},dependencies:[E,r,U],encapsulation:2}));let a=i;return a;})();export{$ as a};/**i18n:a80de7963c3a1ee38e5afb7317b8dafa5dd6a0c8b3d465be96b90b317d6167e1*///# sourceMappingURL=chunk-V7EYHEBD.js.map