/*!
 * Name          : steelseries.js
 * Authors       : Gerrit Grunwald, Mark Crossley
 * Last modified : 09.05.2012
 * Revision      : 0.11.3
 *
 * Copyright (c) 2011, Gerrit Grunwald, Mark Crossley
 * All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without modification, are permitted
 *  provided that the following conditions are met:
 *
 *  # Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 *  # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
 *    disclaimer in the documentation and/or other materials provided with the distribution.
 *
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 *   BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
 *   SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 *   OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
var steelseries=function(){function f(n,t){var i="#"===n.charAt(0)?n.substring(1,7):n,f=parseInt(i.substring(0,2),16),u=parseInt(i.substring(2,4),16),r=parseInt(i.substring(4,6),16);return this.color="rgba("+f+","+u+","+r+","+t+")",this}function ui(t,i,r,u){var f=1/255,y=t.getRed(),v=t.getGreen(),a=t.getBlue(),b=t.getAlpha(),w=i.getRed()-t.getRed(),p=i.getGreen()-t.getGreen(),s=i.getBlue()-t.getBlue(),o=i.getAlpha()*f-t.getAlpha()*f,e=w/r,l=p/r,c=s/r,h=o/r;return new n((y+e*u).toFixed(0),(v+l*u).toFixed(0),(a+c*u).toFixed(0),b+h*u)}function vr(n,t,i){return{start:n,stop:t,color:i}}function c(n,t){var u=Math.floor(Math.log10(n)),r=n/Math.pow(10,u),i;return i=t?1.5>r?1:3>r?2:7>r?5:10:1<r?2<r?5<r?10:5:2:1,i*Math.pow(10,u)}function s(n,t,i,r,u,f){var e=t+r,o=i+u;n.beginPath(),n.moveTo(t+f,i),n.lineTo(e-f,i),n.quadraticCurveTo(e,i,e,i+f),n.lineTo(e,i+u-f),n.quadraticCurveTo(e,o,e-f,o),n.lineTo(t+f,o),n.quadraticCurveTo(t,o,t,o-f),n.lineTo(t,i+f),n.quadraticCurveTo(t,i,t+f,i),n.closePath(),n.stroke()}function t(n,t){var i=r.createElement("canvas");return i.width=n,i.height=t,i}function ii(n,t,i){var u=r.createElement("canvas");return u.width=n,u.height=t,i(u.getContext("2d")),u}function ft(n){var t,i=ii(1,1,function(t){t.fillStyle=n,t.beginPath(),t.rect(0,0,1,1),t.fill()});return t=i.getContext("2d").getImageData(0,0,2,2).data,[t[0],t[1],t[2],t[3]]}function wt(t){var o,e,f,s,u,r=ft(t),i=new n(r[0],r[1],r[2],r[3]);return o=si(i,.32),e=si(i,.62),f=ti(i,.84),s=ti(i,.94),u=ti(i,1),new b(o,e,i,f,s,u)}function ar(n,t,i){var e,r,f,o,s,u;n/=255,t/=255,i/=255,r=Math.max(n,t,i),e=Math.min(n,t,i),s=(r+e)/2;if(r===e)f=o=0;else{u=r-e,o=s>.5?u/(2-r-e):u/(r+e);switch(r){case n:f=(t-i)/u+(t<i?6:0);break;case t:f=(i-n)/u+2;break;case i:f=(n-t)/u+4}f/=6}return[f,o,s]}function vt(n,t,i){var f,u,r,c=Math.floor(n*6),h=n*6-c,e=i*(1-t),o=i*(1-h*t),s=i*(1-(1-h)*t);switch(c%6){case 0:f=i,u=s,r=e;break;case 1:f=o,u=i,r=e;break;case 2:f=e,u=i,r=s;break;case 3:f=e,u=o,r=i;break;case 4:f=s,u=e,r=i;break;case 5:f=i,u=e,r=o}return[Math.floor(f*255),Math.floor(u*255),Math.floor(r*255)]}function st(n,t,i){var e,r,u,o,s,f;n=n/255,t=t/255,i=i/255,r=Math.max(n,t,i),e=Math.min(n,t,i),s=r,f=r-e,o=r===0?0:f/r;if(r===e)u=0;else{switch(r){case n:u=(t-i)/f+(t<i?6:0);break;case t:u=(i-n)/f+2;break;case i:u=(n-t)/f+4}u/=6}return[u,o,s]}function k(n,t){return n<0?0:n>t?t:n}function si(t,i){var f=Math.floor(t.getRed()*(1-i)),u=Math.floor(t.getGreen()*(1-i)),r=Math.floor(t.getBlue()*(1-i));return f=k(f,255),u=k(u,255),r=k(r,255),new n(f,u,r,t.getAlpha())}function ti(t,i){var f=Math.round(t.getRed()*(1+i)),u=Math.round(t.getGreen()*(1+i)),r=Math.round(t.getBlue()*(1+i));return f=k(f,255),u=k(u,255),r=k(r,255),new n(f,u,r,t.getAlpha())}function or(n,t,i){var r,u;if(i<=t)throw"Rotary bounds are of negative or zero size";return r=i-t,u=Math.floor((n-t)/r),n-u*r}function ni(n,t){return or(t-n,-180,180)}var r=document,tt="LCDMono2Ultra,sans-serif",ei=function(n,i){i=i||{};var ot=undefined===i.gaugeType?steelseries.GaugeType.TYPE4:i.gaugeType,f=undefined===i.size?200:i.size,h=undefined===i.minValue?0:i.minValue,b=undefined===i.maxValue?h+100:i.maxValue,bf=undefined===i.niceScale?!0:i.niceScale,ti=undefined===i.threshold?(b-h)/2:i.threshold,ii=undefined===i.section?null:i.section,ui=undefined===i.area?null:i.area,lu=undefined===i.titleString?"":i.titleString,au=undefined===i.unitString?"":i.unitString,hu=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,wu=undefined===i.frameVisible?!0:i.frameVisible,bt=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,bu=undefined===i.backgroundVisible?!0:i.backgroundVisible,pt=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,ar=undefined===i.pointerColor?steelseries.ColorDef.RED:i.pointerColor,ee=undefined===i.knobType?steelseries.KnobType.STANDARD_KNOB:i.knobType,fi=undefined===i.knobStyle?steelseries.KnobStyle.SILVER:i.knobStyle,ei=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,vr=undefined===i.lcdVisible?!0:i.lcdVisible,eu=undefined===i.lcdDecimals?2:i.lcdDecimals,ye=undefined===i.digitalFont?!1:i.digitalFont,pe=undefined===i.fractionalScaleDecimals?1:i.fractionalScaleDecimals,br=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,ru=undefined===i.ledVisible?!0:i.ledVisible,vf=undefined===i.thresholdVisible?!0:i.thresholdVisible,kr=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,dr=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,cf=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,af=undefined===i.foregroundVisible?!0:i.foregroundVisible,oe=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,yr=undefined===i.playAlarm?!1:i.playAlarm,uf=undefined===i.alarmSound?!1:i.alarmSound,fe=undefined===i.customLayer?null:i.customLayer,le=undefined===i.tickLabelOrientation?ot===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:i.tickLabelOrientation,wr=undefined===i.trendVisible?!1:i.trendVisible,hr=undefined===i.trendColors?[steelseries.LedColor.RED_LED,steelseries.LedColor.GREEN_LED,steelseries.LedColor.CYAN_LED]:i.trendColors,sr=undefined===i.useOdometer?!1:i.useOdometer,wt=undefined===i.odometerParams?{}:i.odometerParams,wf=undefined===i.odometerUseValue?!1:i.odometerUseValue,ki;yr&&uf!==!1&&(ki=r.createElement("audio"),ki.setAttribute("src",uf),ki.setAttribute("preload","auto"));var l=h,or=h,yf=this,ri=b,ni=h,ht=!1,ef=0,we,of=steelseries.TrendState.OFF,lr=f*.06,cr=f*.29,er=f*.36,ci,et,gi,at,lt,rr=et+(l-h)*lt,u=r.getElementById(n).getContext("2d");u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=f,u.canvas.height=f;var s=f,k=f,g=s/2,it=k/2,pf=.6*s,ne=.4*k,pr=Math.floor(s/10),ce=pr+"px sans-serif",ae=pr+"px "+tt,hf=k*.13,bi=s*.4,sf=(s-bi)/2,rf=k*.57,tf,ve=k*.61,st=Math.PI/2,ue=Math.PI/180,ff=!1,ir=h,nr=b,ai=b-h,yt=nr-ir,fr=0,vt=0,oi=10,lf=10,re=function(){bf?(ai=c(b-h,!1),vt=c(ai/(lf-1),!0),ir=Math.floor(h/vt)*vt,nr=Math.ceil(b/vt)*vt,fr=c(vt/(oi-1),!0),h=ir,b=nr,yt=b-h):(ai=b-h,ir=h,nr=b,yt=ai,vt=c(ai/(lf-1),!0),fr=c(vt/(oi-1),!0));switch(ot.type){case"type1":ci=0,et=Math.PI,gi=st,at=st,lt=at/yt;break;case"type2":ci=0,et=Math.PI,gi=st,at=Math.PI,lt=at/yt;break;case"type3":ci=0,et=st,gi=0,at=1.5*Math.PI,lt=at/yt;break;case"type4":default:ci=60*ue,et=st+ci/2,gi=0,at=2*Math.PI-ci,lt=at/yt}rr=et+(l-h)*lt},wi=t(f,f),nf=wi.getContext("2d"),di=t(f,f),ut=di.getContext("2d"),fu,hi=t(f*.093457,f*.093457),uu=hi.getContext("2d"),gt=t(f*.093457,f*.093457),nu=gt.getContext("2d"),si=gt,iu=t(Math.ceil(f*.028037),Math.ceil(f*.028037)),se=iu.getContext("2d"),gr=t(Math.ceil(f*.028037),Math.ceil(f*.028037)),he=gr.getContext("2d"),vi=t(f,f),tu=vi.getContext("2d"),yi=t(f,f),ou=yi.getContext("2d"),pi=t(f,f),kt=pi.getContext("2d"),li=t(f,f),pu=li.getContext("2d"),gu,du,ku,yu,cu,tr,su;sr&&vr&&(tr=t(10,10),su=tr.getContext("2d"));var kf=function(n){u.save(),u.textAlign="right",u.strokeStyle=ei.textColor,u.fillStyle=ei.textColor,(ei===steelseries.LcdColor.STANDARD||ei===steelseries.LcdColor.STANDARD_GREEN)&&(u.shadowColor="gray",u.shadowOffsetX=s*.007,u.shadowOffsetY=s*.007,u.shadowBlur=s*.007),u.font=ye?ae:ce,u.fillText(n.toFixed(eu),sf+bi-bi*.05,rf+hf*.5+pr*.38,bi*.9),u.restore()},te=function(n){n.save(),"type1"===ot.type&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.523364,k*.130841),("type1"===ot.type||"type2"===ot.type)&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.130841,k*.514018),("type2"===ot.type||"type3"===ot.type)&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.831775,k*.514018),"type3"===ot.type&&n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.523364,k*.831775),"type4"===ot.type&&(n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.336448,k*.803738),n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,fi),s*.626168,k*.803738)),n.restore()},ie=function(){var t=r.createElement("canvas"),n,i;return t.width=Math.ceil(f*.046728),t.height=Math.ceil(t.width*.9),n=t.getContext("2d"),n.save(),i=n.createLinearGradient(0,.1,0,t.height*.9),i.addColorStop(0,"#520000"),i.addColorStop(.3,"#fc1d00"),i.addColorStop(.59,"#fc1d00"),i.addColorStop(1,"#520000"),n.fillStyle=i,n.beginPath(),n.moveTo(t.width*.5,.1),n.lineTo(t.width*.9,t.height*.9),n.lineTo(t.width*.1,t.height*.9),n.lineTo(t.width*.5,.1),n.closePath(),n.fill(),n.strokeStyle="#FFFFFF",n.stroke(),n.restore(),t},vu=function(n,t,i,r,u){t<h?t=h:t>b&&(t=b),i<h?i=h:i>b&&(i=b);if(t>=i)return;n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=s*.035;var f=at/yt*t-at/yt*h,e=f+(i-t)/(yt/at);n.translate(g,it),n.rotate(et),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,s*.365-n.lineWidth/2,f,e,!1)):n.arc(0,0,s*.365,f,e,!1),u?(n.moveTo(0,0),n.fill()):n.stroke(),n.translate(-g,-it),n.restore()},df=function(n,t){var y,v,a,c;bt.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",y=Math.ceil(s*.04),n.font=y+"px sans-serif",n.strokeStyle=bt.labelColor.getRgbaColor(),n.fillStyle=bt.labelColor.getRgbaColor(),n.translate(g,it),n.rotate(et);var o=et,i=lt*fr,r,e=h,u=oi-1,l=s*.38,w=s*.35,d=s*.355,k=s*.36,p=s*.3,f=s*.1;for((ot.type==="type1"||ot.type==="type2")&&(f=s*.035),v=oi/2,a=parseFloat(b.toFixed(2)),c=h;parseFloat(c.toFixed(2))<=a;c+=fr){r=i+st,u++;if(u===oi){n.lineWidth=1.5,n.beginPath(),n.moveTo(l,0),n.lineTo(w,0),n.closePath(),n.stroke(),n.save(),n.translate(p,0);switch(le.type){case"horizontal":r=-o;break;case"tangent":r=o<=st+Math.PI?Math.PI:0;break;case"normal":default:r=st}n.rotate(r);switch(t.format){case"fractional":n.fillText(e.toFixed(pe),0,0,f);break;case"scientific":n.fillText(e.toPrecision(2),0,0,f);break;case"standard":default:n.fillText(e.toFixed(0),0,0,f)}n.translate(-p,0),n.restore(),e+=vt,u=0,n.rotate(i),o+=i;continue}0==oi%2&&u===v?(n.lineWidth=1,n.beginPath(),n.moveTo(l,0),n.lineTo(d,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(l,0),n.lineTo(k,0),n.closePath(),n.stroke()),n.rotate(i),o+=i}n.translate(-g,-it),n.restore()},ft=function(n){var t,i,u;n=n||{};var c=undefined===n.frame?!1:n.frame,r=undefined===n.background?!1:n.background,e=undefined===n.led?!1:n.led,tt=undefined===n.pointer?!1:n.pointer,b=undefined===n.foreground?!1:n.foreground,ft=undefined===n.trend?!1:n.trend,ht=undefined===n.odo?!1:n.odo;ff=!0,re(),c&&wu&&v(nf,hu,g,it,s,k),r&&bu&&(w(ut,bt,g,it,s,k),rt(ut,fe,g,it,s,k)),e&&(uu.drawImage(o(Math.ceil(f*.093457),1,br),0,0),nu.drawImage(o(Math.ceil(f*.093457),0,br),0,0)),kr&&se.drawImage(a(Math.ceil(f*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),dr&&he.drawImage(a(Math.ceil(f*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0);if(r&&bu){te(ut);if(null!==ii&&0<ii.length){t=ii.length;do t--,vu(ut,ii[t].start,ii[t].stop,ii[t].color,!1);while(0<t)}if(null!==ui&&0<ui.length){i=ui.length;do i--,vu(ut,ui[i].start,ui[i].stop,ui[i].color,!0);while(0<i)}df(ut,oe),ct(ut,s,k,lu,au,bt,!0,!0)}r&&vf&&(ut.save(),ut.translate(g,it),ut.rotate(et+(ti-h)*lt+st),ut.translate(-g,-it),ut.drawImage(ie(),s*.475,k*.13),ut.translate(g,it),ut.restore()),r&&vr&&(sr&&ht?(cu=new steelseries.Odometer("",{_context:su,height:f*.075,decimals:wt.decimals,digits:wt.digits===undefined?5:wt.digits,valueForeColor:wt.valueForeColor,valueBackColor:wt.valueBackColor,decimalForeColor:wt.decimalForeColor,decimalBackColor:wt.decimalBackColor,font:wt.font,value:l}),tf=(s-tr.width)/2):sr||(fu=p(bi,hf,ei),ut.drawImage(fu,sf,rf))),tt&&(nt(tu,s,pt,ar,bt.labelColor,!1),nt(ou,s,pt,ar,bt.labelColor,!0)),b&&af&&(u=pt.type==="type15"||pt.type==="type16"?!1:!0,y(pu,cf,s,k,u,ee,fi,ot)),ft&&wr&&(gu=d(lr,steelseries.TrendState.UP,hr),du=d(lr,steelseries.TrendState.STEADY,hr),ku=d(lr,steelseries.TrendState.DOWN,hr),yu=d(lr,steelseries.TrendState.OFF,hr))},dt=function(n){n=n||{};var u=undefined===n.frame?!1:n.frame,e=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.pointer?!1:n.pointer,i=undefined===n.foreground?!1:n.foreground;u&&(wi.width=f,wi.height=f,nf=wi.getContext("2d")),e&&(di.width=f,di.height=f,ut=di.getContext("2d")),r&&(hi.width=Math.ceil(f*.093457),hi.height=Math.ceil(f*.093457),uu=hi.getContext("2d"),gt.width=Math.ceil(f*.093457),gt.height=Math.ceil(f*.093457),nu=gt.getContext("2d"),si=gt),t&&(vi.width=f,vi.height=f,tu=vi.getContext("2d"),yi.width=f,yi.height=f,ou=yi.getContext("2d"),pi.width=f,pi.height=f,kt=pi.getContext("2d")),i&&(li.width=f,li.height=f,pu=li.getContext("2d"))},gf=function(){ru&&(si=si===hi?gt:hi,yf.repaint())},ur=function(n){n?ef=setInterval(gf,1e3):clearInterval(ef)};return this.setValue=function(n){var t=n<h?h:n>b?b:n;l!==t&&(l=t,l>ni&&(ni=l),l<ri&&(ri=l),l<ti||ht?l<ti&&(ht=!1,ur(ht),yr&&ki.pause()):(ht=!0,ur(ht),yr&&ki.play()),this.repaint())},this.getValue=function(){return l},this.setOdoValue=function(n){var t=n<0?0:n;or!==t&&(or=t,this.repaint())},this.getOdoValue=function(){return or},this.setValueAnimated=function(n){var r=n<h?h:n>b?b:n,t,i;l!==r&&(undefined!==t&&t.playing&&t.stop(),t=new Tween({},"",Tween.regularEaseInOut,l,r,1),i=this,t.onMotionChanged=function(n){l=n.target._pos,l<ti||ht?l<ti&&(ht=!1,ur(ht)):(ht=!0,ur(ht)),l>ni&&(ni=l),l<ri&&(ri=l),i.repaint()},t.start())},this.resetMinMeasuredValue=function(){ri=l,this.repaint()},this.resetMaxMeasuredValue=function(){ni=l,this.repaint()},this.setMinMeasuredValueVisible=function(n){kr=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){dr=n,this.repaint()},this.setMaxMeasuredValue=function(n){var t=n<h?h:n>b?b:n;ni=t,this.repaint()},this.setMinMeasuredValue=function(n){var t=n<h?h:n>b?b:n;ri=t,this.repaint()},this.setTitleString=function(n){lu=n,ft({background:!0}),this.repaint()},this.setUnitString=function(n){au=n,ft({background:!0}),this.repaint()},this.setMinValue=function(n){h=n,ft({frame:!0,background:!0}),this.repaint()},this.getMinValue=function(){return h},this.setMaxValue=function(n){b=n,ft({frame:!0,background:!0}),this.repaint()},this.getMaxValue=function(){return b},this.setThreshold=function(n){var t=n<h?h:n>b?b:n;ti=t,ft({background:!0}),this.repaint()},this.setArea=function(n){ui=n,dt({foreground:!0}),ft({background:!0,foreground:!0}),this.repaint()},this.setSection=function(n){ii=n,dt({foreground:!0}),ft({background:!0,foreground:!0}),this.repaint()},this.setThresholdVisible=function(n){vf=n,this.repaint()},this.setLcdDecimals=function(n){eu=n,this.repaint()},this.setFrameDesign=function(n){dt({frame:!0}),hu=n,ft({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){dt({background:!0,pointer:pt.type==="type2"||pt.type==="type13"?!0:!1}),bt=n,ft({background:!0,pointer:pt.type==="type2"||pt.type==="type13"?!0:!1}),this.repaint()},this.setForegroundType=function(n){dt({foreground:!0}),cf=n,ft({foreground:!0}),this.repaint()},this.setPointerType=function(n){dt({pointer:!0,foreground:!0}),pt=n,ft({pointer:!0,foreground:!0}),this.repaint()},this.setPointerColor=function(n){dt({pointer:!0}),ar=n,ft({pointer:!0}),this.repaint()},this.setLedColor=function(n){dt({led:!0}),br=n,ft({led:!0}),this.repaint()},this.setLcdColor=function(n){ei=n,ft({background:!0}),this.repaint()},this.setTrend=function(n){of=n,this.repaint()},this.setTrendVisible=function(n){wr=n,this.repaint()},this.repaint=function(){ff||ft({frame:!0,background:!0,led:!0,pointer:!0,trend:!0,foreground:!0,odo:!0}),u.clearRect(0,0,u.canvas.width,u.canvas.height),wu&&u.drawImage(wi,0,0),u.drawImage(di,0,0),vr&&(sr?(cu.setValue(wf?l:or),u.drawImage(tr,tf,ve)):kf(l)),ru&&(l<ti&&(ht=!1,si=gt),u.drawImage(si,pf,ne));if(wr)switch(of.state){case"up":u.drawImage(gu,cr,er);break;case"steady":u.drawImage(du,cr,er);break;case"down":u.drawImage(ku,cr,er);break;case"off":u.drawImage(yu,cr,er)}kr&&(u.save(),u.translate(g,it),u.rotate(et+st+(ri-h)*lt),u.translate(-g,-it),u.drawImage(iu,u.canvas.width*.4865,u.canvas.height*.105),u.restore()),dr&&(u.save(),u.translate(g,it),u.rotate(et+st+(ni-h)*lt),u.translate(-g,-it),u.drawImage(gr,u.canvas.width*.4865,u.canvas.height*.105),u.restore()),rr=et+st+(l-h)*lt;var n=s*.006;kt.clearRect(0,0,s,k),kt.save(),kt.translate(g,it),kt.rotate(rr),kt.translate(-g,-it),kt.drawImage(yi,0,0),kt.restore(),u.drawImage(pi,0,0,s,k,n,n,s+n,k+n),u.save(),u.translate(g,it),u.rotate(rr),u.translate(-g,-it),u.drawImage(vi,0,0),u.restore(),af&&u.drawImage(li,0,0)},this.repaint(),this},wi=function(n,i){var yi;i=i||{};var dt=undefined===i.gaugeType?steelseries.GaugeType.TYPE4:i.gaugeType,s=undefined===i.size?200:i.size,f=undefined===i.minValue?0:i.minValue,h=undefined===i.maxValue?f+100:i.maxValue,cf=undefined===i.niceScale?!0:i.niceScale,fi=undefined===i.threshold?(h-f)/2:i.threshold,bt=undefined===i.section?null:i.section,uu=undefined===i.useSectionColors?!1:i.useSectionColors,su=undefined===i.titleString?"":i.titleString,lu=undefined===i.unitString?"":i.unitString,bu=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,yu=undefined===i.frameVisible?!0:i.frameVisible,ei=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,ou=undefined===i.backgroundVisible?!0:i.backgroundVisible,ur=undefined===i.valueColor?steelseries.ColorDef.RED:i.valueColor,ni=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,au=undefined===i.lcdVisible?!0:i.lcdVisible,of=undefined===i.lcdDecimals?2:i.lcdDecimals,nf=undefined===i.digitalFont?!1:i.digitalFont,tf=undefined===i.fractionalScaleDecimals?1:i.fractionalScaleDecimals,wf=undefined===i.customLayer?null:i.customLayer,sr=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,ku=undefined===i.ledVisible?!0:i.ledVisible,pf=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,fu=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,cu=undefined===i.foregroundVisible?!0:i.foregroundVisible,er=undefined===i.playAlarm?!1:i.playAlarm,eu=undefined===i.alarmSound?!1:i.alarmSound,vi=undefined===i.valueGradient?null:i.valueGradient,bf=undefined===i.useValueGradient?!1:i.useValueGradient,df=undefined===i.tickLabelOrientation?dt===steelseries.GaugeType.TYPE1?steelseries.TickLabelOrientation.TANGENT:steelseries.TickLabelOrientation.NORMAL:i.tickLabelOrientation,ar=undefined===i.trendVisible?!1:i.trendVisible,gi=undefined===i.trendColors?[steelseries.LedColor.RED_LED,steelseries.LedColor.GREEN_LED,steelseries.LedColor.CYAN_LED]:i.trendColors;er&&eu!==!1&&(yi=r.createElement("audio"),yi.setAttribute("src",eu),yi.setAttribute("preload","auto"));var it=f,et=h-f,ot=!1,hu=0,ti,kf=this,ft,b,ui,vt,l,lt,st,ii=[],wi=!1,lr=!1,u=r.getElementById(n).getContext("2d");u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=s,u.canvas.height=s;var e=s,ut=s,k=e/2,g=ut/2,cr=Math.floor(e/10),hf=cr+"px sans-serif",lf=cr+"px "+tt,or=ut*.13,oi=e*.4,du=(e-oi)/2,gu=ut/2-or/2,nt=Math.PI/2,vf=e*.116822,af=e*.485981,pt=Math.ceil(s*.093457),vu=e*.53,wu=ut*.61,kt=Math.PI/180,pu=steelseries.TrendState.OFF,bi=s*.06,ki=s*.38,rr=s*.57;switch(dt.type){case"type1":ft=0,b=Math.PI,ui=0,vt=nt,l=nt,lt=l/Math.PI*180,st=l/et;break;case"type2":ft=0,b=Math.PI,ui=0,vt=nt,l=Math.PI,lt=l/Math.PI*180,st=l/et;break;case"type3":ft=0,b=nt,ui=-nt,vt=0,l=1.5*Math.PI,lt=l/Math.PI*180,st=l/et;break;case"type4":default:ft=Math.PI/3,b=nt+ft/2,ui=Math.PI/-3,vt=0,l=2*Math.PI-ft,lt=l/Math.PI*180,st=l/et}var hi=t(s,s),pr=hi.getContext("2d"),ai=t(s,s),at=ai.getContext("2d"),ru,li=t(Math.ceil(s*.060747),Math.ceil(s*.023364)),hr=li.getContext("2d"),ri=t(pt,pt),tu=ri.getContext("2d"),yt=t(pt,pt),gr=yt.getContext("2d"),gt=yt,yf,si=t(s,s),wr=si.getContext("2d"),br,kr,iu,dr,nu=!1,nr=f,tr=h,ci=h-f;et=tr-nr;var di=0,ht=0,fr=10,vr=10,ef=function(){cf?(ci=c(h-f,!1),ht=c(ci/(vr-1),!0),nr=Math.floor(f/ht)*ht,tr=Math.ceil(h/ht)*ht,di=c(ht/(fr-1),!0),f=nr,h=tr,et=h-f):(ci=h-f,nr=f,tr=h,et=ci,ht=c(ci/(vr-1),!0),di=c(ht/(fr-1),!0));switch(dt.type){case"type1":ft=0,b=Math.PI,vt=nt,l=nt,st=l/et;break;case"type2":ft=0,b=Math.PI,vt=nt,l=Math.PI,st=l/et;break;case"type3":ft=0,b=nt,vt=0,l=1.5*Math.PI,st=l/et;break;case"type4":default:ft=60*kt,b=nt+ft/2,vt=0,l=2*Math.PI-ft,st=l/et}angle=b+(it-f)*st},a=function(n){var t;n=n||{};var c=undefined===n.frame?!1:n.frame,i=undefined===n.background?!1:n.background,u=undefined===n.led?!1:n.led,l=undefined===n.value?!1:n.value,s=undefined===n.foreground?!1:n.foreground,r=undefined===n.trend?!1:n.trend;nu=!0,ef(),c&&yu&&v(pr,bu,k,g,e,ut),i&&ou&&(w(at,ei,k,g,e,ut),rt(at,wf,k,g,e,ut)),u&&(tu.drawImage(o(pt,1,sr),0,0),gr.drawImage(o(pt,0,sr),0,0),yf=at.getImageData(vu,wu,pt,pt)),i&&sf(at),i&&ou&&(uf(at,pf),ct(at,e,ut,su,lu,ei,!0,!0)),i&&au&&(ru=p(oi,or,ni),at.drawImage(ru,du,gu)),wi=!1;if(uu&&null!==bt&&0<bt.length){wi=!0,t=bt.length,ii=[];do t--,ii.push({start:(bt[t].start+Math.abs(f))/(h-f)*lt,stop:(bt[t].stop+Math.abs(f))/(h-f)*lt,color:wt(bt[t].color)});while(0<t)}lr=!1,bf&&vi!==null&&(wi=!1,lr=!0),l&&yr(hr,ur),s&&cu&&y(wr,fu,e,ut,!1,dt),r&&ar&&(br=d(bi,steelseries.TrendState.UP,gi),kr=d(bi,steelseries.TrendState.STEADY,gi),iu=d(bi,steelseries.TrendState.DOWN,gi),dr=d(bi,steelseries.TrendState.OFF,gi))},pi=function(n){n=n||{};var u=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.value?!1:n.value,i=undefined===n.foreground?!1:n.foreground;u&&(hi.width=s,hi.height=s,pr=hi.getContext("2d")),f&&(ai.width=s,ai.height=s,at=ai.getContext("2d")),t&&(li.width=Math.ceil(s*.060747),li.height=Math.ceil(s*.023364),hr=li.getContext("2d")),r&&(ri.width=Math.ceil(s*.093457),ri.height=Math.ceil(s*.093457),tu=ri.getContext("2d"),yt.width=Math.ceil(s*.093457),yt.height=Math.ceil(s*.093457),gr=yt.getContext("2d"),gt=yt),i&&(si.width=s,si.height=s,wr=si.getContext("2d"))},sf=function(n){var t,r,i;n.save(),n.save(),n.lineWidth=s*.085,n.beginPath(),n.translate(k,g),n.rotate(b-4*kt),n.translate(-k,-g),n.arc(k,g,e*.35514,0,l+8*kt,!1),n.rotate(-b),t=n.createLinearGradient(0,.107476*ut,0,.897195*ut),t.addColorStop(0,"#000000"),t.addColorStop(.22,"#333333"),t.addColorStop(.76,"#333333"),t.addColorStop(1,"#cccccc"),n.strokeStyle=t,n.stroke(),n.restore(),n.save(),n.lineWidth=s*.075,n.beginPath(),n.translate(k,g),n.rotate(b-4*kt),n.translate(-k,-g),n.arc(k,g,e*.35514,0,l+8*kt,!1),n.rotate(-b),r=n.createLinearGradient(0,.112149*ut,0,.892523*ut),r.addColorStop(0,"#111111"),r.addColorStop(1,"#333333"),n.strokeStyle=r,n.stroke(),n.restore();var f=(e*.116822+e*.060747)/2,o=(e*.485981+e*.023364)/2,u=n.createRadialGradient(f,o,0,f,o,.030373*e);for(u.addColorStop(0,"#3c3c3c"),u.addColorStop(1,"#323232"),i=0,i=0;i<=lt;i+=5)n.save(),n.translate(k,g),n.rotate(i*kt+ui),n.translate(-k,-g),n.beginPath(),n.rect(e*.116822,e*.485981,e*.060747,e*.023364),n.closePath(),n.fillStyle=u,n.fill(),n.restore();n.restore()},yr=function(n,t){n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath();var r=n.canvas.width/2,f=n.canvas.height/2,i=u.createRadialGradient(r,f,0,r,f,n.canvas.width/2);i.addColorStop(0,t.light.getRgbaColor()),i.addColorStop(1,t.dark.getRgbaColor()),n.fillStyle=i,n.fill(),n.restore()},rf=function(n){u.save(),u.textAlign="right",u.strokeStyle=ni.textColor,u.fillStyle=ni.textColor,(ni===steelseries.LcdColor.STANDARD||ni===steelseries.LcdColor.STANDARD_GREEN)&&(u.shadowColor="gray",u.shadowOffsetX=e*.007,u.shadowOffsetY=e*.007,u.shadowBlur=e*.007),u.font=nf?lf:hf,u.fillText(n.toFixed(of),du+oi-oi*.05,gu+or*.5+cr*.38,oi*.9),u.restore()},uf=function(n,t){var a,v,c;ei.labelColor.setAlpha(1),n.save(),n.textAlign="center",n.textBaseline="middle",a=Math.ceil(e*.04),n.font=a+"px sans-serif",n.strokeStyle=ei.labelColor.getRgbaColor(),n.fillStyle=ei.labelColor.getRgbaColor(),n.translate(k,g),n.rotate(b);var s=b,i=st*di,r,u=f,l=fr-1,y=e*.28,o=e*.1;for((dt.type==="type1"||dt.type==="type2")&&(o=e*.0375),v=parseFloat(h.toFixed(2)),c=f;parseFloat(c.toFixed(2))<=v;c+=di){r=+i+nt,l++;if(l===fr){n.save(),n.translate(y,0);switch(df.type){case"horizontal":r=-s;break;case"tangent":r=s<=nt+Math.PI?Math.PI:0;break;case"normal":default:r=nt}n.rotate(r);switch(t.format){case"fractional":n.fillText(u.toFixed(tf),0,0,o);break;case"scientific":n.fillText(u.toPrecision(2),0,0,o);break;case"standard":default:n.fillText(u.toFixed(0),0,0,o)}n.translate(-y,0),n.restore(),u+=ht,l=0,n.rotate(i),s+=i;continue}n.rotate(i),s+=i}n.translate(-k,-g),n.restore()},ir=function(n){n?hu=setInterval(ff,1e3):clearInterval(hu)},ff=function(){ku&&(gt=gt===ri?yt:ri,kf.repaint())};return this.setValue=function(n){var t=n<f?f:n>h?h:n;it!==t&&(it=t,it<fi||ot?it<fi&&(ot=!1,ir(ot),er&&yi.pause()):(ot=!0,ir(ot),er&&yi.play()),this.repaint())},this.getValue=function(){return it},this.setValueAnimated=function(n){var i=n<f?f:n>h?h:n,t;it!==i&&(undefined!==ti&&ti.playing&&ti.stop(),ti=new Tween({},"",Tween.regularEaseInOut,it,i,1),t=this,ti.onMotionChanged=function(n){it=n.target._pos,it<fi||ot?it<fi&&(ot=!1,ir(ot)):(ot=!0,ir(ot)),t.repaint()},ti.start())},this.setFrameDesign=function(n){pi({frame:!0}),bu=n,a({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){pi({background:!0,led:!0}),ei=n,a({background:!0,led:!0}),this.repaint()},this.setForegroundType=function(n){pi({foreground:!0}),fu=n,a({foreground:!0}),this.repaint()},this.setValueColor=function(n){pi({value:!0}),ur=n,a({value:!0}),this.repaint()},this.setLedColor=function(n){pi({led:!0}),sr=n,a({led:!0}),this.repaint()},this.setLcdColor=function(n){ni=n,a({background:!0}),this.repaint()},this.setSection=function(n){bt=n,a(),this.repaint()},this.setSectionActive=function(n){uu=n,a(),this.repaint()},this.setGradient=function(n){vi=n,a(),this.repaint()},this.setGradientActive=function(n){useGradient=n,a(),this.repaint()},this.setMinValue=function(n){f=n,a({background:!0}),this.repaint()},this.getMinValue=function(){return f},this.setMaxValue=function(n){h=n,a({background:!0}),this.repaint()},this.getMaxValue=function(){return h},this.setThreshold=function(n){var t=n<f?f:n>h?h:n;fi=t,a({background:!0}),this.repaint()},this.setTitleString=function(n){su=n,a({background:!0}),this.repaint()},this.setUnitString=function(n){lu=n,a({background:!0}),this.repaint()},this.setTrend=function(n){pu=n,this.repaint()},this.setTrendVisible=function(n){ar=n,this.repaint()},this.repaint=function(){var o,i,e,n,t;for(nu||a({frame:!0,background:!0,led:!0,value:!0,trend:!0,foreground:!0}),u.clearRect(0,0,u.canvas.width,u.canvas.height),yu&&u.drawImage(hi,0,0),u.drawImage(ai,0,0),o=(it+Math.abs(f))/(h-f)*lt,e=ur,n=0;n<=o;n+=5){i=ur;if(lr){var s=f+n/lt*(h-f),c=vi.getEnd()-vi.getStart(),r=s/c;r=Math.max(Math.min(r,1),0),i=wt(vi.getColorAt(r).getRgbaColor())}else if(wi)for(t=0;t<ii.length;t++)if(n>=ii[t].start&&n<ii[t].stop){i=ii[t].color;break}e.medium.getHexColor()!==i.medium.getHexColor()&&(yr(hr,i),e=i),u.save(),u.translate(k,g),u.rotate(n*kt+ui),u.translate(-k,-g),u.drawImage(li,vf,af),u.restore()}au&&rf(it),ku&&(it<fi&&(ot=!1,gt=yt),u.drawImage(gt,vu,wu));if(ar)switch(pu.state){case"up":u.drawImage(br,ki,rr);break;case"steady":u.drawImage(kr,ki,rr);break;case"down":u.drawImage(iu,ki,rr);break;case"off":u.drawImage(dr,ki,rr)}cu&&u.drawImage(si,0,0)},this.repaint(),this},bi=function(n,i){var hi;i=i||{};var ft=undefined===i.orientation?steelseries.Orientation.NORTH:i.orientation,u=undefined===i.size?200:i.size,l=undefined===i.minValue?0:i.minValue,d=undefined===i.maxValue?l+100:i.maxValue,bu=undefined===i.niceScale?!0:i.niceScale,pt=undefined===i.threshold?(d-l)/2:i.threshold,gt=undefined===i.section?null:i.section,ni=undefined===i.area?null:i.area,gr=undefined===i.titleString?"":i.titleString,uu=undefined===i.unitString?"":i.unitString,iu=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ru=undefined===i.frameVisible?!0:i.frameVisible,it=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,yr=undefined===i.backgroundVisible?!0:i.backgroundVisible,ut=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,tr=undefined===i.pointerColor?steelseries.ColorDef.RED:i.pointerColor,du=undefined===i.knobType?steelseries.KnobType.STANDARD_KNOB:i.knobType,ci=undefined===i.knobStyle?steelseries.KnobStyle.SILVER:i.knobStyle,ki=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,tu=undefined===i.ledVisible?!0:i.ledVisible,vr=undefined===i.thresholdVisible?!0:i.thresholdVisible,gi=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,di=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,wr=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,dr=undefined===i.foregroundVisible?!0:i.foregroundVisible,eu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,nr=undefined===i.playAlarm?!1:i.playAlarm,br=undefined===i.alarmSound?!1:i.alarmSound;nr&&br!==!1&&(hi=r.createElement("audio"),hi.setAttribute("src",br),hi.setAttribute("preload","auto"));var kr=steelseries.GaugeType.TYPE5,wu=this,b=l,vt=d,wt=l,tt=!1,nu=0,dt,ct=Math.PI/2,gu=Math.PI/180,pi=l,wi=d,bi=d-l,at=wi-pi,yi=0,ot=0,oi=10,au=10,lu=0,rt=1.25*Math.PI,vu=1.25*Math.PI,kt=ct,ht=kt/at,pr=!1,ai=rt+(b-l)*ht,f=r.getElementById(n).getContext("2d");f.clearRect(0,0,f.canvas.width,f.canvas.height),f.canvas.width=u,f.canvas.height=u;var h=u,k=u,s=h/2,g=k*.733644,pu=.455*h,yu=.51*k,ku=function(){bu?(bi=c(d-l,!1),ot=c(bi/(au-1),!0),pi=Math.floor(l/ot)*ot,wi=Math.ceil(d/ot)*ot,yi=c(ot/(oi-1),!0),l=pi,d=wi,at=d-l):(bi=d-l,pi=l,wi=d,at=bi,yi=1,ot=10),lu=0,rt=1.25*Math.PI,vu=1.25*Math.PI,kt=ct,ht=kt/at,ai=rt+(b-l)*ht},ui=t(u,u),fr=ui.getContext("2d"),ri=t(u,u),p=ri.getContext("2d"),ii=t(u*.093457,u*.093457),cr=ii.getContext("2d"),st=t(u*.093457,u*.093457),ar=st.getContext("2d"),bt=st,hr=t(Math.ceil(u*.028037),Math.ceil(u*.028037)),or=hr.getContext("2d"),er=t(Math.ceil(u*.028037),Math.ceil(u*.028037)),rr=er.getContext("2d"),fi=t(u,u),sr=fi.getContext("2d"),li=t(u,u),lr=li.getContext("2d"),yt=t(u,u),et=yt.getContext("2d"),si=t(u,u),ir=si.getContext("2d"),cu=function(n){"type5"===kr.type&&(n.save(),ft.type==="west"?(n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,ci),h*.44,k*.8),n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,ci),h*.44,k*.16)):(n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,ci),h*.2-k*.037383,k*.446666),n.drawImage(e(Math.ceil(k*.037383),steelseries.KnobType.STANDARD_KNOB,ci),h*.8,k*.446666)),n.restore())},hu=function(){var t=r.createElement("canvas"),n,i;return t.width=Math.ceil(u*.046728),t.height=Math.ceil(t.width*.9),n=t.getContext("2d"),n.save(),i=n.createLinearGradient(0,.1,0,t.height*.9),i.addColorStop(0,"#520000"),i.addColorStop(.3,"#fc1d00"),i.addColorStop(.59,"#fc1d00"),i.addColorStop(1,"#520000"),n.fillStyle=i,n.beginPath(),n.moveTo(t.width*.5,.1),n.lineTo(t.width*.9,t.height*.9),n.lineTo(t.width*.1,t.height*.9),n.lineTo(t.width*.5,.1),n.closePath(),n.fill(),n.strokeStyle="#FFFFFF",n.stroke(),n.restore(),t},ur=function(n,t,i,r,u){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=h*.035;var f=kt/at*t-kt/at*l,e=f+(i-t)/(at/kt);n.translate(s,g),n.rotate(rt),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,h*.365-n.lineWidth/2,f,e,!1)):n.arc(0,0,h*.365,f,e,!1),u?(n.moveTo(0,0),n.fill()):n.stroke(),n.translate(-s,-g),n.restore()},ou=function(n){var r,i,t;n.save(),n.textAlign="left",n.textBaseline="middle",n.strokeStyle=it.labelColor.getRgbaColor(),n.fillStyle=it.labelColor.getRgbaColor(),r=h,ei||vertical||(r=k),n.font=.046728*h+"px sans-serif",i=n.measureText(gr).width,n.fillText(gr,(h-i)/2,k*.4,h*.3),t=n.measureText(uu).width,n.fillText(uu,(h-t)/2,k*.47,h*.2),n.restore()},su=function(n,t){var a;it.labelColor.setAlpha(1),n.save(),steelseries.Orientation.WEST===ft&&(n.translate(s,s),n.rotate(-Math.PI/2),n.translate(-s,-s)),n.textAlign="center",n.textBaseline="middle",a=Math.ceil(h*.04),n.font=a+"px sans-serif",n.strokeStyle=it.labelColor.getRgbaColor(),n.fillStyle=it.labelColor.getRgbaColor(),n.translate(s,g),n.rotate(rt);for(var o=ht*yi,v,i=l,r=oi-1,e=h*.44,k=h*.41,b=h*.415,p=h*.42,c=h*.48,u=h*.0375,w=oi/2,y=parseFloat(d.toFixed(2)),f=l;parseFloat(f.toFixed(2))<=y;f+=yi){v=+o+ct,r++;if(r===oi){n.lineWidth=1.5,n.beginPath(),n.moveTo(e,0),n.lineTo(k,0),n.closePath(),n.stroke(),n.save(),n.translate(c,0),n.rotate(v);switch(t.format){case"fractional":n.fillText(i.toFixed(2),0,0,u);break;case"scientific":n.fillText(i.toPrecision(2),0,0,u);break;case"standard":default:n.fillText(i.toFixed(0),0,0,u)}n.translate(-c,0),n.restore(),i+=ot,r=0,n.rotate(o);continue}0==oi%2&&r===w?(n.lineWidth=1,n.beginPath(),n.moveTo(e,0),n.lineTo(b,0),n.closePath(),n.stroke()):(n.lineWidth=.5,n.beginPath(),n.moveTo(e,0),n.lineTo(p,0),n.closePath(),n.stroke()),n.rotate(o)}n.translate(-s,-g),n.restore()},lt=function(n){var t,i,r;n=n||{};var e=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,d=undefined===n.led?!1:n.led,c=undefined===n.pointer?!1:n.pointer,b=undefined===n.foreground?!1:n.foreground;pr=!0,ku(),e&&ru&&v(fr,iu,s,u/2,h,k),f&&yr&&w(p,it,s,u/2,h,k),d&&(cr.drawImage(o(Math.ceil(u*.093457),1,ki),0,0),ar.drawImage(o(Math.ceil(u*.093457),0,ki),0,0)),gi&&(or.drawImage(a(Math.ceil(u*.028037),steelseries.ColorDef.BLUE.dark.getRgbaColor(),!0,!0),0,0),or.restore()),di&&(rr.drawImage(a(Math.ceil(u*.028037),steelseries.ColorDef.RED.medium.getRgbaColor(),!0),0,0),rr.restore());if(f&&yr){cu(p);if(null!==gt&&0<gt.length){p.save(),steelseries.Orientation.WEST===ft&&(p.translate(s,s),p.rotate(-Math.PI/2),p.translate(-s,-s)),t=gt.length;do t--,ur(p,gt[t].start,gt[t].stop,gt[t].color,!1);while(0<t);p.restore()}if(null!==ni&&0<ni.length){steelseries.Orientation.WEST===ft&&(p.translate(s,s),p.rotate(-Math.PI/2),p.translate(-s,-s)),i=ni.length;do i--,ur(p,ni[i].start,ni[i].stop,ni[i].color,!0);while(0<i);p.restore()}su(p,eu),ou(p)}vr&&(p.save(),steelseries.Orientation.WEST===ft&&(p.translate(s,s),p.rotate(-Math.PI/2),p.translate(-s,-s)),p.translate(s,g),p.rotate(rt+(pt-l)*ht+ct),p.translate(-s,-g),p.drawImage(hu(),h*.475,k*.32),p.restore()),c&&(nt(sr,h*1.17,ut,tr,it.labelColor,!1),nt(lr,h*1.17,ut,tr,it.labelColor,!0)),b&&dr&&(r=ut.type==="type15"||ut.type==="type16"?!1:!0,y(ir,wr,h,k,r,du,ci,kr,ft))},ti=function(n){n=n||{};var f=undefined===n.frame?!1:n.frame,e=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.pointer?!1:n.pointer,i=undefined===n.foreground?!1:n.foreground;f&&(ui.width=u,ui.height=u,fr=ui.getContext("2d")),e&&(ri.width=u,ri.height=u,p=ri.getContext("2d")),r&&(ii.width=Math.ceil(u*.093457),ii.height=Math.ceil(u*.093457),cr=ii.getContext("2d"),st.width=Math.ceil(u*.093457),st.height=Math.ceil(u*.093457),ar=st.getContext("2d"),bt=st),t&&(fi.width=u,fi.height=u,sr=fi.getContext("2d"),li.width=u,li.height=u,lr=li.getContext("2d"),yt.width=u,yt.height=u,et=yt.getContext("2d")),i&&(si.width=u,si.height=u,ir=si.getContext("2d"))},vi=function(n){n?nu=setInterval(fu,1e3):clearInterval(nu)},fu=function(){tu&&(bt=bt===ii?st:ii,wu.repaint())};return this.setValue=function(n){var t=n<l?l:n>d?d:n;b!==t&&(b=t,b>wt&&(wt=b),b<vt&&(vt=b),b<pt||tt?b<pt&&(tt=!1,vi(tt),nr&&hi.pause()):(tt=!0,vi(tt),nr&&hi.play()),this.repaint())},this.getValue=function(){return b},this.setValueAnimated=function(n){var i=n<l?l:n>d?d:n,t;b!==i&&(undefined!==dt&&dt.playing&&dt.stop(),dt=new Tween({},"",Tween.regularEaseInOut,b,i,1),t=this,dt.onMotionChanged=function(n){b=n.target._pos,b<pt||tt?b<pt&&(tt=!1,vi(tt)):(tt=!0,vi(tt)),b>wt&&(wt=b),b<vt&&(vt=b),t.repaint()},dt.start())},this.resetMinMeasuredValue=function(){vt=b,this.repaint()},this.resetMaxMeasuredValue=function(){wt=b,this.repaint()},this.setMinMeasuredValueVisible=function(n){gi=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){di=n,this.repaint()},this.setThresholdVisible=function(n){vr=n,this.repaint()},this.setFrameDesign=function(n){ti({frame:!0}),iu=n,lt({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){ti({background:!0,pointer:ut.type==="type2"||ut.type==="type13"?!0:!1}),it=n,lt({background:!0,pointer:ut.type==="type2"||ut.type==="type13"?!0:!1}),this.repaint()},this.setForegroundType=function(n){ti({foreground:!0}),wr=n,lt({foreground:!0}),this.repaint()},this.setPointerType=function(n){ti({pointer:!0,foreground:!0}),ut=n,lt({pointer:!0,foreground:!0}),this.repaint()},this.setPointerColor=function(n){ti({pointer:!0}),tr=n,lt({pointer:!0}),this.repaint()},this.setLedColor=function(n){ti({led:!0}),ki=n,lt({led:!0}),this.repaint()},this.repaint=function(){pr||lt({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0}),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.save(),ru&&f.drawImage(ui,0,0),f.drawImage(ri,0,0),tu&&(b<pt&&(tt=!1,bt=st),f.drawImage(bt,pu,yu)),steelseries.Orientation.WEST===ft&&(f.translate(s,s),f.rotate(-Math.PI/2),f.translate(-s,-s)),gi&&(f.save(),f.translate(s,g),f.rotate(rt+ct+(vt-l)*ht),f.translate(-s,-g),f.drawImage(hr,f.canvas.width*.4865,f.canvas.height*.27),f.restore()),di&&(f.save(),f.translate(s,g),f.rotate(rt+ct+(wt-l)*ht),f.translate(-s,-g),f.drawImage(er,f.canvas.width*.4865,f.canvas.height*.27),f.restore()),ai=rt+ct+(b-l)*ht;var n=h*.006,t=h*1.17/2;et.clearRect(0,0,h,k),et.save(),et.translate(s,g),et.rotate(ai),et.translate(-t,-t),et.drawImage(li,0,0),et.restore(),steelseries.Orientation.NORTH===ft?f.drawImage(yt,0,0,h,k,n,n,h+n,k+n):f.drawImage(yt,0,0,h,k,-n,n,h-n,k+n),f.save(),f.translate(s,g),f.rotate(ai),f.translate(-t,-t),f.drawImage(fi,0,0),f.restore(),dr&&(f.save(),steelseries.Orientation.WEST===ft&&(f.translate(s,s),f.rotate(Math.PI/2),f.translate(-s,-s)),f.drawImage(si,0,0),f.restore()),f.restore()},this.repaint(),this},yi=function(n,i){var fi;i=i||{};var l=undefined===i.gaugeType?steelseries.GaugeType.TYPE1:i.gaugeType,b=undefined===i.width?140:i.width,d=undefined===i.height?320:i.height,e=undefined===i.minValue?0:i.minValue,s=undefined===i.maxValue?e+100:i.maxValue,gr=undefined===i.niceScale?!0:i.niceScale,bt=undefined===i.threshold?(s-e)/2:i.threshold,gi=undefined===i.titleString?"":i.titleString,wi=undefined===i.unitString?"":i.unitString,sr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,or=undefined===i.frameVisible?!0:i.frameVisible,w=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,lr=undefined===i.backgroundVisible?!0:i.backgroundVisible,wt=undefined===i.valueColor?steelseries.ColorDef.RED:i.valueColor,lt=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,hi=undefined===i.lcdVisible?!0:i.lcdVisible,fr=undefined===i.lcdDecimals?2:i.lcdDecimals,eu=undefined===i.digitalFont?!1:i.digitalFont,ti=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,er=undefined===i.ledVisible?!0:i.ledVisible,ar=undefined===i.thresholdVisible?!0:i.thresholdVisible,tr=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,di=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,fu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,kr=undefined===i.foregroundVisible?!0:i.foregroundVisible,ki=undefined===i.playAlarm?!1:i.playAlarm,vr=undefined===i.alarmSound?!1:i.alarmSound;ki&&vr!==!1&&(fi=r.createElement("audio"),fi.setAttribute("src",vr),fi.setAttribute("preload","auto"));var hu=this,v=e,at=s,ft=e;l.type!=="type1"&&l.type!=="type2"&&(l=steelseries.GaugeType.TYPE1);var yt,vt=!1,br=0,y=r.getElementById(n).getContext("2d");y.clearRect(0,0,y.canvas.width,y.canvas.height),y.canvas.width=b,y.canvas.height=d;var f=b,u=d,h=b<=d,bi,rr,it=Math.round((h?d:b)*.05),nt=Math.round((h?b:d)*.05),ir,nr;h?(bi=f/2-it/2,rr=(l.type==="type1"?.053:.038)*u,ir=Math.floor(u/22)+"px sans-serif",nr=Math.floor(u/22)+"px "+tt):(bi=.89*f,rr=u/2-it/2,ir=Math.floor(u/10)+"px sans-serif",nr=Math.floor(u/10)+"px "+tt);var pr=!1,ci=e,si=s,ei=s-e,yr=si-ci,oi=0,ut=0,ui=10,uu=10,ru=function(){gr?(ei=c(s-e,!1),ut=c(ei/(uu-1),!0),ci=Math.floor(e/ut)*ut,si=Math.ceil(s/ut)*ut,oi=c(ut/(ui-1),!0),e=ci,s=si,yr=s-e):(ei=s-e,ci=e,si=s,yr=ei,oi=1,ut=10)},ii=t(b,d),wr=ii.getContext("2d"),ri=t(b,d),k=ri.getContext("2d"),li,kt=t(it,it),vi=kt.getContext("2d"),rt=t(it,it),yi=rt.getContext("2d"),pt=rt,gt=t(nt,nt),cr=gt.getContext("2d"),dt=t(nt,nt),hr=dt.getContext("2d"),ni=t(b,d),pi=ni.getContext("2d"),cu=function(n,t,i){n.save(),n.textAlign="right",n.textBaseline="middle",n.strokeStyle=lt.textColor,n.fillStyle=lt.textColor,(lt===steelseries.LcdColor.STANDARD||lt===steelseries.LcdColor.STANDARD_GREEN)&&(n.shadowColor="gray",i?(n.shadowOffsetX=u*.003,n.shadowOffsetY=u*.003,n.shadowBlur=u*.004):(n.shadowOffsetX=u*.007,n.shadowOffsetY=u*.007,n.shadowBlur=u*.009));var o,e,r;n.font=eu?nr:ir,i?(o=(f-f*.571428)/2+f*.571428-2,e=u*.88+1+(u*.055-2)/2,r=f*.7-2):(o=f*.695+f*.18-2,e=u*.22+1+(u*.15-2)/2,r=u*.22-2),n.fillText(t.toFixed(fr),o,e,r),n.restore()},ou=function(n){var i=r.createElement("canvas"),t,u;return i.height=i.width=nt,t=i.getContext("2d"),t.save(),u=t.createLinearGradient(0,.1,0,i.height*.9),u.addColorStop(0,"#520000"),u.addColorStop(.3,"#fc1d00"),u.addColorStop(.59,"#fc1d00"),u.addColorStop(1,"#520000"),t.fillStyle=u,n?(t.beginPath(),t.moveTo(.1,i.height*.5),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.9,i.height*.9),t.closePath()):(t.beginPath(),t.moveTo(.1,.1),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.5,i.height*.9),t.closePath()),t.fill(),t.strokeStyle="#FFFFFF",t.stroke(),t.restore(),i},su=function(n,t,i){var o,k;w.labelColor.setAlpha(1),n.save(),n.textBaseline="middle",o=f*.1,n.strokeStyle=w.labelColor.getRgbaColor(),n.fillStyle=w.labelColor.getRgbaColor();var r=e,y=ui-1,h,nt,v,c,a=1,g,it,tt,b,p,d;for(i?(g=.34*f,it=.36*f,tt=.33*f,b=.36*f,p=.32*f,d=.36*f,n.textAlign="right",h=0,nt=u*.12864,v=0,c=l.type==="type1"?u*.856796-u*.12864:u*.7475-u*.12864,a=c/(s-e)):(g=.65*u,it=.63*u,tt=.66*u,b=.63*u,p=.67*u,d=.63*u,n.textAlign="center",nt=0,l.type==="type1"?(h=f*.142857,v=f*.871012-h):(h=f*.19857,v=f*.82-h),c=0,a=v/(s-e)),k=e,tickCounter=0;k<=s;k+=oi,tickCounter+=oi){currentPos=i?nt+c-tickCounter*a:h+tickCounter*a,y++;if(y===ui){n.lineWidth=1.5,ai(n,p,d,currentPos,i);if(i)switch(t.format){case"fractional":n.fillText(r.toFixed(2),f*.28,currentPos,o);break;case"scientific":n.fillText(r.toPrecision(2),f*.28,currentPos,o);break;case"standard":default:n.fillText(r.toFixed(0),f*.28,currentPos,o)}else switch(t.format){case"fractional":n.fillText(r.toFixed(2),currentPos,u*.73,o);break;case"scientific":n.fillText(r.toPrecision(2),currentPos,u*.73,o);break;case"standard":default:n.fillText(r.toFixed(0),currentPos,u*.73,o)}r+=ut,y=0;continue}0==ui%2&&y===ui/2?(n.lineWidth=1,ai(n,tt,b,currentPos,i)):(n.lineWidth=.5,ai(n,g,it,currentPos,i))}n.restore()},ai=function(n,t,i,r,u){u?(n.beginPath(),n.moveTo(t,r),n.lineTo(i,r),n.closePath(),n.stroke()):(n.beginPath(),n.moveTo(r,t),n.lineTo(r,i),n.closePath(),n.stroke())},g=function(n){n=n||{};var b=undefined===n.frame?!1:n.frame,t=undefined===n.background?!1:n.background,y=undefined===n.led?!1:n.led,v=undefined===n.foreground?!1:n.foreground,i,r,c;pr=!0,ru(),b&&or&&ht(wr,sr,f,u,h),t&&lr&&ot(k,w,f,u,h),t&&l.type==="type2"&&dr(k),y&&(h?(vi.drawImage(o(it,1,ti),0,0),yi.drawImage(o(it,0,ti),0,0)):(vi.drawImage(o(it,1,ti),0,0),yi.drawImage(o(it,0,ti),0,0))),tr&&(h?cr.drawImage(a(nt,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,h),0,0):cr.drawImage(a(nt,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,h),0,0)),di&&(h?hr.drawImage(a(nt,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,h),0,0):hr.drawImage(a(nt,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,h),0,0)),t&&lr&&(su(k,fu,h),h?ct(k,f,u,gi,wi,w,h,null,hi,l):ct(k,f,u,gi,wi,w,h,null,hi,l)),t&&ar&&(k.save(),h?(i=l.type==="type1"?.856796:.7475,r=i-.12864,c=u*i-u*r*(bt/(s-e)),k.translate(f*.365,c-nt/2)):(i=l.type==="type1"?.871012:.82,r=i-(l.type==="type1"?.142857:.19857),c=f*r*bt/(s-e),k.translate(f*(l.type==="type1"?.142857:.19857)-nt/2+c,u*.58)),k.drawImage(ou(h),0,0),k.restore()),t&&hi&&(h?(li=p(f*.571428,u*.055,lt),k.drawImage(li,(f-f*.571428)/2,u*.88)):(li=p(f*.18,u*.15,lt),k.drawImage(li,f*.695,u*.22))),v&&l.type==="type2"&&nu(pi),v&&kr&&et(pi,f,u,h,!1)},st=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.led?!1:n.led,i=undefined===n.foreground?!1:n.foreground;r&&(ii.width=b,ii.height=d,wr=ii.getContext("2d")),u&&(ri.width=b,ri.height=d,k=ri.getContext("2d")),t&&(kt.width=Math.ceil(b*.093457),kt.height=Math.ceil(d*.093457),vi=kt.getContext("2d"),rt.width=Math.ceil(b*.093457),rt.height=Math.ceil(d*.093457),yi=rt.getContext("2d"),pt=rt),i&&(ni.width=b,ni.height=d,pi=ni.getContext("2d"))},ur=function(n){n?br=setInterval(iu,1e3):clearInterval(br)},iu=function(){er&&(pt=pt===kt?rt:kt,hu.repaint())},tu=function(n,t,i){var u,o,r=w.labelColor,f,y,nt,c,a,tt,g,ct,ht,st,lt,yt,pt,at,vt,it,k,et,ft,d,p,b,ut,rt,ot;h?(u=i*.12864,o=l.type==="type1"?i*.856796:i*.7475,f=o-u,y=f*(v-e)/(s-e),nt=o-y,ct=0,ht=u,st=0,lt=o):(l.type==="type1"?(u=t*.871012,o=t*.142857):(u=t*.82,o=t*.19857),f=u-o,y=f*(v-e)/(s-e),nt=o,ct=u,ht=0,st=o,lt=0),l.type==="type1"&&(d=w===steelseries.BackgroundColor.CARBON||w===steelseries.BackgroundColor.PUNCHED_SHEET||w===steelseries.BackgroundColor.STAINLESS||w===steelseries.BackgroundColor.BRUSHED_STAINLESS||w===steelseries.BackgroundColor.TURNED?.3:0,p=n.createLinearGradient(ct,ht,st,lt),r.setAlpha(.05+d),p.addColorStop(0,r.getRgbaColor()),r.setAlpha(.15+d),p.addColorStop(.48,r.getRgbaColor()),r.setAlpha(.15+d),p.addColorStop(.49,r.getRgbaColor()),r.setAlpha(.05+d),p.addColorStop(1,r.getRgbaColor()),n.fillStyle=p,h?n.fillRect(t*.435714,u,t*.142857,f):n.fillRect(t*.142857,i*.435714,f,i*.142857),h?(yt=0,pt=u,at=0,vt=u+f):(yt=t*.142857+f,pt=0,at=t*.142857,vt=0),b=n.createLinearGradient(yt,pt,at,vt),r.setAlpha(.3+d),b.addColorStop(0,r.getRgbaColor()),r.setAlpha(.69),b.addColorStop(.48,r.getRgbaColor()),r.setAlpha(.7),b.addColorStop(.49,r.getRgbaColor()),r.setAlpha(.4),b.addColorStop(1,r.getRgbaColor()),n.fillStyle=b,h?(n.fillRect(t*.435714,u,t*.007142,f),n.fillRect(t*.571428,u,t*.007142,f)):(n.fillRect(t*.142857,i*.435714,f,i*.007142),n.fillRect(t*.142857,i*.571428,f,i*.007142))),h?l.type==="type1"?(c=t*.45,a=0,tt=t*.45+t*.114285,g=0):(c=t/2-i*.0486/2,a=0,tt=c+i*.053,g=0):l.type==="type1"?(c=0,a=i*.45,tt=0,g=i*.45+i*.114285):(c=0,a=i/2-t*.025,tt=0,g=a+t*.053),ut=n.createLinearGradient(c,a,tt,g),ut.addColorStop(0,wt.medium.getRgbaColor()),ut.addColorStop(1,wt.light.getRgbaColor()),n.fillStyle=ut,rt=l.type==="type1"?0:h?i*.05:t*.05,h?n.fillRect(c,nt,tt-c,y+rt):n.fillRect(nt-rt,a,y+rt,g-a),l.type==="type1"&&(h?(it=t*.45,k=0,et=it+t*.05,ft=0):(it=0,k=i*.45,et=0,ft=k+i*.05),ot=n.createLinearGradient(it,k,et,ft),ot.addColorStop(0,"rgba(255, 255, 255, 0.7)"),ot.addColorStop(.98,"rgba(255, 255, 255, 0.0)"),n.fillStyle=ot,h?n.fillRect(it,nt,et,y):n.fillRect(nt,k,y,ft-k))},nu=function(n){var t=h?u:f,i;n.save(),h?n.translate(f/2,0):(n.translate(f/2,u/2),n.rotate(Math.PI*.5),n.translate(0,-f/2+f*.05)),n.beginPath(),n.moveTo(-.049*t,.825*t),n.bezierCurveTo(-.049*t,.7975*t,-.0264*t,.775*t,.0013*t,.775*t),n.bezierCurveTo(.0264*t,.775*t,.049*t,.7975*t,.049*t,.825*t),n.bezierCurveTo(.049*t,.85*t,.0264*t,.8725*t,.0013*t,.8725*t),n.bezierCurveTo(-.0264*t,.8725*t,-.049*t,.85*t,-.049*t,.825*t),n.closePath(),i=n.createRadialGradient(0*t,.825*t,0,0*t,.825*t,.049*t),i.addColorStop(0,wt.medium.getRgbaColor()),i.addColorStop(.3,wt.medium.getRgbaColor()),i.addColorStop(1,wt.light.getRgbaColor()),n.fillStyle=i,n.fill(),n.beginPath(),h?(n.moveTo(-.0365*t,.8075*t),n.bezierCurveTo(-.0365*t,.7925*t,-.0214*t,.7875*t,-.0214*t,.7825*t),n.bezierCurveTo(.0189*t,.785*t,.0365*t,.7925*t,.0365*t,.8075*t),n.bezierCurveTo(.0365*t,.8175*t,.0214*t,.815*t,.0013*t,.8125*t),n.bezierCurveTo(-.0189*t,.8125*t,-.0365*t,.8175*t,-.0365*t,.8075*t),i=n.createRadialGradient(0,.8*t,0,0,.8*t,.0377*t)):(n.beginPath(),n.moveTo(-.0214*t,.86*t),n.bezierCurveTo(-.0365*t,.86*t,-.0415*t,.845*t,-.0465*t,.825*t),n.bezierCurveTo(-.0465*t,.805*t,-.0365*t,.7875*t,-.0214*t,.7875*t),n.bezierCurveTo(-.0113*t,.7875*t,-.0163*t,.8025*t,-.0163*t,.8225*t),n.bezierCurveTo(-.0163*t,.8425*t,-.0113*t,.86*t,-.0214*t,.86*t),i=n.createRadialGradient(-.03*t,.8225*t,0,-.03*t,.8225*t,.0377*t)),i.addColorStop(0,"rgba(255, 255, 255, 0.55)"),i.addColorStop(1,"rgba(255, 255, 255, 0.05)"),n.fillStyle=i,n.closePath(),n.fill(),n.beginPath(),n.moveTo(-.0214*t,.115*t),n.bezierCurveTo(-.0214*t,.1075*t,-.0163*t,.1025*t,-.0113*t,.1025*t),n.bezierCurveTo(-.0113*t,.1025*t,-.0113*t,.1025*t,-.0113*t,.1025*t),n.bezierCurveTo(-.0038*t,.1025*t,.0013*t,.1075*t,.0013*t,.115*t),n.bezierCurveTo(.0013*t,.115*t,.0013*t,.76*t,.0013*t,.76*t),n.bezierCurveTo(.0013*t,.7675*t,-.0038*t,.7725*t,-.0113*t,.7725*t),n.bezierCurveTo(-.0113*t,.7725*t,-.0113*t,.7725*t,-.0113*t,.7725*t),n.bezierCurveTo(-.0163*t,.7725*t,-.0214*t,.7675*t,-.0214*t,.76*t),n.bezierCurveTo(-.0214*t,.76*t,-.0214*t,.115*t,-.0214*t,.115*t),n.closePath(),i=n.createLinearGradient(-.0189*t,0,.0013*t,0),i.addColorStop(0,"rgba(255, 255, 255, 0.1)"),i.addColorStop(.34,"rgba(255, 255, 255, 0.5)"),i.addColorStop(1,"rgba(255, 255, 255, 0.1)"),n.fillStyle=i,n.fill(),n.restore()},dr=function(n){var t=h?u:f,i;n.save(),h?n.translate(f/2,0):(n.translate(f/2,u/2),n.rotate(Math.PI*.5),n.translate(0,-f/2+f*.05)),n.beginPath(),n.moveTo(-.0516*t,.825*t),n.bezierCurveTo(-.0516*t,.8525*t,-.0289*t,.875*t,.0013*t,.875*t),n.bezierCurveTo(.0289*t,.875*t,.0516*t,.8525*t,.0516*t,.825*t),n.bezierCurveTo(.0516*t,.8075*t,.044*t,.7925*t,.0314*t,.7825*t),n.bezierCurveTo(.0314*t,.7825*t,.0314*t,.12*t,.0314*t,.12*t),n.bezierCurveTo(.0314*t,.1025*t,.0189*t,.0875*t,.0013*t,.0875*t),n.bezierCurveTo(-.0163*t,.0875*t,-.0289*t,.1025*t,-.0289*t,.12*t),n.bezierCurveTo(-.0289*t,.12*t,-.0289*t,.7825*t,-.0289*t,.7825*t),n.bezierCurveTo(-.0415*t,.79*t,-.0516*t,.805*t,-.0516*t,.825*t),n.closePath(),i=n.createLinearGradient(-.0163*t,0,.0289*t,0),i.addColorStop(0,"rgba(226, 226, 226, 0.5)"),i.addColorStop(.5,"rgba(226, 226, 226, 0.2)"),i.addColorStop(1,"rgba(226, 226, 226, 0.5)"),n.fillStyle=i,n.fill(),n.lineWidth=1,n.strokeStyle="rgba(153, 153, 153, 0.5)",n.stroke(),n.restore()};return this.setValue=function(n){var t=n<e?e:n>s?s:n;v!==t&&(v=t,v>ft&&(ft=v),v<at&&(at=v),v<bt||vt?v<bt&&(vt=!1,ur(vt),ki&&fi.pause()):(vt=!0,ur(vt),ki&&fi.play()),this.repaint())},this.getValue=function(){return v},this.setValueAnimated=function(n){var i=n<e?e:n>s?s:n,t;v!==i&&(undefined!==yt&&yt.playing&&yt.stop(),yt=new Tween({},"",Tween.regularEaseInOut,v,i,1),t=this,yt.onMotionChanged=function(n){t.setValue(n.target._pos)},yt.start())},this.resetMinMeasuredValue=function(){at=v,this.repaint()},this.resetMaxMeasuredValue=function(){ft=v,this.repaint()},this.setMinMeasuredValueVisible=function(n){tr=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){di=n,this.repaint()},this.setThresholdVisible=function(n){ar=n,this.repaint()},this.setLcdDecimals=function(n){fr=n,this.repaint()},this.setFrameDesign=function(n){st({frame:!0}),sr=n,g({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){st({background:!0}),w=n,g({background:!0}),this.repaint()},this.setValueColor=function(n){st({foreground:!0}),wt=n,g({foreground:!0}),this.repaint()},this.setLedColor=function(n){st({led:!0}),ti=n,g({led:!0}),this.repaint()},this.setLcdColor=function(n){st({background:!0}),lt=n,g({background:!0}),this.repaint()},this.setMaxMeasuredValue=function(n){var t=n<e?e:n>s?s:n;ft=t,this.repaint()},this.setMinMeasuredValue=function(n){var t=n<e?e:n>s?s:n;at=t,this.repaint()},this.setTitleString=function(n){gi=n,g({background:!0}),this.repaint()},this.setUnitString=function(n){wi=n,g({background:!0}),this.repaint()},this.setMinValue=function(n){st({background:!0}),e=n,mminMeasuredValue<e&&(at=e),v<e&&(v=e),g({background:!0}),this.repaint()},this.getMinValue=function(){return e},this.setMaxValue=function(n){st({background:!0}),s=n,ft>s&&(ft=s),v>s&&(v=s),g({background:!0}),this.repaint()},this.getMaxValue=function(){return s},this.setThreshold=function(n){var t=n<e?e:n>s?s:n;bt=t,g({background:!0}),this.repaint()},this.repaint=function(){pr||g({frame:!0,background:!0,led:!0,foreground:!0}),y.clearRect(0,0,y.canvas.width,y.canvas.height),or&&y.drawImage(ii,0,0),y.drawImage(ri,0,0),hi&&cu(y,v,h),er&&(v<bt&&(vt=!1,pt=rt),y.drawImage(pt,bi,rr));var t,n,i,o,r;tr&&(h?(n=l.type==="type1"?.856796:.7475,i=n-.12864,t=u*n-u*i*(at/(s-e)),o=f*.34-gt.width,r=t-gt.height/2):(n=l.type==="type1"?.871012:.82,i=n-(l.type==="type1"?.142857:.19857),t=f*i*at/(s-e),o=f*(l.type==="type1"?.142857:.19857)-gt.height/2+t,r=u*.65),y.drawImage(gt,o,r)),di&&(h?(t=u*n-u*i*(ft/(s-e)),o=f*.34-dt.width,r=t-dt.height/2):(n=l.type==="type1"?.871012:.8,i=n-(l.type==="type1"?.14857:.19857),t=f*i*ft/(s-e),o=f*(l.type==="type1"?.142857:.19857)-dt.height/2+t,r=u*.65),y.drawImage(dt,o,r)),y.save(),tu(y,f,u),y.restore(),(kr||l.type==="type2")&&y.drawImage(ni,0,0)},this.repaint(),this},kr=function(n,i){var oi,li,d;i=i||{};var y=undefined===i.width?140:i.width,w=undefined===i.height?320:i.height,u=undefined===i.minValue?0:i.minValue,s=undefined===i.maxValue?u+100:i.maxValue,bt=undefined===i.section?null:i.section,lu=undefined===i.useSectionColors?!1:i.useSectionColors,su=undefined===i.niceScale?!0:i.niceScale,st=undefined===i.threshold?(s-u)/2:i.threshold,ar=undefined===i.titleString?"":i.titleString,rr=undefined===i.unitString?"":i.unitString,dr=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,kr=undefined===i.frameVisible?!0:i.frameVisible,k=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,or=undefined===i.backgroundVisible?!0:i.backgroundVisible,ei=undefined===i.valueColor?steelseries.ColorDef.RED:i.valueColor,kt=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,gi=undefined===i.lcdVisible?!0:i.lcdVisible,pr=undefined===i.lcdDecimals?2:i.lcdDecimals,wu=undefined===i.digitalFont?!1:i.digitalFont,si=undefined===i.ledColor?steelseries.LedColor.RED_LED:i.ledColor,br=undefined===i.ledVisible?!0:i.ledVisible,wr=undefined===i.thresholdVisible?!0:i.thresholdVisible,lr=undefined===i.minMeasuredValueVisible?!1:i.minMeasuredValueVisible,fr=undefined===i.maxMeasuredValueVisible?!1:i.maxMeasuredValueVisible,bu=undefined===i.labelNumberFormat?steelseries.LabelNumberFormat.STANDARD:i.labelNumberFormat,fu=undefined===i.foregroundVisible?!0:i.foregroundVisible,er=undefined===i.playAlarm?!1:i.playAlarm,iu=undefined===i.alarmSound?!1:i.alarmSound,yt=undefined===i.valueGradient?null:i.valueGradient,pu=undefined===i.useValueGradient?!1:i.useValueGradient;er&&iu!==!1&&(oi=r.createElement("audio"),oi.setAttribute("src",iu),oi.setAttribute("preload","auto"));var ku=this,l=u,at=s,lt=u,dt,it=!1,ri=!1,ki=!1,ft=[],ru=0,v=r.getElementById(n).getContext("2d");v.clearRect(0,0,v.canvas.width,v.canvas.height),v.canvas.width=y,v.canvas.height=w;var f=v.canvas.width,e=v.canvas.height,h=y<=w,ur,sr,ut=Math.round((h?w:y)*.05),rt=Math.round((h?y:w)*.05),hr,cr;h?(ur=f/2-ut/2,sr=.053*e,hr=Math.floor(e/22)+"px sans-serif",cr=Math.floor(e/22)+"px "+tt):(ur=.89*f,sr=e/1.95-ut/2,hr=Math.floor(e/10)+"px sans-serif",cr=Math.floor(e/10)+"px "+tt);var tu=!1,pi=u,wi=s,bi=s-u,ou=wi-pi,ai=0,vt=0,ti=10,hu=10,yu=function(){su?(bi=c(s-u,!1),vt=c(bi/(hu-1),!0),pi=Math.floor(u/vt)*vt,wi=Math.ceil(s/vt)*vt,ai=c(vt/(ti-1),!0),u=pi,s=wi,ou=s-u):(bi=s-u,pi=u,wi=s,ou=bi,ai=1,vt=10)},fi=t(y,w),uu=fi.getContext("2d"),hi=t(y,w),nt=hi.getContext("2d"),di,g=r.createElement("canvas");h?(g.width=f*.121428,g.height=e*.012135):(g.width=f*.012135,g.height=e*.121428),li=g.getContext("2d"),d=r.createElement("canvas"),h?(d.width=f*.121428,d.height=e*.012135):(d.width=f*.012135,d.height=e*.121428);var eu=d.getContext("2d"),ni=t(ut,ut),nr=ni.getContext("2d"),pt=t(ut,ut),tr=pt.getContext("2d"),gt=pt,ci=t(rt,rt),gr=ci.getContext("2d"),ii=t(rt,rt),nu=ii.getContext("2d"),ui=t(y,w),yr=ui.getContext("2d"),nf=function(n,t,i){n.save(),n.textAlign="right",n.textBaseline="middle",n.strokeStyle=kt.textColor,n.fillStyle=kt.textColor,(kt===steelseries.LcdColor.STANDARD||kt===steelseries.LcdColor.STANDARD_GREEN)&&(n.shadowColor="gray",i?(n.shadowOffsetX=f*.007,n.shadowOffsetY=f*.007,n.shadowBlur=f*.009):(n.shadowOffsetX=e*.007,n.shadowOffsetY=e*.007,n.shadowBlur=e*.009));var o,u,r;n.font=wu?cr:hr,i?(o=(f-f*.571428)/2+1+f*.571428-2,u=e*.88+1+(e*.055-2)/2,r=f*.7-2):(o=f*.695+f*.18-2,u=e*.22+1+(e*.15-2)/2,r=e*.22-2),n.fillText(t.toFixed(pr),o,u,r),n.restore()},gu=function(n){var i=r.createElement("canvas"),t,u;return i.height=i.width=rt,t=i.getContext("2d"),t.save(),u=t.createLinearGradient(0,.1,0,i.height*.9),u.addColorStop(0,"#520000"),u.addColorStop(.3,"#fc1d00"),u.addColorStop(.59,"#fc1d00"),u.addColorStop(1,"#520000"),t.fillStyle=u,n?(t.beginPath(),t.moveTo(.1,i.height*.5),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.9,i.height*.9),t.closePath()):(t.beginPath(),t.moveTo(.1,.1),t.lineTo(i.width*.9,.1),t.lineTo(i.width*.5,i.height*.9),t.closePath()),t.fill(),t.strokeStyle="#FFFFFF",t.stroke(),t.restore(),i},du=function(n,t,i){var o,y;k.labelColor.setAlpha(1),n.save(),n.textBaseline="middle",o=f*.1,n.strokeStyle=k.labelColor.getRgbaColor(),n.fillStyle=k.labelColor.getRgbaColor();var r=u,l=ti-1,d,b,g,c,h=1,tt,nt,a,v,w,p;for(i?(tt=.34*f,nt=.36*f,a=.33*f,v=.36*f,w=.32*f,p=.36*f,n.textAlign="right",d=0,b=e*.12864,g=0,c=e*.856796-e*.12864,h=c/(s-u)):(tt=.65*e,nt=.63*e,a=.66*e,v=.63*e,w=.67*e,p=.63*e,n.textAlign="center",d=f*.142857,b=0,g=f*.871012-f*.142857,c=0,h=g/(s-u)),y=u,tickCounter=0;y<=s;y+=ai,tickCounter+=ai){currentPos=i?b+c-tickCounter*h:d+tickCounter*h,l++;if(l===ti){n.lineWidth=1.5,ir(n,w,p,currentPos,i);if(i)switch(t.format){case"fractional":n.fillText(r.toFixed(2),f*.28,currentPos,o);break;case"scientific":n.fillText(r.toPrecision(2),f*.28,currentPos,o);break;case"standard":default:n.fillText(r.toFixed(0),f*.28,currentPos,o)}else switch(t.format){case"fractional":n.fillText(r.toFixed(2),currentPos,e*.73,o);break;case"scientific":n.fillText(r.toPrecision(2),currentPos,e*.73,o);break;case"standard":default:n.fillText(r.toFixed(0),currentPos,e*.73,o)}r+=vt,l=0;continue}0==ti%2&&l===ti/2?(n.lineWidth=1,ir(n,a,v,currentPos,i)):(n.lineWidth=.5,ir(n,tt,nt,currentPos,i))}n.restore()},ir=function(n,t,i,r,u){u?(n.beginPath(),n.moveTo(t,r),n.lineTo(i,r),n.closePath(),n.stroke()):(n.beginPath(),n.moveTo(r,t),n.lineTo(r,i),n.closePath(),n.stroke())},b=function(n){var i,t,r,l,c,v;n=n||{};var b=undefined===n.frame?!1:n.frame,y=undefined===n.background?!1:n.background,g=undefined===n.led?!1:n.led,d=undefined===n.foreground?!1:n.foreground,w=undefined===n.bargraphled?!1:n.bargraphled;tu=!0,yu(),b&&kr&&ht(uu,dr,f,e,h),y&&or&&ot(nt,k,f,e,h),g&&(h?(nr.drawImage(o(ut,1,si),0,0),tr.drawImage(o(ut,0,si),0,0)):(nr.drawImage(o(ut,1,si),0,0),tr.drawImage(o(ut,0,si),0,0))),lr&&(h?gr.drawImage(a(rt,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,h),0,0):gr.drawImage(a(rt,steelseries.ColorDef.BLUE.dark.getRgbaColor(),!1,h),0,0)),fr&&(h?nu.drawImage(a(rt,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,h),0,0):nu.drawImage(a(rt,steelseries.ColorDef.RED.medium.getRgbaColor(),!1,h),0,0)),y&&or&&(du(nt,bu,h),wr&&(nt.save(),h?(i=e*.856796-e*.728155*(st/(s-u)),nt.translate(f*.365,i-rt/2)):(i=(f*.856796-f*.12864)*st/(s-u),nt.translate(f*.142857-rt/2+i,e*.58)),nt.drawImage(gu(h),0,0),nt.restore()),h?ct(nt,f,e,ar,rr,k,h,null,gi):ct(nt,f,e,ar,rr,k,h,null,gi)),y&&gi&&(h?(di=p(f*.571428,e*.055,kt),nt.drawImage(di,(f-f*.571428)/2,e*.88)):(di=p(f*.18,e*.15,kt),nt.drawImage(di,f*.695,e*.22))),w&&(cu(eu),vr(li,ei)),ri=!1;if(null!==bt&&0<bt.length){ri=!0,t=bt.length,h?(r=e*.12864,l=e*.856796,c=l-r,v=0):(r=f*.856796,l=f*.12864,c=r-l,v=f*.012135/2),ft=[];do t--,ft.push({start:(bt[t].start+Math.abs(u))/(s-u)*c-v,stop:(bt[t].stop+Math.abs(u))/(s-u)*c-v,color:wt(bt[t].color)});while(0<t)}ki=!1,pu&&yt!==null&&(ri=!1,ki=!0),d&&fu&&et(yr,f,e,h,!1)},yi=function(n){n=n||{};var u=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,r=undefined===n.led?!1:n.led,t=undefined===n.bargraphled?!1:n.bargraphled,i=undefined===n.foreground?!1:n.foreground;u&&(fi.width=y,fi.height=w,uu=fi.getContext("2d")),f&&(hi.width=y,hi.height=w,nt=hi.getContext("2d")),t&&(h?(g.width=y*.121428,g.height=w*.012135):(g.width=y*.012135,g.height=w*.121428),li=g.getContext("2d"),h?(d.width=y*.121428,d.height=w*.012135):(d.width=y*.012135,d.height=w*.121428),eu=d.getContext("2d")),r&&(ni.width=Math.ceil(y*.093457),ni.height=Math.ceil(w*.093457),nr=ni.getContext("2d"),pt.width=Math.ceil(y*.093457),pt.height=Math.ceil(w*.093457),tr=pt.getContext("2d"),gt=pt),i&&(ui.width=y,ui.height=w,yr=ui.getContext("2d"))},vi=function(n){n?ru=setInterval(au,1e3):clearInterval(ru)},au=function(){br&&(gt=gt===ni?pt:ni,ku.repaint())},vu=function(n,t,i){var v,ot,f=k.labelColor,r,bt,ti,ut,et,vt,gt,ni,pt,dt,kt,lt,ct,w,y,rt,it,p,nt,b,tt,ii,ui,ht,at,e,o,a,st,c;h?(v=i*.12864,ot=i*.856796,r=ot-v,bt=r*(l-u)/(s-u),ti=v+r-bt,ut=0,et=v,vt=0,gt=v+r*1.014):(v=t*.856796,ot=t*.12864,r=v-ot,bt=r*(l-u)/(s-u),ti=ot,ut=t*.13,et=i*.435714,vt=ut+r*1.035,gt=et),y=k===steelseries.BackgroundColor.CARBON||k===steelseries.BackgroundColor.PUNCHED_SHEET||k===steelseries.BackgroundColor.STAINLESS||k===steelseries.BackgroundColor.BRUSHED_STAINLESS||k===steelseries.BackgroundColor.TURNED?.3:0,rt=n.createLinearGradient(ut,et,vt,gt),f.setAlpha(.047058+y),rt.addColorStop(0,f.getRgbaColor()),f.setAlpha(.145098+y),rt.addColorStop(.48,f.getRgbaColor()),f.setAlpha(.149019+y),rt.addColorStop(.49,f.getRgbaColor()),f.setAlpha(.047058+y),rt.addColorStop(1,f.getRgbaColor()),n.fillStyle=rt,h?n.fillRect(t*.435714,v,t*.15,r*1.014):n.fillRect(ut,et,r*1.035,i*.152857),h?(ni=0,pt=v,dt=0,kt=v+r*1.014):(ni=ut,pt=0,dt=vt,kt=0),it=n.createLinearGradient(ni,pt,dt,kt),f.setAlpha(.298039+y),it.addColorStop(0,f.getRgbaColor()),f.setAlpha(.686274+y),it.addColorStop(.48,f.getRgbaColor()),f.setAlpha(.698039+y),it.addColorStop(.49,f.getRgbaColor()),f.setAlpha(.4+y),it.addColorStop(1,f.getRgbaColor()),n.fillStyle=it,h?(n.fillRect(t*.435714,v,t*.007142,r*1.014),n.fillRect(t*.571428,v,t*.007142,r*1.014)):(n.fillRect(t*.13,i*.435714,r*1.035,i*.007142),n.fillRect(t*.13,i*.571428,r*1.035,i*.007142)),h?(p=t*.45,nt=i*.851941,b=t*.121428,tt=i*.012135,ii=(p+b)/2,ui=(nt+tt)/2):(p=t*.142857,nt=i*.45,b=t*.012135,tt=i*.121428,ii=(p+b)/2,ui=(nt+tt)/2),st=ei;if(h){for(at=(s+Math.abs(u))/(s-u)*r,o=0;o<=at;o+=tt+1)n.translate(0,-o),n.drawImage(d,p,nt),n.translate(0,o);for(ht=(l+Math.abs(u))/(s-u)*r,o=0;o<=ht;o+=tt+1){a=ei;if(ki)lt=u+o/r*(s-u),ct=yt.getEnd()-yt.getStart(),w=lt/ct,w=Math.max(Math.min(w,1),0),a=wt(yt.getColorAt(w).getRgbaColor());else if(ri)for(c=0;c<ft.length;c++)if(o>=ft[c].start&&o<ft[c].stop){a=ft[c].color;break}st.medium.getHexColor()!==a.medium.getHexColor()&&(vr(li,a),st=a),n.translate(0,-o),n.drawImage(g,p,nt),n.translate(0,o)}}else{for(at=(s+Math.abs(u))/(s-u)*r,e=-(b/2);e<=at;e+=b+1)n.translate(e,0),n.drawImage(d,p,nt),n.translate(-e,0);for(ht=(l+Math.abs(u))/(s-u)*r,e=-(b/2);e<=ht;e+=b+1){a=ei;if(ki)lt=u+e/r*(s-u),ct=yt.getEnd()-yt.getStart(),w=lt/ct,w=Math.max(Math.min(w,1),0),a=wt(yt.getColorAt(w).getRgbaColor());else if(ri)for(c=0;c<ft.length;c++)if(e>=ft[c].start&&e<ft[c].stop){a=ft[c].color;break}st.medium.getHexColor()!==a.medium.getHexColor()&&(vr(li,a),st=a),n.translate(e,0),n.drawImage(g,p,nt),n.translate(-e,0)}}},cu=function(n){n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath();var i=n.canvas.width/2,r=n.canvas.height/2,t=v.createRadialGradient(i,r,0,i,r,n.canvas.width/2);t.addColorStop(0,"#3c3c3c"),t.addColorStop(1,"#323232"),n.fillStyle=t,n.fill(),n.restore()},vr=function(n,t){var r,f,u,i;n.save(),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.closePath(),r=n.canvas.width/2,f=n.canvas.height/2,u=h?n.canvas.width/2:n.canvas.height/2,i=v.createRadialGradient(r,f,0,r,f,u),i.addColorStop(0,t.light.getRgbaColor()),i.addColorStop(1,t.dark.getRgbaColor()),n.fillStyle=i,n.fill(),n.restore()};return this.setValue=function(n){var t=n<u?u:n>s?s:n;l!==t&&(l=t,l>lt&&(lt=l),l<at&&(at=l),l<st||it?l<st&&(it=!1,vi(it),er&&oi.pause()):(it=!0,vi(it),er&&oi.play()),this.repaint())},this.getValue=function(){return l},this.setValueAnimated=function(n){var i=n<u?u:n>s?s:n,t;l!==i&&(undefined!==dt&&dt.playing&&dt.stop(),dt=new Tween({},"",Tween.regularEaseInOut,l,i,1),t=this,dt.onMotionChanged=function(n){l=n.target._pos,l<st||it?l<st&&(it=!1,vi(it)):(it=!0,vi(it)),l>lt&&(lt=l),l<at&&(at=l),t.repaint()},dt.start())},this.resetMinMeasuredValue=function(){at=l,this.repaint()},this.resetMaxMeasuredValue=function(){lt=l,this.repaint()},this.setMinMeasuredValueVisible=function(n){lr=n,this.repaint()},this.setMaxMeasuredValueVisible=function(n){fr=n,this.repaint()},this.setThresholdVisible=function(n){wr=n,this.repaint()},this.setLcdDecimals=function(n){pr=n,this.repaint()},this.setFrameDesign=function(n){yi({frame:!0}),dr=n,b({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){yi({background:!0}),k=n,b({background:!0}),this.repaint()},this.setValueColor=function(n){yi({bargraphled:!0}),ei=n,b({bargraphled:!0}),this.repaint()},this.setLedColor=function(n){yi({led:!0}),si=n,b({led:!0}),this.repaint()},this.setLcdColor=function(n){kt=n,b({background:!0}),this.repaint()},this.setSection=function(n){bt=n,b(),this.repaint()},this.setSectionActive=function(n){lu=n,b(),this.repaint()},this.setGradient=function(n){yt=n,b(),this.repaint()},this.setGradientActive=function(n){useGradient=n,b(),this.repaint()},this.setMaxMeasuredValue=function(n){var t=n<u?u:n>s?s:n;lt!==t&&(lt=t,this.repaint())},this.setMinMeasuredValue=function(n){var t=n<u?u:n>s?s:n;at!==t&&(at=t,this.repaint())},this.setTitleString=function(n){ar=n,b({background:!0}),this.repaint()},this.setUnitString=function(n){rr=n,b({background:!0}),this.repaint()},this.setMinValue=function(n){u=n,b({background:!0,foreground:!0,pointer:!0}),this.repaint()},this.getMinValue=function(){return u},this.setMaxValue=function(n){s!==n&&(s=n,b({background:!0,foreground:!0,pointer:!0}),this.repaint())},this.getMaxValue=function(){return s},this.setThreshold=function(n){var t=n<u?u:n>s?s:n;st!==t&&(st=t,b({background:!0}),this.repaint())},this.repaint=function(){tu||b({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0,bargraphled:!0}),v.clearRect(0,0,v.canvas.width,v.canvas.height),kr&&v.drawImage(fi,0,0),or&&v.drawImage(hi,0,0),gi&&nf(v,l,h),br&&(l<st&&(it=!1,gt=pt),v.drawImage(gt,ur,sr));var n,i,t;lr&&(h?(n=e*.856796-e*.728155*(at/(s-u)),i=f*.34-ci.width,t=n-ci.height/2):(n=(f*.856796-f*.12864)*at/(s-u),i=f*.142857-ci.height/2+n,t=e*.65),v.drawImage(ci,i,t)),fr&&(h?(n=e*.856796-e*.728155*(lt/(s-u)),i=f*.34-ii.width,t=n-ii.height/2):(n=(f*.856796-f*.12864)*lt/(s-u),i=f*.142857-ii.height/2+n,t=e*.65),v.drawImage(ii,i,t)),v.save(),vu(v,f,e),v.restore(),fu&&v.drawImage(ui,0,0)},this.repaint(),this},dr=function(n,i){i=i||{};var b=undefined===i.width?128:i.width,y=undefined===i.height?48:i.height,w=undefined===i.lcdColor?steelseries.LcdColor.STANDARD:i.lcdColor,pt=undefined===i.lcdDecimals?2:i.lcdDecimals,lt=undefined===i.unitString?"":i.unitString,at=undefined===i.unitStringVisible?!1:i.unitStringVisible,ht=undefined===i.digitalFont?!1:i.digitalFont,bt=undefined===i.valuesNumeric?!0:i.valuesNumeric,a=undefined===i.value?0:i.value,ct=undefined===i.autoScroll?!1:i.autoScroll,f=undefined===i.section?null:i.section,c=!1,e=0,g,wt=this,u=r.getElementById(n).getContext("2d");u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=b,u.canvas.height=y;var o=b,h=y,l=0,v=Math.floor(h/1.5),ot=v+"px sans-serif",it=v+"px "+tt,nt=!1,rt,et=[],ut=[],kt=function(n,t){var r,i;u.save(),u.textAlign="right",u.strokeStyle=t,u.fillStyle=t,u.beginPath(),u.rect(2,0,o-4,h),u.closePath(),u.clip(),u.font=ht?it:ot,bt?(r=0,l=0,at&&(u.font=Math.floor(h/2.5)+"px sans-serif",r=u.measureText(lt).width),u.font=ht?it:ot,i=n.toFixed(pt),l=u.measureText(i).width,u.fillText(i,o-r-4-e,h*.5+v*.38),at&&(u.font=Math.floor(h/2.5)+"px sans-serif",u.fillText(lt,o-2-e,h*.5+v*.38))):(l=u.measureText(n).width,ct&&l>o-4?c||(e=o-l-o*.2,c=!0,clearTimeout(g),g=setTimeout(d,200)):ct&&l<=o-4&&(e=0,c=!1),u.fillText(n,o-2-e,h*.5+v*.38)),u.restore()},dt=function(n,i,r,u){var it=t(n,i),f=it.getContext("2d");f.save();var pt=0,d=0,kt=n,et=i,rt=Math.min(n,i)*.095,h=f.createLinearGradient(0,d,0,d+et);h.addColorStop(0,"#4c4c4c"),h.addColorStop(.08,"#666666"),h.addColorStop(.92,"#666666"),h.addColorStop(1,"#e6e6e6"),f.fillStyle=h,s(f,pt,d,kt,et,rt),f.fill(),f.restore(),f.save();var nt=ft(r),e=st(nt[0],nt[1],nt[2]),g=ft(u.gradientStartColor),ht=st(g[0],g[1],g[2]),tt=ft(u.gradientFraction1Color),lt=st(tt[0],tt[1],tt[2]),a=ft(u.gradientFraction2Color),ct=st(a[0],a[1],a[2]),v=ft(u.gradientFraction3Color),wt=st(v[0],v[1],v[2]),c=ft(u.gradientStopColor),yt=st(c[0],c[1],c[2]),l=vt(e[0],e[1],ht[2]-.31),y=vt(e[0],e[1],lt[2]-.31),k=vt(e[0],e[1],ct[2]-.31),p=vt(e[0],e[1],wt[2]-.31),w=vt(e[0],e[1],yt[2]-.31),bt=1,b=1,ot=n-2,ut=i-2,at=rt-1,o=f.createLinearGradient(0,b,0,b+ut);return o.addColorStop(0,"rgb("+l[0]+", "+l[1]+", "+l[2]+")"),o.addColorStop(.03,"rgb("+y[0]+","+y[1]+","+y[2]+")"),o.addColorStop(.49,"rgb("+k[0]+","+k[1]+","+k[2]+")"),o.addColorStop(.5,"rgb("+p[0]+","+p[1]+","+p[2]+")"),o.addColorStop(1,"rgb("+w[0]+","+w[1]+","+w[2]+")"),f.fillStyle=o,s(f,bt,b,ot,ut,at),f.fill(),f.restore(),it},yt=function(n){var i=ft(n),r=st(i[0],i[1],i[2]),t=vt(r[0],.57,.83);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},d=function(){c?(e>o&&(e=-l),e+=2,g=setTimeout(d,60)):e=0,wt.repaint()},k=function(){var n;nt=!0,rt=p(b,y,w);if(null!==f&&0<f.length)for(n=0;n<f.length;n++)et[n]=dt(b,y,f[n].color,w),ut[n]=yt(f[n].color)};return this.setValue=function(n){a!==n&&(a=n,this.repaint())},this.setLcdColor=function(n){w=n,k(),this.repaint()},this.setSection=function(n){f=n,resetBuffers({foreground:!0}),k({background:!0,foreground:!0}),this.repaint()},this.setScrolling=function(n){if(n){if(c)return;c=n,d()}else c=n},this.repaint=function(){nt||k(),u.clearRect(0,0,u.canvas.width,u.canvas.height);var t=rt,i=w.textColor,n;if(null!==f&&0<f.length)for(n=0;n<f.length;n++)if(a>=f[n].start&&a<=f[n].stop){t=et[n],i=ut[n];break}u.drawImage(t,0,0),kt(a,i)},this.repaint(),this},wr=function(n,t){t=t||{};var h=undefined===t.width?128:t.width,c=undefined===t.height?64:t.height,f=undefined===t.lcdColor?steelseries.LcdColor.STANDARD:t.lcdColor,k=undefined===t.lcdDecimals?2:t.lcdDecimals,d=undefined===t.unitString?"":t.unitString,b=undefined===t.unitStringVisible?!1:t.unitStringVisible,w=undefined===t.digitalFont?!1:t.digitalFont,ut=undefined===t.valuesNumeric?!0:t.valuesNumeric,o=undefined===t.value?0:t.value,s=0,i=r.getElementById(n).getContext("2d");i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.canvas.width=h,i.canvas.height=c;var e=h,u=c,g=Math.floor(u/1.875)+"px sans-serif",it=Math.floor(u/1.875)+"px "+tt,y=Math.floor(u/3.5)+"px sans-serif",rt=Math.floor(u/3.5)+"px "+tt,v=!1,l,nt=function(n){var t,o,r;i.save(),i.textAlign="right",i.textBaseline="middle",i.strokeStyle=f.textColor,i.fillStyle=f.textColor,(f===steelseries.LcdColor.STANDARD||f===steelseries.LcdColor.STANDARD_GREEN)&&(i.shadowColor="gray",i.shadowOffsetX=u*.05,i.shadowOffsetY=u*.05,i.shadowBlur=u*.06),ut?(i.font=Math.floor(u/2.5)+"px sans-serif",t=0,b&&(i.font=Math.floor(u/2.5)+"px sans-serif",t=i.measureText(d).width),i.font=w?it:g,o=n.toFixed(k),i.fillText(o,e-t-4,u*.38),b&&(i.font=Math.floor(u/3)+"px sans-serif",i.fillText(d,e-2,u*.46)),r=s.toFixed(k),i.font=w?rt:y,i.textAlign="center",i.fillText(r,e/2,u*.8)):(i.font=Math.floor(u/2.5)+"px sans-serif",i.fillText(n,e-2,u*.38),i.font=y,i.textAlign="center",i.fillText(s,e/2,u*.8)),i.restore()},a=function(){v=!0,l=p(h,c,f)};return this.setValue=function(n){(o!==n||s!==n)&&(s=o,o=n,this.repaint())},this.setLcdColor=function(n){f=n,a(),this.repaint()},this.repaint=function(){v||a(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.drawImage(l,0,0),nt(o)},this.repaint(),this},br=function(n,u){u=u||{};var c=undefined===u.size?200:u.size,st=undefined===u.decimalsVisible?!1:u.decimalsVisible,gt=undefined===u.textOrientationFixed?!1:u.textOrientationFixed,bt=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,at=undefined===u.frameVisible?!0:u.frameVisible,p=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,vt=undefined===u.backgroundVisible?!0:u.backgroundVisible,b=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,lt=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,yt=undefined===u.foregroundVisible?!0:u.foregroundVisible,d,e=0,k=0,h=0,kt=Math.PI/180,ot=this.value,wt=st?1:0,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=c,s.canvas.height=c;var f=c,o=c,l=f/2,a=o/2,pt=!1,g=t(c,c),ut=g.getContext("2d"),nt=t(c,c),et=nt.getContext("2d"),rt=t(c,c),ht=rt.getContext("2d"),tt=t(c,c),ct=tt.getContext("2d"),ni=function(n){n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=p.labelColor.getRgbaColor(),n.fillStyle=p.labelColor.getRgbaColor(),n.translate(l,a);var r,t;for(i=0;360>i;i++){n.strokeStyle=p.labelColor.getRgbaColor(),n.lineWidth=.5,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.37,0),n.closePath(),n.stroke(),0==i%5&&(n.strokeStyle=p.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),0==i%45&&(n.strokeStyle=p.labelColor.getRgbaColor(),n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.34,0),n.closePath(),n.stroke()),300<f&&(r="14px sans-serif",t="12px sans-serif"),300<f||(r="12px sans-serif",t="10px sans-serif"),200<f||(r="10px sans-serif",t="8px sans-serif"),100<f||(r="8px sans-serif",t="6px sans-serif"),n.save();switch(i){case 0:n.translate(f*.31,0),n.rotate(i*Math.PI/180+Math.PI/2),n.font=r,n.fillText("0\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)+Math.PI/2),n.translate(-f*.31,0),n.translate(f*.41,0),n.rotate(i*Math.PI/180-Math.PI/2),n.font=t,n.fillText("0%",0,0,f);break;case 45:n.translate(f*.31,0),n.rotate(i*Math.PI/180+.25*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)+.25*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,f*.085),n.rotate(i*Math.PI/180-.25*Math.PI),n.font=t,n.fillText("100%",0,0,f);break;case 90:n.translate(f*.31,0),n.rotate(i*Math.PI/180),n.font=r,n.fillText("90\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)),n.translate(-f*.31,0),n.translate(f*.21,0),n.rotate(i*Math.PI/180),n.font=t,n.fillText("\u221e",0,0,f);break;case 135:n.translate(f*.31,0),n.rotate(i*Math.PI/180-.25*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-.25*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,-f*.085),n.rotate(i*Math.PI/180+.25*Math.PI),n.font=t,n.fillText("100%",0,0,f);break;case 180:n.translate(f*.31,0),n.rotate(i*Math.PI/180-Math.PI/2),n.font=r,n.fillText("0\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-Math.PI/2),n.translate(-f*.31,0),n.translate(f*.41,0),n.rotate(i*Math.PI/180+Math.PI/2),n.font=t,n.fillText("0%",0,0,f),n.translate(-f*.41,0);break;case 225:n.translate(f*.31,0),n.rotate(i*Math.PI/180-.75*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-.75*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,f*.085),n.rotate(i*Math.PI/180+.75*Math.PI),n.font=t,n.fillText("100%",0,0,f);break;case 270:n.translate(f*.31,0),n.rotate(i*Math.PI/180-Math.PI),n.font=r,n.fillText("90\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-Math.PI),n.translate(-f*.31,0),n.translate(f*.21,0),n.rotate(i*Math.PI/180-Math.PI),n.font=t,n.fillText("\u221e",0,0,f);break;case 315:n.translate(f*.31,0),n.rotate(i*Math.PI/180-1.25*Math.PI),n.font=r,n.fillText("45\u00b0",0,0,f),n.rotate(-(i*Math.PI/180)-1.25*Math.PI),n.translate(-f*.31,0),n.translate(f*.31,-f*.085),n.rotate(i*Math.PI/180+1.25*Math.PI),n.font=t,n.fillText("100%",0,0,f)}n.restore(),n.rotate(kt)}n.translate(-l,-a),n.restore()},ti=function(n){n.save(),n.strokeStyle=p.labelColor.getRgbaColor(),n.fillStyle=p.labelColor.getRgbaColor(),n.save(),n.beginPath(),n.moveTo(f*.200934,o*.434579),n.lineTo(f*.163551,o*.434579),n.lineTo(f*.163551,o*.560747),n.lineTo(f*.200934,o*.560747),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.stroke(),n.save(),n.beginPath(),n.moveTo(f*.163551,o*.471962),n.lineTo(f*.205607,o*.5),n.lineTo(f*.163551,o*.523364),n.lineTo(f*.163551,o*.471962),n.closePath(),n.fill(),n.save(),n.beginPath(),n.moveTo(f*.799065,o*.434579),n.lineTo(f*.836448,o*.434579),n.lineTo(f*.836448,o*.560747),n.lineTo(f*.799065,o*.560747),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.stroke(),n.save(),n.beginPath(),n.moveTo(f*.836448,o*.471962),n.lineTo(f*.794392,o*.5),n.lineTo(f*.836448,o*.523364),n.lineTo(f*.836448,o*.471962),n.closePath(),n.fill(),n.restore()},ii=function(n){var u;n.save(),n.save(),n.beginPath(),n.moveTo(f*.523364,o*.350467),n.lineTo(f*.5,o*.130841),n.lineTo(f*.476635,o*.350467),n.bezierCurveTo(f*.476635,o*.350467,f*.490654,o*.345794,f*.5,o*.345794),n.bezierCurveTo(f*.509345,o*.345794,f*.523364,o*.350467,f*.523364,o*.350467),n.closePath();var t=n.createLinearGradient(0,.154205*o,0,.350466*o),r=b.dark,i=b.light;r.setAlpha(.70588),i.setAlpha(.70588),t.addColorStop(0,r.getRgbaColor()),t.addColorStop(.3,i.getRgbaColor()),t.addColorStop(.59,i.getRgbaColor()),t.addColorStop(1,r.getRgbaColor()),n.fillStyle=t,u=b.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=u,n.fill(),n.stroke(),r.setAlpha(1),i.setAlpha(1),n.restore()},dt=function(n){var i,t,u,s,r,e;n.save(),i=b.dark,t=b.light,i.setAlpha(.70588),t.setAlpha(.70588),n.save(),n.beginPath(),n.moveTo(f*.285046,o*.514018),n.lineTo(f*.21028,o*.5),n.lineTo(f*.285046,o*.481308),n.bezierCurveTo(f*.285046,o*.481308,f*.280373,o*.490654,f*.280373,o*.495327),n.bezierCurveTo(f*.280373,o*.504672,f*.285046,o*.514018,f*.285046,o*.514018),n.closePath(),u=n.createLinearGradient(.224299*f,0,.289719*f,0),u.addColorStop(0,i.getRgbaColor()),u.addColorStop(.3,t.getRgbaColor()),u.addColorStop(.59,t.getRgbaColor()),u.addColorStop(1,i.getRgbaColor()),n.fillStyle=u,s=b.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=s,n.fill(),n.stroke(),n.save(),n.beginPath(),n.moveTo(f*.714953,o*.514018),n.lineTo(f*.789719,o*.5),n.lineTo(f*.714953,o*.481308),n.bezierCurveTo(f*.714953,o*.481308,f*.719626,o*.490654,f*.719626,o*.495327),n.bezierCurveTo(f*.719626,o*.504672,f*.714953,o*.514018,f*.714953,o*.514018),n.closePath(),r=n.createLinearGradient(.7757*f,0,.71028*f,0),r.addColorStop(0,i.getRgbaColor()),r.addColorStop(.3,t.getRgbaColor()),r.addColorStop(.59,t.getRgbaColor()),r.addColorStop(1,i.getRgbaColor()),n.fillStyle=r,e=b.light.getRgbaColor(),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.strokeStyle=e,n.fill(),n.stroke(),i.setAlpha(1),t.setAlpha(1),n.restore()},it=function(){pt=!0,at&&v(ut,bt,l,a,f,o),vt&&(w(ut,p,l,a,f,o),ni(ut)),ti(et),ii(et),dt(ht),yt&&y(ct,lt,f,o,!1)},ft=function(){g.width=c,g.height=c,ut=g.getContext("2d"),nt.width=c,nt.height=c,et=nt.getContext("2d"),rt.width=c,rt.height=c,ht=rt.getContext("2d"),tt.width=c,tt.height=c,ct=tt.getContext("2d")};return this.setValue=function(n){var t;t=0>n?360+n:n,t=359.9<n?n-360:n,e!==t&&(e=t,k=2*(Math.abs(e)*10%10),10<k&&(k-=20),0===e&&(h=90),0<e&&90>=e&&(h=90-e),90<e&&180>=e&&(h=e-90),180<e&&270>=e&&(h=270-e),270<e&&360>=e&&(h=e-270),0>e&&e>=-90&&(h=90-Math.abs(e)),e<-90&&e>=-180&&(h=Math.abs(e)-90),e<-180&&e>=-270&&(h=270-Math.abs(e)),e<-270&&e>=-360&&(h=Math.abs(e)-270),this.repaint())},this.getValue=function(){return e},this.setValueAnimated=function(n){360-n+e<n-e&&(n=360-n);if(e!==n){undefined!==d&&d.playing&&d.stop(),d=new Tween({},"",Tween.regularEaseInOut,e,n,1);var t=this;d.onMotionChanged=function(n){e=n.target._pos,k=2*(Math.abs(e)*10%10),10<k&&(k-=20),0===e&&(h=90),0<e&&90>=e&&(h=90-e),90<e&&180>=e&&(h=e-90),180<e&&270>=e&&(h=270-e),270<e&&360>=e&&(h=e-270),0>e&&e>=-90&&(h=90-Math.abs(e)),e<-90&&e>=-180&&(h=Math.abs(e)-90),e<-180&&e>=-270&&(h=270-Math.abs(e)),e<-270&&e>=-360&&(h=Math.abs(e)-270),t.repaint()},d.start()}},this.setFrameDesign=function(n){ft(),bt=n,it(),this.repaint()},this.setBackgroundColor=function(n){ft(),p=n,it(),this.repaint()},this.setForegroundType=function(n){ft(),lt=n,it(),this.repaint()},this.setPointerColor=function(n){ft(),b=n,it(),this.repaint()},this.repaint=function(){pt||it(),s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),(at||vt)&&s.drawImage(g,0,0),ot=Math.PI/2+e*kt-Math.PI/2,s.save(),s.translate(l,a),s.rotate(ot),s.translate(-l,-a),s.drawImage(nt,0,0),s.fillStyle=p.labelColor.getRgbaColor(),s.textAlign="center",s.textBaseline="middle",gt?(s.restore(),s.font=st?f*.1+"px sans-serif":f*.15+"px sans-serif",s.fillText(h.toFixed(wt)+"\u00b0",l,a,f*.35)):(s.font=st?f*.15+"px sans-serif":f*.2+"px sans-serif",s.fillText(h.toFixed(wt)+"\u00b0",l,a,f*.35),s.restore()),s.translate(l,a),s.rotate(ot+k*Math.PI/180),s.translate(-l,-a),s.drawImage(rt,0,0),s.restore(),yt&&s.drawImage(tt,0,0),s.restore()},this.repaint(),this},gr=function(n,u){u=u||{};var o=undefined===u.size?200:u.size,pt=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,ct=undefined===u.frameVisible?!0:u.frameVisible,tt=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,dt=undefined===u.backgroundVisible?!0:u.backgroundVisible,bt=undefined===u.pointerType?steelseries.PointerType.TYPE2:u.pointerType,h=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,ei=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,ui=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,gt=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,at=undefined===u.foregroundVisible?!0:u.foregroundVisible,c=undefined===u.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:u.pointSymbols,fi=undefined===u.customLayer?null:u.customLayer,ii=undefined===u.degreeScale?!1:u.degreeScale,yt=undefined===u.roseVisible?!0:u.roseVisible,d,p=0,st=Math.PI/180,ht=this.value,s=r.getElementById(n).getContext("2d");s.save(),s.clearRect(0,0,s.canvas.width,s.canvas.height),s.canvas.width=o,s.canvas.height=o;var f=o,e=o,a=f/2,l=e/2,kt=!1,ft=t(o,o),g=ft.getContext("2d"),ut=t(o,o),ti=ut.getContext("2d"),it=t(o,o),lt=it.getContext("2d"),ot=t(o,o),b=ot.getContext("2d"),et=t(o,o),vt=et.getContext("2d"),ri=function(n){var t,r,u;n.textAlign="center",n.textBaseline="middle",n.save(),n.strokeStyle=tt.labelColor.getRgbaColor(),n.fillStyle=tt.labelColor.getRgbaColor(),n.translate(a,l);if(ii)for(t=.08*f+"px serif",r=f*.033+"px serif",n.rotate(st*10),i=10;360>=i;i+=10){n.save();switch(i){case 360:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[2],0,0,f),n.translate(-f*.35,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[4],0,0,f),n.translate(-f*.35,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[6],0,0,f),n.translate(-f*.35,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[0],0,0,f),n.translate(-f*.35,0);break;default:u=(i+90)%360,n.translate(f*.37,0),n.rotate(Math.PI/2),n.font=r,n.fillText("0".substring(u>=100)+u,0,0,f),n.translate(-f*.37,0)}n.restore(),n.rotate(st*10)}else for(t=.12*f+"px serif",r=.06*f+"px serif",i=0;360>i;i+=2.5){0==i%5&&(n.lineWidth=1,n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),n.save();switch(i){case 0:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[2],0,0,f),n.translate(-f*.35,0);break;case 45:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[3],0,0,f),n.translate(-f*.29,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[4],0,0,f),n.translate(-f*.35,0);break;case 135:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[5],0,0,f),n.translate(-f*.29,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[6],0,0,f),n.translate(-f*.35,0);break;case 225:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[7],0,0,f),n.translate(-f*.29,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(c[0],0,0,f),n.translate(-f*.35,0);break;case 315:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=r,n.fillText(c[1],0,0,f),n.translate(-f*.29,0)}n.restore(),yt&&(0===i||22.5===i||45===i||67.5===i||90===i||112.5===i||135===i||157.5===i||180===i||202.5===i||225===i||247.5===i||270===i||292.5===i||315===i||337.5===i||360===i)&&(n.save(),n.beginPath(),i%45?n.moveTo(f*.29,0):n.moveTo(f*.38,0),n.lineTo(f*.1,0),n.closePath(),n.restore(),n.lineWidth=1,n.strokeStyle=tt.symbolColor.getRgbaColor(),n.stroke()),n.rotate(st*2.5)}n.translate(-a,-l),n.restore()},wt=function(n,t){var o,s,l,i,r,u,c;n.save(),t&&(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)");switch(bt.type){case"type2":n.beginPath(),n.moveTo(f*.53271,e*.453271),n.bezierCurveTo(f*.53271,e*.453271,f*.5,e*.149532,f*.5,e*.149532),n.bezierCurveTo(f*.5,e*.149532,f*.467289,e*.453271,f*.467289,e*.453271),n.bezierCurveTo(f*.453271,e*.462616,f*.443925,e*.481308,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.5,f*.556074,e*.5,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.481308,f*.546728,e*.462616,f*.53271,e*.453271),n.closePath(),t||(o=n.createLinearGradient(.471962*f,0,.528036*f,0),o.addColorStop(0,h.light.getRgbaColor()),o.addColorStop(.46,h.light.getRgbaColor()),o.addColorStop(.47,h.medium.getRgbaColor()),o.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=o,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(f*.467289,e*.546728),n.bezierCurveTo(f*.467289,e*.546728,f*.5,e*.850467,f*.5,e*.850467),n.bezierCurveTo(f*.5,e*.850467,f*.53271,e*.546728,f*.53271,e*.546728),n.bezierCurveTo(f*.546728,e*.537383,f*.556074,e*.518691,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.5,f*.443925,e*.5,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.518691,f*.453271,e*.537383,f*.467289,e*.546728),n.closePath(),t||(s=n.createLinearGradient(.471962*f,0,.528036*f,0),s.addColorStop(0,"#e3e5e8"),s.addColorStop(.48,"#e3e5e8"),s.addColorStop(.48,"#abb1b8"),s.addColorStop(1,"#abb1b8"),n.fillStyle=s,l="#abb1b8",n.strokeStyle=l),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type3":n.beginPath(),n.moveTo(f*.5,e*.149532),n.bezierCurveTo(f*.5,e*.149532,f*.443925,e*.490654,f*.443925,e*.5),n.bezierCurveTo(f*.443925,e*.53271,f*.467289,e*.556074,f*.5,e*.556074),n.bezierCurveTo(f*.53271,e*.556074,f*.556074,e*.53271,f*.556074,e*.5),n.bezierCurveTo(f*.556074,e*.490654,f*.5,e*.149532,f*.5,e*.149532),n.closePath(),t||(i=n.createLinearGradient(.471962*f,0,.528036*f,0),i.addColorStop(0,h.light.getRgbaColor()),i.addColorStop(.46,h.light.getRgbaColor()),i.addColorStop(.47,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke();break;case"type1:":default:n.beginPath(),n.moveTo(f*.5,e*.495327),n.lineTo(f*.528037,e*.495327),n.lineTo(f*.5,e*.149532),n.lineTo(f*.471962,e*.495327),n.lineTo(f*.5,e*.495327),n.closePath(),t||(r=n.createLinearGradient(.471962*f,0,.528036*f,0),r.addColorStop(0,h.light.getRgbaColor()),r.addColorStop(.46,h.light.getRgbaColor()),r.addColorStop(.47,h.medium.getRgbaColor()),r.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=r,n.strokeStyle=h.dark.getRgbaColor()),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke(),n.beginPath(),n.moveTo(f*.5,e*.504672),n.lineTo(f*.471962,e*.504672),n.lineTo(f*.5,e*.850467),n.lineTo(f*.528037,e*.504672),n.lineTo(f*.5,e*.504672),n.closePath(),t||(u=n.createLinearGradient(.471962*f,0,.528036*f,0),u.addColorStop(0,"#e3e5e8"),u.addColorStop(.48,"#e3e5e8"),u.addColorStop(.480099,"#abb1b8"),u.addColorStop(1,"#abb1b8"),n.fillStyle=u,c="#abb1b8",n.strokeStyle=c),n.lineWidth=1,n.lineCap="square",n.lineJoin="miter",n.fill(),n.stroke()}t&&blur(n,f,e,Math.floor(f*.006)),n.restore()},k=function(){kt=!0,ct&&v(g,pt,a,l,f,e),dt&&(w(g,tt,a,l,f,e),rt(g,fi,a,l,f,e),yt&&hi(g,a,l,f,e,tt),ri(g)),wt(ti,!1),wt(lt,!0),at&&y(vt,gt,f,e,!0,ei,ui)},nt=function(){ft.width=o,ft.height=o,g=ft.getContext("2d"),ut.width=o,ut.height=o,ti=ut.getContext("2d"),it.width=o,it.height=o,lt=it.getContext("2d"),ot.width=o,ot.height=o,b=ot.getContext("2d"),et.width=o,et.height=o,vt=et.getContext("2d")};return this.setValue=function(n){n=n%360,p!==n&&(p=n,this.repaint())},this.getValue=function(){return p},this.setValueAnimated=function(n){var i=n%360,r=this,t;p!==i&&(undefined!==d&&d.playing&&d.stop(),t=ni(p,i),d=new Tween({},"",Tween.elasticEaseOut,p,p+t,2),d.onMotionChanged=function(n){p=n.target._pos%360,r.repaint()},d.start())},this.setFrameDesign=function(n){nt(),pt=n,k(),this.repaint()},this.setBackgroundColor=function(n){nt(),tt=n,k(),this.repaint()},this.setForegroundType=function(n){nt(),gt=n,k(),this.repaint()},this.setPointerColor=function(n){nt(),h=n,k(),this.repaint()},this.setPointerType=function(n){nt(),bt=n,k(),this.repaint()},this.setPointSymbols=function(n){nt(),c=n,k(),this.repaint()},this.repaint=function(){kt||k(),s.clearRect(0,0,s.canvas.width,s.canvas.height),(ct||dt)&&s.drawImage(ft,0,0),ht=Math.PI/2+p*st-Math.PI/2;var n=f*.006;b.clearRect(0,0,f,e),b.save(),b.translate(a,l),b.rotate(ht),b.translate(-a,-l),b.drawImage(it,0,0),b.restore(),s.drawImage(ot,0,0,f,e,n,n,f+n,e+n),s.save(),s.translate(a,l),s.rotate(ht),s.translate(-a,-l),s.drawImage(ut,0,0),s.restore(),at&&s.drawImage(et,0,0),s.restore()},this.repaint(),this},iu=function(n,u){u=u||{};var o=undefined===u.size?200:u.size,pi=undefined===u.frameDesign?steelseries.FrameDesign.METAL:u.frameDesign,di=undefined===u.frameVisible?!0:u.frameVisible,k=undefined===u.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:u.backgroundColor,gi=undefined===u.backgroundVisible?!0:u.backgroundVisible,dt=undefined===u.pointerTypeLatest?steelseries.PointerType.TYPE1:u.pointerTypeLatest,ri=undefined===u.pointerTypeAverage?steelseries.PointerType.TYPE8:u.pointerTypeAverage,kt=undefined===u.pointerColor?steelseries.ColorDef.RED:u.pointerColor,ii=undefined===u.pointerColorAverage?steelseries.ColorDef.BLUE:u.pointerColorAverage,kr=undefined===u.knobType?steelseries.KnobType.STANDARD_KNOB:u.knobType,dr=undefined===u.knobStyle?steelseries.KnobStyle.SILVER:u.knobStyle,si=undefined===u.foregroundType?steelseries.ForegroundType.TYPE1:u.foregroundType,ir=undefined===u.foregroundVisible?!0:u.foregroundVisible,a=undefined===u.pointSymbols?["N","NE","E","SE","S","SW","W","NW"]:u.pointSymbols,vr=undefined===u.customLayer?null:u.customLayer,wr=undefined===u.degreeScale?!0:u.degreeScale,nr=undefined===u.roseVisible?!1:u.roseVisible,ht=undefined===u.lcdColor?steelseries.LcdColor.STANDARD:u.lcdColor,fr=undefined===u.lcdVisible?!0:u.lcdVisible,pr=undefined===u.digitalFont?!1:u.digitalFont,et=undefined===u.section?null:u.section,ft=undefined===u.area?null:u.area,ti=undefined===u.lcdTitleStrings?["Latest","Average"]:u.lcdTitleStrings,rr=undefined===u.titleString?"":u.titleString,tr=undefined===u.useColorLabels?!1:u.useColorLabels,ut,st,it=0,g=0,ct=Math.PI/180,ei=this.valueLatest,fi=this.valueAverage,ar=-Math.PI/2,bi=Math.PI*2,ur=360,e=r.getElementById(n).getContext("2d");e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o;var f=o,s=o,c=f/2,h=s/2,ui=Math.floor(f/10),br=ui+"px sans-serif",gr=ui+"px "+tt,gt=f*.3,er=s*.12,hr=(f-gt)/2,or=s*.32,cr=s*.565,sr=!1,bt=t(o,o),d=bt.getContext("2d"),oi,at=t(o,o),ci=at.getContext("2d"),vt=t(o,o),li=vt.getContext("2d"),yt=t(o,o),ai=yt.getContext("2d"),lt=t(o,o),ki=lt.getContext("2d"),ot=t(o,o),l=ot.getContext("2d"),wt=t(o,o),yi=wt.getContext("2d"),vi=function(n,t){e.save(),e.textAlign="center",e.strokeStyle=ht.textColor,e.fillStyle=ht.textColor,n<0&&(n+=360),n="00"+Math.round(n),n=n.substring(n.length,n.length-3),(ht===steelseries.LcdColor.STANDARD||ht===steelseries.LcdColor.STANDARD_GREEN)&&(e.shadowColor="gray",e.shadowOffsetX=f*.007,e.shadowOffsetY=f*.007,e.shadowBlur=f*.007),e.font=pr?gr:br,e.fillText(n+"\u00b0",f/2+gt*.05,(t?or:cr)+er*.5+ui*.38,gt*.9),e.restore()},wi=function(n,t,i,r,u){n.save(),n.strokeStyle=r,n.fillStyle=r,n.lineWidth=f*.035;var e=bi/ur*t,o=e+(i-t)/(ur/bi);n.translate(c,h),n.rotate(ar),n.beginPath(),u?(n.moveTo(0,0),n.arc(0,0,f*.365-n.lineWidth/2,e,o,!1)):n.arc(0,0,f*.365,e,o,!1),u?(n.moveTo(0,0),n.fill()):n.stroke(),n.translate(-c,-h),n.restore()},lr=function(n){var l,o;n.textAlign="center",n.textBaseline="middle";var s=f*.38,v=f*.35,w=f*.355,p=f*.36,e=f*.1,y=f*.31,r=f*.36,t,u;n.save(),n.strokeStyle=k.labelColor.getRgbaColor(),n.fillStyle=k.labelColor.getRgbaColor(),n.translate(c,h);if(wr)for(t=Math.floor(.1*f)+"px serif bold",u=Math.floor(f*.04)+"px sans-serif",n.rotate(ct*5),i=5;360>=i;i+=5){n.save();switch(i){case 360:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[2],0,0,e),n.translate(-r,0);break;case 90:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[4],0,0,e),n.translate(-r,0);break;case 180:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[6],0,0,e),n.translate(-r,0);break;case 270:n.translate(r,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[0],0,0,e),n.translate(-r,0);break;case 5:case 85:case 95:case 175:case 185:case 265:case 275:case 355:break;default:(i+90)%20?(n.lineWidth=(i+90)%5?1.5:1,n.beginPath(),n.moveTo(s,0),l=(i+90)%10?p:v,n.lineTo(l,0),n.closePath(),n.stroke()):(n.lineWidth=1.5,n.beginPath(),n.moveTo(s,0),n.lineTo(v,0),n.closePath(),n.stroke(),o=(i+90)%360,n.translate(y,0),n.rotate(Math.PI/2),n.font=u,n.fillText("0".substring(o>=100)+o,0,0,e),n.translate(-y,0))}n.restore(),n.rotate(ct*5)}else for(t=.12*f+"px serif",u=.06*f+"px serif",n.lineWidth=1,n.strokeStyle=k.symbolColor.getRgbaColor(),i=0;360>i;i+=2.5){0==i%5&&(n.beginPath(),n.moveTo(f*.38,0),n.lineTo(f*.36,0),n.closePath(),n.stroke()),n.save();switch(i){case 0:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[2],0,0),n.translate(-f*.35,0);break;case 45:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[3],0,0),n.translate(-f*.29,0);break;case 90:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[4],0,0),n.translate(-f*.35,0);break;case 135:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[5],0,0),n.translate(-f*.29,0);break;case 180:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[6],0,0),n.translate(-f*.35,0);break;case 225:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[7],0,0),n.translate(-f*.29,0);break;case 270:n.translate(f*.35,0),n.rotate(Math.PI/2),n.font=t,n.fillText(a[0],0,0),n.translate(-f*.35,0);break;case 315:n.translate(f*.29,0),n.rotate(Math.PI/2),n.font=u,n.fillText(a[1],0,0),n.translate(-f*.29,0)}n.restore(),nr&&(0===i||22.5===i||45===i||67.5===i||90===i||112.5===i||135===i||157.5===i||180===i||202.5===i||225===i||247.5===i||270===i||292.5===i||315===i||337.5===i||360===i)&&(n.save(),n.beginPath(),i%45?n.moveTo(f*.29,0):n.moveTo(f*.38,0),n.lineTo(f*.1,0),n.closePath(),n.restore(),n.stroke()),n.rotate(ct*2.5)}n.translate(-c,-h),n.restore()},yr=function(n){ti.length>0&&(n.save(),n.textAlign="center",n.textBaseline="middle",n.fillStyle=tr?kt.medium.getRgbaColor():k.labelColor.getRgbaColor(),n.font=.04*f+"px sans-serif",n.fillText(ti[0],f/2,s*.29,f*.3),n.fillStyle=tr?ii.medium.getRgbaColor():k.labelColor.getRgbaColor(),n.fillText(ti[1],f/2,s*.71,f*.3),rr.length>0&&(n.fillStyle=k.labelColor.getRgbaColor(),n.font=.0467*f+"px sans-serif",n.fillText(rr,f/2,s*.5,f*.3)))},b=function(n){var t,i,u;n=n||{};var o=undefined===n.frame?!1:n.frame,r=undefined===n.background?!1:n.background,e=undefined===n.pointer?!1:n.pointer,l=undefined===n.foreground?!1:n.foreground;sr=!0,o&&di&&v(d,pi,c,h,f,s);if(r&&gi){w(d,k,c,h,f,s),rt(d,vr,c,h,f,s);if(null!==et&&0<et.length){t=et.length;do t--,wi(d,et[t].start,et[t].stop,et[t].color,!1);while(0<t)}if(null!==ft&&0<ft.length){i=ft.length;do i--,wi(d,ft[i].start,ft[i].stop,ft[i].color,!0);while(0<i)}lr(d)}r&&nr&&hi(d,c,h,f,s,k),r&&fr&&(oi=p(gt,er,ht),d.drawImage(oi,hr,or),d.drawImage(oi,hr,cr),yr(d)),e&&(nt(ai,f,ri,ii,k.labelColor),nt(ki,f,ri,kt,k.labelColor,!0),nt(ci,f,dt,kt,k.labelColor),nt(li,f,dt,kt,k.labelColor,!0)),l&&ir&&(u=dt.type==="type15"||dt.type==="type16"?!1:!0,y(yi,si,f,s,u,kr,dr))},pt=function(n){n=n||{};var r=undefined===n.background?!1:n.background,i=undefined===n.pointer?!1:n.pointer,t=undefined===n.foreground?!1:n.foreground;r&&(bt.width=o,bt.height=o,d=bt.getContext("2d")),i&&(at.width=o,at.height=o,ci=at.getContext("2d"),vt.width=o,vt.height=o,li=vt.getContext("2d"),yt.width=o,yt.height=o,ai=yt.getContext("2d"),lt.width=o,lt.height=o,ki=lt.getContext("2d"),ot.width=o,ot.height=o,l=ot.getContext("2d")),t&&(wt.width=o,wt.height=o,yi=wt.getContext("2d"))};return this.setValueLatest=function(n){n=n===360?360:n%360,it!==n&&(it=n,this.repaint())},this.getValueLatest=function(){return it},this.setValueAverage=function(n){n=n%360,g!==n&&(g=n,this.repaint())},this.getValueAverage=function(){return g},this.setValueAnimatedLatest=function(n){var t=n===360?360:n%360,i,r;it!==t&&(i=this,undefined!==ut&&ut.playing&&ut.stop(),r=ni(it,t),ut=new Tween({},"",Tween.regularEaseInOut,it,it+r,2.5),ut.onMotionChanged=function(n){it=n.target._pos%360,i.repaint()},t===360&&(ut.onMotionFinished=function(){it=t,i.repaint()}),ut.start())},this.setValueAnimatedAverage=function(n){var i=n===360?360:n%360,t,r;g!==n&&(t=this,undefined!==st&&st.playing&&st.stop(),r=ni(g,i),st=new Tween({},"",Tween.regularEaseInOut,g,g+r,2.5),st.onMotionChanged=function(n){g=n.target._pos%360,t.repaint()},i===360&&(ut.onMotionFinished=function(){g=i,t.repaint()}),st.start())},this.setArea=function(n){ft=n,b({background:!0}),this.repaint()},this.setSection=function(n){et=n,b({background:!0}),this.repaint()},this.setFrameDesign=function(n){pi=n,b({frame:!0,background:!0}),this.repaint()},this.setBackgroundColor=function(n){k=n,b({frame:!0,background:!0}),this.repaint()},this.setForegroundType=function(n){pt({foreground:!0}),si=n,b({foreground:!0}),this.repaint()},this.setPointerColor=function(n){pt({pointer:!0}),kt=n,b({pointer:!0}),this.repaint()},this.setPointerColorAverage=function(n){pt({pointer:!0}),ii=n,b({pointer:!0}),this.repaint()},this.setPointerType=function(n){pt({pointer:!0}),dt=n,b({pointer:!0}),this.repaint()},this.setPointerTypeAverage=function(n){pt({pointer:!0}),ri=n,b({pointer:!0}),this.repaint()},this.setPointSymbols=function(n){a=n,b({frame:!0,background:!0}),this.repaint()},this.setLcdColor=function(n){ht=n,b({background:!0}),this.repaint()},this.setLcdTitleStrings=function(n){ti=n,b({background:!0}),this.repaint()},this.repaint=function(){sr||b({frame:!0,background:!0,led:!0,pointer:!0,foreground:!0}),e.clearRect(0,0,e.canvas.width,e.canvas.height),(di||gi)&&e.drawImage(bt,0,0),fr&&(vi(it,!0),vi(g,!1)),fi=Math.PI/2+g*ct-Math.PI/2;var n=f*.006;l.clearRect(0,0,f,s),l.save(),l.translate(c,h),l.rotate(fi),l.translate(-c,-h),l.drawImage(lt,0,0),l.restore(),e.drawImage(ot,0,0,f,s,n,n,f+n,s+n),e.save(),e.translate(c,h),e.rotate(fi),e.translate(-c,-h),e.drawImage(yt,0,0),e.restore(),ei=Math.PI/2+it*ct-Math.PI/2,l.clearRect(0,0,f,s),l.save(),l.translate(c,h),l.rotate(ei),l.translate(-c,-h),l.drawImage(vt,0,0),l.restore(),e.drawImage(ot,0,0,f,s,n,n,f+n,s+n),e.save(),e.translate(c,h),e.rotate(ei),e.translate(-c,-h),e.drawImage(at,0,0),e.restore(),ir&&e.drawImage(wt,0,0)},this.repaint(),this},ru=function(n,i){i=i||{};var o=undefined===i.size?200:i.size,lt=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,vt=undefined===i.frameVisible?!0:i.frameVisible,st=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,yt=undefined===i.foregroundVisible?!0:i.foregroundVisible,nt=undefined===i.pointerColor?steelseries.ColorDef.WHITE:i.pointerColor,w,b,h=0,s=0,ot=Math.PI*o/360,et=0,g=!1,e=r.getElementById(n).getContext("2d");e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o;var u=o,f=o,l=u/2,c=f/2,ct=!1,k=t(o,o),ht=k.getContext("2d"),p=t(o,o*Math.PI),ft=p.getContext("2d"),a=t(o*.037383,o*.056074),ut=a.getContext("2d"),d=t(o,o),tt=d.getContext("2d"),pt=function(n){var t,u,i,f,h;n.save(),t=o,u=o*Math.PI,n.beginPath(),n.rect(0,0,t,u),n.closePath(),f=n.createLinearGradient(0,0,0,u),f.addColorStop(0,"#7fd5f0"),f.addColorStop(.5,"#7fd5f0"),f.addColorStop(.5,"#3c4439"),f.addColorStop(1,"#3c4439"),n.fillStyle=f,n.fill(),n.lineWidth=1;var s=u/72,e=!1,r=10;for(n.textAlign="center",n.textBaseline="middle",h=t*.04,n.font=h+"px sans-serif",n.fillStyle="#37596e",i=u/2-s;i>0;i-=s)r>90||(e?(n.fillText(r,(t-t*.2)/2-8,i,t*.375),n.fillText(r,t-(t-t*.2)/2+8,i,t*.375),n.beginPath(),n.moveTo((t-t*.2)/2,i),n.lineTo(t-(t-t*.2)/2,i),n.closePath(),r+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),e^=!0;for(e=!1,r=10,n.strokeStyle="#FFFFFF",n.lineWidth=1.5,n.beginPath(),n.moveTo(0,u/2),n.lineTo(t,u/2),n.closePath(),n.stroke(),n.fillStyle="#FFFFFF",n.lineWidth=1,i=u/2+s;i<=u;i+=s)r>90||(e?(n.fillText(-r,(t-t*.2)/2-8,i,t*.375),n.fillText(-r,t-(t-t*.2)/2+8,i,t*.375),n.beginPath(),n.moveTo((t-t*.2)/2,i),n.lineTo(t-(t-t*.2)/2,i),n.closePath(),r+=10):(n.beginPath(),n.moveTo((t-t*.1)/2,i),n.lineTo(t-(t-t*.1)/2,i),n.closePath()),n.stroke()),e^=!0;n.restore()},wt=function(n){var i,r,t;for(n.save(),n.fillStyle=nt.light.getRgbaColor(),n.beginPath(),n.moveTo(u*.476635,f*.5),n.bezierCurveTo(u*.476635,f*.514018,u*.485981,f*.523364,u*.5,f*.523364),n.bezierCurveTo(u*.514018,f*.523364,u*.523364,f*.514018,u*.523364,f*.5),n.bezierCurveTo(u*.523364,f*.485981,u*.514018,f*.476635,u*.5,f*.476635),n.bezierCurveTo(u*.485981,f*.476635,u*.476635,f*.485981,u*.476635,f*.5),n.closePath(),n.moveTo(u*.415887,f*.504672),n.lineTo(u*.415887,f*.495327),n.bezierCurveTo(u*.415887,f*.495327,u*.467289,f*.495327,u*.467289,f*.495327),n.bezierCurveTo(u*.471962,f*.481308,u*.481308,f*.471962,u*.495327,f*.467289),n.bezierCurveTo(u*.495327,f*.467289,u*.495327,f*.415887,u*.495327,f*.415887),n.lineTo(u*.504672,f*.415887),n.bezierCurveTo(u*.504672,f*.415887,u*.504672,f*.467289,u*.504672,f*.467289),n.bezierCurveTo(u*.518691,f*.471962,u*.528037,f*.481308,u*.53271,f*.495327),n.bezierCurveTo(u*.53271,f*.495327,u*.584112,f*.495327,u*.584112,f*.495327),n.lineTo(u*.584112,f*.504672),n.bezierCurveTo(u*.584112,f*.504672,u*.53271,f*.504672,u*.53271,f*.504672),n.bezierCurveTo(u*.528037,f*.518691,u*.518691,f*.53271,u*.5,f*.53271),n.bezierCurveTo(u*.481308,f*.53271,u*.471962,f*.518691,u*.467289,f*.504672),n.bezierCurveTo(u*.467289,f*.504672,u*.415887,f*.504672,u*.415887,f*.504672),n.closePath(),n.fill(),i=5,r=Math.PI/36,n.translate(l,c),n.rotate(-Math.PI/2),n.translate(-l,-c),t=-90;t<=90;t+=i)t%45==0||t===0?(n.strokeStyle=nt.medium.getRgbaColor(),n.lineWidth=2,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.113),n.closePath(),n.stroke()):t%15==0?(n.strokeStyle="#FFFFFF",n.lineWidth=1,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.103785),n.closePath(),n.stroke()):(n.strokeStyle="#FFFFFF",n.lineWidth=.5,n.beginPath(),n.moveTo(u*.5,f*.088785),n.lineTo(u*.5,f*.093785),n.closePath(),n.stroke()),n.translate(l,c),n.rotate(r,l,c),n.translate(-l,-c);n.restore()},at=function(n){n.save();var i=u*.037383,t=f*.056074;n.beginPath(),n.moveTo(i*.5,0),n.lineTo(0,t),n.lineTo(i,t),n.closePath(),n.fillStyle=nt.light.getRgbaColor(),n.fill(),n.strokeStyle=nt.medium.getRgbaColor(),n.stroke(),n.restore()},it=function(){ct=!0,vt&&v(ht,lt,l,c,u,f),pt(ft),at(ut),wt(tt),yt&&y(tt,st,u,f,!0,fi,oi,ai)},rt=function(){k.width=o,k.height=o,ht=k.getContext("2d"),p.width=o,p.height=o*Math.PI,ft=p.getContext("2d"),a.width=o*.037383,a.height=o*.056074,ut=a.getContext("2d"),d.width=o,d.height=o,tt=d.getContext("2d")};return this.setRoll=function(n){n=n%360,h!==n&&(h=n,this.repaint())},this.getRoll=function(){return h},this.setRollAnimated=function(n){n=n%360;if(h!==n){var t=this;undefined!==w&&w.playing&&w.stop(),w=new Tween({},"",Tween.regularEaseInOut,h,n,1),w.onMotionChanged=function(n){h=n.target._pos,t.repaint()},w.start()}},this.setPitch=function(n){n=(n+180-et)%360-180,s!==n&&(s=n,s>90?(s=180-s,g||this.setRoll(h-180),g=!0):s<-90?(s=-180-s,g||this.setRoll(h+180),g=!0):g=!1,this.repaint())},this.getPitch=function(){return s},this.setPitchAnimated=function(n){if(s!==n){undefined!==b&&b.playing&&b.stop();var t=this;b=new Tween({},"",Tween.regularEaseInOut,s,n,1),b.onMotionChanged=function(n){t.setPitch(n.target._pos)},b.start()}},this.setPitchOffset=function(n){et=n,this.repaint()},this.setFrameDesign=function(n){rt(),lt=n,it(),this.repaint()},this.setForegroundType=function(n){rt(),st=n,it(),this.repaint()},this.repaint=function(){ct||it(),e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(k,0,0),e.save(),e.beginPath(),e.arc(l,c,u*.831775/2,0,Math.PI*2,!0),e.closePath(),e.clip(),e.translate(l,c),e.rotate(-(h*Math.PI/180)),e.translate(-l,0),e.translate(0,s*ot),e.drawImage(p,0,-p.height/2),e.translate(0,-(s*ot)-c),e.drawImage(a,u*.5-a.width/2,u*.107476),e.restore(),e.drawImage(d,0,0),e.restore()},this.repaint(),this},nu=function(n,t){var a,e,h,f,c;t=t||{};var u=undefined===t.size?32:t.size,y=undefined===t.ledColor?steelseries.LedColor.RED_LED:t.ledColor,v=!1,p=0,i=r.getElementById(n).getContext("2d");i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.canvas.width=u,i.canvas.height=u,a=!1,e=r.createElement("canvas"),e.width=u,e.height=u,h=e.getContext("2d"),f=r.createElement("canvas"),f.width=u,f.height=u;var l=f.getContext("2d"),s=f,w=function(){a=!0,h.clearRect(0,0,h.canvas.width,h.canvas.height),h.drawImage(o(u,1,y),0,0),l.clearRect(0,0,l.canvas.width,l.canvas.height),l.drawImage(o(u,0,y),0,0)};return this.toggleLed=function(){s=s===e?f:e,c()},this.setLedColor=function(n){y=n,a=!1,c()},this.setLedOnOff=function(n){s=!0===n?e:f,c()},this.blink=function(n){n?v||(p=setInterval(this.toggleLed,1e3),v=!0):v&&(clearInterval(p),v=!1)},c=function(){a||w(),i.save(),i.clearRect(0,0,i.canvas.width,i.canvas.height),i.drawImage(s,0,0),i.restore()},c(),this},tu=function(n,i){i=i||{};var f=undefined===i.size?200:i.size,di=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,ki=undefined===i.frameVisible?!0:i.frameVisible,p=undefined===i.pointerType?steelseries.PointerType.TYPE1:i.pointerType,b=undefined===i.pointerColor?p===steelseries.PointerType.TYPE1?steelseries.ColorDef.GRAY:steelseries.ColorDef.BLACK:i.pointerColor,ut=undefined===i.backgroundColor?p===steelseries.PointerType.TYPE1?steelseries.BackgroundColor.ANTHRACITE:steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,yi=undefined===i.backgroundVisible?!0:i.backgroundVisible,bi=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,si=undefined===i.foregroundVisible?!0:i.foregroundVisible,or=undefined===i.customLayer?null:i.customLayer,nt=undefined===i.isAutomatic?!0:i.isAutomatic,l=undefined===i.hour?11:i.hour,a=undefined===i.minute?5:i.minute,d=undefined===i.second?0:i.second,kt=undefined===i.secondMovesContinuous?!1:i.secondMovesContinuous,dt=undefined===i.timeZoneOffsetHour?0:i.timeZoneOffsetHour,wt=undefined===i.timeZoneOffsetMinute?0:i.timeZoneOffsetMinute,bt=undefined===i.secondPointerVisible?!0:i.secondPointerVisible,k=new Date,ui,ri,ii,nr,it=kt?100:1e3;it=bt?it:100;var sr=this,hr=Math.PI/2,gt=Math.PI*2,tt=Math.PI/180,fi=6,o=r.getElementById(n).getContext("2d");o.save(),o.clearRect(0,0,o.canvas.width,o.canvas.height),o.canvas.width=f,o.canvas.height=f;var u=f,e=f,s=u/2,h=e/2,pi=!1,st=t(f,f),wi=st.getContext("2d"),et=t(f,f),ti=et.getContext("2d"),ot=t(f,f),gi=ot.getContext("2d"),pt=t(f,f),tr=pt.getContext("2d"),vt=t(f,f),rr=vt.getContext("2d"),lt=t(f,f),ir=lt.getContext("2d"),ht=t(f,f),hi=ht.getContext("2d"),yt=t(f,f),ai=yt.getContext("2d"),g=t(f,f),c=g.getContext("2d"),at=t(f,f),oi=at.getContext("2d"),fr=function(n,t){var i,e,o,r,f;r=u*.405,n.save(),n.translate(s,h);switch(t.type){case"type1":for(e=u*.074766,f=r-e,n.strokeStyle=ut.labelColor.getRgbaColor(),n.lineWidth=u*.014018,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*tt);for(o=u*.126168,f=r-o,n.lineWidth=u*.03271,i=0;i<360;i+=90)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(90*tt);break;case"type2":default:for(e=u*.037383,f=r-e,n.strokeStyle=ut.labelColor.getRgbaColor(),n.lineWidth=u*.009345,i=0;i<360;i+=6)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(6*tt);for(o=u*.084112,f=r-o,n.lineWidth=u*.028037,i=0;i<360;i+=30)n.beginPath(),n.moveTo(r,0),n.lineTo(f,0),n.closePath(),n.stroke(),n.rotate(30*tt)}n.translate(-s,-h),n.restore()},vi=function(n,t,i){n.save();var r;i&&(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)");switch(t.type){case"type2":n.beginPath(),n.lineWidth=u*.046728,n.moveTo(s,u*.289719),n.lineTo(s,u*.289719+u*.224299),i||(n.strokeStyle=b.medium.getRgbaColor()),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.471962,e*.560747),n.lineTo(u*.471962,e*.214953),n.lineTo(u*.5,e*.182242),n.lineTo(u*.528037,e*.214953),n.lineTo(u*.528037,e*.560747),n.lineTo(u*.471962,e*.560747),n.closePath(),i||(r=n.createLinearGradient(u*.471962,e*.560747,u*.528037,e*.214953),r.addColorStop(1,b.veryLight.getRgbaColor()),r.addColorStop(0,b.light.getRgbaColor()),n.fillStyle=r,n.strokeStyle=b.light.getRgbaColor()),n.fill(),n.stroke()}i&&blur(n,u,e,Math.floor(u*.006)),n.restore()},li=function(n,t,i){n.save();var r;i&&(n.fillStyle="rgba(0, 0, 0, 0.4)",n.strokeStyle="rgba(0, 0, 0, 0.4)");switch(t.type){case"type2":n.beginPath(),n.lineWidth=u*.03271,n.moveTo(s,u*.116822),n.lineTo(s,u*.116822+u*.38785),i||(n.strokeStyle=b.medium.getRgbaColor()),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.518691,e*.574766),n.lineTo(u*.523364,e*.135514),n.lineTo(u*.5,e*.107476),n.lineTo(u*.476635,e*.140186),n.lineTo(u*.476635,e*.574766),n.lineTo(u*.518691,e*.574766),n.closePath(),i||(r=n.createLinearGradient(u*.518691,e*.574766,u*.476635,e*.140186),r.addColorStop(1,b.veryLight.getRgbaColor()),r.addColorStop(0,b.light.getRgbaColor()),n.fillStyle=r,n.strokeStyle=b.light.getRgbaColor()),n.fill(),n.stroke()}i&&blur(n,u,e,Math.floor(u*.006)),n.restore()},ci=function(n,t,i){n.save();var r;i?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)"):(n.fillStyle=steelseries.ColorDef.RED.medium.getRgbaColor(),n.strokeStyle=steelseries.ColorDef.RED.medium.getRgbaColor());switch(t.type){case"type2":n.lineWidth=u*.009345,n.beginPath(),n.moveTo(s,u*.09813),n.lineTo(s,u*.09813+u*.126168),n.closePath(),n.stroke(),n.lineWidth=u*.018691,n.beginPath(),n.moveTo(s,u*.308411),n.lineTo(s,u*.308411+u*.191588),n.closePath(),n.stroke(),n.lineWidth=u*.016,n.beginPath(),n.arc(s,u*.26,u*.085/2,0,gt),n.closePath(),n.stroke();break;case"type1":default:n.beginPath(),n.moveTo(u*.509345,e*.116822),n.lineTo(u*.509345,e*.574766),n.lineTo(u*.490654,e*.574766),n.lineTo(u*.490654,e*.116822),n.lineTo(u*.509345,e*.116822),n.closePath(),i||(r=n.createLinearGradient(u*.509345,e*.116822,u*.490654,e*.574766),r.addColorStop(0,steelseries.ColorDef.RED.light.getRgbaColor()),r.addColorStop(.47,steelseries.ColorDef.RED.medium.getRgbaColor()),r.addColorStop(1,steelseries.ColorDef.RED.dark.getRgbaColor()),n.fillStyle=r,n.strokeStyle=steelseries.ColorDef.RED.dark.getRgbaColor()),n.fill(),n.stroke()}i&&blur(n,u,e,Math.floor(u*.006)),n.restore()},er=function(n){var i=u*.006,t;n.beginPath(),n.arc(s,h,u*.045,0,gt),n.closePath(),t=n.createLinearGradient(s-u*.045/2,h-u*.045/2,s+u*.045/2,h+u*.045/2),t.addColorStop(0,"#eef0f2"),t.addColorStop(1,"#65696d"),n.fillStyle=t,n.fill()},ur=function(n,t){var r=u*.006,i;n.save();switch(t.type){case"type2":n.fillStyle="#000000",n.beginPath(),n.arc(s,h,u*.088785/2,0,gt),n.closePath(),n.fill();break;case"type1":default:i=n.createLinearGradient(s-u*.027/2,h-u*.027/2,s+u*.027/2,h+u*.027/2),i.addColorStop(0,"#f3f4f7"),i.addColorStop(.11,"#f3f5f7"),i.addColorStop(.12,"#f1f3f5"),i.addColorStop(.2,"#c0c5cb"),i.addColorStop(.2,"#bec3c9"),i.addColorStop(1,"#bec3c9"),n.fillStyle=i,n.beginPath(),n.arc(s,h,u*.027,0,gt),n.closePath(),n.fill()}n.restore()},ni=function(n,t,i){ii=i*fi*tt,ui=t*fi*tt,ri=(n+t/60)*fi*5*tt},ei=function(){nt?k=new Date:(k.setHours(l),k.setMinutes(a),k.setSeconds(d)),d=k.getSeconds()+(kt?k.getMilliseconds()/1e3:0),l=dt!==0&&wt!==0?k.getUTCHours()+dt:k.getHours(),l=l%12,a=dt!==0&&wt!==0?k.getUTCMinutes()+wt:k.getMinutes(),a>60&&(a-=60,l++),a<0&&(a+=60,l--),l=l%12,ni(l,a,d),nt&&(nr=setTimeout(ei,it)),sr.repaint()},ft=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;pi=!0,r&&ki&&v(wi,di,s,h,u,e),f&&yi&&(w(ti,ut,s,h,u,e),rt(ti,or,s,h,u,e),fr(ti,p)),t&&(vi(gi,p,!1),vi(tr,p,!0),li(rr,p,!1),li(ir,p,!0),ci(hi,p,!1),ci(ai,p,!0)),i&&si&&(ur(oi,p),y(oi,bi,u,e,!1))},ct=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;r&&(st.width=f,st.height=f,wi=st.getContext("2d")),u&&(et.width=f,et.height=f,ti=et.getContext("2d")),t&&(ot.width=f,ot.height=f,gi=ot.getContext("2d"),pt.width=f,pt.height=f,tr=pt.getContext("2d"),vt.width=f,vt.height=f,rr=vt.getContext("2d"),lt.width=f,lt.height=f,ir=lt.getContext("2d"),ht.width=f,ht.height=f,hi=ht.getContext("2d"),yt.width=f,yt.height=f,ai=yt.getContext("2d"),g.width=f,g.height=f,c=g.getContext("2d")),i&&(at.width=f,at.height=f,oi=at.getContext("2d"))};return this.getAutomatic=function(){return nt},this.setAutomatic=function(n){nt&&!n?(clearTimer(nr),nt=n):!nt&&n&&(nt=n,ei())},this.getHour=function(){return l},this.setHour=function(n){n=n%12,l!==n&&(l=n,ni(l,a,d),this.repaint())},this.getMinute=function(){return a},this.setMinute=function(n){n=n%60,a!==n&&(a=n,ni(l,a,d),this.repaint())},this.getSecond=function(){return d},this.setSecond=function(n){d=n%60,d!==n&&(d=n,ni(l,a,d),this.repaint())},this.getTimeZoneOffsetHour=function(){return dt},this.setTimeZoneOffsetHour=function(n){dt=n,this.repaint()},this.getTimeZoneOffsetMinute=function(){return wt},this.setTimeZoneOffsetMinute=function(n){wt=n,this.repaint()},this.getSecondPointerVisible=function(){return bt},this.setSecondPointerVisible=function(n){bt=n,this.repaint()},this.getSecondMovesContinuous=function(){return kt},this.setSecondMovesContinuous=function(n){kt=n,it=kt?100:1e3,it=bt?it:100},this.setFrameDesign=function(n){ct({frame:!0}),di=n,ft({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){ct({frame:!0,background:!0}),ut=n,ft({frame:!0,background:!0}),this.repaint()},this.setForegroundType=function(n){ct({foreground:!0}),bi=n,ft({foreground:!0}),this.repaint()},this.setPointerType=function(n){ct({foreground:!0,pointers:!0}),p=n,p.type==="type1"?(b=steelseries.ColorDef.GRAY,ut=steelseries.BackgroundColor.ANTHRACITE):(b=steelseries.ColorDef.BLACK,ut=steelseries.BackgroundColor.LIGHT_GRAY),ft({background:!0,foreground:!0,pointers:!0}),this.repaint()},this.setPointerColor=function(n){ct({pointers:!0}),b=n,ft({pointers:!0}),this.repaint()},this.repaint=function(){pi||ft({frame:!0,background:!0,pointers:!0,foreground:!0}),o.clearRect(0,0,o.canvas.width,o.canvas.height),ki&&o.drawImage(st,0,0),yi&&o.drawImage(et,0,0);var n=u*.006;c.clearRect(0,0,u,e),c.save(),c.translate(s,h),c.rotate(ri),c.translate(-s,-h),c.drawImage(pt,0,0),c.restore(),o.drawImage(g,0,0,u,e,n,n,u+n,e+n),o.save(),o.translate(s,h),o.rotate(ri),o.translate(-s,-h),o.drawImage(ot,0,0),o.restore(),c.clearRect(0,0,u,e),c.save(),c.translate(s,h),c.rotate(ui),c.translate(-s,-h),c.drawImage(lt,0,0),c.restore(),o.drawImage(g,0,0,u,e,n,n,u+n,e+n),o.save(),o.translate(s,h),o.rotate(ui),o.translate(-s,-h),o.drawImage(vt,0,0),o.restore(),p.type==="type1"&&er(o),bt&&(c.clearRect(0,0,u,e),c.save(),c.translate(s,h),c.rotate(ii),c.translate(-s,-h),c.drawImage(yt,0,0),c.restore(),o.drawImage(g,0,0,u,e,n,n,u+n,e+n),o.save(),o.translate(s,h),o.rotate(ii),o.translate(-s,-h),o.drawImage(ht,0,0),o.restore()),si&&o.drawImage(at,0,0)},ei(),this},hr=function(t,i){var s;i=i||{};var o=undefined===i.size?50:i.size,f=undefined===i.value?50:i.value,e=o,h=Math.ceil(o*.45),u=r.getElementById(t).getContext("2d");return u.save(),u.clearRect(0,0,u.canvas.width,u.canvas.height),u.canvas.width=e,u.canvas.height=e,s=function(t,i,r,u){var f,e;t.beginPath(),t.moveTo(i*.025,r*.055555),t.lineTo(i*.9,r*.055555),t.lineTo(i*.9,r*.944444),t.lineTo(i*.025,r*.944444),t.lineTo(i*.025,r*.055555),t.closePath(),t.beginPath(),t.moveTo(i*.925,0),t.lineTo(0,0),t.lineTo(0,r),t.lineTo(i*.925,r),t.lineTo(i*.925,r*.722222),t.bezierCurveTo(i*.925,r*.722222,i*.975,r*.722222,i*.975,r*.722222),t.bezierCurveTo(i,r*.722222,i,r*.666666,i,r*.666666),t.bezierCurveTo(i,r*.666666,i,r*.333333,i,r*.333333),t.bezierCurveTo(i,r*.333333,i,r*.277777,i*.975,r*.277777),t.bezierCurveTo(i*.975,r*.277777,i*.925,r*.277777,i*.925,r*.277777),t.lineTo(i*.925,0),t.closePath(),f=t.createLinearGradient(0,0,0,r),f.addColorStop(0,"#ffffff"),f.addColorStop(1,"#7e7e7e"),t.fillStyle=f,t.fill(),t.beginPath(),e=Math.max(i*.875*(u/100),Math.ceil(i*.01)),t.rect(i*.025,i*.025,e,r*.888888),t.closePath();var a=[0,.4,1],l=[new n(177,25,2,1),new n(219,167,21,1),new n(121,162,75,1)],y=new kt(0,100,a,l);t.fillStyle=y.getColorAt(u/100).getRgbColor(),t.fill(),t.beginPath(),e=Math.max(e-i*.05,0),t.rect(i*.05,i*.05,e,r*.777777),t.closePath();var v=[new n(198,39,5,1),new n(228,189,32,1),new n(163,216,102,1)],h=[new n(246,121,48,1),new n(246,244,157,1),new n(223,233,86,1)],o=[0,.4,1],s=new kt(0,100,o,v),c=new kt(0,100,o,h);f=t.createLinearGradient(i*.05,0,i*.875,0),f.addColorStop(0,s.getColorAt(u/100).getRgbColor()),f.addColorStop(.5,c.getColorAt(u/100).getRgbColor()),f.addColorStop(1,s.getColorAt(u/100).getRgbColor()),t.fillStyle=f,t.fill(),t.beginPath(),t.rect(i*.025,i*.025,i*.875,r*.444444),t.closePath(),f=t.createLinearGradient(i*.025,i*.025,i*.875,r*.444444),f.addColorStop(0,"rgba(255, 255, 255, 0)"),f.addColorStop(1,"rgba(255, 255, 255, 0.8)"),t.fillStyle=f,t.fill()},this.setValue=function(n){n=n<0?0:n>100?100:n,f!==n&&(f=n,this.repaint())},this.getValue=function(){return f},this.repaint=function(){u.clearRect(0,0,u.canvas.width,u.canvas.height),s(u,e,h,f)},this.repaint(),this},cr=function(n,i){i=i||{};var f=undefined===i.size?200:i.size,li=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,oi=undefined===i.frameVisible?!0:i.frameVisible,h=undefined===i.pointerColor?steelseries.ColorDef.BLACK:i.pointerColor,lt=undefined===i.backgroundColor?steelseries.BackgroundColor.LIGHT_GRAY:i.backgroundColor,gt=undefined===i.backgroundVisible?!0:i.backgroundVisible,fi=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,vi=undefined===i.foregroundVisible?!0:i.foregroundVisible,gi=undefined===i.customLayer?null:i.customLayer,bt=0,at=0,kt,di=6,ct=Math.PI*2,pt=Math.PI/180,ki=this,yt=0,d=0,yi=0,pi=0,si=0,a=!1,k=!1,e=r.getElementById(n).getContext("2d"),u=f,c=f,o=u/2,l=c/2,p=.285*u,bi=o-p/2,b=.17*u,ci=!1,ht=t(f,f),hi=ht.getContext("2d"),nt=t(f,f),it=nt.getContext("2d"),tt=t(f,f),wi=tt.getContext("2d"),ut=t(f,f),ai=ut.getContext("2d"),st=t(f,f),ni=st.getContext("2d"),ft=t(f,f),ti=ft.getContext("2d"),g=t(f,f),s=g.getContext("2d"),et=t(f,f),ei=et.getContext("2d"),ui=function(n,t,i,r,u,f,e){var vt,ut=r*t,rt=ut+"px sans-serif",ot=t*.15,at=.5,g=1,ht=1.5,tt=u*t,d=Math.round(.025*t),nt=Math.round(.035*t),it=Math.round(.045*t),st=lt.labelColor.getRgbaColor(),k=lt.labelColor.getRgbaColor(),s=t/2,o=t*.4,h,a,w,y=0,b=0,ct=0,v,c=0,l=0,p,et=-Math.PI,ft=2*Math.PI/i;for(n.width=n.height=t,n.save(),n.textAlign="center",n.textBaseline="middle",n.font=rt,p=et,v=0;v<=i+1;p-=ft*.1,v+=.1)n.lineWidth=at,c=Math.sin(p),l=Math.cos(p),y%2==0&&(h=[s+(o-d)*c+f,s+(o-d)*l+e],a=[s+o*c+f,s+o*l+e],n.strokeStyle=k,n.beginPath(),n.moveTo(h[0],h[1]),n.lineTo(a[0],a[1]),n.closePath(),n.stroke()),(y===10||y===0)&&(n.fillStyle=st,n.lineWidth=g,a=[s+o*c+f,s+o*l+e],w=[s+(o-tt)*c+f,s+(o-tt)*l+e],b===5?(v!==i&&Math.round(v)!==60&&n.fillText(Math.round(v),w[0],w[1],ot),n.lineWidth=ht,h=[s+(o-it)*c+f,s+(o-it)*l+e],b=0):(n.lineWidth=g,h=[s+(o-nt)*c+f,s+(o-nt)*l+e]),n.strokeStyle=k,n.beginPath(),n.moveTo(h[0],h[1]),n.lineTo(a[0],a[1]),n.closePath(),n.stroke(),y=0,ct++,b++),y++;n.restore()},ii=function(n,t){var i,r;n.save(),n.beginPath(),n.moveTo(u*.509345,u*.457943),n.lineTo(u*.5,u*.102803),n.lineTo(u*.490654,u*.457943),n.bezierCurveTo(u*.490654,u*.457943,u*.490654,u*.457943,u*.490654,u*.457943),n.bezierCurveTo(u*.471962,u*.462616,u*.457943,u*.481308,u*.457943,u*.5),n.bezierCurveTo(u*.457943,u*.518691,u*.471962,u*.537383,u*.490654,u*.542056),n.bezierCurveTo(u*.490654,u*.542056,u*.490654,u*.542056,u*.490654,u*.542056),n.lineTo(u*.490654,u*.621495),n.lineTo(u*.509345,u*.621495),n.lineTo(u*.509345,u*.542056),n.bezierCurveTo(u*.509345,u*.542056,u*.509345,u*.542056,u*.509345,u*.542056),n.bezierCurveTo(u*.528037,u*.537383,u*.542056,u*.518691,u*.542056,u*.5),n.bezierCurveTo(u*.542056,u*.481308,u*.528037,u*.462616,u*.509345,u*.457943),n.bezierCurveTo(u*.509345,u*.457943,u*.509345,u*.457943,u*.509345,u*.457943),n.closePath(),t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)",n.fill()):(i=n.createLinearGradient(0,0,0,u*.621495),i.addColorStop(0,h.medium.getRgbaColor()),i.addColorStop(.388888,h.medium.getRgbaColor()),i.addColorStop(.5,h.light.getRgbaColor()),i.addColorStop(.611111,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor(),n.fill(),n.stroke()),t?blur(n,u,c,Math.floor(u*.006)):(n.beginPath(),r=u*.06542/2,n.arc(o,l,r,0,ct),i=n.createLinearGradient(o-r,o+r,0,o+r),i.addColorStop(0,"#e6b35c"),i.addColorStop(.01,"#e6b35c"),i.addColorStop(.99,"#c48200"),i.addColorStop(1,"#c48200"),n.fillStyle=i,n.closePath(),n.fill(),n.beginPath(),r=u*.046728/2,n.arc(o,l,r,0,ct),i=n.createRadialGradient(o,o,0,o,o,r),i.addColorStop(0,"#c5c5c5"),i.addColorStop(.19,"#c5c5c5"),i.addColorStop(.22,"#000000"),i.addColorStop(.8,"#000000"),i.addColorStop(.99,"#707070"),i.addColorStop(1,"#707070"),n.fillStyle=i,n.closePath(),n.fill()),n.restore()},ri=function(n,t){var i,r;n.save(),n.beginPath(),n.moveTo(u*.476635,u*.313084),n.bezierCurveTo(u*.476635,u*.322429,u*.485981,u*.331775,u*.495327,u*.336448),n.bezierCurveTo(u*.495327,u*.336448,u*.495327,u*.350467,u*.495327,u*.350467),n.lineTo(u*.504672,u*.350467),n.bezierCurveTo(u*.504672,u*.350467,u*.504672,u*.336448,u*.504672,u*.336448),n.bezierCurveTo(u*.514018,u*.331775,u*.523364,u*.322429,u*.523364,u*.313084),n.bezierCurveTo(u*.523364,u*.303738,u*.514018,u*.294392,u*.504672,u*.289719),n.bezierCurveTo(u*.504672,u*.289719,u*.5,u*.200934,u*.5,u*.200934),n.bezierCurveTo(u*.5,u*.200934,u*.495327,u*.289719,u*.495327,u*.289719),n.bezierCurveTo(u*.485981,u*.294392,u*.476635,u*.303738,u*.476635,u*.313084),n.closePath(),t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)",n.fill()):(i=n.createLinearGradient(0,0,u,0),i.addColorStop(0,h.medium.getRgbaColor()),i.addColorStop(.388888,h.medium.getRgbaColor()),i.addColorStop(.5,h.light.getRgbaColor()),i.addColorStop(.611111,h.medium.getRgbaColor()),i.addColorStop(1,h.medium.getRgbaColor()),n.fillStyle=i,n.strokeStyle=h.dark.getRgbaColor(),n.fill(),n.stroke()),t?blur(n,u,c,Math.floor(u*.006)):(n.beginPath(),r=u*.037383/2,n.arc(o,b+p/2,r,0,ct),n.fillStyle="#C48200",n.closePath(),n.fill(),n.beginPath(),r=u*.028037/2,n.arc(o,b+p/2,r,0,ct),n.fillStyle="#999999",n.closePath(),n.fill(),n.beginPath(),r=u*.018691/2,n.arc(o,b+p/2,r,0,ct),n.fillStyle="#000000",n.closePath(),n.fill()),n.restore()},wt=function(){d=+new Date-yt,at=d*di/1e3,bt=at%10800/30,yi=d/6e4%30,pi=d/1e3%60,si=d%1e3},ot=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,f=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;ci=!0,r&&oi&&v(hi,li,o,l,u,c),f&&gt&&(w(it,lt,o,l,u,c),rt(it,gi,o,l,u,c),ui(it,u,60,.075,.1,0,0),ui(it,p,30,.095,.13,bi,b)),t&&(ii(ni,!1),ii(ti,!0),ri(wi,!1),ri(ai,!0)),i&&vi&&y(ei,fi,u,c,!1)},vt=function(n){n=n||{};var r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground;r&&(ht.width=f,ht.height=f,hi=ht.getContext("2d")),u&&(nt.width=f,nt.height=f,it=nt.getContext("2d")),t&&(tt.width=f,tt.height=f,wi=tt.getContext("2d"),ut.width=f,ut.height=f,ai=ut.getContext("2d"),st.width=f,st.height=f,ni=st.getContext("2d"),ft.width=f,ft.height=f,ti=ft.getContext("2d"),g.width=f,g.height=f,s=g.getContext("2d")),i&&(et.width=f,et.height=f,ei=et.getContext("2d"))},dt=function(){k||(wt(),ki.repaint()),a&&(kt=setTimeout(dt,200))};return this.isRunning=function(){return a},this.start=function(){a||(a=!0,yt=+new Date-d,dt())},this.stop=function(){a&&(a=!1,clearTimeout(kt)),k&&(k=!1,wt(),this.repaint())},this.reset=function(){a&&(a=!1,k=!1,clearTimeout(kt)),yt=+new Date,wt(),this.repaint()},this.lap=function(){a&&!k?k=!0:k&&(k=!1)},this.getMeasuredTime=function(){return yi+":"+pi+":"+si},this.setFrameDesign=function(n){vt({frame:!0}),li=n,ot({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){vt({background:!0}),lt=n,ot({background:!0}),this.repaint()},this.setForegroundType=function(n){vt({foreground:!0}),fi=n,ot({foreground:!0}),this.repaint()},this.setPointerColor=function(n){vt({pointers:!0}),h=n,ot({pointers:!0}),this.repaint()},this.repaint=function(){ci||ot({frame:!0,background:!0,pointers:!0,foreground:!0}),e.clearRect(0,0,e.canvas.width,e.canvas.height),oi&&e.drawImage(ht,0,0),gt&&e.drawImage(nt,0,0);var n=u*.006,t=(bt+2*Math.sin(bt*pt))*pt;s.clearRect(0,0,u,c),s.save(),s.translate(o,b+p/2),s.rotate(t),s.translate(-o,-(b+p/2)),s.drawImage(ut,0,0),s.restore(),e.drawImage(g,0,0,u,c,n/2,n/2,u+n/2,c+n/2),e.save(),e.translate(o,b+p/2),e.rotate(t),e.translate(-o,-(b+p/2)),e.drawImage(tt,0,0),e.restore(),t=(at+2*Math.sin(at*pt))*pt,s.clearRect(0,0,u,c),s.save(),s.translate(o,l),s.rotate(t),s.translate(-o,-l),s.drawImage(ft,0,0),s.restore(),e.drawImage(g,0,0,u,c,n,n,u+n,c+n),e.save(),e.translate(o,l),e.rotate(t),e.translate(-o,-l),e.drawImage(st,0,0),e.restore(),vi&&e.drawImage(et,0,0)},e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=f,e.canvas.height=f,yt=+new Date,dt(),this},sr=function(n,i){function gi(){nt=2*Math.PI/(li-a),ht=nt/10,pt=ht/10}function nr(){yt=l%1e3/100,kt=l%1e4/100,wt=l%1e5/100}var o,bt,at,ut,ui,ri,fi,k,vt,vi,ct,lt,ai,a=0,li=10,l=a,yt=0,kt=0,wt=0,nt,ht,pt,rr=1,g,u,f,c,h,hi,e=r.getElementById(n).getContext("2d"),hr=Math.PI/2,cr=Math.PI/180,ur=Math.PI,ci=!1,ot=t(o,o),bi=ot.getContext("2d"),et=t(o,o),it=et.getContext("2d"),yi,pi=t(o,o),tr=pi.getContext("2d"),ti=t(o,o),ir=ti.getContext("2d"),ni=t(o,o),or=ni.getContext("2d"),ii=t(o,o),sr=ii.getContext("2d"),ei=t(o,o),fr=ei.getContext("2d"),oi=t(o,o),er=oi.getContext("2d"),b=t(o,o),s=b.getContext("2d"),ft=t(o,o),si=ft.getContext("2d"),d,st;i=i||{},o=undefined===i.size?200:i.size,bt=undefined===i.frameDesign?steelseries.FrameDesign.METAL:i.frameDesign,at=undefined===i.frameVisible?!0:i.frameVisible,ut=undefined===i.backgroundColor?steelseries.BackgroundColor.DARK_GRAY:i.backgroundColor,ui=undefined===i.backgroundVisible?!0:i.backgroundVisible,ri=undefined===i.knobType?steelseries.KnobType.METAL_KNOB:i.knobType,fi=undefined===i.knobStyle?steelseries.KnobStyle.BLACK:i.knobStyle,k=undefined===i.lcdColor?steelseries.LcdColor.BLACK:i.lcdColor,vt=undefined===i.lcdVisible?!0:i.lcdVisible,vi=undefined===i.digitalFont?!1:i.digitalFont,ct=undefined===i.foregroundType?steelseries.ForegroundType.TYPE1:i.foregroundType,lt=undefined===i.foregroundVisible?!0:i.foregroundVisible,ai=undefined===i.customLayer?null:i.customLayer,e.save(),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.canvas.width=o,e.canvas.height=o,u=o,f=o,c=u/2,h=f/2,hi=Math.floor(u*.09)+"px sans-serif";var di=function(n){e.save(),e.textAlign="right",e.textBaseline="middle",e.strokeStyle=k.textColor,e.fillStyle=k.textColor,(k===steelseries.LcdColor.STANDARD||k===steelseries.LcdColor.STANDARD_GREEN)&&(e.shadowColor="gray",e.shadowOffsetX=u*.007,e.shadowOffsetY=u*.007,e.shadowBlur=u*.009),e.font=vi?Math.floor(u*.075)+"px "+tt:Math.floor(u*.075)+"px sans-serif",e.fillText(Math.round(n),(u+u*.4)/2-4,u*.607,u*.4),e.restore()},ki=function(n,t,i,r,f,e){var it=Math.max(u*.012,2),rt=Math.max(u*.007,1.5),d=u*.13,g=u*.05,nt=u*.07,v=u*.4,b=0,ft=0,p=0,y=0,k,w,tt=-i-t/2;for(n.save(),n.textAlign="center",n.textBaseline="middle",n.font=hi,n.strokeStyle=ut.labelColor.getRgbaColor(),n.fillStyle=ut.labelColor.getRgbaColor(),k=tt,w=0;w<=10;k-=e*.1,w+=.1)p=Math.sin(k),y=Math.cos(k),b%2==0&&(n.lineWidth=rt,n.beginPath(),n.moveTo(c+(v-g)*p,h+(v-g)*y),n.lineTo(c+v*p,h+v*y),n.closePath(),n.stroke()),(b===10||b===0)&&(n.lineWidth=it,t===0&&Math.round(w)!==li&&n.fillText(Math.round(w).toString(),c+(v-d)*p,h+(v-d)*y),b=0,ft++,n.beginPath(),n.moveTo(c+(v-nt)*p,h+(v-nt)*y),n.lineTo(c+v*p,h+v*y),n.closePath(),n.stroke()),b++;n.restore()},dt=function(n,t){var i;t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)"):(i=n.createLinearGradient(0,f*.168224,0,f*.626168),i.addColorStop(0,"#ffffff"),i.addColorStop(.31,"#ffffff"),i.addColorStop(.3101,"#ffffff"),i.addColorStop(.32,"#202020"),i.addColorStop(1,"#202020"),n.fillStyle=i),n.save(),n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.471962,u*.509345,f*.467289,u*.509345,f*.467289),n.lineTo(u*.509345,f*.200934),n.lineTo(u*.5,f*.168224),n.lineTo(u*.490654,f*.200934),n.lineTo(u*.490654,f*.467289),n.bezierCurveTo(u*.490654,f*.467289,u*.481308,f*.471962,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.514018,u*.476635,f*.528037,u*.490654,f*.53271),n.bezierCurveTo(u*.490654,f*.53271,u*.490654,f*.579439,u*.490654,f*.588785),n.bezierCurveTo(u*.485981,f*.593457,u*.481308,f*.59813,u*.481308,f*.607476),n.bezierCurveTo(u*.481308,f*.616822,u*.490654,f*.626168,u*.5,f*.626168),n.bezierCurveTo(u*.509345,f*.626168,u*.518691,f*.616822,u*.518691,f*.607476),n.bezierCurveTo(u*.518691,f*.59813,u*.514018,f*.593457,u*.504672,f*.588785),n.bezierCurveTo(u*.504672,f*.579439,u*.504672,f*.53271,u*.509345,f*.53271),n.bezierCurveTo(u*.523364,f*.528037,u*.53271,f*.514018,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),t&&blur(n,u,f,Math.floor(u*.006)),n.restore()},gt=function(n,t){var i;t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)"):(i=n.createLinearGradient(0,f*.401869,0,f*.616822),i.addColorStop(0,"#ffffff"),i.addColorStop(.51,"#ffffff"),i.addColorStop(.52,"#ffffff"),i.addColorStop(.5201,"#202020"),i.addColorStop(.53,"#202020"),i.addColorStop(1,"#202020"),n.fillStyle=i),n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.462616,u*.528037,f*.401869,u*.528037,f*.401869),n.lineTo(u*.5,f*.331775),n.lineTo(u*.471962,f*.401869),n.bezierCurveTo(u*.471962,f*.401869,u*.485981,f*.462616,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.514018,u*.476635,f*.528037,u*.490654,f*.53271),n.bezierCurveTo(u*.490654,f*.53271,u*.462616,f*.574766,u*.462616,f*.593457),n.bezierCurveTo(u*.467289,f*.616822,u*.5,f*.612149,u*.5,f*.612149),n.bezierCurveTo(u*.5,f*.612149,u*.53271,f*.616822,u*.537383,f*.593457),n.bezierCurveTo(u*.537383,f*.574766,u*.509345,f*.53271,u*.509345,f*.53271),n.bezierCurveTo(u*.523364,f*.528037,u*.53271,f*.514018,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),t&&blur(n,u,f,Math.floor(u*.006)),n.restore()},wi=function(n,t){t?(n.fillStyle="rgba(0, 0, 0, 0.5)",n.strokeStyle="rgba(0, 0, 0, 0.5)"):n.fillStyle="#ffffff",n.beginPath(),n.moveTo(u*.518691,f*.471962),n.bezierCurveTo(u*.514018,f*.471962,u*.514018,f*.467289,u*.514018,f*.467289),n.lineTo(u*.514018,f*.317757),n.lineTo(u*.504672,f*.303738),n.lineTo(u*.504672,f*.182242),n.lineTo(u*.53271,f*.116822),n.lineTo(u*.462616,f*.116822),n.lineTo(u*.495327,f*.182242),n.lineTo(u*.495327,f*.299065),n.lineTo(u*.485981,f*.317757),n.lineTo(u*.485981,f*.467289),n.bezierCurveTo(u*.485981,f*.467289,u*.485981,f*.471962,u*.481308,f*.471962),n.bezierCurveTo(u*.471962,f*.481308,u*.467289,f*.490654,u*.467289,f*.5),n.bezierCurveTo(u*.467289,f*.518691,u*.481308,f*.53271,u*.5,f*.53271),n.bezierCurveTo(u*.518691,f*.53271,u*.53271,f*.518691,u*.53271,f*.5),n.bezierCurveTo(u*.53271,f*.490654,u*.528037,f*.481308,u*.518691,f*.471962),n.closePath(),n.fill(),t&&blur(n,u,f,Math.floor(u*.006))};return d=function(n){var e,t,r,i;n=n||{},e=undefined===n.frame?!1:n.frame,t=undefined===n.background?!1:n.background,r=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground,ci=!0,gi(),e&&at&&v(bi,bt,c,h,u,f),t&&ui&&(w(it,ut,c,h,u,f),rt(it,ai,c,h,u,f),ki(it,0,ur,0,10,nt,rr,0,!0,!0,null)),t&&vt&&(yi=p(u*.4,f*.09,k),it.drawImage(yi,(u-u*.4)/2,f*.56)),r&&(dt(fr,!1),dt(er,!0),gt(or,!1),gt(sr,!0),wi(tr,!1),wi(ir,!0)),i&&lt&&y(si,ct,u,f,!0,ri,fi)},st=function(n){var r,u,t,i;n=n||{},r=undefined===n.frame?!1:n.frame,u=undefined===n.background?!1:n.background,t=undefined===n.pointers?!1:n.pointers,i=undefined===n.foreground?!1:n.foreground,r&&(ot.width=o,ot.height=o,bi=ot.getContext("2d")),u&&(et.width=o,et.height=o,it=et.getContext("2d")),t&&(pointer100ftBuffer.width=o,pointer100ftBuffer.height=o,pointer100ftContext=pointer100ftBuffer.getContext("2d"),pointer100ftShadowBuffer.width=o,pointer100ftShadowBuffer.height=o,pointer100ftShadowContext=pointer100ftShadowBuffer.getContext("2d"),pointer1000ftBuffer.width=o,pointer1000ftBuffer.height=o,pointer1000ftContext=pointer1000ftBuffer.getContext("2d"),pointer1000ftShadowBuffer.width=o,pointer1000ftShadowBuffer.height=o,pointer1000ftShadowContext=pointer1000ftShadowBuffer.getContext("2d"),pointer10000ftBuffer.width=o,pointer10000ftBuffer.height=o,pointer10000ftContext=pointer10000ftBuffer.getContext("2d"),pointer10000ftShadowBuffer.width=o,pointer10000ftShadowBuffer.height=o,pointer10000ftShadowContext=pointer10000ftShadowBuffer.getContext("2d"),b.width=o,b.height=o,s=b.getContext("2d")),i&&(ft.width=o,ft.height=o,si=ft.getContext("2d"))},this.setValue=function(n){l=n,this.repaint()},this.getValue=function(){return l},this.setValueAnimated=function(n){var t=n<a?a:n,r=this,i;l!==t&&(undefined!==g&&g.playing&&g.stop(),i=Math.max(Math.abs(l-t)/2e3,1),g=new Tween({},"",Tween.regularEaseInOut,l,t,i),g.onMotionChanged=function(n){l=n.target._pos,r.repaint()},g.start())},this.setFrameDesign=function(n){st({frame:!0}),bt=n,d({frame:!0}),this.repaint()},this.setBackgroundColor=function(n){st({background:!0,pointer:!0}),ut=n,d({background:!0,pointer:!0}),this.repaint()},this.setForegroundType=function(n){st({foreground:!0}),ct=n,d({foreground:!0}),this.repaint()},this.setLcdColor=function(n){k=n,d({background:!0}),this.repaint()},this.repaint=function(){ci||d({frame:!0,background:!0,led:!0,pointers:!0,foreground:!0}),e.clearRect(0,0,e.canvas.width,e.canvas.height),at&&e.drawImage(ot,0,0),e.drawImage(et,0,0),vt&&di(l),nr();var n=u*.006*.5;s.clearRect(0,0,u,f),s.save(),s.translate(c,h),s.rotate((wt-a)*pt),s.translate(-c,-h),s.drawImage(ti,0,0),s.restore(),e.drawImage(b,0,0,u,f,n,n,u+n,f+n),e.save(),e.translate(c,h),e.rotate((wt-a)*pt),e.translate(-c,-h),e.drawImage(pi,0,0),e.restore(),s.clearRect(0,0,u,f),s.save(),s.translate(c,h),s.rotate((kt-a)*ht),s.translate(-c,-h),s.drawImage(ii,0,0),s.restore(),e.drawImage(b,0,0,u,f,n,n,u+n,f+n),n=u*.006*.75,e.save(),e.translate(c,h),e.rotate((kt-a)*ht),e.translate(-c,-h),e.drawImage(ni,0,0),e.restore(),n=u*.006,s.clearRect(0,0,u,f),s.save(),s.translate(c,h),s.rotate((yt-a)*nt),s.translate(-c,-h),s.drawImage(oi,0,0),s.restore(),e.drawImage(b,0,0,u,f,n,n,u+n,f+n),e.save(),e.translate(c,h),e.rotate((yt-a)*nt),e.translate(-c,-h),e.drawImage(ei,0,0),e.restore(),lt&&e.drawImage(ft,0,0)},this.repaint(),this},lr=function(n,t){function at(n,t,i){var u=r.createElement("canvas");return u.width=n,u.height=t,i(u.getContext("2d")),u}var w,b,f,tt,i,u,d=!1,nt=!1,g=!1,rt=!1,k=r.createElement("canvas"),bt=k.getContext("2d"),p=r.createElement("canvas"),ft=p.getContext("2d"),s=r.createElement("canvas"),kt=s.getContext("2d"),h=r.createElement("canvas"),wt=h.getContext("2d"),o=r.createElement("canvas"),yt=o.getContext("2d"),e=r.createElement("canvas"),pt=e.getContext("2d"),c=r.createElement("canvas"),dt=c.getContext("2d"),v=r.createElement("canvas"),ii=v.getContext("2d"),l=r.createElement("canvas"),ri=l.getContext("2d"),a=r.createElement("canvas"),ti=a.getContext("2d"),y,it;t=t||{},w=undefined===t.width?98:t.width,b=undefined===t.height?278:t.height,f=r.getElementById(n).getContext("2d"),f.save(),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.canvas.width=w,f.canvas.height=b,tt=w<b*.352517?w*2.836734:b,i=tt*.352517,u=tt,k.width=i,k.height=u,p.width=i,p.height=u,s.width=i,s.height=u,h.width=i,h.height=u,o.width=i,o.height=u,e.width=i,e.height=u,c.width=i,c.height=u,v.width=i,v.height=u,l.width=i,l.height=u,a.width=i,a.height=u;var gt=function(n){var r,t;n.save(),n.save(),n.beginPath(),n.moveTo(.107142*i,0),n.lineTo(i-.107142*i,0),n.quadraticCurveTo(i,0,i,.107142*i),n.lineTo(i,u-.107142*i),n.quadraticCurveTo(i,u,i-.107142*i,u),n.lineTo(.107142*i,u),n.quadraticCurveTo(0,u,0,u-.107142*i),n.lineTo(0,.107142*i),n.quadraticCurveTo(0,0,.107142*i,u),n.closePath(),r=n.createLinearGradient(.040816*i,.007194*u,.952101*i,.995882*u),r.addColorStop(0,"rgb(152, 152, 154)"),r.addColorStop(.01,"rgb(152, 152, 154)"),r.addColorStop(.09,"#333333"),r.addColorStop(.24,"rgb(152, 152, 154)"),r.addColorStop(.55,"rgb(31, 31, 31)"),r.addColorStop(.78,"#363636"),r.addColorStop(.98,"#000000"),r.addColorStop(1,"#000000"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.030612*i+.084183*i,.010791*u),n.lineTo(.030612*i+.938775*i-.084183*i,.010791*u),n.quadraticCurveTo(.030612*i+.938775*i,.010791*u,.030612*i+.938775*i,.010791*u+.084183*i),n.lineTo(.030612*i+.938775*i,.010791*u+.978417*u-.084183*i),n.quadraticCurveTo(.030612*i+.938775*i,.010791*u+.978417*u,.030612*i+.938775*i-.084183*i,.010791*u+.978417*u),n.lineTo(.030612*i+.084183*i,.010791*u+.978417*u),n.quadraticCurveTo(.030612*i,.010791*u+.978417*u,.030612*i,.010791*u+.978417*u-.084183*i),n.lineTo(.030612*i,.010791*u+.084183*i),n.quadraticCurveTo(.030612*i,.010791*u,.030612*i+.084183*i,.010791*u),n.closePath(),t=n.createLinearGradient(-.132653*i,-.053956*u,2.061408*i,.667293*u),t.addColorStop(0,"#000000"),t.addColorStop(.01,"#000000"),t.addColorStop(.16,"#373735"),t.addColorStop(.31,"#000000"),t.addColorStop(.44,"#303030"),t.addColorStop(.65,"#000000"),t.addColorStop(.87,"#363636"),t.addColorStop(.98,"#000000"),t.addColorStop(1,"#000000"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},ni=function(n){var t,f,r,e;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.805755*u,.397959*i,0,2*Math.PI,!1),t=n.createLinearGradient(0,.665467*u,0,.946043*u),t.addColorStop(0,"#ffffff"),t.addColorStop(.05,"rgb(204, 204, 204)"),t.addColorStop(.1,"rgb(153, 153, 153)"),t.addColorStop(.17,"#666666"),t.addColorStop(.27,"#333333"),t.addColorStop(1,"#010101"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.083333,1),n.beginPath(),n.arc(.461538*i,.816546*u,.367346*i,0,2*Math.PI,!1),f=n.createLinearGradient(0,.68705*u,0,.946043*u),f.addColorStop(0,"#000000"),f.addColorStop(.35,"#040404"),f.addColorStop(.66,"#000000"),f.addColorStop(1,"#010101"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.357142*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.362244*i),r.addColorStop(0,"#000000"),r.addColorStop(.88,"#000000"),r.addColorStop(.95,"rgb(94, 94, 94)"),r.addColorStop(1,"#010101"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.357142*i,0,2*Math.PI,!1),e=n.createLinearGradient(0,.68705*u,0,.917266*u),e.addColorStop(0,"#000000"),e.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.restore()},et=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.32653*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.32653*i),r.addColorStop(0,"rgb(85, 185, 123)"),r.addColorStop(1,"rgb(0, 31, 0)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.812949*u),n.bezierCurveTo(0,.910071*u,.224489*i,.989208*u,.5*i,.989208*u),n.bezierCurveTo(.77551*i,.989208*u,i,.910071*u,i,.809352*u),n.bezierCurveTo(.908163*i,.751798*u,.704081*i,.68705*u,.5*i,.68705*u),n.bezierCurveTo(.285714*i,.68705*u,.081632*i,.751798*u,0,.812949*u),n.closePath(),t=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.515306*i),t.addColorStop(0,"rgb(65, 187, 126)"),t.addColorStop(1,"rgba(4, 37, 8, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},ot=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.32653*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.32653*i),r.addColorStop(0,"rgba(0, 255, 0, 0.25)"),r.addColorStop(1,"rgba(0, 255, 0, 0.05)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.809352*u,.32653*i,0,2*Math.PI,!1),t=n.createRadialGradient(.5*i,.809352*u,0,.5*i,.809352*u,.32653*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.12)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.12)"),t.addColorStop(1,"rgba(0, 0, 0, 0.5)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(y,"repeat"),n.fill(),n.restore()},st=function(n){var t,f,r,e;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.496402*u,.397959*i,0,2*Math.PI,!1),t=n.createLinearGradient(0,.356115*u,0,.63669*u),t.addColorStop(0,"#ffffff"),t.addColorStop(.05,"rgb(204, 204, 204)"),t.addColorStop(.1,"rgb(153, 153, 153)"),t.addColorStop(.17,"#666666"),t.addColorStop(.27,"#333333"),t.addColorStop(1,"#010101"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.083333,1),n.beginPath(),n.arc(.461538*i,.507194*u,.367346*i,0,2*Math.PI,!1),f=n.createLinearGradient(0,.377697*u,0,.63669*u),f.addColorStop(0,"#000000"),f.addColorStop(.35,"#040404"),f.addColorStop(.66,"#000000"),f.addColorStop(1,"#010101"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.357142*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.362244*i),r.addColorStop(0,"#000000"),r.addColorStop(.88,"#000000"),r.addColorStop(.95,"#5e5e5e"),r.addColorStop(1,"#010101"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.357142*i,0,2*Math.PI,!1),e=n.createLinearGradient(0,.377697*u,0,.607913*u),e.addColorStop(0,"#000000"),e.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.restore()},ut=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653*i),r.addColorStop(0,"#fed434"),r.addColorStop(1,"#82330c"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.503597*u),n.bezierCurveTo(0,.600719*u,.224489*i,.679856*u,.5*i,.679856*u),n.bezierCurveTo(.77551*i,.679856*u,i,.600719*u,i,.5*u),n.bezierCurveTo(.908163*i,.442446*u,.704081*i,.377697*u,.5*i,.377697*u),n.bezierCurveTo(.285714*i,.377697*u,.081632*i,.442446*u,0,.503597*u),n.closePath(),t=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.515306*i),t.addColorStop(0,"#fed434"),t.addColorStop(1,"rgba(130, 51, 12, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},vt=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653*i),r.addColorStop(0,"rgba(255, 255, 0, 0.25)"),r.addColorStop(1,"rgba(255, 255, 0, 0.05)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.5*u,.32653*i,0,2*Math.PI,!1),t=n.createRadialGradient(.5*i,.5*u,0,.5*i,.5*u,.32653*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.12)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.13)"),t.addColorStop(1,"rgba(0, 0, 0, 0.5)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(y,"repeat"),n.fill(),n.restore()},lt=function(n){var t,f,r,e;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.18705*u,.397959*i,0,2*Math.PI,!1),t=n.createLinearGradient(.5*i,.046762*u,.5*i,.327338*u),t.addColorStop(0,"#ffffff"),t.addColorStop(.05,"#cccccc"),t.addColorStop(.1,"#999999"),t.addColorStop(.17,"#666666"),t.addColorStop(.27,"#333333"),t.addColorStop(1,"#010101"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.scale(1.083333,1),n.beginPath(),n.arc(.461538*i,.197841*u,.367346*i,0,2*Math.PI,!1),f=n.createLinearGradient(.5*i,.068345*u,.5*i,.327338*u),f.addColorStop(0,"#000000"),f.addColorStop(.35,"#040404"),f.addColorStop(.66,"#000000"),f.addColorStop(1,"#010101"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.357142*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.362244*i),r.addColorStop(0,"#000000"),r.addColorStop(.88,"#000000"),r.addColorStop(.95,"#5e5e5e"),r.addColorStop(1,"#010101"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.357142*i,0,2*Math.PI,!1),e=n.createLinearGradient(.5*i,.068345*u,.5*i,.298561*u),e.addColorStop(0,"#000000"),e.addColorStop(1,"rgba(1, 1, 1, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.restore()},ct=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.32653*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.32653*i),r.addColorStop(0,"#ff0000"),r.addColorStop(1,"#410004"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(0,.194244*u),n.bezierCurveTo(0,.291366*u,.224489*i,.370503*u,.5*i,.370503*u),n.bezierCurveTo(.77551*i,.370503*u,i,.291366*u,i,.190647*u),n.bezierCurveTo(.908163*i,.133093*u,.704081*i,.068345*u,.5*i,.068345*u),n.bezierCurveTo(.285714*i,.068345*u,.081632*i,.133093*u,0,.194244*u),n.closePath(),t=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.515306*i),t.addColorStop(0,"#ff0000"),t.addColorStop(1,"rgba(118, 5, 1, 0)"),n.fillStyle=t,n.fill(),n.restore(),n.restore()},ht=function(n){var r,t;n.save(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.32653*i,0,2*Math.PI,!1),r=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.32653*i),r.addColorStop(0,"rgba(255, 0, 0, 0.25)"),r.addColorStop(1,"rgba(255, 0, 0, 0.05)"),n.fillStyle=r,n.fill(),n.restore(),n.save(),n.scale(1,1),n.beginPath(),n.arc(.5*i,.190647*u,.32653*i,0,2*Math.PI,!1),t=n.createRadialGradient(.5*i,.190647*u,0,.5*i,.190647*u,.32653*i),t.addColorStop(0,"rgba(1, 1, 1, 0)"),t.addColorStop(.55,"rgba(0, 0, 0, 0)"),t.addColorStop(.5501,"rgba(0, 0, 0, 0)"),t.addColorStop(.78,"rgba(0, 0, 0, 0.12)"),t.addColorStop(.79,"rgba(0, 0, 0, 0.13)"),t.addColorStop(1,"rgba(0, 0, 0, 0.5)"),n.fillStyle=t,n.fill(),n.restore(),n.fillStyle=n.createPattern(y,"repeat"),n.fill(),n.restore()};return y=at(2,2,function(n){n.save(),n.strokeStyle="rgba(0, 0, 0, 0.1)",n.beginPath(),n.lineTo(0,0,1,0),n.lineTo(0,1,0,1),n.stroke(),n.restore()}),it=function(){rt=!0,gt(bt),ni(ft),et(kt),ot(wt),st(yt),ut(pt),vt(dt),lt(ii),ct(ri),ht(ti)},this.setRedOn=function(n){d=n,this.repaint()},this.isRedOn=function(){return d},this.setYellowOn=function(n){nt=n,this.repaint()},this.isYellowOn=function(){return nt},this.setGreenOn=function(n){g=n,this.repaint()},this.isGreenOn=function(){return g},this.repaint=function(){rt||it(),f.save(),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.drawImage(k,0,0),f.drawImage(p,0,0),g&&f.drawImage(s,0,0),f.drawImage(h,0,0),f.drawImage(o,0,0),nt&&f.drawImage(e,0,0),f.drawImage(c,0,0),f.drawImage(v,0,0),d&&f.drawImage(l,0,0),f.drawImage(a,0,0),f.restore()},this.repaint(),this},yr=function(n,t){function tt(n,t,i){var u=r.createElement("canvas");return u.width=n,u.height=t,i(u.getContext("2d")),u}var f,l,c,e,a,u,i,b=!1,v=!1,y=1,h=r.createElement("canvas"),g=h.getContext("2d"),o=r.createElement("canvas"),ut=o.getContext("2d"),s=r.createElement("canvas"),it=s.getContext("2d"),p;t=t||{},l=undefined===t.width?100:t.width,c=undefined===t.height?100:t.height,e=undefined===t.glowColor?"#ffff00":t.glowColor,f=document.getElementById(n).getContext("2d"),f.save(),f.clearRect(0,0,f.canvas.width,f.canvas.height),f.canvas.width=l,f.canvas.height=c,a=l<c?l:c,u=a,i=a,p=function(n){var t,i=tt(1,1,function(t){t.fillStyle=n,t.beginPath(),t.rect(0,0,1,1),t.fill()});return t=i.getContext("2d").getImageData(0,0,2,2).data,[t[0],t[1],t[2]]},h.width=u,h.height=i,o.width=u,o.height=i,s.width=u,s.height=i;var rt=function(n){var t;n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.289473*u,.438596*i),n.bezierCurveTo(.289473*u,.561403*i,.385964*u,.605263*i,.385964*u,.745614*i),n.bezierCurveTo(.385964*u,.745614*i,.587719*u,.745614*i,.587719*u,.745614*i),n.bezierCurveTo(.587719*u,.605263*i,.692982*u,.561403*i,.692982*u,.438596*i),n.bezierCurveTo(.692982*u,.324561*i,.605263*u,.22807*i,.5*u,.22807*i),n.bezierCurveTo(.385964*u,.22807*i,.289473*u,.324561*i,.289473*u,.438596*i),n.closePath(),t=n.createLinearGradient(0,.289473*i,0,.701754*i),t.addColorStop(0,"#eeeeee"),t.addColorStop(.99,"#999999"),t.addColorStop(1,"#999999"),n.fillStyle=t,n.fill(),n.lineCap="butt",n.lineJoin="round",n.lineWidth=.008771*u,n.strokeStyle="#cccccc",n.stroke(),n.restore(),n.restore()},d=function(n){var t,h=p(e),o=h[0],r=h[1],s=h[2],f=ar(o,r,s);n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.289473*u,.438596*i),n.bezierCurveTo(.289473*u,.561403*i,.385964*u,.605263*i,.385964*u,.745614*i),n.bezierCurveTo(.385964*u,.745614*i,.587719*u,.745614*i,.587719*u,.745614*i),n.bezierCurveTo(.587719*u,.605263*i,.692982*u,.561403*i,.692982*u,.438596*i),n.bezierCurveTo(.692982*u,.324561*i,.605263*u,.22807*i,.5*u,.22807*i),n.bezierCurveTo(.385964*u,.22807*i,.289473*u,.324561*i,.289473*u,.438596*i),n.closePath(),t=n.createLinearGradient(0,.289473*i,0,.701754*i),o===r&&r===s?(t.addColorStop(0,"hsl(0, 60%, 0%)"),t.addColorStop(1,"hsl(0, 40%, 0%)")):(t.addColorStop(0,"hsl("+f[0]*255+", "+f[1]*100+"%, 70%)"),t.addColorStop(1,"hsl("+f[0]*255+", "+f[1]*100+"%, 80%)")),n.fillStyle=t,n.shadowOffsetX=0,n.shadowOffsetY=0,n.shadowBlur=30,n.shadowColor=e,n.fill(),n.lineCap="butt",n.lineJoin="round",n.lineWidth=.008771*u,n.strokeStyle="rgba("+o+", "+r+", "+s+", 0.4)",n.stroke(),n.restore(),n.restore()},k=function(n){var e,t,f,r;n.save(),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.save(),n.beginPath(),n.moveTo(.350877*u,.333333*i),n.bezierCurveTo(.350877*u,.280701*i,.41228*u,.236842*i,.5*u,.236842*i),n.bezierCurveTo(.578947*u,.236842*i,.64035*u,.280701*i,.64035*u,.333333*i),n.bezierCurveTo(.64035*u,.385964*i,.578947*u,.429824*i,.5*u,.429824*i),n.bezierCurveTo(.41228*u,.429824*i,.350877*u,.385964*i,.350877*u,.333333*i),n.closePath(),e=n.createLinearGradient(0,.245614*i,0,.429824*i),e.addColorStop(0,"#ffffff"),e.addColorStop(.99,"rgba(255, 255, 255, 0)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),n.fillStyle=e,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.377192*u,.745614*i),n.bezierCurveTo(.377192*u,.745614*i,.429824*u,.72807*i,.491228*u,.72807*i),n.bezierCurveTo(.561403*u,.72807*i,.605263*u,.736842*i,.605263*u,.736842*i),n.lineTo(.605263*u,.763157*i),n.lineTo(.596491*u,.780701*i),n.lineTo(.605263*u,.798245*i),n.lineTo(.596491*u,.815789*i),n.lineTo(.605263*u,.833333*i),n.lineTo(.596491*u,.850877*i),n.lineTo(.605263*u,.868421*i),n.lineTo(.596491*u,.885964*i),n.lineTo(.605263*u,.894736*i),n.bezierCurveTo(.605263*u,.894736*i,.570175*u,.95614*i,.535087*u,.991228*i),n.bezierCurveTo(.526315*u,.991228*i,.517543*u,i,.5*u,i),n.bezierCurveTo(.482456*u,i,.473684*u,i,.464912*u,.991228*i),n.bezierCurveTo(.421052*u,.947368*i,.394736*u,.903508*i,.394736*u,.903508*i),n.lineTo(.394736*u,.894736*i),n.lineTo(.385964*u,.885964*i),n.lineTo(.394736*u,.868421*i),n.lineTo(.385964*u,.850877*i),n.lineTo(.394736*u,.833333*i),n.lineTo(.385964*u,.815789*i),n.lineTo(.394736*u,.798245*i),n.lineTo(.377192*u,.789473*i),n.lineTo(.394736*u,.771929*i),n.lineTo(.377192*u,.763157*i),n.lineTo(.377192*u,.745614*i),n.closePath(),t=n.createLinearGradient(.473684*u,.72807*i,.484702*u,.938307*i),t.addColorStop(0,"#333333"),t.addColorStop(.04,"#d9dad6"),t.addColorStop(.19,"#e4e5e0"),t.addColorStop(.24,"#979996"),t.addColorStop(.31,"#fbffff"),t.addColorStop(.4,"#818584"),t.addColorStop(.48,"#f5f7f4"),t.addColorStop(.56,"#959794"),t.addColorStop(.64,"#f2f2f0"),t.addColorStop(.7,"#828783"),t.addColorStop(.78,"#fcfcfc"),t.addColorStop(1,"#666666"),n.fillStyle=t,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.377192*u,.745614*i),n.bezierCurveTo(.377192*u,.745614*i,.429824*u,.72807*i,.491228*u,.72807*i),n.bezierCurveTo(.561403*u,.72807*i,.605263*u,.736842*i,.605263*u,.736842*i),n.lineTo(.605263*u,.763157*i),n.lineTo(.596491*u,.780701*i),n.lineTo(.605263*u,.798245*i),n.lineTo(.596491*u,.815789*i),n.lineTo(.605263*u,.833333*i),n.lineTo(.596491*u,.850877*i),n.lineTo(.605263*u,.868421*i),n.lineTo(.596491*u,.885964*i),n.lineTo(.605263*u,.894736*i),n.bezierCurveTo(.605263*u,.894736*i,.570175*u,.95614*i,.535087*u,.991228*i),n.bezierCurveTo(.526315*u,.991228*i,.517543*u,i,.5*u,i),n.bezierCurveTo(.482456*u,i,.473684*u,i,.464912*u,.991228*i),n.bezierCurveTo(.421052*u,.947368*i,.394736*u,.903508*i,.394736*u,.903508*i),n.lineTo(.394736*u,.894736*i),n.lineTo(.385964*u,.885964*i),n.lineTo(.394736*u,.868421*i),n.lineTo(.385964*u,.850877*i),n.lineTo(.394736*u,.833333*i),n.lineTo(.385964*u,.815789*i),n.lineTo(.394736*u,.798245*i),n.lineTo(.377192*u,.789473*i),n.lineTo(.394736*u,.771929*i),n.lineTo(.377192*u,.763157*i),n.lineTo(.377192*u,.745614*i),n.closePath(),f=n.createLinearGradient(.377192*u,.789473*i,.605263*u,.789473*i),f.addColorStop(0,"rgba(0, 0, 0, 0.4)"),f.addColorStop(.15,"rgba(0, 0, 0, 0.32)"),f.addColorStop(.85,"rgba(0, 0, 0, 0.33)"),f.addColorStop(1,"rgba(0, 0, 0, 0.4)"),n.fillStyle=f,n.fill(),n.restore(),n.save(),n.beginPath(),n.moveTo(.421052*u,.947368*i),n.bezierCurveTo(.438596*u,.95614*i,.447368*u,.973684*i,.464912*u,.991228*i),n.bezierCurveTo(.473684*u,i,.482456*u,i,.5*u,i),n.bezierCurveTo(.517543*u,i,.526315*u,.991228*i,.535087*u,.991228*i),n.bezierCurveTo(.543859*u,.982456*i,.561403*u,.95614*i,.578947*u,.947368*i),n.bezierCurveTo(.552631*u,.938596*i,.526315*u,.938596*i,.5*u,.938596*i),n.bezierCurveTo(.473684*u,.938596*i,.447368*u,.938596*i,.421052*u,.947368*i),n.closePath(),r=n.createLinearGradient(0,.938596*i,0,i),r.addColorStop(0,"#050a06"),r.addColorStop(.61,"#070602"),r.addColorStop(.71,"#999288"),r.addColorStop(.83,"#010101"),r.addColorStop(1,"#000000"),n.fillStyle=r,n.fill(),n.restore(),n.restore()},nt=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,n.canvas.width,n.canvas.height),n.restore()},w=function(){b=!0,rt(g),d(ut),k(it)};return this.setOn=function(n){v=n,this.repaint()},this.isOn=function(){return v},this.setAlpha=function(n){y=n,this.repaint()},this.getAlpha=function(){return y},this.setGlowColor=function(n){e=n,w(),this.repaint()},this.getGlowColor=function(){return e},this.repaint=function(){b||w(),nt(f),f.save(),f.drawImage(h,0,0),f.globalAlpha=y,v&&f.drawImage(o,0,0),f.globalAlpha=1,f.drawImage(s,0,0),f.restore()},this.repaint(),this},pr=function(n,i){function vt(){var t,n;for(ht=!0,v.rect(0,0,c,o),t=v.createLinearGradient(0,0,0,o),t.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)"),v.fillStyle=t,v.fill(),r.rect(0,0,f,s*1.1),r.fillStyle=lt,r.fill(),r.strokeStyle="#f0f0f0",r.lineWidth="1px",r.moveTo(0,0),r.lineTo(0,s*1.1),r.stroke(),r.strokeStyle="#202020",r.moveTo(f,0),r.lineTo(f,s*1.1),r.stroke(),r.textAlign="center",r.textBaseline="middle",r.font=ut,r.fillStyle=ct,n=9;n<21;n++)r.fillText(n%10,f*.5,h*(n-9)+h/2);if(l>0)for(u.rect(0,0,f,s*1.1),u.fillStyle=ot,u.fill(),u.strokeStyle="#f0f0f0",u.lineWidth="1px",u.moveTo(0,0),u.lineTo(0,s*1.1),u.stroke(),u.strokeStyle="#202020",u.moveTo(f,0),u.lineTo(f,s*1.1),u.stroke(),u.textAlign="center",u.textBaseline="middle",u.font=ut,u.fillStyle=et,n=9;n<21;n++)u.fillText(n%10,f*.5,h*(n-9)+h/2);for(n=0;n<p+l;n++)g[n]=Math.random()*rt*o-rt*o/2}function at(){for(var s=1,u,t,i,o,r=e,n=0;n<l;n++)r*=10;for(t=Math.floor(r),i=r-t,t=String(t),o=9,n=0;n<l+p;n++)u=+t.substring(t.length-n-1,t.length-n)||0,o!==9&&(i=0),n<l?w.drawImage(d,c-f*s,-(h*(u+i)+tt+g[n])):w.drawImage(b,c-f*s,-(h*(u+i)+tt+g[n])),s++,o=u}var yt=document,it,o,p,l,ot,et,st,e,lt,ct,rt,ht=!1,a,y,ft,f,ut,c,s,h,tt,g=[],k,w,nt,v,b,r,d,u;i=i||{},it=undefined===i.height?null:i._context,o=undefined===i.height?40:i.height,p=undefined===i.digits?6:i.digits,l=undefined===i.decimals?1:i.decimals,ot=undefined===i.decimalBackColor?"#F0F0F0":i.decimalBackColor,et=undefined===i.decimalForeColor?"#F01010":i.decimalForeColor,st=undefined===i.font?"sans-serif":i.font,e=undefined===i.value?0:i.value,lt=undefined===i.valueBackColor?"#050505":i.valueBackColor,ct=undefined===i.valueForeColor?"#F8F8F8":i.valueForeColor,rt=undefined===i.wobbleFactor?.07:i.wobbleFactor,y=it?it:yt.getElementById(n).getContext("2d"),e<0&&(e=0),ft=Math.floor(o*.85),ut="600 "+ft+"px "+st,f=Math.floor(o*.68),c=f*(p+l),s=ft*11,h=s/12,tt=h*.81,y.canvas.width=c,y.canvas.height=o,k=t(c,o),w=k.getContext("2d"),nt=t(c,o),v=nt.getContext("2d"),b=t(f,s*1.1),r=b.getContext("2d"),d=t(f,s*1.1),u=d.getContext("2d"),this.setValueAnimated=function(n){var t=this;n<0&&(n=0),e!==n&&(undefined!==a&&a.playing&&a.stop(),a=new Tween({},"",Tween.strongEaseOut,e,n,2),a.onMotionChanged=function(n){e=n.target._pos,t.repaint()},a.start()),this.repaint()},this.setValue=function(n){e=n,e<0&&(e=0),this.repaint()},this.getValue=function(){return e},this.repaint=function(){ht||vt(),at(),w.drawImage(nt,0,0),y.drawImage(k,0,0)},this.repaint()},hi=function(n,t,i,r,u,f){var c=!0,e,o,h=Math.PI/180,s=f.symbolColor.getRgbaColor();for(n.save(),n.lineWidth=1,n.fillStyle=s,n.strokeStyle=s,n.translate(t,i),e=0;e<360;e+=15)c=!c,n.beginPath(),n.arc(0,0,r*.26,e*h,(e+15)*h,!1),n.arc(0,0,r*.23,(e+15)*h,e*h,!0),n.closePath(),c&&n.fill(),n.stroke();for(n.translate(-t,-i),e=0;360>=e;e+=90)n.beginPath(),n.moveTo(r*.560747,u*.584112),n.lineTo(r*.640186,u*.644859),n.lineTo(r*.584112,u*.560747),n.lineTo(r*.560747,u*.584112),n.closePath(),n.fillStyle=s,n.fill(),n.stroke(),n.beginPath(),n.moveTo(r*.523364,u*.397196),n.lineTo(r*.5,u*.196261),n.lineTo(r*.471962,u*.397196),n.lineTo(r*.523364,u*.397196),n.closePath(),o=n.createLinearGradient(.476635*r,0,.518691*r,0),o.addColorStop(0,"rgb(222, 223, 218)"),o.addColorStop(.48,"rgb(222, 223, 218)"),o.addColorStop(.49,s),o.addColorStop(1,s),n.fillStyle=o,n.fill(),n.stroke(),n.translate(t,i),n.rotate(e*Math.PI/180),n.translate(-t,-i);n.beginPath(),n.translate(t,i),n.arc(0,0,r*.1,0,Math.PI*2,!1),n.lineWidth=r*.022,n.stroke(),n.translate(-t,-i),n.restore()},nt=function(n,i,r,u,f,e){var l,o,s,h,c=i.toString()+r.type+u.light.getHexColor()+u.medium.getHexColor()+e;if(!nt.cache[c]){l=t(i,i),o=l.getContext("2d"),e&&(o.fillStyle="rgba(0, 0, 0, 1)",o.strokeStyle="rgba(0, 0, 0, 1)",o.shadowBlur=3,o.globalAlpha=.5);switch(r.type){case"type2":e||(s=o.createLinearGradient(0,i*.471962,0,i*.130841),s.addColorStop(0,f.getRgbaColor()),s.addColorStop(.36,f.getRgbaColor()),s.addColorStop(.361,u.light.getRgbaColor()),s.addColorStop(1,u.light.getRgbaColor()),o.fillStyle=s),o.beginPath(),o.moveTo(i*.518691,i*.471962),o.lineTo(i*.509345,i*.462616),o.lineTo(i*.509345,i*.341121),o.lineTo(i*.504672,i*.130841),o.lineTo(i*.495327,i*.130841),o.lineTo(i*.490654,i*.341121),o.lineTo(i*.490654,i*.462616),o.lineTo(i*.481308,i*.471962),o.closePath(),o.fill();break;case"type3":o.beginPath(),o.rect(i*.495327,i*.130841,i*.009345,i*.373831),o.closePath(),e||(o.fillStyle=u.light.getRgbaColor()),o.fill();break;case"type4":e||(s=o.createLinearGradient(.467289*i,0,.528036*i,0),s.addColorStop(0,u.dark.getRgbaColor()),s.addColorStop(.51,u.dark.getRgbaColor()),s.addColorStop(.52,u.light.getRgbaColor()),s.addColorStop(1,u.light.getRgbaColor()),o.fillStyle=s),o.beginPath(),o.moveTo(i*.5,i*.126168),o.lineTo(i*.514018,i*.135514),o.lineTo(i*.53271,i*.5),o.lineTo(i*.523364,i*.602803),o.lineTo(i*.476635,i*.602803),o.lineTo(i*.467289,i*.5),o.lineTo(i*.485981,i*.135514),o.lineTo(i*.5,i*.126168),o.closePath(),o.fill();break;case"type5":e||(s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,u.light.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.5,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s),o.beginPath(),o.moveTo(i*.5,i*.495327),o.lineTo(i*.528037,i*.495327),o.lineTo(i*.5,i*.149532),o.lineTo(i*.471962,i*.495327),o.lineTo(i*.5,i*.495327),o.closePath(),o.fill(),o.lineWidth=1,o.lineCap="square",o.lineJoin="miter",e||(o.strokeStyle=u.dark.getRgbaColor()),o.stroke();break;case"type6":e||(o.fillStyle=u.medium.getRgbaColor()),o.beginPath(),o.moveTo(i*.481308,i*.485981),o.lineTo(i*.481308,i*.392523),o.lineTo(i*.485981,i*.317757),o.lineTo(i*.495327,i*.130841),o.lineTo(i*.504672,i*.130841),o.lineTo(i*.514018,i*.317757),o.lineTo(i*.518691,i*.38785),o.lineTo(i*.518691,i*.485981),o.lineTo(i*.504672,i*.485981),o.lineTo(i*.504672,i*.38785),o.lineTo(i*.5,i*.317757),o.lineTo(i*.495327,i*.392523),o.lineTo(i*.495327,i*.485981),o.lineTo(i*.481308,i*.485981),o.closePath(),o.fill();break;case"type7":e||(s=o.createLinearGradient(.481308*i,0,.518691*i,0),s.addColorStop(0,u.dark.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s),o.beginPath(),o.moveTo(i*.490654,i*.130841),o.lineTo(i*.481308,i*.5),o.lineTo(i*.518691,i*.5),o.lineTo(i*.504672,i*.130841),o.lineTo(i*.490654,i*.130841),o.closePath(),o.fill();break;case"type8":e||(s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,u.light.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.5,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.dark.getRgbaColor()),o.beginPath(),o.moveTo(i*.5,i*.53271),o.lineTo(i*.53271,i*.5),o.bezierCurveTo(i*.53271,i*.5,i*.509345,i*.457943,i*.5,i*.149532),o.bezierCurveTo(i*.490654,i*.457943,i*.467289,i*.5,i*.467289,i*.5),o.lineTo(i*.5,i*.53271),o.closePath(),o.fill(),o.stroke();break;case"type9":e||(s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,"rgb(50, 50, 50)"),s.addColorStop(.5,"#666666"),s.addColorStop(1,"rgb(50, 50, 50)"),o.fillStyle=s,o.strokeStyle="#2E2E2E"),o.beginPath(),o.moveTo(i*.495327,i*.233644),o.lineTo(i*.504672,i*.233644),o.lineTo(i*.514018,i*.439252),o.lineTo(i*.485981,i*.439252),o.lineTo(i*.495327,i*.233644),o.closePath(),o.moveTo(i*.490654,i*.130841),o.lineTo(i*.471962,i*.471962),o.lineTo(i*.471962,i*.528037),o.bezierCurveTo(i*.471962,i*.528037,i*.476635,i*.602803,i*.476635,i*.602803),o.bezierCurveTo(i*.476635,i*.607476,i*.481308,i*.607476,i*.5,i*.607476),o.bezierCurveTo(i*.518691,i*.607476,i*.523364,i*.607476,i*.523364,i*.602803),o.bezierCurveTo(i*.523364,i*.602803,i*.528037,i*.528037,i*.528037,i*.528037),o.lineTo(i*.528037,i*.471962),o.lineTo(i*.509345,i*.130841),o.lineTo(i*.490654,i*.130841),o.closePath(),o.fill(),o.beginPath(),o.moveTo(i*.495327,i*.219626),o.lineTo(i*.504672,i*.219626),o.lineTo(i*.504672,i*.135514),o.lineTo(i*.495327,i*.135514),o.lineTo(i*.495327,i*.219626),o.closePath(),e||(o.fillStyle=u.medium.getRgbaColor()),o.fill();break;case"type10":o.beginPath(),o.moveTo(i*.5,i*.149532),o.bezierCurveTo(i*.5,i*.149532,i*.443925,i*.490654,i*.443925,i*.5),o.bezierCurveTo(i*.443925,i*.53271,i*.467289,i*.556074,i*.5,i*.556074),o.bezierCurveTo(i*.53271,i*.556074,i*.556074,i*.53271,i*.556074,i*.5),o.bezierCurveTo(i*.556074,i*.490654,i*.5,i*.149532,i*.5,i*.149532),o.closePath(),e||(s=o.createLinearGradient(.471962*i,0,.528036*i,0),s.addColorStop(0,u.light.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.5,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.medium.getRgbaColor()),o.lineWidth=1,o.lineCap="square",o.lineJoin="miter",o.fill(),o.stroke();break;case"type11":o.beginPath(),o.moveTo(.5*i,.168224*i),o.lineTo(.485981*i,.5*i),o.bezierCurveTo(.485981*i,.5*i,.481308*i,.584112*i,.5*i,.584112*i),o.bezierCurveTo(.514018*i,.584112*i,.509345*i,.5*i,.509345*i,.5*i),o.lineTo(.5*i,.168224*i),o.closePath(),e||(s=o.createLinearGradient(0,.168224*i,0,.584112*i),s.addColorStop(0,u.medium.getRgbaColor()),s.addColorStop(1,u.dark.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.dark.getRgbaColor()),o.fill(),o.stroke();break;case"type12":o.beginPath(),o.moveTo(.5*i,.168224*i),o.lineTo(.485981*i,.5*i),o.lineTo(.5*i,.504672*i),o.lineTo(.509345*i,.5*i),o.lineTo(.5*i,.168224*i),o.closePath(),e||(s=o.createLinearGradient(0,.168224*i,0,.504672*i),s.addColorStop(0,u.medium.getRgbaColor()),s.addColorStop(1,u.dark.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.dark.getRgbaColor()),o.fill(),o.stroke();break;case"type13":case"type14":o.beginPath(),o.moveTo(.485981*i,.168224*i),o.lineTo(.5*i,.130841*i),o.lineTo(.509345*i,.168224*i),o.lineTo(.509345*i,.509345*i),o.lineTo(.485981*i,.509345*i),o.lineTo(.485981*i,.168224*i),o.closePath(),e||(r.type==="type13"?(s=o.createLinearGradient(0,.5*i,0,.130841*i),s.addColorStop(0,f.getRgbaColor()),s.addColorStop(.85,f.getRgbaColor()),s.addColorStop(.85,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s):(s=o.createLinearGradient(.485981*i,0,.509345*i,0),s.addColorStop(0,u.veryDark.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(1,u.veryDark.getRgbaColor()),o.fillStyle=s)),o.fill();break;case"type15":case"type16":o.beginPath(),o.moveTo(i*.509345,i*.457943),o.lineTo(i*.5015,i*.13),o.lineTo(i*.4985,i*.13),o.lineTo(i*.490654,i*.457943),o.bezierCurveTo(i*.490654,i*.457943,i*.490654,i*.457943,i*.490654,i*.457943),o.bezierCurveTo(i*.471962,i*.462616,i*.457943,i*.481308,i*.457943,i*.5),o.bezierCurveTo(i*.457943,i*.518691,i*.471962,i*.537383,i*.490654,i*.542056),o.bezierCurveTo(i*.490654,i*.542056,i*.490654,i*.542056,i*.490654,i*.542056),r.type==="type15"?(o.lineTo(i*.490654,i*.57),o.bezierCurveTo(i*.46,i*.58,i*.46,i*.62,i*.490654,i*.63),o.bezierCurveTo(i*.47,i*.62,i*.48,i*.59,i*.5,i*.59),o.bezierCurveTo(i*.53,i*.59,i*.52,i*.62,i*.509345,i*.63),o.bezierCurveTo(i*.54,i*.62,i*.54,i*.58,i*.509345,i*.57),o.lineTo(i*.509345,i*.57)):(o.lineTo(i*.490654,i*.621495),o.lineTo(i*.509345,i*.621495)),o.lineTo(i*.509345,i*.542056),o.bezierCurveTo(i*.509345,i*.542056,i*.509345,i*.542056,i*.509345,i*.542056),o.bezierCurveTo(i*.528037,i*.537383,i*.542056,i*.518691,i*.542056,i*.5),o.bezierCurveTo(i*.542056,i*.481308,i*.528037,i*.462616,i*.509345,i*.457943),o.bezierCurveTo(i*.509345,i*.457943,i*.509345,i*.457943,i*.509345,i*.457943),o.closePath(),e?o.fill():(s=r.type==="type15"?o.createLinearGradient(0,0,0,i*.63):o.createLinearGradient(0,0,0,i*.621495),s.addColorStop(0,u.medium.getRgbaColor()),s.addColorStop(.388888,u.medium.getRgbaColor()),s.addColorStop(.5,u.light.getRgbaColor()),s.addColorStop(.611111,u.medium.getRgbaColor()),s.addColorStop(1,u.medium.getRgbaColor()),o.fillStyle=s,o.strokeStyle=u.dark.getRgbaColor(),o.fill(),o.stroke()),e||(o.beginPath(),h=i*.06542/2,o.arc(i*.5,i*.5,h,0,Math.PI*2),s=o.createLinearGradient(i*.5-h,i*.5+h,0,i*.5+h),s.addColorStop(0,"#e6b35c"),s.addColorStop(.01,"#e6b35c"),s.addColorStop(.99,"#c48200"),s.addColorStop(1,"#c48200"),o.fillStyle=s,o.closePath(),o.fill(),o.beginPath(),h=i*.046728/2,o.arc(i*.5,i*.5,h,0,Math.PI*2),s=o.createRadialGradient(i*.5,i*.5,0,i*.5,i*.5,h),s.addColorStop(0,"#c5c5c5"),s.addColorStop(.19,"#c5c5c5"),s.addColorStop(.22,"#000000"),s.addColorStop(.8,"#000000"),s.addColorStop(.99,"#707070"),s.addColorStop(1,"#707070"),o.fillStyle=s,o.closePath(),o.fill());break;case"type1":default:e||(s=o.createLinearGradient(0,i*.471962,0,i*.130841),s.addColorStop(0,u.veryDark.getRgbaColor()),s.addColorStop(.3,u.medium.getRgbaColor()),s.addColorStop(.59,u.medium.getRgbaColor()),s.addColorStop(1,u.veryDark.getRgbaColor()),o.fillStyle=s),o.beginPath(),o.moveTo(i*.518691,i*.471962),o.bezierCurveTo(i*.514018,i*.457943,i*.509345,i*.415887,i*.509345,i*.401869),o.bezierCurveTo(i*.504672,i*.383177,i*.5,i*.130841,i*.5,i*.130841),o.bezierCurveTo(i*.5,i*.130841,i*.490654,i*.383177,i*.490654,i*.397196),o.bezierCurveTo(i*.490654,i*.415887,i*.485981,i*.457943,i*.481308,i*.471962),o.bezierCurveTo(i*.471962,i*.481308,i*.467289,i*.490654,i*.467289,i*.5),o.bezierCurveTo(i*.467289,i*.518691,i*.481308,i*.53271,i*.5,i*.53271),o.bezierCurveTo(i*.518691,i*.53271,i*.53271,i*.518691,i*.53271,i*.5),o.bezierCurveTo(i*.53271,i*.490654,i*.528037,i*.481308,i*.518691,i*.471962),o.closePath(),o.fill()}nt.cache[c]=l}return n.drawImage(nt.cache[c],0,0),this},v,ht,w,rt,ot,y,et,e,o,p,a,d,h,u,b,ut,at,pt,ri,dt,g,l,lt,gt,bt,yt;nt.cache={},v=function(i,r,u,f,e,o){var w,s,h,y,c,l,a,p=e.toString()+o+r.design;if(!v.cache[p]){w=t(e,o),s=w.getContext("2d"),s.fillStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.5)",s.beginPath(),s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.fill(),s.stroke(),s.beginPath(),s.arc(u,f,e*.990654/2,0,Math.PI*2,!0),s.closePath();switch(r.design){case"metal":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"#fefefe"),h.addColorStop(.07,"rgb(210, 210, 210)"),h.addColorStop(.12,"rgb(179, 179, 179)"),h.addColorStop(1,"rgb(213, 213, 213)"),s.fillStyle=h,s.fill();break;case"brass":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"rgb(249, 243, 155)"),h.addColorStop(.05,"rgb(246, 226, 101)"),h.addColorStop(.1,"rgb(240, 225, 132)"),h.addColorStop(.5,"rgb(90, 57, 22)"),h.addColorStop(.9,"rgb(249, 237, 139)"),h.addColorStop(.95,"rgb(243, 226, 108)"),h.addColorStop(1,"rgb(202, 182, 113)"),s.fillStyle=h,s.fill();break;case"steel":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"rgb(231, 237, 237)"),h.addColorStop(.05,"rgb(189, 199, 198)"),h.addColorStop(.1,"rgb(192, 201, 200)"),h.addColorStop(.5,"rgb(23, 31, 33)"),h.addColorStop(.9,"rgb(196, 205, 204)"),h.addColorStop(.95,"rgb(194, 204, 203)"),h.addColorStop(1,"rgb(189, 201, 199)"),s.fillStyle=h,s.fill();break;case"gold":h=s.createLinearGradient(0,e*.004672,0,o*.990654),h.addColorStop(0,"rgb(255, 255, 207)"),h.addColorStop(.15,"rgb(255, 237, 96)"),h.addColorStop(.22,"rgb(254, 199, 57)"),h.addColorStop(.3,"rgb(255, 249, 203)"),h.addColorStop(.38,"rgb(255, 199, 64)"),h.addColorStop(.44,"rgb(252, 194, 60)"),h.addColorStop(.51,"rgb(255, 204, 59)"),h.addColorStop(.6,"rgb(213, 134, 29)"),h.addColorStop(.68,"rgb(255, 201, 56)"),h.addColorStop(.75,"rgb(212, 135, 29)"),h.addColorStop(1,"rgb(247, 238, 101)"),s.fillStyle=h,s.fill();break;case"anthracite":h=s.createLinearGradient(0,.004672*o,0,.995326*o),h.addColorStop(0,"rgb(118, 117, 135)"),h.addColorStop(.06,"rgb(74, 74, 82)"),h.addColorStop(.12,"rgb(50, 50, 54)"),h.addColorStop(1,"rgb(79, 79, 87)"),s.fillStyle=h,s.fill();break;case"tiltedGray":h=s.createLinearGradient(.233644*e,.084112*o,.81258*e,.910919*o),h.addColorStop(0,"#ffffff"),h.addColorStop(.07,"rgb(210, 210, 210)"),h.addColorStop(.16,"rgb(179, 179, 179)"),h.addColorStop(.33,"#ffffff"),h.addColorStop(.55,"#c5c5c5"),h.addColorStop(.79,"#ffffff"),h.addColorStop(1,"#666666"),s.fillStyle=h,s.fill();break;case"tiltedBlack":h=s.createLinearGradient(.228971*e,.079439*o,.802547*e,.898591*o),h.addColorStop(0,"#666666"),h.addColorStop(.21,"#000000"),h.addColorStop(.47,"#666666"),h.addColorStop(.99,"#000000"),h.addColorStop(1,"#000000"),s.fillStyle=h,s.fill();break;case"glossyMetal":h=s.createRadialGradient(.5*e,.5*o,0,.5*e,.5*e,.5*e),h.addColorStop(0,"rgb(207, 207, 207)"),h.addColorStop(.96,"rgb(205, 204, 205)"),h.addColorStop(1,"rgb(244, 244, 244)"),s.fillStyle=h,s.fill(),s.beginPath(),s.arc(.5*e,.5*o,.973962*e/2,0,Math.PI*2),s.closePath(),h=s.createLinearGradient(0,o-.971962*o,0,.971962*o),h.addColorStop(0,"rgb(249, 249, 249)"),h.addColorStop(.23,"rgb(200, 195, 191)"),h.addColorStop(.36,"#ffffff"),h.addColorStop(.59,"rgb(29, 29, 29)"),h.addColorStop(.76,"rgb(200, 194, 192)"),h.addColorStop(1,"rgb(209, 209, 209)"),s.fillStyle=h,s.fill(),s.beginPath(),s.arc(.5*e,.5*o,.869158*e/2,0,Math.PI*2),s.closePath(),s.fillStyle="#f6f6f6",s.fill(),s.beginPath(),s.arc(.5*e,.5*o,.85*e/2,0,Math.PI*2),s.closePath(),s.fillStyle="#333333",s.fill();break;case"blackMetal":l=[0,.125,.347222,.5,.680555,.875,1],a=[new n(254,254,254,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(254,254,254,1)],s.save(),s.clip(s.arc(u,f,e*.990654/2,0,Math.PI*2,!0)),y=e*.495327,c=e*.42056,h=new it(l,a,-Math.PI/2),h.fill(s,u,f,c,y),s.strokeStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.8)",s.beginPath(),s.lineWidth=e/90,s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.stroke(),s.restore();break;case"shinyMetal":l=[0,.125,.25,.347222,.5,.652777,.75,.875,1],a=[new n(254,254,254,1),new n(210,210,210,1),new n(179,179,179,1),new n(238,238,238,1),new n(160,160,160,1),new n(238,238,238,1),new n(179,179,179,1),new n(210,210,210,1),new n(254,254,254,1)],s.save(),s.clip(s.arc(u,f,e*.990654/2,0,Math.PI*2,!0)),y=e*.495327,c=e*.42056,h=new it(l,a,-Math.PI/2),h.fill(s,u,f,c,y),s.strokeStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.8)",s.beginPath(),s.lineWidth=e/90,s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.stroke(),s.restore();break;case"chrome":l=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],a=[new n(255,255,255,1),new n(255,255,255,1),new n(136,136,138,1),new n(164,185,190,1),new n(158,179,182,1),new n(112,112,112,1),new n(221,227,227,1),new n(155,176,179,1),new n(156,176,177,1),new n(254,255,255,1),new n(255,255,255,1),new n(156,180,180,1),new n(198,209,211,1),new n(246,248,247,1),new n(204,216,216,1),new n(164,188,190,1),new n(255,255,255,1)],s.save(),s.clip(s.arc(u,f,e*.990654/2,0,Math.PI*2,!0)),y=e*.495327,c=e*.42056,h=new it(l,a,-Math.PI/2),h.fill(s,u,f,c,y),s.strokeStyle="#848484",s.strokeStyle="rgba(132, 132, 132, 0.8)",s.beginPath(),s.lineWidth=e/90,s.arc(u,f,e/2,0,Math.PI*2,!0),s.closePath(),s.stroke(),s.restore()}s.fillStyle="rgb(191, 191, 191)",s.beginPath(),s.arc(u,f,e*.841121/2,0,Math.PI*2,!0),s.closePath(),s.fill(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(u,f,e*.831775/2,0,Math.PI*2,!0),s.closePath(),s.fill(),v.cache[p]=w}return i.drawImage(v.cache[p],0,0),this},v.cache={},ht=function(i,r,u,f,e){var c,k,h,l,d,w,o,p=[],v=[],y,a,b=u.toString()+f+r.design+e;if(!ht.cache[b]){c=Math.sqrt(u*u+f*f)*.04,c=Math.min(c,(e?u:f)*.1),k=t(u,f),h=k.getContext("2d"),e?(l=u*.05,d=l-1,w=u*.028571):(l=f*.05,d=l-1,w=f*.028571),s(h,0,0,u,f,l),h.fillStyle="#838383",h.fill(),s(h,1,1,u-2,f-2,d);switch(r.design){case"metal":o=h.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"#fefefe"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.12,"rgb(179, 179, 179)"),o.addColorStop(1,"rgb(213, 213, 213)"),h.fillStyle=o,h.fill();break;case"brass":o=h.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"rgb(249, 243, 155)"),o.addColorStop(.05,"rgb(246, 226, 101)"),o.addColorStop(.1,"rgb(240, 225, 132)"),o.addColorStop(.5,"rgb(90, 57, 22)"),o.addColorStop(.9,"rgb(249, 237, 139)"),o.addColorStop(.95,"rgb(243, 226, 108)"),o.addColorStop(1,"rgb(202, 182, 113)"),h.fillStyle=o,h.fill();break;case"steel":o=h.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"rgb(231, 237, 237)"),o.addColorStop(.05,"rgb(189, 199, 198)"),o.addColorStop(.1,"rgb(192, 201, 200)"),o.addColorStop(.5,"rgb(23, 31, 33)"),o.addColorStop(.9,"rgb(196, 205, 204)"),o.addColorStop(.95,"rgb(194, 204, 203)"),o.addColorStop(1,"rgb(189, 201, 199)"),h.fillStyle=o,h.fill();break;case"gold":o=h.createLinearGradient(0,u*.004672,0,f*.990654),o.addColorStop(0,"rgb(255, 255, 207)"),o.addColorStop(.15,"rgb(255, 237, 96)"),o.addColorStop(.22,"rgb(254, 199, 57)"),o.addColorStop(.3,"rgb(255, 249, 203)"),o.addColorStop(.38,"rgb(255, 199, 64)"),o.addColorStop(.44,"rgb(252, 194, 60)"),o.addColorStop(.51,"rgb(255, 204, 59)"),o.addColorStop(.6,"rgb(213, 134, 29)"),o.addColorStop(.68,"rgb(255, 201, 56)"),o.addColorStop(.75,"rgb(212, 135, 29)"),o.addColorStop(1,"rgb(247, 238, 101)"),h.fillStyle=o,h.fill();break;case"anthracite":o=h.createLinearGradient(0,.004672*f,0,.995326*f),o.addColorStop(0,"rgb(118, 117, 135)"),o.addColorStop(.06,"rgb(74, 74, 82)"),o.addColorStop(.12,"rgb(50, 50, 54)"),o.addColorStop(1,"rgb(79, 79, 87)"),h.fillStyle=o,h.fill();break;case"tiltedGray":o=h.createLinearGradient(.233644*u,.084112*f,.81258*u,.910919*f),o.addColorStop(0,"#ffffff"),o.addColorStop(.07,"rgb(210, 210, 210)"),o.addColorStop(.16,"rgb(179, 179, 179)"),o.addColorStop(.33,"#ffffff"),o.addColorStop(.55,"#c5c5c5"),o.addColorStop(.79,"#ffffff"),o.addColorStop(1,"#666666"),h.fillStyle=o,h.fill();break;case"tiltedBlack":o=h.createLinearGradient(.228971*u,.079439*f,.802547*u,.898591*f),o.addColorStop(0,"#666666"),o.addColorStop(.21,"#000000"),o.addColorStop(.47,"#666666"),o.addColorStop(.99,"#000000"),o.addColorStop(1,"#000000"),h.fillStyle=o,h.fill();break;case"glossyMetal":h.clip(s(h,1,1,u-2,f-2,l)),o=h.createLinearGradient(0,1,0,f-2),o.addColorStop(0,"rgb(249, 249, 249)"),o.addColorStop(.2,"rgb(200, 195, 191)"),o.addColorStop(.3,"#ffffff"),o.addColorStop(.6,"rgb(29, 29, 29)"),o.addColorStop(.8,"rgb(200, 194, 192)"),o.addColorStop(1,"rgb(209, 209, 209)"),h.fillStyle=o,h.fill(),h.clip(s(h,c-2,c-2,u-(c-2)*2,f-(c-2)*2,w)),h.fillStyle="#f6f6f6",h.fill(),h.clip(s(h,c-1,c-1,u-(c-1)*2,f-(c-1)*2,w)),h.fillStyle="#333333",h.fill();break;case"blackMetal":p=[0,.125,.347222,.5,.680555,.875,1],v=[new n(254,254,254,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(153,153,153,1),new n(0,0,0,1),new n(254,254,254,1)],y=0,a=Math.sqrt(f*f+u*u)/2,h.clip(s(h,1,1,u-2,f-2,l)),o=new it(p,v,-Math.PI/2),o.fill(h,u/2,f/2,y,a);break;case"shinyMetal":p=[0,.125,.25,.347222,.5,.652777,.75,.875,1],v=[new n(254,254,254,1),new n(210,210,210,1),new n(179,179,179,1),new n(238,238,238,1),new n(160,160,160,1),new n(238,238,238,1),new n(179,179,179,1),new n(210,210,210,1),new n(254,254,254,1)],y=0,a=Math.sqrt(f*f+u*u)/2,h.clip(s(h,1,1,u-2,f-2,l)),o=new it(p,v,-Math.PI/2),o.fill(h,u/2,f/2,y,a);break;case"chrome":p=[0,.09,.12,.16,.25,.29,.33,.38,.48,.52,.63,.68,.8,.83,.87,.97,1],v=[new n(255,255,255,1),new n(255,255,255,1),new n(136,136,138,1),new n(164,185,190,1),new n(158,179,182,1),new n(112,112,112,1),new n(221,227,227,1),new n(155,176,179,1),new n(156,176,177,1),new n(254,255,255,1),new n(255,255,255,1),new n(156,180,180,1),new n(198,209,211,1),new n(246,248,247,1),new n(204,216,216,1),new n(164,188,190,1),new n(255,255,255,1)],y=0,a=Math.sqrt(f*f+u*u)/2,h.clip(s(h,1,1,u-2,f-2,l)),o=new it(p,v,-Math.PI/2),o.fill(h,u/2,f/2,y,a)}s(h,c-1,c-1,u-(c-1)*2,f-(c-1)*2,w-1),h.fillStyle="rgb(192, 192, 192)",h.globalCompositeOperation="destination-out",s(h,c,c,u-c*2,f-c*2,4),h.fill(),ht.cache[b]=k}return i.drawImage(ht.cache[b],0,0),this},ht.cache={},w=function(i,r,u,f,e,o){var p,s,h,k,d,g=e*.831775/2,et,ft,rt,tt,ut,c,v,a,l,nt,y,b=e.toString()+o+r.name;if(!w.cache[b]){p=t(e,o),s=p.getContext("2d"),s.beginPath(),s.arc(u,f,e*.831775/2,0,Math.PI*2,!0),s.closePath();if(r.name==="CARBON"||r.name==="PUNCHED_SHEET"||r.name==="BRUSHED_METAL"||r.name==="BRUSHED_STAINLESS")r.name==="CARBON"&&(s.fillStyle=s.createPattern(vi,"repeat"),s.fill()),r.name==="PUNCHED_SHEET"&&(s.fillStyle=s.createPattern(ci,"repeat"),s.fill()),h=s.createLinearGradient(g,0,e-g,0),h.addColorStop(0,"rgba(0, 0, 0, 0.25)"),h.addColorStop(.5,"rgba(0, 0, 0, 0)"),h.addColorStop(1,"rgba(0, 0, 0, 0.25)"),s.fillStyle=h,s.beginPath(),s.arc(u,f,e*.831775/2,0,Math.PI*2,!0),s.closePath(),s.fill(),(r.name==="BRUSHED_METAL"||r.name==="BRUSHED_STAINLESS")&&(et=r.name==="BRUSHED_METAL"?!0:!1,ft=parseInt(r.gradientStop.getHexColor().substr(-6),16),rt=li(ft,5,.1,et,.5),s.fillStyle=s.createPattern(rt.fill(0,0,e,o),"no-repeat"),s.fill());else if(r.name==="STAINLESS"||r.name==="TURNED"){k=[0,.03,.1,.14,.24,.33,.38,.5,.62,.67,.76,.81,.85,.97,1],d=[new n("#FDFDFD"),new n("#FDFDFD"),new n("#B2B2B4"),new n("#ACACAE"),new n("#FDFDFD"),new n("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#ACACAE"),new n("#B2B2B4"),new n("#FDFDFD"),new n("#FDFDFD")],tt=e*.831775/2,ut=0,h=new it(k,d,Math.PI/1.75),h.fill(s,u,f,ut,tt),s.closePath();if(r.name==="TURNED"){for(c=Math.PI*2,v=e*.831775/2,a=v*.55,l=c/360*(500/v),s.save(),s.clip(s.arc(u,f,v,0,c)),s.lineWidth=.5,nt=c-l*.3,y=0;y<nt;y+=l)s.strokeStyle="rgba(240, 240, 255, 0.25)",s.beginPath(),s.arc(u+a,f,a,0,c),s.stroke(),s.translate(u,f),s.rotate(l*.3),s.translate(-u,-f),s.strokeStyle="rgba(25, 10, 10, 0.1)",s.beginPath(),s.arc(u+a,f,a,0,c),s.stroke(),s.translate(u,f),s.rotate(-l*.3),s.translate(-u,-f),s.translate(u,f),s.rotate(l),s.translate(-u,-f);s.restore()}}else h=s.createLinearGradient(0,e*.084112,0,o*.831775),h.addColorStop(0,r.gradientStart.getRgbaColor()),h.addColorStop(.4,r.gradientFraction.getRgbaColor()),h.addColorStop(1,r.gradientStop.getRgbaColor()),s.fillStyle=h,s.fill();h=s.createRadialGradient(u,f,0,u,f,e*.831775/2),h.addColorStop(0,"rgba(0, 0, 0, 0)"),h.addColorStop(.7,"rgba(0, 0, 0, 0)"),h.addColorStop(.71,"rgba(0, 0, 0, 0)"),h.addColorStop(.86,"rgba(0, 0, 0, 0.03)"),h.addColorStop(.92,"rgba(0, 0, 0, 0.07)"),h.addColorStop(.97,"rgba(0, 0, 0, 0.15)"),h.addColorStop(1,"rgba(0, 0, 0, 0.3)"),s.fillStyle=h,s.beginPath(),s.arc(u,f,e*.831775/2,0,c,!0),s.closePath(),s.fill(),w.cache[b]=p}return i.drawImage(w.cache[b],0,0),this},w.cache={},rt=function(n,t,i,r,u,f){var o=u*.831775,e=f*.831775,h=(u-o)/2,s=(f-e)/2;return t!==null&&t.height>0&&t.width>0&&(n.save(),n.beginPath(),n.arc(i,r,u*.831775/2,0,Math.PI*2,!0),n.clip(),n.drawImage(t,h,s,o,e),n.restore()),this},ot=function(i,r,u,f,e){var l,tt,c,ut,b,h,g,o,k,w,p,v,a,y,ft,rt,nt,d=u.toString()+f+e+r.name;if(!ot.cache[d]){h=Math.sqrt(u*u+f*f)*.04,h=Math.min(h,(e?u:f)*.1),g=t(u,f),o=g.getContext("2d"),linBColor=r,s(o,h,h,u-h*2,f-h*2,4);if(r.name==="CARBON"||r.name==="PUNCHED_SHEET"||r.name==="STAINLESS"||r.name==="BRUSHED_METAL"||r.name==="BRUSHED_STAINLESS"||r.name==="TURNED"){r.name==="CARBON"&&(o.fillStyle=o.createPattern(vi,"repeat"),o.fill()),r.name==="PUNCHED_SHEET"&&(o.fillStyle=o.createPattern(ci,"repeat"),o.fill());if(r.name==="STAINLESS"||r.name==="TURNED"){ut=[0,.03,.1,.14,.24,.33,.38,.5,.62,.67,.76,.81,.85,.97,1],b=[new n("#FDFDFD"),new n("#FDFDFD"),new n("#B2B2B4"),new n("#ACACAE"),new n("#FDFDFD"),new n("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#6E6E70"),new n("#6E6E70"),new n("#FDFDFD"),new n("#ACACAE"),new n("#B2B2B4"),new n("#FDFDFD"),new n("#FDFDFD")],c=new it(ut,b,Math.PI/1.75),o.clip(s(o,h,h,u-h*2,f-h*2,4)),k=Math.sqrt((u-h*2)*(u-h*2)+(f-h*2)*(f-h*2))/2,c.fill(o,u/2,f/2,0,k),c=o.createLinearGradient(0,h,0,f-h*2),c.addColorStop(0,"rgba(0, 0, 0, 0.25)"),c.addColorStop(.1,"rgba(0, 0, 0, 0.05)"),c.addColorStop(1,"rgba(0, 0, 0, 0)"),o.fillStyle=c,s(o,h,h,u-h*2,f-h*2,4),o.fill(),o.restore();if(r.name==="TURNED"){for(w=Math.PI*2,p=k*.55,v=u/2,a=f/2,y=w/360*(400/k),o.save(),o.lineWidth=.5,tt=w-y*.3,l=0;l<tt;l+=y)o.strokeStyle="rgba(240, 240, 255, 0.25)",o.beginPath(),o.arc(v+p,a,p,0,w),o.stroke(),o.translate(v,a),o.rotate(y*.3),o.translate(-v,-a),o.strokeStyle="rgba(25, 10, 10, 0.1)",o.beginPath(),o.arc(v+p,a,p,0,w),o.stroke(),o.translate(v,a),o.rotate(-y*.3),o.translate(-v,-a),o.translate(v,a),o.rotate(y),o.translate(-v,-a);o.restore()}}c=o.createLinearGradient(h,h,u-h*2,f-h*2),c.addColorStop(0,"rgba(0, 0, 0, 0.25)"),c.addColorStop(.5,"rgba(0, 0, 0, 0)"),c.addColorStop(1,"rgba(0, 0, 0, 0.25)"),o.fillStyle=c,s(o,h,h,u-h*2,f-h*2,4),o.fill(),(r.name==="BRUSHED_METAL"||r.name==="BRUSHED_STAINLESS")&&(ft=r.name==="BRUSHED_METAL"?!0:!1,rt=parseInt(r.gradientStop.getHexColor().substr(-6),16),nt=li(rt,5,.1,ft,.5),o.fillStyle=o.createPattern(nt.fill(0,0,u,f),"no-repeat"),o.fill())}else c=o.createLinearGradient(0,h,0,f-h*2),c.addColorStop(0,r.gradientStart.getRgbaColor()),c.addColorStop(.4,r.gradientFraction.getRgbaColor()),c.addColorStop(1,r.gradientStop.getRgbaColor()),o.fillStyle=c,o.fill();for(b=["rgba(0, 0, 0, 0.3)","rgba(0, 0, 0, 0.15)","rgba(0, 0, 0, 0.07)","rgba(0, 0, 0, 0.03)","rgba(0, 0, 0, 0)","rgba(0, 0, 0, 0)","rgba(0, 0, 0, 0)"],l=0;l<7;l++)s(o,h+l,h+l,u-h*2-2*l,f-h*2-2*l,4),o.strokeStyle=b[l],o.stroke();ot.cache[d]=g}return i.drawImage(ot.cache[d],0,0),this},ot.cache={},y=function(n,i,r,u,f,o,s,h,c){var g,l,v=Math.ceil(u*.084112),p=r*.5-v/2,b=u*.5-v/2,w=r*.008,a,k,d=i.type+r+u+f+(o!==undefined?o.type:"-")+(s!==undefined?s.style:"-")+(h!==undefined?h.type:"-")+(c!==undefined?c.type:"-");if(!y.cache[d]){g=t(r,u),l=g.getContext("2d"),f&&(h===steelseries.GaugeType.TYPE5?steelseries.Orientation.WEST===c?(p=r*.733644-v/2,l.drawImage(e(v,o,s,!0),p+w,b+w),l.drawImage(e(v,o,s,!1),p,b)):(b=u*.733644-v/2,l.drawImage(e(v,o,s,!0),p+w,u*.6857+w),l.drawImage(e(v,o,s,!1),p,u*.6857)):(l.drawImage(e(v,o,s,!0),p+w,b+w),l.drawImage(e(v,o,s,!1),p,b)));switch(i.type){case"type2":l.beginPath(),l.moveTo(r*.135514,u*.696261),l.bezierCurveTo(r*.214953,u*.588785,r*.317757,u*.5,r*.462616,u*.425233),l.bezierCurveTo(r*.612149,u*.345794,r*.733644,u*.317757,r*.873831,u*.322429),l.bezierCurveTo(r*.766355,u*.112149,r*.528037,u*.023364,r*.313084,u*.130841),l.bezierCurveTo(r*.09813,u*.238317,r*.028037,u*.485981,r*.135514,u*.696261),l.closePath(),a=l.createLinearGradient(.313084*r,.135514*u,.495528*r,.493582*u),a.addColorStop(0,"rgba(255, 255, 255, 0.275)"),a.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type3":l.beginPath(),l.moveTo(r*.084112,u*.509345),l.bezierCurveTo(r*.21028,u*.556074,r*.462616,u*.560747,r*.5,u*.560747),l.bezierCurveTo(r*.537383,u*.560747,r*.794392,u*.560747,r*.915887,u*.509345),l.bezierCurveTo(r*.915887,u*.2757,r*.738317,u*.084112,r*.5,u*.084112),l.bezierCurveTo(r*.261682,u*.084112,r*.084112,u*.2757,r*.084112,u*.509345),l.closePath(),a=l.createLinearGradient(0,.093457*u,0,.556073*u),a.addColorStop(0,"rgba(255, 255, 255, 0.275)"),a.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type4":l.beginPath(),l.moveTo(r*.67757,u*.24299),l.bezierCurveTo(r*.771028,u*.308411,r*.822429,u*.411214,r*.813084,u*.528037),l.bezierCurveTo(r*.799065,u*.654205,r*.719626,u*.757009,r*.593457,u*.799065),l.bezierCurveTo(r*.485981,u*.831775,r*.369158,u*.808411,r*.285046,u*.728971),l.bezierCurveTo(r*.2757,u*.719626,r*.252336,u*.714953,r*.233644,u*.728971),l.bezierCurveTo(r*.214953,u*.747663,r*.219626,u*.771028,r*.228971,u*.7757),l.bezierCurveTo(r*.331775,u*.878504,r*.476635,u*.915887,r*.616822,u*.869158),l.bezierCurveTo(r*.771028,u*.822429,r*.873831,u*.691588,r*.88785,u*.53271),l.bezierCurveTo(r*.897196,u*.38785,r*.836448,u*.257009,r*.719626,u*.182242),l.bezierCurveTo(r*.705607,u*.172897,r*.682242,u*.163551,r*.663551,u*.186915),l.bezierCurveTo(r*.654205,u*.205607,r*.668224,u*.238317,r*.67757,u*.24299),l.closePath(),a=l.createRadialGradient(.5*r,.5*u,0,.5*r,.5*u,.38785*r),a.addColorStop(0,"rgba(255, 255, 255, 0)"),a.addColorStop(.82,"rgba(255, 255, 255, 0)"),a.addColorStop(.83,"rgba(255, 255, 255, 0)"),a.addColorStop(1,"rgba(255, 255, 255, 0.15)"),l.beginPath(),l.moveTo(r*.261682,u*.224299),l.bezierCurveTo(r*.285046,u*.238317,r*.252336,u*.285046,r*.24299,u*.317757),l.bezierCurveTo(r*.24299,u*.350467,r*.271028,u*.383177,r*.271028,u*.397196),l.bezierCurveTo(r*.2757,u*.415887,r*.261682,u*.457943,r*.238317,u*.509345),l.bezierCurveTo(r*.224299,u*.542056,r*.17757,u*.612149,r*.158878,u*.612149),l.bezierCurveTo(r*.144859,u*.612149,r*.088785,u*.546728,r*.130841,u*.369158),l.bezierCurveTo(r*.140186,u*.336448,r*.214953,u*.200934,r*.261682,u*.224299),l.closePath(),k=l.createLinearGradient(.130841*r,.369158*u,.273839*r,.412877*u),k.addColorStop(0,"rgba(255, 255, 255, 0.275)"),k.addColorStop(1,"rgba(255, 255, 255, 0.015)"),l.fillStyle=k,l.fill();break;case"type5":l.beginPath(),l.moveTo(r*.084112,u*.5),l.bezierCurveTo(r*.084112,u*.271028,r*.271028,u*.084112,r*.5,u*.084112),l.bezierCurveTo(r*.700934,u*.084112,r*.864485,u*.224299,r*.906542,u*.411214),l.bezierCurveTo(r*.911214,u*.439252,r*.911214,u*.518691,r*.845794,u*.537383),l.bezierCurveTo(r*.794392,u*.546728,r*.551401,u*.411214,r*.392523,u*.457943),l.bezierCurveTo(r*.168224,u*.509345,r*.135514,u*.7757,r*.093457,u*.593457),l.bezierCurveTo(r*.088785,u*.560747,r*.084112,u*.53271,r*.084112,u*.5),l.closePath(),a=l.createLinearGradient(0,.084112*u,0,.644859*u),a.addColorStop(0,"rgba(255, 255, 255, 0.275)"),a.addColorStop(1,"rgba(255, 255, 255, 0.015)");break;case"type1":default:l.beginPath(),l.moveTo(r*.084112,u*.509345),l.bezierCurveTo(r*.205607,u*.448598,r*.336448,u*.415887,r*.5,u*.415887),l.bezierCurveTo(r*.672897,u*.415887,r*.789719,u*.443925,r*.915887,u*.509345),l.bezierCurveTo(r*.915887,u*.2757,r*.738317,u*.084112,r*.5,u*.084112),l.bezierCurveTo(r*.261682,u*.084112,r*.084112,u*.2757,r*.084112,u*.509345),l.closePath(),a=l.createLinearGradient(0,.088785*u,0,.490654*u),a.addColorStop(0,"rgba(255, 255, 255, 0.275)"),a.addColorStop(1,"rgba(255, 255, 255, 0.015)")}l.fillStyle=a,l.fill(),y.cache[d]=g}return n.drawImage(y.cache[d],0,0),this},y.cache={},et=function(n,i,r,u){var l,o,e,h,f,s,c=i.toString()+r+u;return et.cache[c]||(l=t(i,r),o=l.getContext("2d"),h=Math.sqrt(i*i+r*r)*.04,h=Math.min(h,(u?i:r)*.1),f=h*1.3,s=f*1.33,o.beginPath(),o.moveTo(f,r-f),o.lineTo(i-f,r-f),o.bezierCurveTo(i-f,r-f,i-s,r*.7,i-s,r*.5),o.bezierCurveTo(i-s,s,i-f,f,i-h,f),o.lineTo(f,f),o.bezierCurveTo(f,f,s,r*.285714,s,r*.5),o.bezierCurveTo(s,r*.7,f,r-f,h,r-f),o.closePath(),e=o.createLinearGradient(0,r-h,0,h),e.addColorStop(0,"rgba(255, 255, 255, 0)"),e.addColorStop(.06,"rgba(255, 255, 255, 0)"),e.addColorStop(.07,"rgba(255, 255, 255, 0)"),e.addColorStop(.12,"rgba(255, 255, 255, 0)"),e.addColorStop(.17,"rgba(255, 255, 255, 0.013546)"),e.addColorStop(.1701,"rgba(255, 255, 255, 0)"),e.addColorStop(.79,"rgba(255, 255, 255, 0)"),e.addColorStop(.8,"rgba(255, 255, 255, 0)"),e.addColorStop(.84,"rgba(255, 255, 255, 0.082217)"),e.addColorStop(.93,"rgba(255, 255, 255, 0.288702)"),e.addColorStop(.94,"rgba(255, 255, 255, 0.298039)"),e.addColorStop(.96,"rgba(255, 255, 255, 0.119213)"),e.addColorStop(.97,"rgba(255, 255, 255, 0)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),o.fillStyle=e,o.fill(),et.cache[c]=l),n.drawImage(et.cache[c],0,0),this},et.cache={},e=function(n,i,r,u){var l,f,h=n/2,s=n/2,o,c=n.toString()+i.type+r.style+u;if(!e.cache[c]){l=t(n*1.18889,n*1.18889),f=l.getContext("2d"),u&&(f.fillStyle="rgba(0, 0, 0, 1)",f.strokeStyle="rgba(0, 0, 0, 1)",f.shadowBlur=3,f.globalAlpha=.5);switch(i.type){case"metalKnob":f.beginPath(),f.moveTo(0,n*.5),f.bezierCurveTo(0,n*.222222,n*.222222,0,n*.5,0),f.bezierCurveTo(n*.777777,0,n,n*.222222,n,n*.5),f.bezierCurveTo(n,n*.777777,n*.777777,n,n*.5,n),f.bezierCurveTo(n*.222222,n,0,n*.777777,0,n*.5),f.closePath(),u||(o=f.createLinearGradient(0,0,0,n),o.addColorStop(0,"rgb(92, 95, 101)"),o.addColorStop(.47,"rgb(46, 49, 53)"),o.addColorStop(1,"rgb(22, 23, 26)"),f.fillStyle=o),f.fill(),f.beginPath(),f.moveTo(n*.055555,n*.5),f.bezierCurveTo(n*.055555,n*.277777,n*.277777,n*.055555,n*.5,n*.055555),f.bezierCurveTo(n*.722222,n*.055555,n*.944444,n*.277777,n*.944444,n*.5),f.bezierCurveTo(n*.944444,n*.722222,n*.722222,n*.944444,n*.5,n*.944444),f.bezierCurveTo(n*.277777,n*.944444,n*.055555,n*.722222,n*.055555,n*.5),f.closePath();if(u)f.fill();else{o=f.createLinearGradient(0,.055555*n,0,.944443*n);switch(r.style){case"black":o.addColorStop(0,"rgb(43, 42, 47)"),o.addColorStop(1,"rgb(26, 27, 32)");break;case"brass":o.addColorStop(0,"rgb(150, 110, 54)"),o.addColorStop(1,"rgb(124, 95, 61)");break;case"silver":default:o.addColorStop(0,"rgb(204, 204, 204)"),o.addColorStop(1,"rgb(87, 92, 98)")}f.fillStyle=o,f.fill()}f.beginPath(),f.moveTo(n*.777777,n*.833333),f.bezierCurveTo(n*.722222,n*.722222,n*.611111,n*.666666,n*.5,n*.666666),f.bezierCurveTo(n*.388888,n*.666666,n*.277777,n*.722222,n*.222222,n*.833333),f.bezierCurveTo(n*.277777,n*.888888,n*.388888,n*.944444,n*.5,n*.944444),f.bezierCurveTo(n*.611111,n*.944444,n*.722222,n*.888888,n*.777777,n*.833333),f.closePath(),u||(o=f.createRadialGradient(.555555*n,.944444*n,0,.555555*n,.944444*n,.388888*n),o.addColorStop(0,"rgba(255, 255, 255, 0.6)"),o.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=o),f.fill(),f.beginPath(),f.moveTo(n*.944444,n*.277777),f.bezierCurveTo(n*.833333,n*.111111,n*.666666,0,n*.5,0),f.bezierCurveTo(n*.333333,0,n*.166666,n*.111111,n*.055555,n*.277777),f.bezierCurveTo(n*.166666,n*.333333,n*.333333,n*.388888,n*.5,n*.388888),f.bezierCurveTo(n*.666666,n*.388888,n*.833333,n*.333333,n*.944444,n*.277777),f.closePath(),u||(o=f.createRadialGradient(.5*n,0,0,.5*n,0,.583333*n),o.addColorStop(0,"rgba(255, 255, 255, 0.749019)"),o.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=o),f.fill(),f.beginPath(),f.moveTo(n*.277777,n*.555555),f.bezierCurveTo(n*.277777,n*.388888,n*.388888,n*.277777,n*.5,n*.277777),f.bezierCurveTo(n*.611111,n*.277777,n*.777777,n*.388888,n*.777777,n*.555555),f.bezierCurveTo(n*.777777,n*.666666,n*.611111,n*.777777,n*.5,n*.777777),f.bezierCurveTo(n*.388888,n*.777777,n*.277777,n*.666666,n*.277777,n*.555555),f.closePath(),u||(o=f.createLinearGradient(0,.277777*n,0,.722221*n),o.addColorStop(0,"#000000"),o.addColorStop(1,"rgb(204, 204, 204)"),f.fillStyle=o),f.fill(),f.beginPath(),f.moveTo(n*.333333,n*.555555),f.bezierCurveTo(n*.333333,n*.444444,n*.388888,n*.333333,n*.5,n*.333333),f.bezierCurveTo(n*.611111,n*.333333,n*.722222,n*.444444,n*.722222,n*.555555),f.bezierCurveTo(n*.722222,n*.611111,n*.611111,n*.722222,n*.5,n*.722222),f.bezierCurveTo(n*.388888,n*.722222,n*.333333,n*.611111,n*.333333,n*.555555),f.closePath(),u||(o=f.createLinearGradient(0,.333333*n,0,.666666*n),o.addColorStop(0,"rgb(10, 9, 1)"),o.addColorStop(1,"rgb(42, 41, 37)"),f.fillStyle=o),f.fill();break;case"standardKnob":u||(o=f.createLinearGradient(0,0,0,n),o.addColorStop(0,"rgb(180, 180, 180)"),o.addColorStop(.46,"rgb(63, 63, 63)"),o.addColorStop(1,"rgb(40, 40, 40)"),f.fillStyle=o),f.beginPath(),f.arc(h,s,n/2,0,Math.PI*2,!0),f.closePath(),f.fill();if(!u){o=f.createLinearGradient(0,n-n*.77,0,n-n*.77+n*.77);switch(r.style){case"black":o.addColorStop(0,"rgb(191, 191, 191)"),o.addColorStop(.5,"rgb(45, 44, 49)"),o.addColorStop(1,"rgb(125, 126, 128)");break;case"brass":o.addColorStop(0,"rgb(223, 208, 174)"),o.addColorStop(.5,"rgb(123, 95, 63)"),o.addColorStop(1,"rgb(207, 190, 157)");break;case"silver":default:o.addColorStop(0,"rgb(215, 215, 215)"),o.addColorStop(.5,"rgb(116, 116, 116)"),o.addColorStop(1,"rgb(215, 215, 215)")}f.fillStyle=o}f.beginPath(),f.arc(h,s,n*.77/2,0,Math.PI*2,!0),f.closePath(),f.fill(),u||(o=f.createRadialGradient(h,s,0,h,s,n*.77/2),o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(.75,"rgba(0, 0, 0, 0)"),o.addColorStop(.76,"rgba(0, 0, 0, 0.01)"),o.addColorStop(1,"rgba(0, 0, 0, 0.2)"),f.fillStyle=o),f.beginPath(),f.arc(h,s,n*.77/2,0,Math.PI*2,!0),f.closePath(),f.fill()}e.cache[c]=l}return e.cache[c]},e.cache={},o=function(n,i,r){var l,u,s=n/2,h=n/2,e,c=n.toString()+i+r.outerColor_ON;if(!o.cache[c]){l=t(n,n),u=l.getContext("2d");switch(i){case 0:e=u.createRadialGradient(s,h,0,s,h,n*.5/2),e.addColorStop(0,r.innerColor1_OFF),e.addColorStop(.2,r.innerColor2_OFF),e.addColorStop(1,r.outerColor_OFF),u.fillStyle=e,u.beginPath(),u.arc(s,h,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),e=u.createRadialGradient(s,h,0,s,h,n*.5/2),e.addColorStop(0,"rgba(0, 0, 0, 0)"),e.addColorStop(.8,"rgba(0, 0, 0, 0)"),e.addColorStop(1,"rgba(0, 0, 0, 0.4)"),u.fillStyle=e,u.beginPath(),u.arc(s,h,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),e=u.createLinearGradient(0,.35*n,0,.35*n+.15*n),e.addColorStop(0,"rgba(255, 255, 255, 0.4)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),u.fillStyle=e,u.beginPath(),u.arc(s,.35*n+.2*n/2,n*.2,0,Math.PI*2,!0),u.closePath(),u.fill();break;case 1:e=u.createRadialGradient(s,h,0,s,h,n*.5/2),e.addColorStop(0,r.innerColor1_ON),e.addColorStop(.2,r.innerColor2_ON),e.addColorStop(1,r.outerColor_ON),u.fillStyle=e,u.beginPath(),u.arc(s,h,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),e=u.createRadialGradient(s,h,0,s,h,n*.5/2),e.addColorStop(0,"rgba(0, 0, 0, 0)"),e.addColorStop(.8,"rgba(0, 0, 0, 0)"),e.addColorStop(1,"rgba(0, 0, 0, 0.4)"),u.fillStyle=e,u.beginPath(),u.arc(s,h,n*.5/2,0,Math.PI*2,!0),u.closePath(),u.fill(),e=u.createLinearGradient(0,.35*n,0,.35*n+.15*n),e.addColorStop(0,"rgba(255, 255, 255, 0.4)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),u.fillStyle=e,u.beginPath(),u.arc(s,.35*n+.2*n/2,n*.2,0,Math.PI*2,!0),u.closePath(),u.fill(),e=u.createRadialGradient(s,h,0,s,h,n/2),e.addColorStop(0,f(r.coronaColor,0).color),e.addColorStop(.6,f(r.coronaColor,.4).color),e.addColorStop(.7,f(r.coronaColor,.25).color),e.addColorStop(.8,f(r.coronaColor,.15).color),e.addColorStop(.85,f(r.coronaColor,.05).color),e.addColorStop(1,f(r.coronaColor,0).color),u.fillStyle=e,u.beginPath(),u.arc(s,h,n/2,0,Math.PI*2,!0),u.closePath(),u.fill()}o.cache[c]=l}return o.cache[c]},o.cache={},p=function(n,i,r){var c,f,b=0,h=0,y=n,a=i,v=Math.min(n,i)*.095,u,k=1,o=1,d=n-2,l=i-2,w=v-1,e=n.toString()+i+JSON.stringify(r);return p.cache[e]||(c=t(n,i),f=c.getContext("2d"),u=f.createLinearGradient(0,h,0,h+a),u.addColorStop(0,"#4c4c4c"),u.addColorStop(.08,"#666666"),u.addColorStop(.92,"#666666"),u.addColorStop(1,"#e6e6e6"),f.fillStyle=u,s(f,b,h,y,a,v),f.fill(),u=f.createLinearGradient(0,o,0,o+l),u.addColorStop(0,r.gradientStartColor),u.addColorStop(.03,r.gradientFraction1Color),u.addColorStop(.49,r.gradientFraction2Color),u.addColorStop(.5,r.gradientFraction3Color),u.addColorStop(1,r.gradientStopColor),f.fillStyle=u,s(f,k,o,d,l,w),f.fill(),p.cache[e]=c),p.cache[e]},p.cache={},a=function(n,t,i,u){var e,f,o=n.toString()+t+i+u;return a.cache[o]||(e=r.createElement("canvas"),f=e.getContext("2d"),e.width=n,e.height=n,f.fillStyle=t,i?(f.beginPath(),f.moveTo(n*.5,n),f.lineTo(0,0),f.lineTo(n,0),f.closePath(),f.fill()):u?(f.beginPath(),f.moveTo(n,n*.5),f.lineTo(0,0),f.lineTo(0,n),f.closePath(),f.fill()):(f.beginPath(),f.moveTo(n*.5,0),f.lineTo(n,n),f.lineTo(0,n),f.closePath(),f.fill()),a.cache[o]=e),a.cache[o]},a.cache={},d=function(n,i,r){var e=n*2,l,u,o,v,c=i.state+n+JSON.stringify(r),s=function(){var t=r[0];i.state==="up"?(o=u.createRadialGradient(.5*n,.2*e,0,.5*n,.2*e,.5*n),o.addColorStop(0,t.innerColor1_ON),o.addColorStop(.2,t.innerColor2_ON),o.addColorStop(1,t.outerColor_ON)):(o=u.createLinearGradient(0,0,0,.5*e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c")),u.fillStyle=o,u.beginPath(),u.moveTo(.5*n,0),u.lineTo(n,.2*e),u.lineTo(.752*n,.2*e),u.lineTo(.752*n,.37*e),u.lineTo(.252*n,.37*e),u.lineTo(.252*n,.2*e),u.lineTo(0,.2*e),u.closePath(),u.fill(),i.state!=="up"?(u.strokeStyle="rgba(0, 0, 0, 0.4)",u.beginPath(),u.moveTo(0,.2*e),u.lineTo(.5*n,0),u.lineTo(n,.2*e),u.moveTo(.252*n,.2*e),u.lineTo(.252*n,.37*e),u.stroke(),u.strokeStyle="rgba(255, 255, 255, 0.3)",u.beginPath(),u.moveTo(.252*n,.37*e),u.lineTo(.752*n,.37*e),u.lineTo(.752*n,.2*e),u.lineTo(n,.2*e),u.stroke()):(o=u.createRadialGradient(.5*n,.2*e,0,.5*n,.2*e,.7*n),o.addColorStop(0,f(t.coronaColor,0).color),o.addColorStop(.5,f(t.coronaColor,.3).color),o.addColorStop(.7,f(t.coronaColor,.2).color),o.addColorStop(.8,f(t.coronaColor,.1).color),o.addColorStop(.85,f(t.coronaColor,.05).color),o.addColorStop(1,f(t.coronaColor,0).color),u.fillStyle=o,u.beginPath(),u.arc(.5*n,.2*e,.7*n,0,Math.PI*2,!0),u.closePath(),u.fill())},h=function(){var t=r[1];u.beginPath(),i.state==="steady"?(o=t.outerColor_ON,u.fillStyle=o,u.rect(.128*n,.41*e,.744*n,.074*e),u.rect(.128*n,.516*e,.744*n,.074*e),u.closePath(),u.fill()):(o=u.createLinearGradient(0,.41*e,0,.41*e+.074*e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c"),u.fillStyle=o,u.rect(.128*n,.41*e,.744*n,.074*e),u.closePath(),u.fill(),o=u.createLinearGradient(0,.516*e,0,.516*e+.074*e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c"),u.fillStyle=o,u.rect(.128*n,.516*e,.744*n,.074*e),u.closePath(),u.fill()),i.state!=="steady"?(u.strokeStyle="rgba(0, 0, 0, 0.4)",u.beginPath(),u.moveTo(.128*n,.41*e+.074*e),u.lineTo(.128*n,.41*e),u.lineTo(.128*n+.744*n,.41*e),u.stroke(),u.beginPath(),u.moveTo(.128*n,.516*e+.074*e),u.lineTo(.128*n,.516*e),u.lineTo(.128*n+.744*n,.516*e),u.stroke(),u.strokeStyle="rgba(255, 255, 255, 0.3)",u.beginPath(),u.moveTo(.128*n+.744*n,.41*e),u.lineTo(.128*n+.744*n,.41*e+.074*e),u.lineTo(.128*n,.41*e+.074*e),u.stroke(),u.beginPath(),u.moveTo(.128*n+.744*n,.516*e),u.lineTo(.128*n+.744*n,.516*e+.074*e),u.lineTo(.128*n,.516*e+.074*e),u.stroke()):(o=u.createRadialGradient(.5*n,.5*e,0,.5*n,.5*e,.7*n),o.addColorStop(0,f(t.coronaColor,0).color),o.addColorStop(.5,f(t.coronaColor,.3).color),o.addColorStop(.7,f(t.coronaColor,.2).color),o.addColorStop(.8,f(t.coronaColor,.1).color),o.addColorStop(.85,f(t.coronaColor,.05).color),o.addColorStop(1,f(t.coronaColor,0).color),u.fillStyle=o,u.beginPath(),u.arc(.5*n,.5*e,.7*n,0,Math.PI*2,!0),u.closePath(),u.fill())},a=function(){var t=r[2];i.state==="down"?(o=u.createRadialGradient(.5*n,.8*e,0,.5*n,.8*e,.5*n),o.addColorStop(0,t.innerColor1_ON),o.addColorStop(.2,t.innerColor2_ON),o.addColorStop(1,t.outerColor_ON)):(o=u.createLinearGradient(0,.63*e,0,e),o.addColorStop(0,"#323232"),o.addColorStop(1,"#5c5c5c")),u.beginPath(),u.fillStyle=o,u.moveTo(.5*n,e),u.lineTo(n,.8*e),u.lineTo(.725*n,.8*e),u.lineTo(.725*n,.63*e),u.lineTo(.252*n,.63*e),u.lineTo(.252*n,.8*e),u.lineTo(0,.8*e),u.closePath(),u.fill(),i.state!=="down"?(u.strokeStyle="rgba(0, 0, 0, 0.4)",u.beginPath(),u.moveTo(0,.8*e),u.lineTo(.252*n,.8*e),u.moveTo(.252*n,.63*e),u.lineTo(.752*n,.63*e),u.stroke(),u.beginPath(),u.moveTo(.752*n,.8*e),u.lineTo(n,.8*e),u.stroke(),u.strokeStyle="rgba(255, 255, 255, 0.3)",u.beginPath(),u.moveTo(0,.8*e),u.lineTo(.5*n,e),u.lineTo(n,.8*e),u.stroke(),u.beginPath(),u.moveTo(.752*n,.8*e),u.lineTo(.752*n,.63*e),u.stroke()):(o=u.createRadialGradient(.5*n,.8*e,0,.5*n,.8*e,.7*n),o.addColorStop(0,f(t.coronaColor,0).color),o.addColorStop(.5,f(t.coronaColor,.3).color),o.addColorStop(.7,f(t.coronaColor,.2).color),o.addColorStop(.8,f(t.coronaColor,.1).color),o.addColorStop(.85,f(t.coronaColor,.05).color),o.addColorStop(1,f(t.coronaColor,0).color),u.fillStyle=o,u.beginPath(),u.arc(.5*n,.8*e,.7*n,0,Math.PI*2,!0),u.closePath(),u.fill())};if(!d.cache[c]){l=t(n*2,n*4),u=l.getContext("2d"),u.translate(n*.5,n*.5);switch(i.state){case"up":a(),h(),s();break;case"steady":a(),s(),h();break;case"down":default:s(),h(),a()}d.cache[c]=l}return d.cache[c]},d.cache={};var ct=function(n,t,i,r,u,f,e,o,s,h){h=undefined===h?h=steelseries.GaugeType.TYPE1:h,n.save(),n.textAlign=o?"center":"left",n.textBaseline="middle",n.strokeStyle=f.labelColor.getRgbaColor(),n.fillStyle=f.labelColor.getRgbaColor(),o?(n.font=.046728*t+"px sans-serif",n.fillText(r,t/2,i*.3,t*.3),n.fillText(u,t/2,i*.38,t*.3)):e?(n.font=.1*t+"px sans-serif",n.save(),n.translate(.671428*t,.1375*i),n.rotate(1.570796),n.fillText(r,0,0),n.translate(-.671428*t,-.1375*i),n.restore(),n.font=.071428*t+"px sans-serif",s?h.type==="type2"?(n.textAlign="right",n.fillText(u,.36*t,i*.79,t*.25)):n.fillText(u,.63*t,i*.85,t*.2):(n.textAlign="center",h.type==="type2"?n.fillText(u,t/2,i*.92,t*.2):n.fillText(u,t/2,i*.89,t*.2))):(n.font=.035*t+"px sans-serif",n.fillText(r,t*.15,i*.25,t*.3),n.font=.025*t+"px sans-serif",n.fillText(u,t*.0625,i*.7,t*.07)),n.restore()},vi=ii(12,12,function(n){var u=n.canvas.width,t=n.canvas.height,f=0,r=0,i;n.save(),n.save(),n.beginPath(),n.rect(0,0,u*.5,t*.5),n.closePath(),n.restore(),i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"rgb(35, 35, 35)"),i.addColorStop(1,"rgb(23, 23, 23)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.083333,0,u*.333333,t*.416666),n.closePath(),n.restore(),f=.083333,r=0,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"rgb(38, 38, 38)"),i.addColorStop(1,"rgb(30, 30, 30)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.5,t*.5,u*.5,t*.5),n.closePath(),n.restore(),f=.5,r=.5,i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"rgb(35, 35, 35)"),i.addColorStop(1,"rgb(23, 23, 23)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.583333,t*.5,u*.333333,t*.416666),n.closePath(),n.restore(),f=.583333,r=.5,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"rgb(38, 38, 38)"),i.addColorStop(1,"rgb(30, 30, 30)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.5,0,u*.5,t*.5),n.closePath(),n.restore(),f=.5,r=0,i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"#303030"),i.addColorStop(1,"rgb(40, 40, 40)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.583333,t*.083333,u*.333333,t*.416666),n.closePath(),n.restore(),f=.583333,r=.083333,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"rgb(53, 53, 53)"),i.addColorStop(1,"rgb(45, 45, 45)"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(0,t*.5,u*.5,t*.5),n.closePath(),n.restore(),f=0,r=.5,i=n.createLinearGradient(0,r*t,0,.5*t+r*t),i.addColorStop(0,"#303030"),i.addColorStop(1,"#282828"),n.fillStyle=i,n.fill(),n.save(),n.beginPath(),n.rect(u*.083333,t*.583333,u*.333333,t*.416666),n.closePath(),n.restore(),f=.083333,r=.583333,i=n.createLinearGradient(0,r*t,0,.416666*t+r*t),i.addColorStop(0,"#353535"),i.addColorStop(1,"#2d2d2d"),n.fillStyle=i,n.fill(),n.restore()}),ci=ii(15,15,function(n){var i=n.canvas.width,t=n.canvas.height,r;n.save(),n.save(),n.beginPath(),n.rect(0,0,i,t),n.closePath(),n.restore(),n.fillStyle="#1D2123",n.fill(),n.save(),n.beginPath(),n.moveTo(0,t*.266666),n.bezierCurveTo(0,t*.4,i*.066666,t*.466666,i*.2,t*.466666),n.bezierCurveTo(i*.333333,t*.466666,i*.4,t*.4,i*.4,t*.266666),n.bezierCurveTo(i*.4,t*.133333,i*.333333,t*.066666,i*.2,t*.066666),n.bezierCurveTo(i*.066666,t*.066666,0,t*.133333,0,t*.266666),n.closePath(),r=n.createLinearGradient(0,.066666*t,0,.466666*t),r.addColorStop(0,"#000000"),r.addColorStop(1,"#444444"),n.fillStyle=r,n.fill(),n.save(),n.beginPath(),n.moveTo(0,t*.2),n.bezierCurveTo(0,t*.333333,i*.066666,t*.4,i*.2,t*.4),n.bezierCurveTo(i*.333333,t*.4,i*.4,t*.333333,i*.4,t*.2),n.bezierCurveTo(i*.4,t*.066666,i*.333333,0,i*.2,0),n.bezierCurveTo(i*.066666,0,0,t*.066666,0,t*.2),n.closePath(),n.fillStyle="#050506",n.fill(),n.save(),n.beginPath(),n.moveTo(i*.466666,t*.733333),n.bezierCurveTo(i*.466666,t*.866666,i*.533333,t*.933333,i*.666666,t*.933333),n.bezierCurveTo(i*.8,t*.933333,i*.866666,t*.866666,i*.866666,t*.733333),n.bezierCurveTo(i*.866666,t*.6,i*.8,t*.533333,i*.666666,t*.533333),n.bezierCurveTo(i*.533333,t*.533333,i*.466666,t*.6,i*.466666,t*.733333),n.closePath(),r=n.createLinearGradient(0,.533333*t,0,.933333*t),r.addColorStop(0,"#000000"),r.addColorStop(1,"#444444"),n.fillStyle=r,n.fill(),n.save(),n.beginPath(),n.moveTo(i*.466666,t*.666666),n.bezierCurveTo(i*.466666,t*.8,i*.533333,t*.866666,i*.666666,t*.866666),n.bezierCurveTo(i*.8,t*.866666,i*.866666,t*.8,i*.866666,t*.666666),n.bezierCurveTo(i*.866666,t*.533333,i*.8,t*.466666,i*.666666,t*.466666),n.bezierCurveTo(i*.533333,t*.466666,i*.466666,t*.533333,i*.466666,t*.666666),n.closePath(),n.fillStyle="#050506",n.fill(),n.restore()}),li=function(n,i,r,u,f){function o(n,t){return n+=(2*Math.random()-1)*t|0,n<0?0:n>255?255:n}function e(n){return n<0?0:n>255?255:n}function s(n,t,i,r,u,f){var o,v,e,a,s,h,c,l;for(u<i||(u=i-1),a=1/(u*2+1),s=0,v=0;v<r;v++){for(h=c=l=0,o=0;o<u;o++)e=(s+o)*4,h+=n.data[e],c+=n.data[e+1],l+=n.data[e+2];for(o=0;o<i;o++)o>u&&(e=(s-u-1)*4,h-=n.data[e],c-=n.data[e+1],l-=n.data[e+2]),o+u<i&&(e=(s+u)*4,h+=n.data[e],c+=n.data[e+1],l+=n.data[e+2]),e=s*4,t.data[e]=h*a|0,t.data[e+1]=c*a|0,t.data[e+2]=l*a|0,t.data[e+3]=f,s++}}return this.fill=function(h,c,l,a){var k,d,ut,st,p,w,et,b,v,ot,ht=255,lt=n>>16&255,ct=n>>8&255,at=n&255,g=0,nt=255*r,vt,pt,yt,y,rt,it,tt,ft;h=Math.floor(h),c=Math.floor(c),l=Math.ceil(l),a=Math.ceil(a),p=l-h,w=a-c,et=t(p,w),b=et.getContext("2d"),v=b.createImageData(p,w),ot=b.createImageData(p,w);if(f!==0)for(st=[],k=0;k<p;k++)st[k]=255*f*Math.sin(k/p*Math.PI)|0;for(ut=0;ut<w;ut++)for(i!==0&&(vt=pt=yt=0),d=0;d<p;d++)y=ut*p*4+d*4,rt=lt,it=ct,tt=at,f!==0&&(ft=st[d],rt+=ft,it+=ft,tt+=ft),u?(g=(2*Math.random()-1)*nt|0,v.data[y]=e(rt+g),v.data[y+1]=e(it+g),v.data[y+2]=e(tt+g),v.data[y+3]=ht):(v.data[y]=o(rt,nt),v.data[y+1]=o(it,nt),v.data[y+2]=o(tt,nt),v.data[y+3]=ht);return i>0?(s(v,ot,p,w,i,ht),b.putImageData(ot,h,c)):b.putImageData(v,h,c),et},this},n=function(n,t,i,r){function s(){e=k(n,255),f=k(t,255),u=k(i,255),o=k(r,1)}var e,f,u,o;arguments.length===1?(i=parseInt(n.substr(5,2),16),t=parseInt(n.substr(3,2),16),n=parseInt(n.substr(1,2),16),r=1):arguments.length===3&&(r=1),s(),this.getRed=function(){return e},this.setRed=function(n){e=k(n,255)},this.getGreen=function(){return f},this.setGreen=function(n){f=k(n,255)},this.getBlue=function(){return u},this.setBlue=function(n){u=k(n,255)},this.getAlpha=function(){return o},this.setAlpha=function(n){o=k(n,1)},this.getRgbaColor=function(){return"rgba("+e+", "+f+", "+u+", "+o+")"},this.getRgbColor=function(){return"rgb("+e+", "+f+", "+u+")"},this.getHexColor=function(){return"#"+e.toString(16)+f.toString(16)+u.toString(16)}},it=function(n,t,i){i=i===undefined?-Math.PI/2:i,this.fill=function(r,u,f,e,o){var h,s,p,v=2*Math.PI,c,a,w,b,y,k=180/Math.PI,d=e+(o-e)*.5,l=v/Math.max(360,o*2.2);for(r.save(),r.lineWidth=1.5,r.translate(u,f),r.rotate(i),r.translate(-u,-f),h=0,p=n.length-1;h<p;h++)for(c=v*n[h],a=v*n[h+1],w=a-c,b=t[h],y=t[h+1],s=c;s<a;s+=l)r.beginPath(),r.fillStyle=ui(b,y,w,s-c).getRgbaColor(),r.strokeStyle=r.fillStyle,e>0?r.arc(u,f,e,s+l,s,!0):r.moveTo(u,f),r.arc(u,f,o,s,s+l),r.fill(),r.stroke();r.restore()}},kt=function(n,t,i,r){this.getColorAt=function(n){var u=0,e=0,f=1,s=1,h=0,t,o;for(n=n<0?0:n>1?1:n,t=0;t<i.length;t++){i[t]<n&&u<i[t]&&(u=i[t],e=t);if(i[t]===n)return r[t];i[t]>n&&f>=i[t]&&(f=i[t],s=t)}return o=(n-u)/(f-u),ui(r[e],r[s],1,o)},this.getStart=function(){return n},this.getEnd=function(){return t}};Math.log10=function(n){return Math.log(n)/Math.LN10},function(){h=function(n,t,i,r,u,f){this.gradientStart=n,this.gradientFraction=t,this.gradientStop=i,this.labelColor=r,this.symbolColor=u,this.name=f}}(),function(){u=function(n,t,i,r,u,f){this.gradientStartColor=n,this.gradientFraction1Color=t,this.gradientFraction2Color=i,this.gradientFraction3Color=r,this.gradientStopColor=u,this.textColor=f}}(),function(){b=function(n,t,i,r,u,f){this.veryDark=n,this.dark=t,this.medium=i,this.light=r,this.lighter=u,this.veryLight=f}}(),function(){ut=function(n,t,i,r,u,f,e){this.innerColor1_ON=n,this.innerColor2_ON=t,this.outerColor_ON=i,this.coronaColor=r,this.innerColor1_OFF=u,this.innerColor2_OFF=f,this.outerColor_OFF=e}}(),function(){at=function(n){this.type=n}}(),function(){pt=function(n){this.type=n}}(),function(){ri=function(n){this.type=n}}(),function(){dt=function(n){this.style=n}}(),function(){g=function(n){this.design=n}}(),function(){l=function(n){this.type=n}}(),function(){lt=function(n){this.type=n}}(),function(){gt=function(n){this.format=n}}(),function(){bt=function(n){this.type=n}}(),function(){yt=function(n){this.state=n}}();var di={DARK_GRAY:new h(new n(0,0,0,1),new n(51,51,51,1),new n(153,153,153,1),new n(255,255,255,1),new n(180,180,180,1),"DARK_GRAY"),SATIN_GRAY:new h(new n(45,57,57,1),new n(45,57,57,1),new n(45,57,57,1),new n(167,184,180,1),new n(137,154,150,1),"SATIN_GRAY"),LIGHT_GRAY:new h(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"LIGHT_GRAY"),WHITE:new h(new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1),new n(0,0,0,1),new n(80,80,80,1),"WHITE"),BLACK:new h(new n(0,0,0,1),new n(0,0,0,1),new n(0,0,0,1),new n(255,255,255,1),new n(150,150,150,1),"BLACK"),BEIGE:new h(new n(178,172,150,1),new n(204,205,184,1),new n(231,231,214,1),new n(0,0,0,1),new n(80,80,80,1),"BEIGE"),BROWN:new h(new n(245,225,193,1),new n(245,225,193,1),new n(255,250,240,1),new n(109,73,47,1),new n(89,53,27,1),"BROWN"),RED:new h(new n(198,93,95,1),new n(212,132,134,1),new n(242,218,218,1),new n(0,0,0,1),new n(90,0,0,1),"RED"),GREEN:new h(new n(65,120,40,1),new n(129,171,95,1),new n(218,237,202,1),new n(0,0,0,1),new n(0,90,0,1),"GREEN"),BLUE:new h(new n(45,83,122,1),new n(115,144,170,1),new n(227,234,238,1),new n(0,0,0,1),new n(0,0,90,1),"BLUE"),ANTHRACITE:new h(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(250,250,250,1),new n(180,180,180,1),"ANTHRACITE"),MUD:new h(new n(80,86,82,1),new n(70,76,72,1),new n(57,62,58,1),new n(255,255,240,1),new n(225,225,210,1),"MUD"),PUNCHED_SHEET:new h(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1),"PUNCHED_SHEET"),CARBON:new h(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(255,255,255,1),new n(180,180,180,1),"CARBON"),STAINLESS:new h(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"STAINLESS"),BRUSHED_METAL:new h(new n(50,50,54,1),new n(47,47,51,1),new n(69,69,74,1),new n(0,0,0,1),new n(80,80,80,1),"BRUSHED_METAL"),BRUSHED_STAINLESS:new h(new n(50,50,54,1),new n(47,47,51,1),new n(110,110,112,1),new n(0,0,0,1),new n(80,80,80,1),"BRUSHED_STAINLESS"),TURNED:new h(new n(130,130,130,1),new n(181,181,181,1),new n(253,253,253,1),new n(0,0,0,1),new n(80,80,80,1),"TURNED")},ki={BEIGE:new u("#c8c8b1","rgb(241, 237, 207)","rgb(234, 230, 194)","rgb(225, 220, 183)","rgb(237, 232, 191)","#000000"),BLUE:new u("#ffffff","rgb(231, 246, 255)","rgb(170, 224, 255)","rgb(136, 212, 255)","rgb(192, 232, 255)","#124564"),ORANGE:new u("#ffffff","rgb(255, 245, 225)","rgb(255, 217, 147)","rgb(255, 201, 104)","rgb(255, 227, 173)","#503700"),RED:new u("#ffffff","rgb(255, 225, 225)","rgb(253, 152, 152)","rgb(252, 114, 115)","rgb(254, 178, 178)","#4f0c0e"),YELLOW:new u("#ffffff","rgb(245, 255, 186)","rgb(210, 255, 0)","rgb(158, 205, 0)","rgb(210, 255, 0)","#405300"),WHITE:new u("#ffffff","#ffffff","rgb(241, 246, 242)","rgb(229, 239, 244)","#ffffff","#000000"),GRAY:new u("#414141","rgb(117, 117, 117)","rgb(87, 87, 87)","#414141","rgb(81, 81, 81)","#ffffff"),BLACK:new u("#414141","#666666","#333333","#000000","#333333","#cccccc"),GREEN:new u("rgb(33, 67, 67)","rgb(33, 67, 67)","rgb(29, 58, 58)","rgb(28, 57, 57)","rgb(23, 46, 46)","rgba(0, 185, 165, 255)"),BLUE2:new u("rgb(0, 68, 103)","rgb(8, 109, 165)","rgb(0, 72, 117)","rgb(0, 72, 117)","rgb(0, 68, 103)","rgb(111, 182, 228)"),BLUE_BLACK:new u("rgb(22, 125, 212)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(3, 162, 254)","rgb(11, 172, 244)","#000000"),BLUE_DARKBLUE:new u("rgb(18, 33, 88)","rgb(18, 33, 88)","rgb(19, 30, 90)","rgb(17, 31, 94)","rgb(21, 25, 90)","rgb(23, 99, 221)"),BLUE_GRAY:new u("rgb(135, 174, 255)","rgb(101, 159, 255)","rgb(44, 93, 255)","rgb(27, 65, 254)","rgb(12, 50, 255)","#b2b4ed"),STANDARD:new u("rgb(131, 133, 119)","rgb(176, 183, 167)","rgb(165, 174, 153)","rgb(166, 175, 156)","rgb(175, 184, 165)","rgb(35, 42, 52)"),STANDARD_GREEN:new u("#ffffff","rgb(219, 230, 220)","rgb(179, 194, 178)","rgb(153, 176, 151)","rgb(114, 138, 109)","#080C06"),BLUE_BLUE:new u("rgb(100, 168, 253)","rgb(100, 168, 253)","rgb(95, 160, 250)","rgb(80, 144, 252)","rgb(74, 134, 255)","#002cbb"),RED_DARKRED:new u("rgb(72, 36, 50)","rgb(185, 111, 110)","rgb(148, 66, 72)","rgb(83, 19, 20)","rgb(7, 6, 14)","#FE8B92"),DARKBLUE:new u("rgb(14, 24, 31)","rgb(46, 105, 144)","rgb(19, 64, 96)","rgb(6, 20, 29)","rgb(8, 9, 10)","#3DB3FF"),LILA:new u("rgb(175, 164, 255)","rgb(188, 168, 253)","rgb(176, 159, 255)","rgb(174, 147, 252)","rgb(168, 136, 233)","#076148"),BLACKRED:new u("rgb(8, 12, 11)","rgb(10, 11, 13)","rgb(11, 10, 15)","rgb(7, 13, 9)","rgb(9, 13, 14)","#B50026"),DARKGREEN:new u("rgb(25, 85, 0)","rgb(47, 154, 0)","rgb(30, 101, 0)","rgb(30, 101, 0)","rgb(25, 85, 0)","#233123"),AMBER:new u("rgb(182, 71, 0)","rgb(236, 155, 25)","rgb(212, 93, 5)","rgb(212, 93, 5)","rgb(182, 71, 0)","#593A0A"),LIGHTBLUE:new u("rgb(125, 146, 184)","rgb(197, 212, 231)","rgb(138, 155, 194)","rgb(138, 155, 194)","rgb(125, 146, 184)","#090051"),SECTIONS:new u("#b2b2b2","#ffffff","#c4c4c4","#c4c4c4","#b2b2b2","#000000")},pi={RED:new b(new n(82,0,0,1),new n(158,0,19,1),new n(213,0,25,1),new n(240,82,88,1),new n(255,171,173,1),new n(255,217,218,1)),GREEN:new b(new n(8,54,4,1),new n(0,107,14,1),new n(15,148,0,1),new n(121,186,37,1),new n(190,231,141,1),new n(234,247,218,1)),BLUE:new b(new n(0,11,68,1),new n(0,73,135,1),new n(0,108,201,1),new n(0,141,242,1),new n(122,200,255,1),new n(204,236,255,1)),ORANGE:new b(new n(118,83,30,1),new n(215,67,0,1),new n(240,117,0,1),new n(255,166,0,1),new n(255,255,128,1),new n(255,247,194,1)),YELLOW:new b(new n(41,41,0,1),new n(102,102,0,1),new n(177,165,0,1),new n(255,242,0,1),new n(255,250,153,1),new n(255,252,204,1)),CYAN:new b(new n(15,109,109,1),new n(0,109,144,1),new n(0,144,191,1),new n(0,174,239,1),new n(153,223,249,1),new n(204,239,252,1)),MAGENTA:new b(new n(98,0,114,1),new n(128,24,72,1),new n(191,36,107,1),new n(255,48,143,1),new n(255,172,210,1),new n(255,214,23,1)),WHITE:new b(new n(210,210,210,1),new n(220,220,220,1),new n(235,235,235,1),new n(255,255,255,1),new n(255,255,255,1),new n(255,255,255,1)),GRAY:new b(new n(25,25,25,1),new n(51,51,51,1),new n(76,76,76,1),new n(128,128,128,1),new n(204,204,204,1),new n(243,243,243,1)),BLACK:new b(new n(0,0,0,1),new n(5,5,5,1),new n(10,10,10,1),new n(15,15,15,1),new n(20,20,20,1),new n(25,25,25,1)),RAITH:new b(new n(0,32,65,1),new n(0,65,125,1),new n(0,106,172,1),new n(130,180,214,1),new n(148,203,242,1),new n(191,229,255,1)),GREEN_LCD:new b(new n(0,55,45,1),new n(15,109,93,1),new n(0,185,165,1),new n(48,255,204,1),new n(153,255,227,1),new n(204,255,241,1)),JUG_GREEN:new b(new n(0,56,0,1),new n(32,69,36,1),new n(50,161,0,1),new n(129,206,0,1),new n(190,231,141,1),new n(234,247,218,1))},gi={RED_LED:new ut("#FF9A89","#FF9A89","#FF3300","#FF8D70","#7E1C00","#7E1C00","#641B00"),GREEN_LED:new ut("#9AFF89","#9AFF89","#59FF2A","#A5FF00","#1C7E00","#1C7E00","#1B6400"),BLUE_LED:new ut("#899AFF","#899AFF","#0033FF","#708DFF","#001C7E","#001C7E","#001B64"),ORANGE_LED:new ut("#FEA23F","#FEA23F","#FD6C00","#FD6C00","#592800","#592800","#421F00"),YELLOW_LED:new ut("#FFFF62","#FFFF62","#FFFF00","#FFFF00","#6B6D00","#6B6D00","#515300"),CYAN_LED:new ut("#00FFFF","#00FFFF","#1BC3C3","#00FFFF","#083B3B","#083B3B","#052727"),MAGENTA_LED:new ut("#D300FF","#D300FF","#8600CB","#C300FF","#38004B","#38004B","#280035")},ai={TYPE1:new at("type1"),TYPE2:new at("type2"),TYPE3:new at("type3"),TYPE4:new at("type4"),TYPE5:new at("type5")},ur={NORTH:new pt("north"),SOUTH:new pt("south"),EAST:new pt("east"),WEST:new pt("west")},fi={STANDARD_KNOB:new ri("standardKnob"),METAL_KNOB:new ri("metalKnob")},oi={BLACK:new dt("black"),BRASS:new dt("brass"),SILVER:new dt("silver")},fr={BLACK_METAL:new g("blackMetal"),METAL:new g("metal"),SHINY_METAL:new g("shinyMetal"),BRASS:new g("brass"),STEEL:new g("steel"),CHROME:new g("chrome"),GOLD:new g("gold"),ANTHRACITE:new g("anthracite"),TILTED_GRAY:new g("tiltedGray"),TILTED_BLACK:new g("tiltedBlack"),GLOSSY_METAL:new g("glossyMetal")},er={TYPE1:new l("type1"),TYPE2:new l("type2"),TYPE3:new l("type3"),TYPE4:new l("type4"),TYPE5:new l("type5"),TYPE6:new l("type6"),TYPE7:new l("type7"),TYPE8:new l("type8"),TYPE9:new l("type9"),TYPE10:new l("type10"),TYPE11:new l("type11"),TYPE12:new l("type12"),TYPE13:new l("type13"),TYPE14:new l("type14"),TYPE15:new l("type15"),TYPE16:new l("type16")},rr={TYPE1:new lt("type1"),TYPE2:new lt("type2"),TYPE3:new lt("type3"),TYPE4:new lt("type4"),TYPE5:new lt("type5")},nr={STANDARD:new gt("standard"),FRACTIONAL:new gt("fractional"),SCIENTIFIC:new gt("scientific")},tr={NORMAL:new bt("normal"),HORIZONTAL:new bt("horizontal"),TANGENT:new bt("tangent")},ir={UP:new yt("up"),STEADY:new yt("steady"),DOWN:new yt("down"),OFF:new yt("off")};return{Radial:ei,RadialBargraph:wi,RadialVertical:bi,Linear:yi,LinearBargraph:kr,DisplaySingle:dr,DisplayMulti:wr,Level:br,Compass:gr,WindDirection:iu,Horizon:ru,Led:nu,Clock:tu,Battery:hr,StopWatch:cr,Altimeter:sr,TrafficLight:lr,LightBulb:yr,Odometer:pr,drawFrame:v,drawBackground:w,drawForeground:y,rgbaColor:n,ConicalGradient:it,setAlpha:f,getColorFromFraction:ui,gradientWrapper:kt,BackgroundColor:di,LcdColor:ki,ColorDef:pi,LedColor:gi,GaugeType:ai,Orientation:ur,FrameDesign:fr,PointerType:er,ForegroundType:rr,KnobType:fi,KnobStyle:oi,LabelNumberFormat:nr,TickLabelOrientation:tr,TrendState:ir,Section:vr}}()