"use strict";var UrsOdometerEx=function(t,e){function o(t,e){var o=document.createElement("canvas");return o.width=t,o.height=e,o}function i(){var t,e;for(z=!0,p.rect(0,0,f,y),(t=p.createLinearGradient(0,0,0,y)).addColorStop(0,"rgba(0, 0, 0, 1)"),t.addColorStop(.1,"rgba(0, 0, 0, 0.4)"),t.addColorStop(.33,"rgba(255, 255, 255, 0.45)"),t.addColorStop(.46,"rgba(255, 255, 255, 0)"),t.addColorStop(.9,"rgba(0, 0, 0, 0.4)"),t.addColorStop(1,"rgba(0, 0, 0, 1)"),p.fillStyle=t,p.fill(),x.rect(0,0,d,1.1*c),x.fillStyle=E,x.fill(),x.strokeStyle="#f0f0f0",x.lineWidth="1px",x.moveTo(0,0),x.lineTo(0,1.1*c),x.stroke(),x.strokeStyle="#202020",x.moveTo(d,0),x.lineTo(d,1.1*c),x.stroke(),x.textAlign="center",x.textBaseline="middle",x.font=s,x.fillStyle=W,e=9;e<21;e++)x.fillText(e%10,.5*d,g*(e-9)+g/2);if(k>0)for(F.rect(0,0,d,1.1*c),F.fillStyle=b,F.fill(),F.strokeStyle="#f0f0f0",F.lineWidth="1px",F.moveTo(0,0),F.lineTo(0,1.1*c),F.stroke(),F.strokeStyle="#202020",F.moveTo(d,0),F.lineTo(d,1.1*c),F.stroke(),F.textAlign="center",F.textBaseline="middle",F.font=s,F.fillStyle=B,e=9;e<21;e++)F.fillText(e%10,.5*d,g*(e-9)+g/2);for(e=0;e<T+k;e++)D[e]=Math.random()*A*y-A*y/2}function r(){var t,e,o,i,r,n=1,l=M;for(t=0;t<k;t++)l*=10;for(i=l-(o=Math.floor(l)),o=String(o),r=9,t=0;t<k+T;t++)e=+o.substring(o.length-t-1,o.length-t)||0,9!==r&&(i=0),t<k?v.drawImage(S,f-d*n,-(g*(e+i)+u+D[t])):v.drawImage(C,f-d*n,-(g*(e+i)+u+D[t])),n++,r=e}var n,l,a,d,s,f,c,g,u,h,v,m,p,C,x,S,F,w=void 0===(e=e||{}).context?null:e.context,y=void 0===e.height?0:e.height,T=void 0===e.digits?6:e.digits,k=void 0===e.decimals?1:e.decimals,b=void 0===e.decimalBackColor?"#F0F0F0":e.decimalBackColor,B=void 0===e.decimalForeColor?"#F01010":e.decimalForeColor,I=void 0===e.font?"sans-serif":e.font,M=void 0===e.value?0:e.value,E=void 0===e.valueBackColor?"#050505":e.valueBackColor,W=void 0===e.valueForeColor?"#F8F8F8":e.valueForeColor,A=void 0===e.wobbleFactor?.07:e.wobbleFactor,V=void 0===e.top?0:e.top,O=void 0===e.left?0:e.left,P=void 0!==e.resize&&e.true,z=!1,D=[],G=!1;l=w||function(t){return("string"==typeof t||t instanceof String?document.getElementById(t):t).getContext("2d")}(t),0===y&&(y=l.canvas.height),M<0&&(M=0),a=Math.floor(.85*y),s="600 "+a+"px "+I,d=Math.floor(.68*y),f=d*(T+k),u=.81*(g=(c=11*a)/12),P&&(l.canvas.width=f,l.canvas.height=y),h=o(f,y),v=h.getContext("2d"),m=o(f,y),p=m.getContext("2d"),C=o(d,1.1*c),x=C.getContext("2d"),S=o(d,1.1*c),F=S.getContext("2d"),this.setValue=function(t){return void 0!==n&&n.isPlaying&&n.stop(),(M=parseFloat(t))<0&&(M=0),this.repaint(),this},this.setValueAnimated=function(t,e){var o=this;return(t=parseFloat(t))<0&&(t=0),M!==t&&(void 0!==n&&n.isPlaying&&n.stop(),(n=new Tween({},"",Tween.regularEaseOut,M,t,e)).onMotionChanged=function(t){M=t.target._pos,G||(G=!0,window.setTimeout(o.repaint,62.5))},n.start()),this.repaint(),this},this.getValue=function(){return M},this.getDigitWidth=function(){return d},this.getWidth=function(){return f},this.getHeight=function(){return y},this.repaint=function(){z||i(),r(),v.drawImage(m,0,0),l.drawImage(h,O,V),G=!1},this.repaint()};