import{a as U}from"./chunk-Q367344W.js";import{a as r}from"./chunk-XN5VGOY3.js";import{Eb as g,Fc as E,Ha as n,L as y,Sa as D,Tg as h,Za as f,ba as m,gb as d,hc as S,jc as v,mg as c,pb as _,qb as u,rb as Q,zb as p}from"./chunk-YAKH5Q6V.js";import{i as l}from"./chunk-DM5LJ7VI.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="Unbegrenzt",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new r().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="Unbegrenzt";}),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="Gesamtes Videokontingent";let o;return o="T\xE4gliches Videokontingent",[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:197837fef124041a3f31333a5ea4afa44db030645e23ee7031f32704e8696a1d*///# sourceMappingURL=chunk-5E6YXU6D.js.map