import{a as f}from"./chunk-F6OP3MIC.js";import{a as r}from"./chunk-D6SYNZK4.js";import{$a as E,Aa as n,Bb as h,Gh as U,K as p,Ka as D,_a as c,aa as l,eb as m,fb as _,gb as u,hb as Q,li as g,mc as v,oc as y,vb as S}from"./chunk-R4Z6ZI3L.js";import{i as d}from"./chunk-P6NJDXIL.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="\u7121\u5236\u9650",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new r().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="\u7121\u5236\u9650";}),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="\u5408\u8A08\u306E\u52D5\u753B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5BB9\u91CF\u5236\u9650";let o;return o="1\u65E5\u3042\u305F\u308A\u306E\u52D5\u753B\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5236\u9650",[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:138e9aba5923606215625ab5641fbdc103d8a34cfe13ae910386f40f27aea675*///# sourceMappingURL=chunk-ONLJXVPJ.js.map