(function(dvt) {
var DvtGauge=function(){};dvt.Obj.createSubclass(DvtGauge,dvt.BaseComponent);DvtGauge._DEFAULT_MIN_VALUE=0;DvtGauge._DEFAULT_MAX_VALUE=100;
DvtGauge.prototype.Init=function(a,b,c,d){DvtGauge.superclass.Init.call(this,a,b,c);this._bStaticRendering=d;this._bStaticRendering||(this.EventManager=this.CreateEventManager(),this.EventManager.addListeners(this),dvt.Agent.isTouchDevice()||this.EventManager.setKeyboardHandler(this.CreateKeyboardHandler(this.EventManager)),this.setId("gauge1000"+Math.floor(1E9*Math.random())),this._editingOverlay=new dvt.Rect(a,0,0),this._editingOverlay.setInvisibleFill(),this.addChild(this._editingOverlay));this._bResizeRender=
this._bEditing=!1;this._oldValue=null};DvtGauge.prototype.SetOptions=function(a){this.Options=a;dvt.Agent.isEnvironmentBrowser()||(this.Options.animationOnDisplay="none",this.Options.animationOnDataChange="none");dvt.Agent.isPlatformIE()&&"auto"==this.Options.visualEffects&&(this.Options.visualEffects="none");a.className&&(this.Options.svgClassName=a.className);a.style&&(this.Options.svgStyle=a.style)};
DvtGauge.prototype.render=function(a,b,c){a?this.SetOptions(a):this.Options||this.SetOptions(null);this.Options.thresholds&&(this.Options.thresholds=this.Options.thresholds.sort(DvtGauge._thresholdComparator));isNaN(b)||isNaN(c)||(this._bResizeRender=0!=this.Width&&this.Width!=b||0!=this.Height&&this.Height!=c?!0:!1,this.Width=b,this.Height=c);c=this.__shapes;this.__shapes=[];b=new dvt.Container(this.getCtx());this.addChildAt(b,0);this.Render(b,this.Width,this.Height);this._setAnimation(b,null!=a,
c,this.Width,this.Height);this._editingOverlay&&(this._editingOverlay.setWidth(this.Width),this._editingOverlay.setHeight(this.Height),this.getEventManager().associate(this._editingOverlay,this.__getLogicalObject(),!0));this.UpdateAriaAttributes();this._bStaticRendering||this.Options.readOnly||(b.setAriaRole("slider"),b.setAriaProperty("valuemin",this.Options.min),b.setAriaProperty("valuemax",this.Options.max),a=DvtGaugeRenderer.getFormattedMetricLabel(this.Options.value,this),b.setAriaProperty("valuenow",
a),c=DvtGaugeRenderer.getTooltipString(this),dvt.Agent.isTouchDevice()&&(this._container.setAriaProperty("live","assertive"),a!=c&&(c=a+dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"ARIA_LABEL_DESC_DELIMITER")+c)),a!=c&&b.setAriaProperty("label",c),this._renderCount=null!=this._renderCount?this._renderCount+1:0,a=this.getId()+"_"+this._renderCount,b.setId(a),this.getCtx().setActiveElement(b));this.Options._selectingCursor&&this.setCursor(dvt.SelectionEffectUtils.getSelectingCursor());this.Animation||
this.RenderComplete()};DvtGauge.prototype.__getLogicalObject=function(){var a=this.Options.tooltip,b=a?a.renderer:null,a=DvtGaugeStyleUtils.getColor(this);if(b){var c={component:this.Options._widgetConstructor,label:DvtGaugeRenderer.getFormattedMetricLabel(this.Options.value,this),color:a};return new dvt.CustomDatatipPeer(this.getCtx().getTooltipManager(),b,a,c)}b=DvtGaugeRenderer.getTooltipString(this);return new dvt.SimpleObjPeer(null,b,a)};DvtGauge.prototype.Render=function(a,b,c){};
DvtGauge.prototype._setAnimation=function(a,b,c,d,e){this.StopAnimation();var f=!1,g=this._bEditing||this._bResizeRender?"none":this.getOptions().animationOnDataChange,h=this._bEditing||this._bResizeRender?"none":this.getOptions().animationOnDisplay,k=dvt.StyleUtils.getTimeMilliseconds(this.getOptions().animationDuration)/1E3;if(h||g)d=new dvt.Rectangle(0,0,d,e),e=this.getCtx(),this._container||"none"===h||null==this.__shapes[0]?this._container&&"none"!=g&&b&&null!=this.__shapes[0]&&((this.Animation=
dvt.BlackBoxAnimationHandler.getCombinedAnimation(e,g,this._container,a,d,k))?f=!0:this.Animation=this.CreateAnimationOnDataChange(c,this.__shapes,h,k)):(this.Animation=dvt.BlackBoxAnimationHandler.getInAnimation(e,h,a,d,k),this.Animation||(this.Animation=this.CreateAnimationOnDisplay(this.__shapes,h,k))),!f&&this._container&&(this.removeChild(this._container),this._container.destroy()),this.Animation&&(this.Animation.play(),this.Animation.setOnEnd(this._onAnimationEnd,this)),f&&(this._oldContainer=
this._container),this._container=a};DvtGauge.prototype.CreateAnimationOnDisplay=function(a,b,c){return null};DvtGauge.prototype.CreateAnimationOnDataChange=function(a,b,c,d){c=[];for(var e=0;e<a.length;e++){var f=b[e],g=a[e].getAnimationParams(),h=f.getAnimationParams();f.setAnimationParams(g);g=new dvt.CustomAnimation(this.getCtx(),f,d);g.getAnimator().addProp(dvt.Animator.TYPE_NUMBER_ARRAY,f,f.getAnimationParams,f.setAnimationParams,h);c.push(g)}return new dvt.ParallelPlayable(this.getCtx(),c)};
DvtGauge.prototype.GetValueAt=function(a,b){return null};DvtGauge.prototype.renderUpdate=function(){this.render();this.UpdateAriaLiveValue(this._container)};DvtGauge.prototype.UpdateAriaLiveValue=function(a,b){b=DvtGaugeRenderer.getFormattedMetricLabel(b?b:this.Options.value,this);a.setAriaProperty("valuenow",b);dvt.Agent.isTouchDevice()&&a.setAriaProperty("label",b)};
DvtGauge.prototype._onAnimationEnd=function(){this._oldContainer&&(this.removeChild(this._oldContainer),this._oldContainer.destroy(),this._oldContainer=null);this.AnimationStopped||this.RenderComplete();this.Animation=null;this.AnimationStopped=!1};DvtGauge.prototype.__processValueChangeStart=function(a,b){this._bEditing=!0;this._oldValue=this.Options.value;this.__processValueChangeMove(a,b)};
DvtGauge.prototype.__processValueChangeMove=function(a,b){if(null!=this._oldValue){var c=DvtGaugeRenderer.adjustForStep(this.Options,this.GetValueAt(a,b));c!=this.Options.value&&(this.Options.value=c,this.renderUpdate(),this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(this._oldValue,this.Options.value,!1)))}};
DvtGauge.prototype.__processValueChangeEnd=function(a,b){this.__processValueChangeMove(a,b);if(dvt.Agent.isTouchDevice()){var c=DvtGaugeRenderer.getFormattedMetricLabel(this.Options.value,this),d=DvtGaugeRenderer.getTooltipString(this);c!=d&&(d=c+dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"ARIA_LABEL_DESC_DELIMITER")+d,this._container.setAriaProperty("label",d))}this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(this._oldValue,this.Options.value,!0));this._bEditing=!1;this._oldValue=
null};DvtGauge.prototype.__increaseValue=function(){if(!this.Options.readOnly){var a=this.Options.value;this.Options.value=null!=this.Options.step?DvtGaugeRenderer.adjustForStep(this.Options,this.Options.value+this.Options.step):Math.min(Math.max(this.Options.value+(this.Options.max-this.Options.min)/100,this.Options.min),this.Options.max);this.renderUpdate();this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(a,this.Options.value,!1))}};
DvtGauge.prototype.__decreaseValue=function(){if(!this.Options.readOnly){var a=this.Options.value;this.Options.value=null!=this.Options.step?DvtGaugeRenderer.adjustForStep(this.Options,this.Options.value-this.Options.step):Math.min(Math.max(this.Options.value-(this.Options.max-this.Options.min)/100,this.Options.min),this.Options.max);this.renderUpdate();this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(a,this.Options.value,!1))}};DvtGauge.prototype.CreateEventManager=function(){return new DvtGaugeEventManager(this)};
DvtGauge._thresholdComparator=function(a,b){return null!=a.max&&null!=b.max?a.max-b.max:a.max?-Infinity:Infinity};DvtGauge.prototype.getAutomation=function(){return new DvtGaugeAutomation(this)};DvtGauge.prototype.CreateKeyboardHandler=function(a){return new DvtGaugeKeyboardHandler(a,this)};DvtGauge.prototype.GetComponentDescription=function(){return dvt.Bundle.getTranslation(this.getOptions(),"componentName",dvt.Bundle.UTIL_PREFIX,"GAUGE")};
DvtGauge.prototype.UpdateAriaAttributes=function(){if(!this._bStaticRendering){var a=DvtGaugeRenderer.getTooltipString(this);this.IsParentRoot()?this.Options.readOnly?(this.getCtx().setAriaRole("img"),this.getCtx().setAriaLabel(dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"COLON_SEP_LIST",[dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"DATA_VISUALIZATION"),dvt.Displayable.generateAriaLabel(dvt.StringUtils.processAriaLabel(this.GetComponentDescription()),a?[a]:null)]))):(this.getCtx().setAriaRole("application"),
this.getCtx().setAriaLabel(dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"COLON_SEP_LIST",[dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"DATA_VISUALIZATION"),dvt.StringUtils.processAriaLabel(this.GetComponentDescription())]))):this.Options.readOnly&&(this.setAriaRole("img"),this.setAriaProperty("label",dvt.Displayable.generateAriaLabel(dvt.StringUtils.processAriaLabel(this.GetComponentDescription()),a?[a]:null)))}};
var DvtGaugeAutomation=function(a){this._gauge=a};dvt.Obj.createSubclass(DvtGaugeAutomation,dvt.Automation);DvtGaugeAutomation.prototype.getDomElementForSubId=function(a){if(a==dvt.Automation.TOOLTIP_SUBID)return this.GetTooltipElement(this._gauge);if(0==a.indexOf("item")){var b=a.indexOf("["),c=a.indexOf("]");if(0<b&&0<c&&(a=a.substring(b+1,c),a=this._gauge.__getRatingGaugeItem(a)))return a.getElem()}return null};
DvtGaugeAutomation.prototype.GetSubIdForDomElement=function(a){for(var b=this._gauge.getOptions(),c=0;c<b.max;c++)if(this._gauge.__getRatingGaugeItem(c)==a)return"item["+c+"]";return null};DvtGaugeAutomation.prototype.getValue=function(){return this._gauge.getOptions().value};DvtGaugeAutomation.prototype.getMetricLabel=function(){return DvtGaugeRenderer.getFormattedMetricLabel(this.getValue(),this._gauge)};
dvt.Bundle.addDefaultStrings(dvt.Bundle.GAUGE_PREFIX,{});
var DvtGaugeDefaults=function(){};dvt.Obj.createSubclass(DvtGaugeDefaults,dvt.BaseComponentDefaults);DvtGaugeDefaults.SKIN_ALTA={skin:dvt.CSSStyle.SKIN_ALTA,color:"#393737",metricLabel:{style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_ALTA)},_statusMessageStyle:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_ALTA),label:{style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_ALTA)},_thresholdColors:["#ed6647","#fad55c","#68c182"]};
DvtGaugeDefaults.VERSION_1={skin:dvt.CSSStyle.SKIN_SKYROS,min:0,max:100,center:{},color:"#313842",borderColor:null,visualEffects:"auto",emptyText:null,animationOnDataChange:"none",animationOnDisplay:"none",animationDuration:500,readOnly:"true",metricLabel:{rendered:"auto",scaling:"auto",style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_SKYROS),textType:"number"},_statusMessageStyle:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_SKYROS),label:{style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_SKYROS),
position:"auto"},_thresholdColors:["#D62800","#FFCF21","#84AE31"],__layout:{outerGap:1,labelGap:5}};DvtGaugeDefaults.prototype.Init=function(a){a={skyros:dvt.JsonUtils.merge(a.skyros,DvtGaugeDefaults.VERSION_1),alta:dvt.JsonUtils.merge(a.alta,DvtGaugeDefaults.SKIN_ALTA)};DvtGaugeDefaults.superclass.Init.call(this,a)};DvtGaugeDefaults.isSkyrosSkin=function(a){return a.getOptions().skin==dvt.CSSStyle.SKIN_SKYROS};
var DvtGaugeDataUtils={};dvt.Obj.createSubclass(DvtGaugeDataUtils,dvt.Obj);DvtGaugeDataUtils.hasData=function(a){var b=a.getOptions();return b&&null!=b.value&&DvtGaugeDataUtils.hasValidData(a)};DvtGaugeDataUtils.hasValidData=function(a){a=a.getOptions();return Number(a.min)<Number(a.max)};DvtGaugeDataUtils.getValueThresholdIndex=function(a,b){var c=a.getOptions(),d=null!=b?b:c.value,c=c.thresholds;if(!c)return-1;for(var e=0;e<c.length;e++)if(d<=c[e].max)return e;return c.length-1};
DvtGaugeDataUtils.getThreshold=function(a,b){var c=a.getOptions().thresholds;return c&&0<=b&&b<c.length?c[b]:null};DvtGaugeDataUtils.getReferenceObject=function(a,b){var c=a.getOptions().referenceLines;return c&&0<=b&&b<c.length?c[b]:null};
var DvtGaugeEventManager=function(a){this.Init(a.getCtx(),a.dispatchEvent,a);this._gauge=a;this.IsMouseEditing=!1};dvt.Obj.createSubclass(DvtGaugeEventManager,dvt.EventManager);DvtGaugeEventManager.prototype.OnMouseDown=function(a){if(!1===this._gauge.getOptions().readOnly){this.IsMouseEditing=!0;this.hideTooltip();var b=this.GetRelativePosition(a.pageX,a.pageY);this._gauge.__processValueChangeStart(b.x,b.y);a.preventDefault()}else DvtGaugeEventManager.superclass.OnMouseDown.call(this,a)};
DvtGaugeEventManager.prototype.OnMouseUp=function(a){this.IsMouseEditing?(this.IsMouseEditing=!1,a=this.GetRelativePosition(a.pageX,a.pageY),this._gauge.__processValueChangeEnd(a.x,a.y)):DvtGaugeEventManager.superclass.OnMouseUp.call(this,a)};
DvtGaugeEventManager.prototype.OnMouseMove=function(a){if(this.IsMouseEditing){var b=this.GetRelativePosition(a.pageX,a.pageY);this._gauge.__processValueChangeMove(b.x,b.y)}!this.IsShowingTooltipWhileEditing()&&this.IsMouseEditing||DvtGaugeEventManager.superclass.OnMouseMove.call(this,a)};DvtGaugeEventManager.prototype.IsShowingTooltipWhileEditing=function(){return!1};
DvtGaugeEventManager.prototype.PreEventBubble=function(a){if(dvt.TouchEvent.TOUCHSTART===a.type&&!1===this._gauge.getOptions().readOnly){this.IsMouseEditing=!0;var b=this.GetRelativePosition(a.touches[0].pageX,a.touches[0].pageY);this._gauge.__processValueChangeStart(b.x,b.y);a.preventDefault()}else dvt.TouchEvent.TOUCHMOVE===a.type&&this.IsMouseEditing?(b=this.GetRelativePosition(a.touches[0].pageX,a.touches[0].pageY),this._gauge.__processValueChangeMove(b.x,b.y),a.preventDefault()):dvt.TouchEvent.TOUCHEND===
a.type&&this.IsMouseEditing&&(this.IsMouseEditing=!1,b=this.GetRelativePosition(a.changedTouches[0].pageX,a.changedTouches[0].pageY),this._gauge.__processValueChangeEnd(b.x,b.y),a.preventDefault());this.IsMouseEditing&&!this.IsShowingTooltipWhileEditing()||DvtGaugeEventManager.superclass.PreEventBubble.call(this,a)};
DvtGaugeEventManager.prototype.ProcessKeyboardEvent=function(a){if(!this.KeyboardHandler)return!1;this.KeyboardHandler.processKeyDown(a);var b=a.keyCode;if(b==dvt.KeyboardEvent.UP_ARROW||b==dvt.KeyboardEvent.LEFT_ARROW||b==dvt.KeyboardEvent.DOWN_ARROW||b==dvt.KeyboardEvent.RIGHT_ARROW||b==dvt.KeyboardEvent.TAB)b=this._gauge.getCtx().getStageAbsolutePosition(),this.ProcessObjectTooltip(a,b.x,b.y,this._gauge.__getLogicalObject(),this._gauge);return!1};
DvtGaugeEventManager.prototype.OnBlur=function(a){DvtGaugeEventManager.superclass.OnBlur.call(this,a);this.hideTooltip()};DvtGaugeEventManager.prototype.GetRelativePosition=function(a,b){var c=this.getCtx().pageToStageCoords(a,b);return this._gauge.stageToLocal(c)};DvtGaugeEventManager.prototype.UpdateActiveElement=function(a,b){};DvtGaugeEventManager.prototype.__isMouseEditing=function(){return this.IsMouseEditing};
var DvtGaugeKeyboardHandler=function(a,b){this.Init(a,b)};dvt.Obj.createSubclass(DvtGaugeKeyboardHandler,dvt.KeyboardHandler);DvtGaugeKeyboardHandler.prototype.Init=function(a,b){DvtGaugeKeyboardHandler.superclass.Init.call(this,a);this._gauge=b};
DvtGaugeKeyboardHandler.prototype.processKeyDown=function(a){var b=a.keyCode,c=dvt.Agent.isRightToLeft(this._gauge.getCtx()),d=this._gauge.getOptions().value;this._gauge.getOptions().readOnly||(b!=dvt.KeyboardEvent.TAB||this._bEditing?b==dvt.KeyboardEvent.UP_ARROW||b==(c?dvt.KeyboardEvent.LEFT_ARROW:dvt.KeyboardEvent.RIGHT_ARROW)?(this._gauge.__increaseValue(),dvt.EventManager.consumeEvent(a)):b==dvt.KeyboardEvent.DOWN_ARROW||b==(c?dvt.KeyboardEvent.RIGHT_ARROW:dvt.KeyboardEvent.LEFT_ARROW)?(this._gauge.__decreaseValue(),
dvt.EventManager.consumeEvent(a)):!this._bEditing||b!=dvt.KeyboardEvent.ENTER&&b!=dvt.KeyboardEvent.TAB||this._oldValue==d||(this._gauge.dispatchEvent(dvt.EventFactory.newValueChangeEvent(this._oldValue,d,!0)),b==dvt.KeyboardEvent.TAB?(this._bEditing=!1,this._oldValue=null):this._oldValue=d):(this._bEditing=!0,this._oldValue=d))};
var DvtGaugeStyleUtils={};dvt.Obj.createSubclass(DvtGaugeStyleUtils,dvt.Obj);DvtGaugeStyleUtils._THRESHOLD_COLOR_RAMP=["#ed6647","#fad55c","#68c182"];DvtGaugeStyleUtils._SKYROS_THRESHOLD_COLOR_RAMP=["#D62800","#FFCF21","#84AE31"];DvtGaugeStyleUtils._ALTA_CIRCLE={startAngle:202.5,angleExtent:225,anchorX:100,anchorY:103,metricLabelBounds:{x:80,y:86,width:40,height:34},indicatorLength:.85,tickLabelHeight:20,tickLabelWidth:30,radius:60,majorTickCount:6};
DvtGaugeStyleUtils._ALTA_DOME={startAngle:202.5,angleExtent:225,anchorX:100,anchorY:103,metricLabelBounds:{x:83,y:86,width:34,height:34},indicatorLength:.85,tickLabelHeight:20,tickLabelWidth:30,radius:60,majorTickCount:6};DvtGaugeStyleUtils._ALTA_RECTANGLE={startAngle:202.5,angleExtent:225,anchorX:100,anchorY:103,metricLabelBounds:{x:83,y:86,width:34,height:34},indicatorLength:.85,tickLabelHeight:20,tickLabelWidth:30,radius:60,majorTickCount:6};
DvtGaugeStyleUtils._ANTIQUE_CIRCLE={startAngle:220.5,angleExtent:261.1,anchorX:100,anchorY:100,metricLabelBounds:{x:82,y:133,width:36,height:34},indicatorLength:.85,tickLabelHeight:20,tickLabelWidth:30,radius:61,majorTickCount:6};DvtGaugeStyleUtils._ANTIQUE_DOME={startAngle:195.5,angleExtent:210.8,anchorX:100,anchorY:100,metricLabelBounds:{x:84,y:135,width:32,height:35},indicatorLength:.98,tickLabelHeight:20,tickLabelWidth:30,radius:63,majorTickCount:6};
DvtGaugeStyleUtils._ANTIQUE_RECTANGLE={startAngle:207.6,angleExtent:235,anchorX:100,anchorY:95.8,metricLabelBounds:{x:83,y:125,width:34,height:40},indicatorLength:1.05,tickLabelHeight:20,tickLabelWidth:30,radius:64,majorTickCount:6};DvtGaugeStyleUtils._LIGHT_CIRCLE={startAngle:220.5,angleExtent:261.1,anchorX:100,anchorY:100,metricLabelBounds:{x:80,y:82,width:40,height:40},indicatorLength:.82,tickLabelHeight:20,tickLabelWidth:30,radius:58,majorTickCount:6};
DvtGaugeStyleUtils._LIGHT_DOME={startAngle:201,angleExtent:222,anchorX:100.2,anchorY:89,metricLabelBounds:{x:80,y:70,width:41,height:39},indicatorLength:1.23,tickLabelHeight:20,tickLabelWidth:30,radius:56,majorTickCount:6};DvtGaugeStyleUtils._LIGHT_RECTANGLE={startAngle:211,angleExtent:242,anchorX:100,anchorY:91.445,metricLabelBounds:{x:78,y:75,width:44,height:38},indicatorLength:1.1,tickLabelHeight:20,tickLabelWidth:30,radius:58,majorTickCount:6};
DvtGaugeStyleUtils._DARK_CIRCLE={startAngle:220.5,angleExtent:261.5,metricLabelBounds:{x:80,y:82,width:40,height:40},indicatorLength:.85,tickLabelHeight:20,tickLabelWidth:30,radius:60,majorTickCount:6};DvtGaugeStyleUtils._DARK_DOME={startAngle:201,angleExtent:222,anchorX:100.2,anchorY:89,metricLabelBounds:{x:80,y:73,width:40,height:36},indicatorLength:1.23,tickLabelHeight:20,tickLabelWidth:30,radius:56,majorTickCount:6};
DvtGaugeStyleUtils._DARK_RECTANGLE={startAngle:201,angleExtent:222,anchorX:100.2,anchorY:99.5,metricLabelBounds:{x:80,y:83,width:41,height:36},indicatorLength:1.1,tickLabelHeight:20,tickLabelWidth:30,radius:58,majorTickCount:6};DvtGaugeStyleUtils._ANTIQUE_INDICATOR={anchorX:42,anchorY:510};DvtGaugeStyleUtils._ALTA_INDICATOR={anchorX:187,anchorY:388};DvtGaugeStyleUtils._LIGHT_INDICATOR={anchorX:227,anchorY:425};DvtGaugeStyleUtils._DARK_INDICATOR={anchorX:227,anchorY:425};
DvtGaugeStyleUtils.getColor=function(a){var b=a.getOptions(),c=DvtGaugeDataUtils.getValueThresholdIndex(a),d=DvtGaugeDataUtils.getThreshold(a,c);return!d||a instanceof dvt.StatusMeterGauge&&!(a instanceof dvt.StatusMeterGauge&&"onIndicator"==b.thresholdDisplay)?b.color:DvtGaugeStyleUtils.getThresholdColor(a,d,c)};
DvtGaugeStyleUtils.getBorderColor=function(a){var b=a.getOptions(),c=DvtGaugeDataUtils.getValueThresholdIndex(a);return(c=DvtGaugeDataUtils.getThreshold(a,c))&&c.borderColor&&(!(a instanceof dvt.StatusMeterGauge)||a instanceof dvt.StatusMeterGauge&&"onIndicator"==b.thresholdDisplay)?c.borderColor:b.borderColor};
DvtGaugeStyleUtils.getPlotAreaColor=function(a){var b=a.getOptions(),c=DvtGaugeDataUtils.getValueThresholdIndex(a),d=DvtGaugeDataUtils.getThreshold(a,c);return!d||a instanceof dvt.StatusMeterGauge&&!(a instanceof dvt.StatusMeterGauge&&"onIndicator"!=b.thresholdDisplay)?b.plotArea.color:DvtGaugeStyleUtils.getThresholdColor(a,d,c)};
DvtGaugeStyleUtils.getPlotAreaBorderColor=function(a){var b=a.getOptions(),c=b.plotArea.borderColor;return a instanceof dvt.StatusMeterGauge&&"circular"!=b.orientation&&null==c?"skyros"==b.skin?"#C6C6C6":"#D6DFE6":c};DvtGaugeStyleUtils.getThresholdColor=function(a,b,c){if(b.color)return b.color;a=a.getOptions();return a._thresholdColors[c%a._thresholdColors.length]};
DvtGaugeStyleUtils.getDialBackground=function(a){return"rectangleAlta"===a?DvtGaugeStyleUtils._ALTA_RECTANGLE:"domeAlta"===a?DvtGaugeStyleUtils._ALTA_DOME:"circleAntique"===a?DvtGaugeStyleUtils._ANTIQUE_CIRCLE:"rectangleAntique"===a?DvtGaugeStyleUtils._ANTIQUE_RECTANGLE:"domeAntique"===a?DvtGaugeStyleUtils._ANTIQUE_DOME:"circleLight"===a?DvtGaugeStyleUtils._LIGHT_CIRCLE:"rectangleLight"===a?DvtGaugeStyleUtils._LIGHT_RECTANGLE:"domeLight"===a?DvtGaugeStyleUtils._LIGHT_DOME:"circleDark"===a?DvtGaugeStyleUtils._DARK_CIRCLE:
"rectangleDark"===a?DvtGaugeStyleUtils._DARK_RECTANGLE:"domeDark"===a?DvtGaugeStyleUtils._DARK_DOME:DvtGaugeStyleUtils._ALTA_CIRCLE};DvtGaugeStyleUtils.getDialIndicator=function(a){return"needleAntique"===a?DvtGaugeStyleUtils._ANTIQUE_INDICATOR:"needleLight"===a?DvtGaugeStyleUtils._LIGHT_INDICATOR:"needleDark"===a?DvtGaugeStyleUtils._DARK_INDICATOR:DvtGaugeStyleUtils._ALTA_INDICATOR};DvtGaugeStyleUtils.hasLabel=function(a){return!!a.label.text};
var DvtGaugeRenderer={};dvt.Obj.createSubclass(DvtGaugeRenderer,dvt.Obj);
DvtGaugeRenderer.renderEmptyText=function(a,b,c){var d=a.getOptions(),e=d.emptyText;e||(e=dvt.Bundle.getTranslation(d,"labelNoData",dvt.Bundle.UTIL_PREFIX,"NO_DATA",null));DvtGaugeDataUtils.hasValidData(a)||(e=dvt.Bundle.getTranslation(d,"labelInvalidData",dvt.Bundle.UTIL_PREFIX,"INVALID_DATA",null));d=d._statusMessageStyle;d.getStyle("font-size")||d.setStyle("font-size","13px");if(a instanceof dvt.StatusMeterGauge){var f=d.getStyle("color");d.setStyle("color",f?f:"#333333")}dvt.TextUtils.renderEmptyText(b,
e,new dvt.Rectangle(c.x,c.y,c.w,c.h),a.getEventManager(),d)};DvtGaugeRenderer.getFormattedMetricLabel=function(a,b){var c=b.getOptions();return c.metricLabel.text?c.metricLabel.text:DvtGaugeRenderer._formatMetricLabelValue(a,b,c.metricLabel.converter,c.metricLabel.scaling,c.metricLabel.autoPrecision?c.metricLabel.autoPrecision:"on","percent"==c.metricLabel.textType)};
DvtGaugeRenderer.formatTickLabelValue=function(a,b){var c=b.getOptions(),d=null,e="percent"==c.tickLabel.textType;"on"==c.tickLabel.rendered&&c.tickLabel.converter&&(d=c.tickLabel.converter);var f=null;"on"==c.tickLabel.rendered&&c.tickLabel.scaling&&(f=c.tickLabel.scaling);return DvtGaugeRenderer._formatMetricLabelValue(a,b,d,f,c.tickLabel.autoPrecision?c.tickLabel.autoPrecision:"on",e)};
DvtGaugeRenderer._formatMetricLabelValue=function(a,b,c,d,e,f){var g=b.getOptions(),h=g.min,k=g.max,l=k-h,m=1E3>l?100:1E3,n=null;isNaN(l)||(n=l/m);f&&(a=DvtGaugeRenderer.getFillPercentage(g,g.min,g.max,a,!0));b=new dvt.LinearScaleAxisValueFormatter(b.getCtx(),h,k,n,d,e);a=c&&c.getAsString?b.format(a,c):c&&c.format?b.format(a,c):f?Math.round(100*a):b.format(a);return f?String(a)+"%":a};
DvtGaugeRenderer.getFillPercentage=function(a,b,c,d,e){a=(d-b)/(a.max-a.min);return a=e?a:Math.min(Math.max(0,a),1)};DvtGaugeRenderer.getTooltipString=function(a){var b=a.getOptions(),c=DvtGaugeDataUtils.getValueThresholdIndex(a),c=DvtGaugeDataUtils.getThreshold(a,c);a=DvtGaugeRenderer.getFormattedMetricLabel(b.value,a);return c&&null!=c.shortDesc?c.shortDesc:null!=b.shortDesc?b.shortDesc:b.label.text?dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"COLON_SEP_LIST",[b.label.text,a]):a};
DvtGaugeRenderer.renderMetricLabel=function(a,b,c,d,e,f,g){var h=a.getOptions(),k=!1;if("on"==h.metricLabel.rendered||g&&"off"!=h.metricLabel.rendered){g=DvtGaugeRenderer.getFormattedMetricLabel(h.value,a);var k=DvtGaugeRenderer.getFormattedMetricLabel(h.min,a),l=DvtGaugeRenderer.getFormattedMetricLabel(h.max,a);a=new dvt.OutputText(a.getCtx(),g,c.x+c.w/2,c.y+c.h/2);a.setCSSStyle(h.metricLabel.style);h=(h=h.metricLabel.style.getStyle("font-size"))?parseInt(h):null;h||(h=DvtGaugeRenderer.calcLabelFontSize([g,
k,l],a,c),a.setTextString(g),a.setFontSize(h));"top"==f?(a.setY(c.y),a.alignTop()):"middle"==f?dvt.TextUtils.centerTextVertically(a,c.y+c.h/2):"bottom"==f&&(a.setY(c.y+c.h),a.alignBottom());"center"==e?a.alignCenter():"left"==e?(a.setX(c.x),a.alignLeft()):"right"==e&&(a.setX(c.x+c.w),a.alignRight());null!=d&&a.setSolidFill(d);k=dvt.TextUtils.fitText(a,c.w,c.h,b)}return k};
DvtGaugeRenderer.renderLabel=function(a,b,c,d,e){var f=a.getOptions(),g=!1;if(DvtGaugeStyleUtils.hasLabel(f)){var g=f.label.text,h=f.label.style,f=new dvt.MultilineText(a.getCtx(),g),k=h.clone();f.setCSSStyle(h);var l=h.getStyle("font-size"),l=l?parseInt(l):null;l||(g=new dvt.OutputText(a.getCtx(),g,0,0),g.setCSSStyle(h),l=g.getOptimalFontSize(c),k.setFontSize("font-size",l.toString()));null!=d&&k.setStyle("color",d);f.setCSSStyle(k);g=dvt.TextUtils.fitText(f,c.w,c.h,a);a=dvt.TextUtils.getTextHeight(f);
"top"==e?f.setY(c.y):"bottom"==e?f.setY(c.y+c.h-a):f.setY(c.y+c.h/2-a/2);f.setX(c.x+c.w/2);f.alignCenter();b.addChild(f)}return g};DvtGaugeRenderer.calcLabelFontSize=function(a,b,c){for(var d=0,e=null,f=0,g=0;g<a.length;g++)b.setTextString(a[g]),f=b.measureDimensions().w,f>d&&(e=a[g],d=f);b.setTextString(e);return b.getOptimalFontSize(c)};DvtGaugeRenderer.adjustForStep=function(a,b){var c=Number(a.step);if(c&&0<c){var d=b/c;return.5>d?a.min:Math.max(Math.min(a.max,Math.ceil(d)*c),a.min)}return b};
dvt.LedGauge=function(){};dvt.Obj.createSubclass(dvt.LedGauge,DvtGauge);dvt.LedGauge.newInstance=function(a,b,c,d){var e=new dvt.LedGauge;e.Init(a,b,c,d);return e};dvt.LedGauge.prototype.Init=function(a,b,c,d){dvt.LedGauge.superclass.Init.call(this,a,b,c,d);this.Defaults=new DvtLedGaugeDefaults};
dvt.LedGauge.prototype.SetOptions=function(a){a.title&&(a.label=a.title);dvt.LedGauge.superclass.SetOptions.call(this,this.Defaults.calcOptions(a));"auto"==this.Options.animationOnDisplay&&(this.Options.animationOnDisplay="zoom");"auto"==this.Options.animationOnDataChange&&(this.Options.animationOnDataChange="alphaFade");this.Options.readOnly=!0};dvt.LedGauge.prototype.Render=function(a,b,c){DvtLedGaugeRenderer.render(this,a,b,c)};
var DvtLedGaugeDefaults=function(){this.Init({skyros:DvtLedGaugeDefaults.VERSION_1,alta:{}})};dvt.Obj.createSubclass(DvtLedGaugeDefaults,DvtGaugeDefaults);DvtLedGaugeDefaults.VERSION_1={type:"circle"};
var DvtLedGaugeRenderer={};dvt.Obj.createSubclass(DvtLedGaugeRenderer,dvt.Obj);DvtLedGaugeRenderer._SKYROS_SHAPE_TRIANGLE_CMDS="M-42,36.6Q-50,36.6,-46.54,28.6L-4,-43.07Q0,-50,4,-43.07L46.54,28.6Q50,36.6,42,36.6Z";DvtLedGaugeRenderer._SHAPE_TRIANGLE_CMDS=[-50,36.6,0,-50,50,36.6];DvtLedGaugeRenderer._SKYROS_SHAPE_TRIANGLE_INNER_CMDS=[-50,36.6,0,-50,50,36.6];
DvtLedGaugeRenderer._SKYROS_SHAPE_STAR_CMDS=[-13.05,-12.94,-50,-11.13,-21.06,11.9,-30.74,47.6,.1,27.18,31.06,47.44,21.17,11.79,50,-11.39,13.05,-13.01,-.06,-47.59];DvtLedGaugeRenderer._SHAPE_STAR_CMDS=[-50,-11.22,-16.69,-17.94,0,-47.55,16.69,-17.94,50,-11.22,26.69,13.8,30.9,47.56,0,33.42,-30.9,47.56,-26.69,13.8];DvtLedGaugeRenderer._SKYROS_SHAPE_ARROW_CMDS="M0,45L21,45Q24.414,44.414,25,41L25,10L42,10Q48.5,9.1,45,4L2,-38Q0,-39,-2,-38L-45,4Q-48.5,9.1,-42,10L-25,10L-25,41Q-24.414,44.414,-21,45Z";
DvtLedGaugeRenderer._SHAPE_ARROW_CMDS=[25,48,25,8,47.5,8,0,-39,-47.5,8,-25,8,-25,48];DvtLedGaugeRenderer._SKYROS_SHAPE_ARROW_INNER_CMDS=[25,48,25,8,47.5,8,0,-39,-47.5,8,-25,8,-25,48];DvtLedGaugeRenderer._SHAPE_HUMAN_CMDS="M -0.06059525142297417 -50.86842065108466 C -11.4496388584463 -50.86842065108466 -20.708163169810554 -39.024253028220556 -20.708163169810554 -24.413724255650386 C -20.708163169810554 -9.803195483080515 -11.4496388584463 2.040972139783591 -0.06059525142297417 2.040972139783591 C 11.328499974520241 2.040972139783591 20.586972666964613 -9.803195483080515 20.586972666964613 -24.413724255650386 C 20.586972666964613 -39.024253028220556 11.328499974520241 -50.86842065108466 -0.06059525142297417 -50.86842065108466 z M -23.93434565705865 -2.959610715450779 C -30.908061721494278 3.3998402034127153 -42.00096758564793 18.817121073473572 -38.77478509839983 33.65756051481475 C -20.651382358034887 47.30044101688934 14.372054723529814 49.13162219665128 39.298831093003386 32.85101489300273 C 40.26410489318826 16.477493533721187 32.34060070450674 4.7883891459240715 23.167918656763206 -2.959610715450779 C 11.553661702670112 21.074158341552575 -11.029615708066558 16.237465556670102 -23.93434565705865 -2.959610715450779 z ";
DvtLedGaugeRenderer.render=function(a,b,c,d){if(DvtGaugeDataUtils.hasData(a)){var e=a.getOptions(),f=e.__layout.outerGap,g=e&&(0<=e.size||1>e.size)?Math.sqrt(e.size):1;d=new dvt.Rectangle(f+(c-2*f)*(1-g)/2,f+(d-2*f)*(1-g)/2,(c-2*f)*g,(d-2*f)*g);DvtLedGaugeRenderer._renderShape(a,b,d);DvtLedGaugeRenderer._renderVisualEffects(a,b,d);f=!1;c=dvt.ColorUtils.getContrastingTextColor(DvtGaugeStyleUtils.getColor(a));DvtGaugeStyleUtils.hasLabel(e)&&(f="middle",g=DvtLedGaugeRenderer._getMetricLabelBounds(a,
b,d),"on"==e.metricLabel.rendered&&(g.y+=.6*g.h,g.h*=.4,f="top"),f=dvt.Agent.isHighContrast()||null==e.label.style.getStyle("color")?DvtGaugeRenderer.renderLabel(a,b,g,c,f):DvtGaugeRenderer.renderLabel(a,b,g,null,f));"on"==e.metricLabel.rendered&&(d=DvtLedGaugeRenderer._getMetricLabelBounds(a,b,d),g="middle",f&&(d.h*=.55,g="bottom"),dvt.Agent.isHighContrast()||null==e.metricLabel.style.getStyle("color")?DvtGaugeRenderer.renderMetricLabel(a,b,d,c,"center",g):DvtGaugeRenderer.renderMetricLabel(a,b,
d,null,"center",g))}else DvtGaugeRenderer.renderEmptyText(a,b,new dvt.Rectangle(0,0,c,d))};
DvtLedGaugeRenderer._renderShape=function(a,b,c){var d=a.getCtx(),e=a.getOptions(),f=e.type,g=DvtGaugeStyleUtils.getColor(a),h=DvtGaugeStyleUtils.getBorderColor(a),k=c.x+c.w/2,l=c.y+c.h/2,m=Math.min(c.w,c.h)/2,n=DvtGaugeDefaults.isSkyrosSkin(a);DvtLedGaugeRenderer._cache||(DvtLedGaugeRenderer._cache=new dvt.Cache(50));var p=Math.min(c.w/100,c.h/100);"square"==f?k=new dvt.Rect(d,k-m,l-m,2*m,2*m):"rectangle"==f?k=new dvt.Rect(d,c.x,c.y,c.w,c.h):"diamond"==f?k=new dvt.Polygon(d,[k-m,l,k,l-m,k+m,l,k,
l+m]):"circle"==f?k=new dvt.Circle(d,k,l,m):("star"==f?k=n?DvtLedGaugeRenderer._SKYROS_SHAPE_STAR_CMDS:DvtLedGaugeRenderer._SHAPE_STAR_CMDS:"triangle"==f?k=n?DvtLedGaugeRenderer._SKYROS_SHAPE_TRIANGLE_CMDS:DvtLedGaugeRenderer._SHAPE_TRIANGLE_CMDS:"arrow"==f?k=n?DvtLedGaugeRenderer._SKYROS_SHAPE_ARROW_CMDS:DvtLedGaugeRenderer._SHAPE_ARROW_CMDS:"human"==f?k=DvtLedGaugeRenderer._SHAPE_HUMAN_CMDS:(k=DvtLedGaugeRenderer._cache.get(f),k||(k=new dvt.Path(d,f),k=dvt.DisplayableUtils.getDimForced(d,k),l=100/
Math.max(k.w,k.h),k=dvt.PathUtils.transformPath(f,-l*(k.x+k.w/2),-l*(k.y+k.h/2),l,l),DvtLedGaugeRenderer._cache.put(f,k))),(n||"triangle"!=f&&"arrow"!=f)&&"star"!=f?(k=dvt.PathUtils.transformPath(k,c.x+c.w/2,c.y+c.h/2,p,p),k=new dvt.Path(d,k)):(k=dvt.PolygonUtils.scale(k,p,p),k=dvt.PolygonUtils.translate(k,c.x+c.w/2,c.y+c.h/2),k=new dvt.Polygon(d,k)));n||"none"==e.visualEffects?k.setSolidFill(g):(d=[dvt.ColorUtils.adjustHSL(g,0,-.09,.04),dvt.ColorUtils.adjustHSL(g,0,-.04,-.05)],g=e&&0==e.rotation%
90?e.rotation:0,k.setFill(new dvt.LinearGradientFill("arrow"==f||"star"==f||"triangle"==f?g-90:270,d,[1,1],[0,1])));h&&k.setSolidStroke(h);k.setClassName(e.svgClassName);k.setStyle(e.svgStyle);(g=n?e.rotation+90:e.rotation)&&("arrow"==f||"triangle"==f||k instanceof dvt.Path&&"human"!=f)&&(k=DvtLedGaugeRenderer._rotate(a,b,k,c));b.addChild(k)};
DvtLedGaugeRenderer._rotate=function(a,b,c,d){var e=a.getOptions();a=new dvt.Container(a.getCtx());b.addChild(a);a.addChild(c);b=e&&0==e.rotation%90?e.rotation:0;e=new dvt.Matrix;e.rotate(Math.PI*b/180);c.setMatrix(e);b=a.getDimensions();c=d.x+d.w/2-(b.x+b.w/2);d=d.y+d.h/2-(b.y+b.h/2);b=new dvt.Matrix;b.translate(c,d);a.setMatrix(b);return a};
DvtLedGaugeRenderer._renderVisualEffects=function(a,b,c){var d=a.getOptions(),e=d.type;"none"!=d.visualEffects&&DvtGaugeDefaults.isSkyrosSkin(a)&&("circle"==e?DvtLedGaugeRenderer._renderOverlayCircle(a,b,c):"diamond"==e?DvtLedGaugeRenderer._renderOverlayDiamond(a,b,c):"triangle"==e?DvtLedGaugeRenderer._renderOverlayTriangle(a,b,c):"arrow"==e?DvtLedGaugeRenderer._renderOverlayArrow(a,b,c):DvtLedGaugeRenderer._renderOverlayRectangle(a,b,c))};
DvtLedGaugeRenderer._renderOverlayRectangle=function(a,b,c){var d=.04*c.w,e=.04*c.h;c=new dvt.Rectangle(c.x+d,c.y+e,c.w-2*d,c.h-2*e);a=new dvt.Rect(a.getCtx(),c.x,c.y,c.w,c.h);a.setMouseEnabled(!1);b.addChild(a);b=new dvt.LinearGradientFill(270,"#FFFFFF #FFFFFF #FFFFFF #FFFFFF #FFFFFF #FFFFFF #FFFFFF".split(" "),[.75,.5,.15,0,.2,.4,.2],[0,.05,.4,.6,.8,.9,1]);a.setFill(b)};
DvtLedGaugeRenderer._renderOverlayDiamond=function(a,b,c){var d=.05*c.w,e=.05*c.h,e=new dvt.Rectangle(c.x+d,c.y+e,c.w-2*d,c.h-2*e);c=e.x+e.w/2;d=e.y+e.h/2;e=Math.min(e.w,e.h)/2;a=new dvt.Polygon(a.getCtx(),[c-e,d,c,d-e,c+e,d,c,d+e]);a.setMouseEnabled(!1);b.addChild(a);b=new dvt.LinearGradientFill(270,"#FFFFFF #FFFFFF #FFFFFF #FFFFFF #FFFFFF #FFFFFF #FFFFFF".split(" "),[.75,.5,.15,0,.2,.4,.2],[0,.05,.4,.6,.8,.9,1]);a.setFill(b)};
DvtLedGaugeRenderer._renderOverlayTriangle=function(a,b,c){var d=.05*c.w,e=.05*c.h,f=DvtGaugeDefaults.isSkyrosSkin(a),d=new dvt.Rectangle(c.x+d,c.y+e,c.w-2*d,c.h-2*e),e=DvtLedGaugeRenderer._SKYROS_SHAPE_TRIANGLE_INNER_CMDS,g=Math.min(d.w/100,d.h/100),e=dvt.PolygonUtils.scale(e,g,g),e=dvt.PolygonUtils.translate(e,c.x+c.w/2,c.y+c.h/2);c=new dvt.Polygon(a.getCtx(),e);e=(e=a.getOptions())&&0==e.rotation%90?e.rotation:0;f=new dvt.LinearGradientFill(f?e-90:360-e,["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF",
"#FFFFFF"],[.3,.55,0,.25,.1],[0,.05,.4,.9,1]);c.setFill(f);c=DvtLedGaugeRenderer._rotate(a,b,c,d);c.setMouseEnabled(!1);b.addChild(c)};
DvtLedGaugeRenderer._renderOverlayArrow=function(a,b,c){var d=.05*c.w,e=.05*c.h,f=DvtGaugeDefaults.isSkyrosSkin(a),d=new dvt.Rectangle(c.x+d,c.y+e,c.w-2*d,c.h-2*e),e=DvtLedGaugeRenderer._SKYROS_SHAPE_ARROW_INNER_CMDS,g=Math.min(d.w/100,d.h/100),e=dvt.PolygonUtils.scale(e,g,g),e=dvt.PolygonUtils.translate(e,c.x+c.w/2,c.y+c.h/2);c=new dvt.Polygon(a.getCtx(),e);e=(e=a.getOptions())&&0==e.rotation%90?e.rotation:0;f=new dvt.LinearGradientFill(f?e-90:360-e,["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"],
[.3,.55,0,.25,.1],[0,.05,.4,.9,1]);c.setFill(f);c=DvtLedGaugeRenderer._rotate(a,b,c,d);c.setMouseEnabled(!1);b.addChild(c)};
DvtLedGaugeRenderer._renderOverlayCircle=function(a,b,c){var d=.05*c.w,e=.05*c.h;c=new dvt.Rectangle(c.x+d,c.y+e,c.w-2*d,c.h-2*e);var d=c.x+c.w/2,e=c.y+c.h/2,f=Math.min(c.w,c.h)/2,g=new dvt.Circle(a.getCtx(),d,e,f);g.setMouseEnabled(!1);b.addChild(g);var h=new dvt.RadialGradientFill(["#FFFFFF","#FFFFFF","#FFFFFF"],[0,.25,.5],[.15,.7,.95],d,e-.6*f,1.5*f,[c.x,c.y,c.w,c.h]);g.setFill(h);g=.6*f;f*=.4;e-=.3*f;a=new dvt.Oval(a.getCtx(),d,e-f,g,f);a.setMouseEnabled(!1);b.addChild(a);b=new dvt.RadialGradientFill(["#FFFFFF",
"#FFFFFF","#FFFFFF"],[0,.2,.5],[.6,.8,1],d,e,g,[c.x,c.y,c.w,c.h]);a.setFill(b)};
DvtLedGaugeRenderer._getMetricLabelBounds=function(a,b,c){b=a.getOptions();a=b.type;b=0==b.rotation%90?b.rotation:0;var d=Math.min(c.w,c.h),e=c.x+c.w/2-d/2;c=c.y+c.h/2-d/2;var f=d,g=d;"triangle"==a?0==b?(e+=.2*d,c+=.25*d,f-=.4*d,g-=.3*d):90==b?(e+=.05*d,c+=.2*d,f-=.3*d,g-=.4*d):180==b?(e+=.2*d,c+=.05*d,f-=.4*d,g-=.3*d):270==b&&(e+=.25*d,c+=.2*d,f-=.3*d,g-=.4*d):"arrow"==a?0==b?(e+=.2*d,c+=.2*d,f-=.4*d,g-=.4*d):90==b?(e+=.05*d,c+=.2*d,f-=.28*d,g-=.4*d):180==b?(e+=.2*d,c+=.2*d,f-=.4*d,g-=.4*d):270==
b&&(e+=.23*d,c+=.2*d,f-=.28*d,g-=.4*d):"star"==a?(e+=.25*d,c+=.25*d,f-=.5*d,g-=.4*d):"diamond"==a?(e+=.15*d,c+=.15*d,f-=.3*d,g-=.3*d):"rectangle"==a?(e+=.1*d,c+=.1*d,f-=.2*d,g-=.2*d):(e+=.15*d,c+=.15*d,f-=.3*d,g-=.3*d);return new dvt.Rectangle(e,c,f,g)};
dvt.StatusMeterGauge=function(){};dvt.Obj.createSubclass(dvt.StatusMeterGauge,DvtGauge);dvt.StatusMeterGauge.newInstance=function(a,b,c){var d=new dvt.StatusMeterGauge;d.Init(a,b,c);return d};dvt.StatusMeterGauge.prototype.Init=function(a,b,c){dvt.StatusMeterGauge.superclass.Init.call(this,a,b,c);this.Defaults=new DvtStatusMeterGaugeDefaults;this.__axisInfo=null};
dvt.StatusMeterGauge.prototype.SetOptions=function(a){a.title&&(a.label=a.title);a.plotArea&&(a.plotArea.className&&(a.plotArea.svgClassName=a.plotArea.className),a.plotArea.style&&(a.plotArea.svgStyle=a.plotArea.style));dvt.StatusMeterGauge.superclass.SetOptions.call(this,this.Defaults.calcOptions(a))};dvt.StatusMeterGauge.prototype.Render=function(a,b,c){DvtStatusMeterGaugeRenderer.render(this,a,b,c)};
dvt.StatusMeterGauge.prototype.CreateAnimationOnDisplay=function(a,b,c){b=[];for(var d=0;d<a.length;d++){var e=a[d],f=e.getAnimationParams();"horizontal"==this.Options.orientation?e.setAnimationParams([f[0],f[0],f[2],f[3]]):"vertical"==this.Options.orientation?e.setAnimationParams([f[0],f[1],f[3],f[3]]):"circular"==this.Options.orientation&&e.setAnimationParams([f[0],f[1],0,f[3],f[4]]);var g=new dvt.CustomAnimation(this.getCtx(),e,c);g.getAnimator().addProp(dvt.Animator.TYPE_NUMBER_ARRAY,e,e.getAnimationParams,
e.setAnimationParams,f);g.getAnimator().setEasing(function(a){return dvt.Easing.backOut(a,.7)});b.push(g)}return new dvt.ParallelPlayable(this.getCtx(),b)};
dvt.StatusMeterGauge.prototype.GetValueAt=function(a,b){var c=this.Options,d=dvt.Agent.isRightToLeft(this.getCtx());if("horizontal"==c.orientation)return this.__axisInfo.getBoundedValueAt(a);if("vertical"==c.orientation)return this.__axisInfo.getBoundedValueAt(b);if("circular"==c.orientation){var e=c.angleExtent,f=Math.atan2(b-this.cy,a-this.cx),d=d?180-(dvt.Math.radsToDegrees(f)-c.startAngle):dvt.Math.radsToDegrees(f)-(360-c.startAngle),d=(d+720)%360,f=c.min,c=c.max,f=d/e*(c-f)+f;d>e&&(f=.5<(d-e)/
(360-e)?0:c);return f}};
var DvtStatusMeterGaugeDefaults=function(){this.Init({skyros:DvtStatusMeterGaugeDefaults.VERSION_1,alta:DvtStatusMeterGaugeDefaults.SKIN_ALTA})};dvt.Obj.createSubclass(DvtStatusMeterGaugeDefaults,DvtGaugeDefaults);DvtStatusMeterGaugeDefaults.SKIN_ALTA={color:"#393737",metricLabel:{style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_ALTA)},plotArea:{color:"#E4E8EA"}};
DvtStatusMeterGaugeDefaults.VERSION_1={angleExtent:360,borderRadius:"auto",color:"#313842",indicatorSize:1,innerRadius:.7,metricLabel:{style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_SKYROS),position:"auto"},orientation:"horizontal",plotArea:{color:"#AAAAAA",rendered:"auto",borderRadius:"auto"},startAngle:90,thresholdDisplay:"onIndicator"};
var DvtStatusMeterGaugeRenderer={};dvt.Obj.createSubclass(DvtStatusMeterGaugeRenderer,dvt.Obj);
DvtStatusMeterGaugeRenderer.render=function(a,b,c,d){if(DvtGaugeDataUtils.hasData(a)){var e=a.getOptions(),f=e.__layout.outerGap;c=new dvt.Rectangle(f,f,c-2*f,d-2*f);"horizontal"==e.orientation||"vertical"==e.orientation?(DvtStatusMeterGaugeRenderer._hasMetricLabelOutsidePlotArea(e)&&DvtStatusMeterGaugeRenderer._renderMetricLabelOutsidePlotArea(a,b,c),DvtStatusMeterGaugeRenderer._renderShape(a,b,c)):"circular"==e.orientation&&DvtStatusMeterGaugeRenderer._renderCircularGauge(a,b,c)}else DvtGaugeRenderer.renderEmptyText(a,
b,new dvt.Rectangle(0,0,c,d))};
DvtStatusMeterGaugeRenderer._renderCircularGauge=function(a,b,c){var d=a.getOptions(),e=c.clone(),f=dvt.Agent.isRightToLeft(a.getCtx()),g=0,h=null,k=d.value,l=d.innerRadius,m=d.thresholds,n,p=null,q=dvt.Math.TWO_PI-dvt.Math.degreesToRads(d.startAngle),r=dvt.Math.degreesToRads(d.angleExtent),t=(q+r)%(2*Math.PI);a.cx=c.w/2;a.cy=c.h/2;r!=2*Math.PI&&(h=DvtStatusMeterGaugeRenderer._adjustCenterAndBounds(a,l,q,r,t,c,f),p=a.maxInnerDiameter);n=n?n:Math.min(c.w,c.h);var f=.5*n*l,t=.5*n,u=d.indicatorSize;
if(u&&1<u)var w=(1-1/u)/2*(t-f),f=f+w,t=t-w;w="middle";h||(p=Math.min(c.w,c.h)*l,h=new dvt.Rectangle(c.x+c.w/2-3/7*p,c.y+c.h/2-2.5/7*p,6/7*p,5/7*p));var v=!1;if(DvtGaugeStyleUtils.hasLabel(d)){var v="middle",x=new dvt.Rectangle(h.x,h.y,h.w,h.h);"off"!=d.metricLabel.rendered&&(x.y+=.6*x.h,x.h*=.4,v="top");(v=DvtGaugeRenderer.renderLabel(a,b,x,null,v))&&"off"!=d.metricLabel.rendered&&(h.h*=.55,w="bottom")}DvtGaugeRenderer.renderMetricLabel(a,b,h,null,"center",w,!0);w=q;g*=r;h=DvtGaugeStyleUtils.getPlotAreaBorderColor(a);
if(m&&"off"!=d.plotArea.rendered&&"all"==d.thresholdDisplay)for(v=0;v<m.length;v++){var x=DvtGaugeStyleUtils.getThresholdColor(a,m[v],v),g=m[v].max<d.max?m[v].max:d.max,z=0==v?d.min:m[v-1].max,w=q+r*DvtGaugeRenderer.getFillPercentage(d,d.min,g,z),g=DvtGaugeRenderer.getFillPercentage(d,z,g,g),g=g*r,z=m[v].borderColor;DvtStatusMeterGaugeRenderer._drawCircularArc(a,b,c,w,g,f,t,x,!0,z?z:h)}else"off"!=d.plotArea.rendered&&"all"!=d.thresholdDisplay&&(m=DvtGaugeStyleUtils.getPlotAreaColor(a),DvtStatusMeterGaugeRenderer._drawCircularArc(a,
b,c,q,r,f,t,m,!0,h));f=n*l*.5;t=.5*n;u&&1>u&&(l=(1-u)/2*(t-f),f+=l,t-=l);g=DvtGaugeRenderer.getFillPercentage(d,d.min,d.max,k);DvtStatusMeterGaugeRenderer._drawCircularArc(a,b,c,q,g*r,f,t,DvtGaugeStyleUtils.getColor(a),!1);if(l=d.referenceLines)for(n=0;n<l.length;n++)m=l[n].color?l[n].color:"black",f=l[n].lineWidth?l[n].lineWidth:2,t=l[n].lineStyle,k=l[n].value,k=q+DvtGaugeRenderer.getFillPercentage(d,d.min,d.max,k)*r,DvtStatusMeterGaugeRenderer._drawCircularReferenceLine(a,b,c,k,m,f,t);d.center.renderer&&
DvtStatusMeterGaugeRenderer._renderCenterContent(a,d,c,e,p)};
DvtStatusMeterGaugeRenderer._renderShape=function(a,b,c){var d=a.getOptions(),e=dvt.Agent.isRightToLeft(a.getCtx()),f="vertical"==d.orientation,g={layout:{}};g.layout.gapRatio=0;g.timeAxisType="disabled";g.position=f?"left":"bottom";g.min=d.min;g.max=d.max;g.dataMin=d.min;g.dataMax=d.max;g.tickLabel={rendered:"off"};g=dvt.AxisInfo.newInstance(a.getCtx(),g,c);a.__axisInfo=g;var h=0;0>=d.max?h=d.max:0<=d.min&&(h=d.min);var k=g.getCoordAt(h);"off"==d.plotArea.rendered||"auto"==d.plotArea.rendered&&"onIndicator"==
d.thresholdDisplay||(k=g.getUnboundedCoordAt(d.min));var l=g.getUnboundedCoordAt(d.value),l=f?Math.max(c.y,Math.min(c.y+c.h,l)):Math.max(c.x,Math.min(c.x+c.w,l)),m=d.indicatorSize,n,p,q,r,t,u,w=0,w=1>m?1:m;q=1<m?1:m;f?(h=c.x+(1-q)/2*c.w+.5,n=c.x+c.w*(1+q)/2-.5,q=k-.5,p=l+.5,r=c.x+(1-1/w)/2*c.w,t=c.x+c.w*(1+1/w)/2,u=c.y,w=c.y+c.h):(h=e?k-.5:k+.5,n=e?l+.5:l-.5,p=c.y+(1-q)/2*c.h+.5,q=c.y+c.h*(1+q)/2-.5,r=c.x,t=c.x+c.w,u=c.y+(1-1/w)/2*c.h,w=c.y+c.h*(1+1/w)/2);var v=!0;l==k&&(f?p=q:h=n,v=!1);var l=DvtGaugeStyleUtils.getBorderColor(a),
x=DvtGaugeStyleUtils.getPlotAreaBorderColor(a),z=d.thresholds,m=f?0:270;if(z&&"off"!=d.plotArea.rendered&&"all"==d.thresholdDisplay)for(k=z.length-1;0<=k;k--){var y=k,A=DvtStatusMeterGaugeRenderer._createShape(a,a.getCtx(),r,t,u,w),B=new dvt.ClipPath("pacp"+a.getId());if(k==z.length-1)!f&&e?B.addRect(g.getUnboundedCoordAt(d.max)+1,0,c.w+2,c.h+2,0,0):B.addRect(0,0,c.w+2,c.h+2,0,0);else if(f)B.addRect(0,g.getUnboundedCoordAt(d.max),c.w+2,1*(d.max-z[z.length-2-y].max)/Math.abs(d.min-d.max)*c.h,0,0);
else if(e){var C=null==z[z.length-2-y].max?100:z[z.length-2-y].max;B.addRect(g.getUnboundedCoordAt(d.max),0,1*(d.max-C)/Math.abs(d.min-d.max)*c.w,c.h+2,0,0)}else B.addRect(0,0,1*(z[y].max-d.min)/Math.abs(d.min-d.max)*c.w,c.h+2,0,0);A.setClipPath(B);if(e||f)y=z.length-1-k;A.setSolidFill(DvtGaugeStyleUtils.getThresholdColor(a,z[y],y));B=z[y].borderColor;A.setSolidStroke(B?B:x);DvtStatusMeterGaugeRenderer._renderPlotAreaVisualEffects(a,b,A,DvtGaugeStyleUtils.getThresholdColor(a,z[y],y),m)}else"off"==
d.plotArea.rendered||"auto"==d.plotArea.rendered&&"onIndicator"==d.thresholdDisplay||"all"==d.thresholdDisplay||(A=f?DvtStatusMeterGaugeRenderer._createShape(a,a.getCtx(),r,t,g.getUnboundedCoordAt(d.max),g.getUnboundedCoordAt(d.min)):DvtStatusMeterGaugeRenderer._createShape(a,a.getCtx(),g.getUnboundedCoordAt(d.min),g.getUnboundedCoordAt(d.max),u,w),k=DvtGaugeStyleUtils.getPlotAreaColor(a),A.setSolidFill(k),A.setSolidStroke(x),DvtStatusMeterGaugeRenderer._renderPlotAreaVisualEffects(a,b,A,k,m));k=
new DvtStatusMeterGaugeIndicator(a,a.getCtx(),h,n,p,q);a.__shapes.push(k);e=DvtGaugeStyleUtils.getColor(a);DvtGaugeDefaults.isSkyrosSkin(a)||"none"==d.visualEffects?k.setSolidFill(e):(x=[dvt.ColorUtils.adjustHSL(e,0,-.09,.04),dvt.ColorUtils.adjustHSL(e,0,-.04,-.05)],x=new dvt.LinearGradientFill(m,x,[1,1],[0,1]),k.setFill(x));l&&k.setSolidStroke(l);k.setClassName(d.svgClassName);k.setStyle(d.svgStyle);v&&b.addChild(k);k=DvtStatusMeterGaugeRenderer._createShape(a,a.getCtx(),h,n,p,q);DvtStatusMeterGaugeRenderer._renderVisualEffects(a,
b,k,v,m);if(v=d.referenceLines)for(k=0;k<v.length;k++)l=v[k].color?v[k].color:"white",z=v[k].value,m=d.indicatorSize,f?(A=((1-m)/2+m)*c.w,x=c.x+(1-m)/4*c.w,m=g.getUnboundedCoordAt(z),m=new dvt.Line(a.getCtx(),x,m,x+A,m)):(A=((1-m)/2+m)*c.h,x=g.getUnboundedCoordAt(z),m=c.y+(1-m)/4*c.h,m=new dvt.Line(a.getCtx(),x,m,x,m+A)),l=new dvt.SolidStroke(l,1,v[k].lineWidth?v[k].lineWidth:2),v[k].lineStyle&&l.setStyle(dvt.Stroke.convertTypeString(v[k].lineStyle)),m.setStroke(l),b.addChild(m),dvt.Agent.isPlatformIE()||
"none"==d.visualEffects||(l=dvt.ColorUtils.makeRGBA(0,0,0,.8),l=new dvt.Shadow(l,.75,3,3,50,1,2,!1,!1,!1),m.addDrawEffect(l));f=d.metricLabel.position;"on"!=d.metricLabel.rendered||DvtStatusMeterGaugeRenderer._hasMetricLabelOutsidePlotArea(d)||DvtGaugeStyleUtils.hasLabel(d)?DvtGaugeStyleUtils.hasLabel(d)&&DvtStatusMeterGaugeRenderer._renderLabel(a,b,c,f):DvtStatusMeterGaugeRenderer._renderMetricLabelInsidePlotArea(a,b,c,e,f,{x1:h,x2:n,y1:p,y2:q},{x1:r,x2:t,y1:u,y2:w})};
DvtStatusMeterGaugeRenderer._createShape=function(a,b,c,d,e,f){var g=Math.min(c,d),h=Math.min(e,f);c=Math.abs(c-d);e=Math.abs(f-e);f=a.getOptions();d="vertical"==f.orientation?c:e;a=DvtGaugeDefaults.isSkyrosSkin(a)?"25%":"15%";g=dvt.PathUtils.rectangleWithBorderRadius(g,h,c,e,"auto"!=f.plotArea.borderRadius?f.plotArea.borderRadius:f.borderRadius,d,a);return new dvt.Path(b,g)};
DvtStatusMeterGaugeRenderer._renderVisualEffects=function(a,b,c,d,e){"none"!=a.getOptions().visualEffects&&DvtGaugeDefaults.isSkyrosSkin(a)&&(e=new dvt.LinearGradientFill(e,["#FFFFFF","#FFFFFF","#FFFFFF"],[.5,.3125,0],[0,.3,1]),c.setFill(e),a.__shapes.push(c),c.setMouseEnabled(!1),d&&b.addChild(c))};
DvtStatusMeterGaugeRenderer._renderPlotAreaVisualEffects=function(a,b,c,d,e){var f=a.getOptions();c.setMouseEnabled(!1);b.addChild(c);"none"!=f.visualEffects&&(DvtGaugeDefaults.isSkyrosSkin(a)?(a=[dvt.ColorUtils.getDarker(d,.1),d,dvt.ColorUtils.getBrighter(d,.7)],e=new dvt.LinearGradientFill(e,a,[1,1,1],[0,.04,.73])):(a=[dvt.ColorUtils.adjustHSL(d,0,-.04,-.05),dvt.ColorUtils.adjustHSL(d,0,-.09,.04)],e=new dvt.LinearGradientFill(e,a,[1,1],[0,1])),c.setFill(e),c.setClassName(f.plotArea.svgClassName),
c.setStyle(f.plotArea.svgStyle))};
DvtStatusMeterGaugeRenderer._renderMetricLabelOutsidePlotArea=function(a,b,c){var d=a.getOptions(),e=dvt.Agent.isRightToLeft(a.getCtx()),f="vertical"==d.orientation,g=new dvt.OutputText(a.getCtx(),""),h=DvtGaugeRenderer.getFormattedMetricLabel(d.value,a),k=d.__layout.labelGap,l=d.metricLabel.style,m=l.getStyle("color"),m=m?m:"#333333",n=null;g.setCSSStyle(l);g.setSolidFill(m);if(f&&"on"==d.metricLabel.rendered){var p=0<d.max?d.max:d.min,p=DvtGaugeRenderer.getFormattedMetricLabel(p,a),n=new dvt.OutputText(a.getCtx(),
p);n.setCSSStyle(l);d=new dvt.Rectangle(c.x,c.y+.8*c.h,c.w,.2*c.h);f=(f=l.getStyle("font-size"))?parseInt(f):n.getOptimalFontSize(d);n=n.measureDimensions();c.h-=n.h;p=n.w;g.setFontSize(f);g.setTextString(h);g.setX(c.x+c.w/2);g.setY(c.y+c.h);c.h-=k;g.alignCenter();dvt.TextUtils.fitText(g,c.w,c.h,b)}else if(!f&&"on"==d.metricLabel.rendered){f=l.getStyle("font-size");m=DvtGaugeRenderer.getFormattedMetricLabel(d.min,a);n=DvtGaugeRenderer.getFormattedMetricLabel(d.max,a);void 0===f&&18>c.h&&(f=DvtGaugeRenderer.calcLabelFontSize([h,
m,n],g,c));f=f?parseInt(f):13;g.setFontSize(f);var q;if(0<d.max||"off"!=d.plotArea.rendered||"auto"!=d.plotArea.rendered||"onIndicator"!=d.thresholdDisplay)p=0<d.max?d.max:d.min,p=DvtGaugeRenderer.getFormattedMetricLabel(p,a),n=new dvt.OutputText(a.getCtx(),p),n.setCSSStyle(l),n.setFontSize(f),n=n.measureDimensions(),n.w=Math.min(n.w,c.w),q=e?c.x+n.w:c.x+c.w,p=n.w,e&&(c.x+=n.w+k),c.w-=n.w+k;if(0>d.min&&"on"!=d.plotArea.rendered&&("auto"!=d.plotArea.rendered||"onIndicator"!=d.thresholdDisplay)){n=
DvtGaugeRenderer.getFormattedMetricLabel(d.min,a);m=new dvt.OutputText(a.getCtx(),n);m.setCSSStyle(l);m.setFontSize(f);l=m.measureDimensions();if(0>d.value||0>=d.max)q=e?c.x+c.w:c.x+l.w,p=l.w;e||(c.x+=l.w+k);c.w-=l.w+k}g.setTextString(h);g.setX(q);dvt.TextUtils.centerTextVertically(g,c.y+c.h/2);g.alignRight();dvt.TextUtils.fitText(g,p,c.h,b)}};
DvtStatusMeterGaugeRenderer._renderMetricLabelInsidePlotArea=function(a,b,c,d,e,f,g,h){var k=a.getOptions(),l=dvt.Agent.isRightToLeft(a.getCtx()),m="vertical"==k.orientation,n="on"==k.plotArea.rendered,p="center",q="middle",r=new dvt.Rectangle(Math.min(f.x1,f.x2),Math.min(f.y1,f.y2),Math.abs(f.x2-f.x1),Math.abs(f.y2-f.y1)),k=k.metricLabel.style.getStyle("color");"center"==e?(k=k?k:dvt.ColorUtils.getContrastingTextColor(d),m?(r.h-=r.w,r.y+=r.w/2):(r.w-=r.h,r.x+=r.h/2)):"insideIndicatorEdge"==e?(k=
k?k:dvt.ColorUtils.getContrastingTextColor(d),m?(r.h-=r.w,r.y+=r.w/2,q=!n&&f.y1>f.y2?"bottom":"top"):(r.w-=r.h,r.x+=r.h/2,p=l?!n&&f.x1<f.x2?"right":"left":!n&&f.x1>f.x2?"left":"right")):"outsideIndicatorEdge"==e&&(m?(r.h=Math.abs(g.y1-f.y1)-r.w,r.y=g.y1+r.w/2,q="bottom",!n&&f.y1>f.y2&&(r.h=Math.abs(g.y1-f.y1)-r.w,r.y=f.y1+r.w/2,q="top")):l?!n&&f.x1<f.x2?(r.w=Math.abs(g.x2-f.x2)-r.h,r.x=f.x2+r.h/2,p="left"):(r.w=Math.abs(g.x1-f.x2)-r.h,r.x=g.x1+r.h/2,p="right"):!n&&f.x1>f.x2?(r.w=Math.abs(g.x1-f.x2)-
r.h,r.x=g.x1+r.h/2,p="right"):(r.w=Math.abs(g.x2-f.x2)-r.h,r.x=f.x2+r.h/2,p="left"));DvtGaugeRenderer.renderMetricLabel(a,b,r,k,p,q)||h||("outsideIndicatorEdge"==e?DvtStatusMeterGaugeRenderer._renderMetricLabelInsidePlotArea(a,b,c,d,"insideIndicatorEdge",f,g,!0):"insideIndicatorEdge"!=e&&"center"!=e||DvtStatusMeterGaugeRenderer._renderMetricLabelInsidePlotArea(a,b,c,d,"outsideIndicatorEdge",f,g,!0))};
DvtStatusMeterGaugeRenderer._renderLabel=function(a,b,c,d){d=dvt.Agent.isRightToLeft(a.getCtx());var e=a.getOptions(),f="vertical"==e.orientation,g=new dvt.Rectangle(c.x,c.y,f?c.w:c.w-c.h,f?c.h-c.w:c.h),h=e.label.text;if(!DvtStatusMeterGaugeRenderer._hasMetricLabelOutsidePlotArea(e)&&"on"==e.metricLabel.rendered)var k=DvtGaugeRenderer.getFormattedMetricLabel(e.value,a),h=dvt.Bundle.getTranslatedString(dvt.Bundle.UTIL_PREFIX,"COLON_SEP_LIST",[h,k]);var l=e.label.style,k=l.clone(),m=l.getStyle("font-size");
m||(m=new dvt.OutputText(a.getCtx(),h,0,0),m.setCSSStyle(l),m.setTextString(h),m=f?m.getOptimalFontSize(new dvt.Rectangle(g.x,g.y,g.w,Number.MAX_VALUE)):m.getOptimalFontSize(new dvt.Rectangle(g.x,g.y,Number.MAX_VALUE,g.h)));h=new dvt.MultilineText(a.getCtx(),h);k.setFontSize("font-size",m.toString());h.setCSSStyle(k);dvt.TextUtils.fitText(h,g.w,g.h,a);"center"==e.label.position||"auto"==e.label.position&&f?(dvt.TextUtils.centerTextVertically(h,c.y+c.h/2),h.setX(c.x+c.w/2),h.alignCenter()):(dvt.TextUtils.centerTextVertically(h,
c.y+c.h/2),!f&&d)?(h.setX(c.x+c.w-g.h/2),h.alignRight()):f||d?f&&(h.setY(c.y+c.h-h.getDimensions().h-g.w/2),h.setX(c.x+c.w/2),h.alignCenter()):(h.setX(c.x+g.h/2),h.alignLeft());b.addChild(h)};DvtStatusMeterGaugeRenderer._calcPointOnArc=function(a,b,c){return{x:Math.cos(c)*b+a.w/2+a.x,y:Math.sin(c)*b+a.h/2+a.y}};
DvtStatusMeterGaugeRenderer._drawCircularArc=function(a,b,c,d,e,f,g,h,k,l){var m=a.getCtx();dvt.Agent.isRightToLeft(a.getCtx())&&(d=Math.PI-d-e,d=0<d?d:d+2*Math.PI);k?c=new dvt.Path(m,DvtStatusMeterGaugeRenderer.createCircularPathCmd(c,d,e,f,g)):(c=new DvtStatusMeterGaugeCircularIndicator(m,c,d,e,f,g),a.__shapes.push(c));c.setSolidFill(h);(h=DvtGaugeStyleUtils.getBorderColor(a))&&!k?c.setSolidStroke(h):k&&l&&c.setSolidStroke(l);a=a.getOptions();c.setClassName(k?a.plotArea.svgClassName:a.svgClassName);
c.setStyle(k?a.plotArea.svgStyle:a.svgStyle);b.addChild(c)};DvtStatusMeterGaugeRenderer._drawCircularReferenceLine=function(a,b,c,d,e,f,g){var h=a.getCtx(),k=Math.min(c.w,c.h),l=.275*k,k=.5*k;dvt.Agent.isRightToLeft(a.getCtx())&&(d=Math.PI-d,d=0<d?d:d+2*Math.PI);a=DvtStatusMeterGaugeRenderer._calcPointOnArc(c,l,d);c=DvtStatusMeterGaugeRenderer._calcPointOnArc(c,k,d);h=new dvt.Line(h,a.x,a.y,c.x,c.y);e=new dvt.SolidStroke(e,1,f);g&&e.setStyle(dvt.Stroke.convertTypeString(g));h.setStroke(e);b.addChild(h)};
DvtStatusMeterGaugeRenderer.createCircularPathCmd=function(a,b,c,d,e){var f,g,h;c<dvt.Math.TWO_PI?(f=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,e,b),g=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,e,b+c),h=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,d,b+c),a=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,d,b),e=dvt.PathUtils.moveTo(f.x,f.y)+dvt.PathUtils.arcTo(e,e,c,1,g.x,g.y)+dvt.PathUtils.lineTo(h.x,h.y)+dvt.PathUtils.arcTo(d,d,c,0,a.x,a.y)+dvt.PathUtils.closePath()):(f=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,
e,b),g=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,e,b+c/2),h=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,d,b),a=DvtStatusMeterGaugeRenderer._calcPointOnArc(a,d,b+c/2),e=dvt.PathUtils.moveTo(f.x,f.y)+dvt.PathUtils.arcTo(e,e,c/2,1,g.x,g.y)+dvt.PathUtils.arcTo(e,e,c/2,1,f.x,f.y),0<d&&(e+=dvt.PathUtils.moveTo(a.x,a.y)+dvt.PathUtils.arcTo(d,d,c/2,0,h.x,h.y)+dvt.PathUtils.arcTo(d,d,c/2,0,a.x,a.y)),e+=dvt.PathUtils.closePath());return e};
DvtStatusMeterGaugeRenderer.getAngleQuadrant=function(a,b){var c=1;if(b)a>=dvt.Math.HALF_PI&&a<Math.PI?c=2:a>=Math.PI&&a<1.5*Math.PI?c=3:a>=1.5*Math.PI&&a<dvt.Math.TWO_PI&&(c=4);else if(a>dvt.Math.HALF_PI&&a<=Math.PI)c=2;else if(a>Math.PI&&a<=1.5*Math.PI)c=3;else if(a>1.5*Math.PI&&a<dvt.Math.TWO_PI||0==a)c=4;return c};DvtStatusMeterGaugeRenderer._hasMetricLabelOutsidePlotArea=function(a){var b=a.metricLabel.position;return"auto"==b||"outsidePlotArea"==b||("withLabel"==b||"withTitle"==b)&&!DvtGaugeStyleUtils.hasLabel(a)};
DvtStatusMeterGaugeRenderer._adjustCenterAndBounds=function(a,b,c,d,e,f,g){var h=null,k=DvtStatusMeterGaugeRenderer.getAngleQuadrant(c,!0),l=DvtStatusMeterGaugeRenderer.getAngleQuadrant(e,!1),m=f.w,n=f.h,p=m/2,q=n/2,r;if(k==l&&d<=dvt.Math.HALF_PI)if(c=2*Math.min(f.w,f.h),f.w+=c/2,f.h+=c/2,r=c*b,!g&&1==k||g&&2==k)f.x-=c/2,f.y-=c/2,p=m/2-c/4+1,q=n/2-c/4+1,h=new dvt.Rectangle(f.x+f.w/2-1,f.y+f.h/2-1,3/7*r-2,2.5/7*r-2);else if(!g&&2==k||g&&1==k)f.y-=c/2,p=m/2+c/4-1,q=n/2-c/4+1,h=new dvt.Rectangle(f.x+
f.w/2-3/7*r+1,f.y+f.h/2-1,3/7*r-2,2.5/7*r-2);else if(!g&&3==k||g&&4==k)p=m/2+c/4-1,q=n/2+c/4-1,h=new dvt.Rectangle(f.x+f.w/2-3/7*r+1,f.y+f.h/2-2.5/7*r+1,3/7*r-2,2.5/7*r-2);else{if(!g&&4==k||g&&3==k)f.x-=c/2,p=m/2-c/4+1,q=n/2+c/4-1,h=new dvt.Rectangle(f.x+f.w/2-1,f.y+f.h/2-2.5/7*r+1,3/7*r-2,2.5/7*r-2)}else k%4+1==l&&d<=Math.PI?1==k||3==k?(c=Math.min(f.w,2*f.h),r=c*b,f.w>f.h&&(h=new dvt.Rectangle(f.x+f.w/2-3/7*r,f.y+f.h-(f.h-c/2)/2-2.75/7*r,6/7*r,2.5/7*r),1==k?(h.y=f.y+(f.h-c/2)/2+.5/7*r,f.y-=c/2-(f.h-
c/2)/2,q=n/2-c/4+1):(f.y+=(f.h-c/2)/2,q=n/2+c/4-1),f.h=c)):(c=Math.min(2*f.w,f.h),r=c*b,f.w<f.h&&(h=new dvt.Rectangle(f.x+f.w-(f.w-c/2)/2-3.25/7*r,f.y+f.h/2-2.5/7*r,3/7*r,5/7*r),!g&&4==k||g&&2==k?(h.x=f.x+(f.w-c/2)/2+.25/7*r,f.x-=c/2-(f.w-c/2)/2,p=m/2-c/4+1):(f.x+=(f.w-c/2)/2,p=m/2+c/4-1),f.w=c)):l%4+1==k&&d>Math.PI&&(1==k&&f.h>f.w?(c=Math.min(f.w/(Math.cos(c)+1)*2,f.w/(Math.sin(e-1.5*Math.PI)+1)*2,f.h),r=c*b,b=3/7*r*(2*f.w/c-1),g?(h=new dvt.Rectangle(f.x+f.w-c/2-b,f.y+f.h/2-2.5/7*r,3/7*r+b,5/7*r),
f.x-=c-f.w,p=-c/2+m):(h=new dvt.Rectangle(f.x+c/2-3/7*r,f.y+f.h/2-2.5/7*r,3/7*r*(1+(2*f.w/c-1)),5/7*r),p=c/2),f.w=c):2==k&&f.h<f.w?(c=Math.min(f.h/(Math.cos(c-dvt.Math.HALF_PI)+1)*2,f.h/(Math.sin(e)+1)*2,f.w),r=c*b,h=new dvt.Rectangle(f.x+f.w/2-3/7*r,f.y+c/2-2.5/7*r,6/7*r,2.5/7*r*(1+(2*f.h/c-1))),f.h=c,q=c/2):3==k&&f.h>f.w?(c=Math.min(f.w/(Math.cos(c-Math.PI)+1)*2,f.w/(Math.sin(e-dvt.Math.HALF_PI)+1)*2,f.h),r=c*b,b=3/7*r*(2*f.w/c-1),g?(h=new dvt.Rectangle(f.x+c/2-3/7*r,f.y+f.h/2-2.5/7*r,3/7*r*(1+
(2*f.w/c-1)),5/7*r),p=c/2):(h=new dvt.Rectangle(f.x+f.w-c/2-b,f.y+f.h/2-2.5/7*r,3/7*r+b,5/7*r),f.x-=c-f.w,p=-c/2+m),f.w=c):4==k&&f.h<f.w&&(c=Math.min(f.h/(Math.cos(c-1.5*Math.PI)+1)*2,f.h/(Math.sin(dvt.Math.TWO_PI-e)+1)*2,f.w),r=c*b,b=2.5/7*r*(2*f.h/c-1),h=new dvt.Rectangle(f.x+f.w/2-3/7*r,f.y+f.h-c/2-b,6/7*r,2.5/7*r+b),f.y-=c-f.h,f.h=c,q=-c/2+n));a.cx=p;a.cy=q;a.maxInnerDiameter=r;return h};
DvtStatusMeterGaugeRenderer._renderCenterContent=function(a,b,c,d,e){var f=new dvt.Rectangle(c.x+.5*(c.w-e),c.y+.5*(c.h-e),e,e),f=f.getIntersection(d);c=new dvt.Rectangle(c.x+.5*(c.w-e/Math.sqrt(2)),c.y+.5*(c.h-e/Math.sqrt(2)),e/Math.sqrt(2),e/Math.sqrt(2));c=c.getIntersection(d);if(d=b.center.renderer)if(c={outerBounds:{x:f.x,y:f.y,width:f.w,height:f.h},innerBounds:{x:c.x,y:c.y,width:c.w,height:c.h},metricLabel:DvtGaugeRenderer.getFormattedMetricLabel(b.value,a),component:b._widgetConstructor},b=
a.getCtx(),f=b.getContainer(),(e=a.centerDiv)&&f.removeChild(e),c=d(c))d=b.createOverlayDiv(),d.appendChild(c),a.centerDiv=d,f.appendChild(d),(a=b.getOverlayAttachedCallback())&&a(d)};
var DvtStatusMeterGaugeIndicator=function(a,b,c,d,e,f){this.Init(a,b,c,d,e,f)};dvt.Obj.createSubclass(DvtStatusMeterGaugeIndicator,dvt.Path);DvtStatusMeterGaugeIndicator.prototype.Init=function(a,b,c,d,e,f){DvtStatusMeterGaugeIndicator.superclass.Init.call(this,b);this._gauge=a;this.setCoords(c,d,e,f)};
DvtStatusMeterGaugeIndicator.prototype.setCoords=function(a,b,c,d){this._x1=a;this._x2=b;this._y1=c;this._y2=d;var e=Math.min(a,b),f=Math.min(c,d);a=Math.abs(a-b);c=Math.abs(d-c);d=this._gauge.getOptions();b="vertical"==d.orientation?a:c;var g=DvtGaugeDefaults.isSkyrosSkin(this._gauge)?"25%":"15%",e=dvt.PathUtils.rectangleWithBorderRadius(e,f,a,c,d.borderRadius,b,g);this.setCmds(e)};DvtStatusMeterGaugeIndicator.prototype.getAnimationParams=function(){return[this._x1,this._x2,this._y1,this._y2]};
DvtStatusMeterGaugeIndicator.prototype.setAnimationParams=function(a){a&&4==a.length&&this.setCoords(a[0],a[1],a[2],a[3])};
var DvtStatusMeterGaugeCircularIndicator=function(a,b,c,d,e,f){this.Init(a,b,c,d,e,f)};dvt.Obj.createSubclass(DvtStatusMeterGaugeCircularIndicator,dvt.Path);DvtStatusMeterGaugeCircularIndicator.prototype.Init=function(a,b,c,d,e,f){DvtStatusMeterGaugeCircularIndicator.superclass.Init.call(this,a);this.setPath(b,c,d,e,f)};
DvtStatusMeterGaugeCircularIndicator.prototype.setPath=function(a,b,c,d,e){a&&a instanceof dvt.Rectangle?this._bounds=a:a=this._bounds;this._startAngle=b;this._angleExtent=c;this._innerRadius=d;this._outerRadius=e;this.setCmds(DvtStatusMeterGaugeRenderer.createCircularPathCmd(a,b,c,d,e))};DvtStatusMeterGaugeCircularIndicator.prototype.getAnimationParams=function(){return[this._bounds,this._startAngle,this._angleExtent,this._innerRadius,this._outerRadius]};
DvtStatusMeterGaugeCircularIndicator.prototype.setAnimationParams=function(a){a&&5==a.length&&this.setPath(a[0],a[1],a[2],a[3],a[4])};
dvt.DialGauge=function(){};dvt.Obj.createSubclass(dvt.DialGauge,DvtGauge);dvt.DialGauge.newInstance=function(a,b,c){var d=new dvt.DialGauge;d.Init(a,b,c);return d};dvt.DialGauge.prototype.Init=function(a,b,c){dvt.DialGauge.superclass.Init.call(this,a,b,c);this.Defaults=new DvtDialGaugeDefaults;this.__anchorPt=null};
dvt.DialGauge.prototype.SetOptions=function(a){var b=a.background,c=a.indicator;"string"===typeof b&&(a.background=DvtGaugeStyleUtils.getDialBackground(b),a.background.images=a._backgroundImages);"string"===typeof c&&(a.indicator=DvtGaugeStyleUtils.getDialIndicator(c),a.indicator.images=a._indicatorImages);dvt.DialGauge.superclass.SetOptions.call(this,this.Defaults.calcOptions(a))};dvt.DialGauge.prototype.Render=function(a,b,c){DvtDialGaugeRenderer.render(this,a,b,c)};
dvt.DialGauge.prototype.renderUpdate=function(){DvtDialGaugeRenderer.updateIndicatorAndLabel(this,this._container,this.Width,this.Height);var a=this.getEventManager();a&&a.associate(this._editingOverlay,this.__getLogicalObject(),!0);this.UpdateAriaLiveValue(this._container)};
dvt.DialGauge.prototype.CreateAnimationOnDisplay=function(a,b,c){b=[];for(var d=0;d<a.length;d++){var e=a[d],f=e.getAnimationParams(),g=DvtDialGaugeRenderer.__getStartAngle(this);e.setAngle(g);g=new dvt.CustomAnimation(this.getCtx(),e,c);g.getAnimator().addProp(dvt.Animator.TYPE_NUMBER_ARRAY,e,e.getAnimationParams,e.setAnimationParams,f);g.getAnimator().setEasing(function(a){return dvt.Easing.backOut(a,.7)});b.push(g)}return new dvt.ParallelPlayable(this.getCtx(),b)};
dvt.DialGauge.prototype.GetValueAt=function(a,b){var c=dvt.Math.radsToDegrees(Math.atan2(b-this.__anchorPt.y,a-this.__anchorPt.x));0>=c&&(c+=360);var d=dvt.Agent.isRightToLeft(this.getCtx()),e=this.getOptions().background,f=d?180+e.startAngle:360-e.startAngle,e=e.angleExtent,g=f+e;if(d)for(g=f,f-=e;0>f;)f+=360,g+=360;c+360>=f&&c+360<=g?c+=360:c>=f&&c<=g||(c=c>g?f+360-c<c-g?f:g:f-c<c+360-g?f:g);c=(c-f)/e;d&&(c=1-c);d=this.Options.min;return c*(this.Options.max-d)+d};
var DvtDialGaugeDefaults=function(){this.Init({skyros:DvtDialGaugeDefaults.VERSION_1,alta:{}})};dvt.Obj.createSubclass(DvtDialGaugeDefaults,DvtGaugeDefaults);DvtDialGaugeDefaults.VERSION_1={background:{startAngle:180,angleExtent:180,indicatorLength:.7},metricLabel:{style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_ALTA)},tickLabel:{scaling:"auto",style:new dvt.CSSStyle(dvt.BaseComponentDefaults.FONT_FAMILY_ALTA)}};
var DvtDialGaugeRenderer={};dvt.Obj.createSubclass(DvtDialGaugeRenderer,dvt.Obj);DvtDialGaugeRenderer.render=function(a,b,c,d){DvtGaugeDataUtils.hasData(a)?(c=new dvt.Rectangle(0,0,c,d),DvtDialGaugeRenderer._renderShape(a,b,c),DvtDialGaugeRenderer._renderLabel(a,b,c)):DvtGaugeRenderer.renderEmptyText(a,b,new dvt.Rectangle(0,0,c,d))};
DvtDialGaugeRenderer.updateIndicatorAndLabel=function(a,b,c,d){a.__indicatorContainer.setAngle(DvtDialGaugeRenderer._getRotation(a,a.getOptions().value));b.removeChild(a.__label);DvtDialGaugeRenderer._renderLabel(a,b,new dvt.Rectangle(0,0,c,d))};
DvtDialGaugeRenderer._renderShape=function(a,b,c){var d=a.getOptions(),e=DvtDialGaugeRenderer._createBackground(a,c);b.addChild(e);d.background.majorTickCount&&d.background.radius&&DvtDialGaugeRenderer._renderTickLabels(a,b,c);var e=DvtDialGaugeRenderer._createIndicator(a,c),f=new dvt.Container(a.getCtx()),g=new DvtDialGaugeIndicator(a.getCtx());b.addChild(f);f.addChild(g);g.addChild(e);var h=e.getDimensions(),d=DvtDialGaugeRenderer._getRotation(a,d.value);b=DvtDialGaugeRenderer._getBackgroundAnchorPoint(a,
c);var k=DvtDialGaugeRenderer._getIndicatorAnchorPoint(a,c,h);c=DvtDialGaugeRenderer._getIndicatorScaleFactor(a,c,h);h=new dvt.Matrix;h.translate(-k.x,-k.y);h.scale(c,c);e.setMatrix(h);g.setAngle(d);h=new dvt.Matrix;h.translate(b.x,b.y);f.setMatrix(h);a.__shapes.push(g);a.__indicatorContainer=g;a.__anchorPt=b};
DvtDialGaugeRenderer._createBackground=function(a,b){var c=a.getOptions().background,d=dvt.Agent.isRightToLeft(a.getCtx()),e=dvt.Agent.isTouchDevice(),f=e?2*b.w:b.w,g=e?2*b.h:b.h,h=c.images;if(h&&0<h.length){var k,l,m,e=[];for(k=0;k<h.length;k++){var n="rtl"==h[k].dir;d&&n?e.push(h[k]):d||n||e.push(h[k])}h=0<e.length?e:h;for(k=0;k<h.length;k++){var p=h[k],n=p.src,e=p.width,p=p.height,q=n&&-1<n.search(".svg");0==k&&(l=e,m=p);if(q||e>=f&&p>=g||k==h.length-1){var f=new dvt.Image(a.getCtx(),n,0,0,e,p),
r=new dvt.Matrix,g=Math.min(b.w/e,b.h/p),h=(b.w-g*e)/2;k=(b.h-g*p)/2;r.scale(g,g);r.translate(h,k);f.setMatrix(r);q&&dvt.Agent.isPlatformWebkit()&&(n=dvt.ImageLoader.loadImage(a.getCtx(),n,dvt.Obj.createCallback(f,f.__setDimensions)))&&f.__setDimensions(n);b.x+=h;b.y+=k;b.w=g*e;b.h=g*p;isNaN(c.anchorX)||isNaN(c.anchorY)||(c._anchorX=d?b.x+b.w-b.w*c.anchorX/l:b.x+b.w*c.anchorX/l,c._anchorY=b.y+b.h*c.anchorY/m);c.metricLabelBounds&&(e={},e.width=b.w*c.metricLabelBounds.width/l,e.height=b.h*c.metricLabelBounds.height/
m,e.y=b.y+b.h*c.metricLabelBounds.y/m,e.x=d?b.x+b.w-b.w*c.metricLabelBounds.x/l-e.width:b.x+b.w*c.metricLabelBounds.x/l,c._metricLabelBounds=e);c._radius=c.radius*Math.min(b.w/l,b.h/m);c._tickLabelHeight=c.tickLabelHeight*b.h/m;c._tickLabelWidth=c.tickLabelWidth*b.w/l;return f}}}return null};
DvtDialGaugeRenderer._createIndicator=function(a,b){var c=a.getOptions().indicator,d=DvtDialGaugeRenderer._getIndicatorLength(a,b),e=dvt.Agent.isTouchDevice()?2*d:d,f,g,h=c.images;if(h&&0<h.length)for(var k=0;k<h.length;k++){var l=h[k],d=l.src,m=l.width,l=l.height,n=d&&-1<d.search(".svg");0==k&&(f=m,g=l);if(n||l>=e||k==h.length-1)return e=new dvt.Image(a.getCtx(),d,0,0,m,l),n&&dvt.Agent.isPlatformWebkit()&&dvt.ImageLoader.loadImage(a.getCtx(),d,dvt.Obj.createCallback(e,e.__setDimensions))&&(e.setWidth(m),
e.setHeight(l)),isNaN(c.anchorX)||isNaN(c.anchorY)||(c._anchorX=c.anchorX*m/f,c._anchorY=c.anchorY*l/g),e}return null};DvtDialGaugeRenderer.__getStartAngle=function(a){var b=a.getOptions().background;a=dvt.Agent.isRightToLeft(a.getCtx())?180-b.startAngle:b.startAngle;return Math.PI*(90-a)/180};
DvtDialGaugeRenderer._getRotation=function(a,b){var c=a.getOptions(),d=c.background,e=c.min,c=c.max;b=Math.max(Math.min(b,c),e);e=(b-e)/(c-e);c=dvt.Agent.isRightToLeft(a.getCtx());return Math.PI*(90-((c?180-d.startAngle:d.startAngle)-e*(c?-d.angleExtent:d.angleExtent)))/180};DvtDialGaugeRenderer._getBackgroundAnchorPoint=function(a,b){var c=a.getOptions().background,d=c._anchorX,c=c._anchorY;return isNaN(d)||isNaN(c)?new dvt.Point(b.x+b.w/2,b.y+b.h/2):new dvt.Point(d,c)};
DvtDialGaugeRenderer._getIndicatorLength=function(a,b){var c=Math.min(b.w,b.h)/2;return a.getOptions().background.indicatorLength*c};DvtDialGaugeRenderer._getIndicatorAnchorPoint=function(a,b,c){b=a.getOptions().indicator;a=b._anchorX;b=b._anchorY;return isNaN(a)||isNaN(b)?new dvt.Point(c.x+c.w/2,c.y+c.h):new dvt.Point(a,b)};DvtDialGaugeRenderer._getIndicatorScaleFactor=function(a,b,c){return DvtDialGaugeRenderer._getIndicatorLength(a,b)/c.h};
DvtDialGaugeRenderer._renderLabel=function(a,b,c){var d=a.getOptions();if("on"==d.metricLabel.rendered){var e=DvtGaugeRenderer.getFormattedMetricLabel(d.value,a),f=DvtGaugeRenderer.getFormattedMetricLabel(d.min,a),g=DvtGaugeRenderer.getFormattedMetricLabel(d.max,a),h=c.x+c.w/2,k=c.y+c.h/2,l=c.w,m=c.h,n=d.background._metricLabelBounds;n&&(h=n.x+n.width/2,k=n.y+n.height/2,c.w=n.width,c.h=n.height);h=new dvt.OutputText(a.getCtx(),e,h,k);!d.metricLabel.style.getStyle("color")&&d.background._isDark&&d.metricLabel.style.setStyle("color",
"#CCCCCC");h.setCSSStyle(d.metricLabel.style);d=(d=parseInt(d.metricLabel.style.getFontSize()))?parseInt(d):null;d||(d=DvtGaugeRenderer.calcLabelFontSize([e,f,g],h,c),h.setTextString(e),h.setFontSize(d));h.alignCenter();h.alignMiddle();dvt.TextUtils.fitText(h,l,m,b)&&(a.__label=h)}};
DvtDialGaugeRenderer._renderTickLabels=function(a,b,c){var d=a.getOptions(),e=dvt.Agent.isRightToLeft(a.getCtx());if(d.background.radius&&d.background.majorTickCount){var f=d.background._radius,g=d.min,h=d.max,k=d.background.majorTickCount,l=12,m=new dvt.Rectangle(t,q,c.w,c.h),n=d.metricLabel.style.getStyle("font-size");d.background._tickLabelHeight&&!n&&(m.h=d.background._tickLabelHeight);d.background._tickLabelWidth&&!n&&(m.w=d.background._tickLabelWidth);if(!n)var p=new dvt.OutputText(a.getCtx(),
"",t,q),l=DvtGaugeRenderer.calcLabelFontSize([DvtGaugeRenderer.formatTickLabelValue(d.max,a),DvtGaugeRenderer.formatTickLabelValue(d.min,a)],p,m);for(n=0;n<k;n++){t=g+Math.abs(h-g)*n/(k-1);e&&(t=g+Math.abs(h-g)*(k-1-n)/(k-1));var p=DvtGaugeRenderer.formatTickLabelValue(t,a),q=DvtDialGaugeRenderer._getRotation(a,t),r=DvtDialGaugeRenderer._getBackgroundAnchorPoint(a,c),t=r.x+f*Math.cos(q-Math.PI/2),q=r.y+f*Math.sin(q-Math.PI/2),p=new dvt.OutputText(a.getCtx(),p,t,q);!d.tickLabel.style.getStyle("color")&&
d.background._isDark&&d.tickLabel.style.setStyle("color","#CCCCCC");p.setCSSStyle(d.tickLabel.style);d.tickLabel.style.getStyle("font-size")||p.setFontSize(l);p.alignCenter();p.alignMiddle();dvt.TextUtils.fitText(p,m.w+.5,m.h+.5,b)}}};
var DvtDialGaugeIndicator=function(a){this.Init(a)};dvt.Obj.createSubclass(DvtDialGaugeIndicator,dvt.Container);DvtDialGaugeIndicator.prototype.setAngle=function(a){var b=new dvt.Matrix;b.rotate(a);this.setMatrix(b);this._angleRads=a};DvtDialGaugeIndicator.prototype.getAnimationParams=function(){return[this._angleRads]};DvtDialGaugeIndicator.prototype.setAnimationParams=function(a){a&&1==a.length&&this.setAngle(a[0])};
dvt.RatingGauge=function(){};dvt.Obj.createSubclass(dvt.RatingGauge,DvtGauge);dvt.RatingGauge.newInstance=function(a,b,c){var d=new dvt.RatingGauge;d.Init(a,b,c);return d};dvt.RatingGauge.prototype.Init=function(a,b,c){dvt.RatingGauge.superclass.Init.call(this,a,b,c);this.Defaults=new DvtRatingGaugeDefaults};
dvt.RatingGauge.prototype.SetOptions=function(a){a.changedState&&(a.changedState.className&&(a.changedState.svgClassName=a.changedState.className),a.changedState.style&&(a.changedState.svgStyle=a.changedState.style));a.hoverState&&(a.hoverState.className&&(a.hoverState.svgClassName=a.hoverState.className),a.hoverState.style&&(a.hoverState.svgStyle=a.hoverState.style));a.selectedState&&(a.selectedState.className&&(a.selectedState.svgClassName=a.selectedState.className),a.selectedState.style&&(a.selectedState.svgStyle=
a.selectedState.style));a.unselectedState&&(a.unselectedState.className&&(a.unselectedState.svgClassName=a.unselectedState.className),a.unselectedState.style&&(a.unselectedState.svgStyle=a.unselectedState.style));dvt.RatingGauge.superclass.SetOptions.call(this,this.Defaults.calcOptions(a))};
dvt.RatingGauge.prototype.Render=function(a,b,c){var d=this.Options.__layout.outerGap,e=this.Options.max,f="vertical"==this.Options.orientation,g="none"!=this.Options.preserveAspectRatio;this.Options.selectedState.source&&g?dvt.ImageLoader.loadImage(this.getCtx(),this.Options.selectedState.source,dvt.Obj.createCallback(this,function(g){dvt.Agent.isPlatformIE()&&11==dvt.Agent.getVersion()&&g&&0==g.width&&0==g.height&&(g.width=1,g.height=1);g&&g.width&&g.height&&(g=g.width/g.height,this.__shapeWidth=
f?Math.min(b-2*d,(c-2*d)*g/e):Math.min((c-2*d)*g,(b-2*d)/e),this.__shapeHeight=this.__shapeWidth/g,this.__bounds=f?new dvt.Rectangle(d,(c-this.__shapeHeight*e)/2,b-2*d,this.__shapeHeight*e):new dvt.Rectangle((b-this.__shapeWidth*e)/2,d,this.__shapeWidth*e,c-2*d),DvtRatingGaugeRenderer.render(this,a,b,c))})):(g?this.__shapeHeight=this.__shapeWidth=f?Math.min(b-2*d,(c-2*d)/e):Math.min(c-2*d,(b-2*d)/e):(this.__shapeWidth=f?b-2*d:(b-2*d)/e,this.__shapeHeight=f?(c-2*d)/e:c-2*d),this.__bounds=f?new dvt.Rectangle(d,
(c-this.__shapeHeight*e)/2,b-2*d,this.__shapeHeight*e):new dvt.Rectangle((b-this.__shapeWidth*e)/2,d,this.__shapeWidth*e,c-2*d),DvtRatingGaugeRenderer.render(this,a,b,c))};
dvt.RatingGauge.prototype.__getLogicalObject=function(){var a=this.Options.tooltip,a=a?a.renderer:null,b=DvtGaugeStyleUtils.getColor(this);if(a){var c={component:this.Options._widgetConstructor,label:DvtGaugeRenderer.getFormattedMetricLabel(this.Options.value,this),color:b};return new dvt.CustomDatatipPeer(this.getCtx().getTooltipManager(),a,b,c)}return new DvtRatingGaugePeer(this)};
dvt.RatingGauge.prototype.GetValueAt=function(a,b){var c="vertical"==this.Options.orientation?this.__shapeHeight:this.__shapeWidth;if(DvtGaugeDataUtils.hasData(this)){if("vertical"==this.Options.orientation)b=Math.max(Math.min(b,this.__bounds.y+this.__bounds.h),this.__bounds.y),d=Math.max((this.__bounds.y+this.__bounds.h-b)/c,this.Options.min);else{a=Math.max(Math.min(a,this.__bounds.x+this.__bounds.w),this.__bounds.x);var d=0,d=dvt.Agent.isRightToLeft(this.getCtx())?Math.max((this.__bounds.x+this.__bounds.w-
a)/c,this.Options.min):Math.max((a-this.__bounds.x)/c,this.Options.min)}return DvtGaugeRenderer.adjustForStep(this.Options,d)}return null};dvt.RatingGauge.prototype.__processHoverEnd=function(a,b){this.__updateClipRects(this.Options.value,"render");this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(this.Options.value,this.Options.value,!1))};dvt.RatingGauge.prototype.__processValueChangeStart=function(a,b){this.__processValueChangeMove(a,b)};
dvt.RatingGauge.prototype.__processValueChangeMove=function(a,b){var c=this.GetValueAt(a,b);this.__updateClipRects(c,"hover");this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(this.Options.value,c,!1))};
dvt.RatingGauge.prototype.__processValueChangeEnd=function(a,b){var c=this.Options.value;this.Options.value=this.GetValueAt(a,b);this.Options.changed=!0;this.render();this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(c,this.Options.value,!1));this.dispatchEvent(dvt.EventFactory.newValueChangeEvent(c,this.Options.value,!0))};
dvt.RatingGauge.prototype.__updateClipRects=function(a,b,c){if(DvtGaugeDataUtils.hasData(this)){c||(c=this._container);var d=dvt.Agent.isRightToLeft(this.getCtx()),e="vertical"==this.Options.orientation,f=e?this.__shapeHeight:this.__shapeWidth;a=Math.max(Math.min(a,this.Options.max),0);var g=0,h=a*f,k=a*f;"render"==b&&(g=a*f,h=0);if(e){if(b=c.getChildAt(0),d=new dvt.ClipPath,d.addRect(this.__bounds.x,this.__bounds.y,this.__bounds.w,this.__bounds.h-k),b.setClipPath(d),b=c.getChildAt(1),d=new dvt.ClipPath,
d.addRect(this.__bounds.x,this.__bounds.y+this.__bounds.h-g,this.__bounds.w,g),b.setClipPath(d),g=c.getChildAt(2))b=new dvt.ClipPath,b.addRect(this.__bounds.x,this.__bounds.y+this.__bounds.h-h,this.__bounds.w,h),g.setClipPath(b)}else if(d){if(b=c.getChildAt(0),d=new dvt.ClipPath,d.addRect(this.__bounds.x,this.__bounds.y,this.__bounds.w-k,this.__bounds.h),b.setClipPath(d),b=c.getChildAt(1),d=new dvt.ClipPath,d.addRect(this.__bounds.x+this.__bounds.w-k,this.__bounds.y,g,this.__bounds.h),b.setClipPath(d),
g=c.getChildAt(2))b=new dvt.ClipPath,b.addRect(this.__bounds.x+this.__bounds.w-k,this.__bounds.y,h,this.__bounds.h),g.setClipPath(b)}else if(b=c.getChildAt(0),d=new dvt.ClipPath,d.addRect(this.__bounds.x+k,this.__bounds.y,this.__bounds.w-k,this.__bounds.h),b.setClipPath(d),b=c.getChildAt(1),d=new dvt.ClipPath,d.addRect(this.__bounds.x,this.__bounds.y,g,this.__bounds.h),b.setClipPath(d),g=c.getChildAt(2))b=new dvt.ClipPath,b.addRect(this.__bounds.x,this.__bounds.y,h,this.__bounds.h),g.setClipPath(b);
this.UpdateAriaLiveValue(c,a)}};dvt.RatingGauge.prototype.__getRatingGaugeItem=function(a){return this._container.getChildAt(0).getChildAt(a)};dvt.RatingGauge.prototype.CreateEventManager=function(){return new DvtRatingGaugeEventManager(this)};
var DvtRatingGaugeDefaults=function(){this.Init({skyros:DvtRatingGaugeDefaults.VERSION_1,alta:DvtRatingGaugeDefaults.SKIN_ALTA})};dvt.Obj.createSubclass(DvtRatingGaugeDefaults,DvtGaugeDefaults);DvtRatingGaugeDefaults.SKIN_ALTA={unselectedState:{shape:"star",color:"#C4CED7",borderColor:null},selectedState:{shape:"star",color:"#F8C15A",borderColor:null},hoverState:{shape:"star",color:"#007CC8",borderColor:null},changedState:{shape:"star",color:"#ED2C02",borderColor:null}};
DvtRatingGaugeDefaults.VERSION_1={min:0,max:5,orientation:"horizontal",unselectedState:{shape:"star",color:"#F2F2F2",borderColor:"#B6B6B6"},selectedState:{shape:"star",color:"#F8C15A",borderColor:"#F5A700"},hoverState:{shape:"star",color:"#66A7DA",borderColor:"#4A86C5"},changedState:{shape:"star",color:"#F8C15A",borderColor:"#959595"},preserveAspectRatio:"meet",step:1};
var DvtRatingGaugePeer=function(a){this.Init();this._gauge=a};dvt.Obj.createSubclass(DvtRatingGaugePeer,dvt.SimpleObjPeer);DvtRatingGaugePeer.prototype.getDatatip=function(a,b,c){a=this._gauge.getOptions();b=this._gauge.getEventManager().__isMouseEditing()?DvtGaugeDataUtils.getValueThresholdIndex(this._gauge,this._gauge.GetValueAt(b,c)):DvtGaugeDataUtils.getValueThresholdIndex(this._gauge);return(b=DvtGaugeDataUtils.getThreshold(this._gauge,b))&&b.shortDesc?b.shortDesc:a.shortDesc};
var DvtRatingGaugeRenderer={};dvt.Obj.createSubclass(DvtRatingGaugeRenderer,dvt.Obj);
DvtRatingGaugeRenderer.render=function(a,b,c,d){if(DvtGaugeDataUtils.hasData(a)){c=a.getOptions();d=DvtGaugeDataUtils.getValueThresholdIndex(a);d=DvtGaugeDataUtils.getThreshold(a,d);var e=c.selectedState.color,f=c.changedState.color,g=c.selectedState.borderColor,h=c.changedState.borderColor;d&&d.color&&(f=e=d.color);d&&d.borderColor&&(h=g=d.borderColor);d={value:0,type:c.unselectedState.shape,color:c.unselectedState.color,borderColor:c.unselectedState.borderColor,visualEffects:c.visualEffects,source:c.unselectedState.source,
svgClassName:c.unselectedState.svgClassName,svgStyle:c.unselectedState.svgStyle};e={value:0,type:c.selectedState.shape,color:e,borderColor:g,visualEffects:c.visualEffects,source:c.selectedState.source,svgClassName:c.selectedState.svgClassName,svgStyle:c.selectedState.svgStyle};f={value:0,type:c.changedState.shape,color:f,borderColor:h,visualEffects:c.visualEffects,source:c.changedState.source,svgClassName:c.changedState.svgClassName,svgStyle:c.changedState.svgStyle};h={value:0,type:c.hoverState.shape,
color:c.hoverState.color,borderColor:c.hoverState.borderColor,visualEffects:c.visualEffects,source:c.hoverState.source,svgClassName:c.hoverState.svgClassName,svgStyle:c.hoverState.svgStyle};"dot"==c.unselectedState.shape&&(d.type="circle",d.visualEffects="none",d.size=.05);DvtRatingGaugeRenderer._createShapes(a,b,d);DvtRatingGaugeRenderer._createShapes(a,b,c.changed?f:e);c.readOnly||DvtRatingGaugeRenderer._createShapes(a,b,h);a.__updateClipRects(c.value,"render",b)}else DvtGaugeRenderer.renderEmptyText(a,
b,new dvt.Rectangle(0,0,c,d))};
DvtRatingGaugeRenderer._createShapes=function(a,b,c){var d=a.getCtx(),e=new dvt.Container(d);b.addChild(e);b=a.getOptions();var f=a.__bounds,g=a.__shapeWidth;a=a.__shapeHeight;var h;c.source?(h=new dvt.ImageMarker(d,g/2,a/2,g,a,null,c.source),h.setPreserveAspectRatio("none")):"none"!=c.type&&(h=dvt.LedGauge.newInstance(d,null,null,!0),h.render(c,g,a));for(c=0;c<b.max;c++){var k,l;"vertical"==b.orientation?(k=f.x+f.w/2-g/2,l=f.y+f.h-(c+1)*a):(k=dvt.Agent.isRightToLeft(d)?f.x+f.w-(c+1)*g:f.x+c*g,l=
f.y+f.h/2-a/2);h&&(h.setClassName(b.svgClassName),h.setStyle(b.svgStyle),k=new dvt.Use(d,k,l,h),e.addChild(k))}};
var DvtRatingGaugeEventManager=function(a){this.Init(a.getCtx(),a.dispatchEvent,a);this._gauge=a};dvt.Obj.createSubclass(DvtRatingGaugeEventManager,DvtGaugeEventManager);DvtRatingGaugeEventManager.prototype.OnMouseOver=function(a){if(!1===this._gauge.getOptions().readOnly){var b=this.GetRelativePosition(a.pageX,a.pageY);this._gauge.__processValueChangeStart(b.x,b.y);this.IsMouseEditing=!0}DvtRatingGaugeEventManager.superclass.OnMouseOver.call(this,a)};
DvtRatingGaugeEventManager.prototype.OnMouseOut=function(a){if(!1===this._gauge.getOptions().readOnly){var b=this.GetRelativePosition(a.pageX,a.pageY);this._gauge.__processHoverEnd(b.x,b.y);this.IsMouseEditing=!1}DvtRatingGaugeEventManager.superclass.OnMouseOut.call(this,a)};
DvtRatingGaugeEventManager.prototype.OnMouseMove=function(a){var b=this.GetRelativePosition(a.pageX,a.pageY);!1!==this._gauge.getOptions().readOnly||this.IsMouseEditing||this._gauge.getOptions().value==this._gauge.GetValueAt(b.x,b.y)||(this.IsMouseEditing=!0);DvtRatingGaugeEventManager.superclass.OnMouseMove.call(this,a)};DvtRatingGaugeEventManager.prototype.OnMouseDown=function(a){DvtGaugeEventManager.superclass.OnMouseDown.call(this,a)};
DvtRatingGaugeEventManager.prototype.ProcessKeyboardEvent=function(a){this.IsMouseEditing=!1;return DvtRatingGaugeEventManager.superclass.ProcessKeyboardEvent.call(this,a)};DvtRatingGaugeEventManager.prototype.IsShowingTooltipWhileEditing=function(){return!0};
dvt.exportProperty(dvt,"DialGauge",dvt.DialGauge);dvt.exportProperty(dvt,"LedGauge",dvt.LedGauge);dvt.exportProperty(dvt,"RatingGauge",dvt.RatingGauge);dvt.exportProperty(dvt,"StatusMeterGauge",dvt.StatusMeterGauge);dvt.exportProperty(dvt.DialGauge,"DialGauge",dvt.DialGauge);dvt.exportProperty(dvt.DialGauge,"LedGauge",dvt.LedGauge);dvt.exportProperty(dvt.DialGauge,"RatingGauge",dvt.RatingGauge);dvt.exportProperty(dvt.DialGauge,"StatusMeterGauge",dvt.StatusMeterGauge);
dvt.exportProperty(DvtGauge.prototype,"getAutomation",DvtGauge.prototype.getAutomation);dvt.exportProperty(DvtGauge.prototype,"destroy",DvtGauge.prototype.destroy);dvt.exportProperty(DvtGauge.prototype,"render",DvtGauge.prototype.render);dvt.exportProperty(DvtGaugeAutomation.prototype,"getDomElementForSubId",DvtGaugeAutomation.prototype.getDomElementForSubId);dvt.exportProperty(DvtGaugeAutomation.prototype,"getValue",DvtGaugeAutomation.prototype.getValue);
dvt.exportProperty(DvtGaugeAutomation.prototype,"getMetricLabel",DvtGaugeAutomation.prototype.getMetricLabel);dvt.LedGaugeRenderer=DvtLedGaugeRenderer;
})(dvt);
