"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[7503],{7503:function(e,a,n){n.r(a),n.d(a,{default:function(){return w}});n(8309);var l=n(6252),t=n(3577),o={class:"entity battery-container"},r={class:"head"},u={class:"icon"},i={class:"label"},c=["textContent"],s={class:"value-container"},v=["textContent"];function d(e,a,n,d,f,p){var C=(0,l.up)("EntityIcon");return(0,l.wg)(),(0,l.iD)("div",o,[(0,l._)("div",r,[(0,l._)("div",u,[(0,l.Wm)(C,{entity:e.value,icon:p.icon,loading:e.loading,error:e.error},null,8,["entity","icon","loading","error"])]),(0,l._)("div",i,[(0,l._)("div",{class:"name",textContent:(0,t.zw)(e.value.name)},null,8,c)]),(0,l._)("div",s,[null!=p.valuePercent?((0,l.wg)(),(0,l.iD)("span",{key:0,class:"value",textContent:(0,t.zw)(p.valuePercent+"%")},null,8,v)):(0,l.kq)("",!0)])])])}var f=n(6347),p=n(4648),C=(n(6977),n(7909)),h=n(1706),y=[{iconClass:"full",color:"#157145",value:.9},{iconClass:"three-quarters",color:"#94C595",value:.825},{iconClass:"half",color:"#F0B67F",value:.625},{iconClass:"quarter",color:"#FE5F55",value:.375},{iconClass:"low",color:"#CC444B",value:.15},{iconClass:"empty",color:"#EC0B43",value:.05}],m={name:"Battery",components:{EntityIcon:h["default"]},mixins:[C["default"]],computed:{valuePercent:function(){var e;if(null==(null===(e=this.value)||void 0===e?void 0:e.value))return null;var a=this.value.min||0,n=this.value.max||100;return(100*this.value.value/(n-a)).toFixed(0)},icon:function(){var e,a=(0,p.Z)({},(null===(e=this.value.meta)||void 0===e?void 0:e.icon)||{}),n=this.valuePercent,l=y[0];if(null!=n){n=parseFloat(n)/100;var t,o=(0,f.Z)(y);try{for(o.s();!(t=o.n()).done;){var r=t.value;if(n>r.value)break;l=r}}catch(u){o.e(u)}finally{o.f()}}return a["class"]="fas fa-battery-".concat(l.iconClass),a["color"]=l.color,a}},methods:{prevent:function(e){return e.stopPropagation(),!1}}},b=n(3744);const k=(0,b.Z)(m,[["render",d],["__scopeId","data-v-4b2ced66"]]);var w=k}}]);
//# sourceMappingURL=7503-legacy.ad9a73d9.js.map