import{a as U}from"./chunk-QZ53ZUSC.js";import{a as r}from"./chunk-EHVKFKPD.js";import{Cb as g,Ha as n,Hc as E,K as y,Sa as D,Ya as f,aa as m,ai as h,eb as d,jc as S,lc as v,nb as _,ob as u,pb as Q,wh as c,xb as p}from"./chunk-PXFCSR5K.js";import{i as l}from"./chunk-DOSG2ZAB.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="ale",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new r().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="ale";}),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="ken pi pana sitelen";let o;return o="ona o ken pana e sitelen pi mute seme lon tenpo suno wan",[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:c65a26d1e9dd8b923403d49a4dccad76e3fa3313ede414d8a3b16d3f73c99bce*///# sourceMappingURL=chunk-ZI5UBWVA.js.map