"use strict";
CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,n,o){return i<2*o&&(o=i/2),n<2*o&&(o=n/2),this.beginPath(),this.moveTo(t+o,e),this.arcTo(t+i,e,t+i,e+n,o),this.arcTo(t+i,e+n,t,e+n,o),this.arcTo(t,e+n,t,e,o),this.arcTo(t,e,t+i,e,o),this.closePath(),this};
var UrsElectricMeter=function(t,e){var i,n,o,l,a,r=void 0===(e=e||{}).context?null:e.context,s=void 0===e.duration?2:e.duration;i=r||("string"==typeof(a=t)||a instanceof String?document.getElementById(a):a).getContext("2d"),this.repaint=function(){i.fillStyle="rgb(190, 190, 190)",i.roundRect(42,6,586,386,60).fill();var t=0;i.fillStyle="rgb(70, 70, 70)",i.roundRect(36+t,0+t,580-2*t,380-2*t,60-t/2).fill(),t=40,i.fillStyle="rgb(170, 170, 170)",i.roundRect(36+t,0+t,580-2*t,380-2*t,60-t/2).fill(),t=45,i.lineWidth=3,i.roundRect(36+t,0+t,580-2*t,380-2*t,60-t/2).stroke(),t=50,i.lineWidth=2,i.strokeStyle="rgb(224, 224, 224)",i.roundRect(36+t,0+t,580-2*t,380-2*t,60-t/2).stroke(),t=52;var e=i.createLinearGradient(0,0,580,580);e.addColorStop(0,"rgba(191, 191, 191, 1.000)"),e.addColorStop(.5,"rgba(210, 210, 210, 1.000)"),e.addColorStop(1,"rgba(191, 191, 191, 1.000)"),i.fillStyle=e,i.roundRect(36+t,0+t,580-2*t,380-2*t,60-t/2).fill();var a=new Image;a.src="rightHandle.png",a.onload=function(){i.drawImage(a,616,0+(380-a.height)/2)};var r=new Image;r.src="leftHandle.png",r.onload=function(){i.drawImage(r,0,0+(380-r.height)/2)};var s=new Image;s.src="broken.png",s.onload=function(){i.drawImage(s,110,264)},i.fillStyle="rgb(0, 0, 0)",i.font="bold 60px sans-serif",i.fillText("kWh",423,128),i.fillText("W",423,235),n=new UrsOdometerEx("cv",{height:60,decimals:3,digits:4,wobbleFactor:0,top:70,left:120}),o=new UrsSlidingScaleEx("cv",{height:60,width:300,left:110,top:180}),l=new UrsLCDDisplay("cv",{height:40,width:155,left:254,top:271,align:"center"}),t=11;var c=15,d=n.getWidth()+2*t,h=60+2*t,f=4*n.getDigitWidth()+t+1,g=120-t,u=70-t;i.beginPath(),i.moveTo(g+c,u),i.lineTo(g+f,u),i.lineTo(g+f,u+h),i.arcTo(g,u+h,g,u,c),i.arcTo(g,u,g+c,u,c),i.closePath(),i.fillStyle="#333",i.fill(),i.beginPath(),i.moveTo(g+f,u),i.arcTo(g+d,u,g+d,u+h,c),i.arcTo(g+d,u+h,g+f,u+h,c),i.lineTo(g+f,u+h),i.lineTo(g+f,u),i.closePath(),i.fillStyle="#F00",i.fill(),i.fillStyle="#FFF",i.font="46px sans-serif",i.fillText(",",g+f-7,u+h-6),n.repaint()},this.setConsumtionValueAnimated=function(t){n.setValueAnimated(t,s)},this.setConsumtionValue=function(t){n.setValue(t)},this.setPowerValue=function(t){o.setValue(t)},this.setPowerValueAnimated=function(t){o.setValueAnimated(t,s)},this.setLCDValue=function(t){l.setValue(t)},this.repaint()};