import{a as f}from"./chunk-3SS442VG.js";import{a as r}from"./chunk-S2XS2ZJ7.js";import{Da as n,Db as h,K as p,La as D,Lh as U,aa as l,ab as c,bb as E,gb as m,hb as _,ib as u,jb as Q,oc as v,qc as y,qi as g,xb as S}from"./chunk-DWEAL4OJ.js";import{i as d}from"./chunk-YM6OINSR.js";function V(a,i){if(a&1&&(_(0,"div",5)(1,"div",3),S(2,1),u(),Q(3,"my-progress-bar",4),v(4,"bytes"),u()),a&2){let s=h();n(3),m("label",s.labelQuotaDaily())("max",(s.user==null?null:s.user.videoQuotaDaily)||0)("value",s.userVideoQuotaUsedDaily)("valueFormatted",y(4,5,s.userVideoQuotaUsedDaily,1))("maxFormatted",s.userVideoQuotaDaily);}}var N=(()=>{let i=class i{userService=l(g);auth=l(U);userVideoQuota="0";userVideoQuotaUsed=0;userVideoQuotaPercentage=15;userVideoQuotaDaily="0";userVideoQuotaUsedDaily=0;userVideoQuotaDailyPercentage=15;get user(){return this.auth.getUser();}ngOnInit(){this.auth.userInformationLoaded.pipe(p()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new r().transform(this.user.videoQuota,0).toString():this.userVideoQuota="Ubegrenset",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new r().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="Ubegrenset";}),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}`;}};d(i,"\u0275fac",function(o){return new(o||i)();}),d(i,"\u0275cmp",D({type:i,selectors:[["my-user-quota"]],decls:7,vars:9,consts:()=>{let t;t="Total videokvote";let o;return o="Daglig videokvote",[t,o,[1,"user-quota","mb-3"],[1,"label"],["height","2rem",3,"label","max","value","valueFormatted","maxFormatted"],[1,"mt-3"]];},template:function(o,e){o&1&&(_(0,"div",2)(1,"div")(2,"div",3),S(3,0),u(),Q(4,"my-progress-bar",4),v(5,"bytes"),u(),c(6,V,5,8,"div",5),u()),o&2&&(n(4),m("label",e.labelQuota())("max",(e.user==null?null:e.user.videoQuota)||0)("value",e.userVideoQuotaUsed)("valueFormatted",y(5,6,e.userVideoQuotaUsed,1))("maxFormatted",e.userVideoQuota),n(2),E(e.hasDailyQuota()?6:-1));},dependencies:[f,r],encapsulation:2}));let a=i;return a;})();export{N as a};/**i18n:5a85df092a135682c90bae008e37ec28160e04e5f445e29af2927333ba91ffa1*///# sourceMappingURL=chunk-LCN3MJ6M.js.map