/*! roundSlider v1.3.2 | (c) 2015-2018, Soundar | MIT license | http://roundsliderui.com/licence.html */ ;(function($,window,undefined){"use strict";function RoundSlider(n,t){this.id=n.id,this.control=$(n),this.options=$.extend({},this.defaults,t)}function CreateRoundSlider(n,t){for(var i,r,u,f=0;f=c&&s<=h&&(n.preventDefault(),r=this.control.find(".rs-handle.rs-focus"),this.control.attr("tabindex","0").focus().removeAttr("tabindex"),i.hasClass("rs-seperator")?(t=i.parent().hasClass("rs-start")?this.options.min:this.options.max,u=this._valueToAngle(t)):(f=this._getAngleValue(e,o),u=f.angle,t=f.value),this._rangeSlider&&(r=this.control.find(".rs-handle.rs-focus"),this._active=r.length==1?parseFloat(r.attr("index")):this._handle2.value-t=35&&t<=40)&&(t>=37&&t<=40&&this._removeAnimation(),u=this["_handle"+this._active],n.preventDefault(),t==r.UP||t==r.RIGHT?i=this._round(this._limitValue(u.value+this.options.step)):t==r.DOWN||t==r.LEFT?i=this._round(this._limitValue(u.value-this._getMinusStep(u.value))):t==36?i=this._getKeyValue("Home"):t==35&&(i=this._getKeyValue("End")),f=this._valueToAngle(i),this._changeSliderValue(i,f),this._raiseEvent("change"))},_handleKeyUp:function(){this._addAnimation()},_getMinusStep:function(n){if(n==this.options.max){var t=(this.options.max-this.options.min)%this.options.step;return t==0?this.options.step:t}return this.options.step},_getKeyValue:function(n){return this._rangeSlider?n=="Home"?this._active==1?this.options.min:this._handle1.value:this._active==1?this._handle2.value:this.options.max:n=="Home"?this.options.min:this.options.max},_elementScroll:function(n){if(!this._isReadOnly){n.preventDefault();var i=n.originalEvent||n,r,t,f,u;(u=i.wheelDelta?i.wheelDelta/60:i.detail?-i.detail/2:0,u!=0)&&(this._updateActiveHandle(n),r=this["_handle"+this._active],t=r.value+(u>0?this.options.step:-this._getMinusStep(r.value)),t=this._limitValue(t),f=this._valueToAngle(t),this._removeAnimation(),this._changeSliderValue(t,f),this._raiseEvent("change"),this._addAnimation())}},_updateActiveHandle:function(n){var t=$(n.target);t.hasClass("rs-handle")&&t.parent().parent()[0]==this.control[0]&&(this.bar=t.parent(),this._active=parseFloat(t.attr("index"))),this.bar.find(".rs-handle").hasClass("rs-focus")||this.bar.find(".rs-handle").focus()},_bindControlEvents:function(n){this[n](this.control,"mousedown",this._elementDown),this[n](this.control,"touchstart",this._elementDown)},_bindScrollEvents:function(n){this[n](this.control,"mousewheel",this._elementScroll),this[n](this.control,"DOMMouseScroll",this._elementScroll)},_bindMouseEvents:function(n){this[n]($(document),"mousemove",this._handleMove),this[n]($(document),"mouseup",this._handleUp),this[n]($(document),"mouseleave",this._handleUp),this[n]($(document),"touchmove",this._handleMove),this[n]($(document),"touchend",this._handleUp),this[n]($(document),"touchcancel",this._handleUp)},_bindKeyboardEvents:function(n){this[n]($(document),"keydown",this._handleKeyDown),this[n]($(document),"keyup",this._handleKeyUp)},_changeSliderValue:function(n,t){var u=this._oriAngle(t),i=this._limitAngle(t);if(this._rangeSlider||this._showRange){if(this._active==1&&u<=this._oriAngle(this._handle2.angle)||this._active==2&&u>=this._oriAngle(this._handle1.angle)||this._invertRange){this["_handle"+this._active]={angle:t,value:n},this.options.value=this._rangeSlider?this._handle1.value+","+this._handle2.value:n,this.bar.rsRotate(i),this._updateARIA(n);var r=this._oriAngle(this._handle2.angle)-this._oriAngle(this._handle1.angle),f="1",e="0";r<=180&&!(r<0&&r>-180)&&(f="0",e="1"),this.block2.css("opacity",f),this.block3.css("opacity",e),(this._active==1?this.block4:this.block2).rsRotate(i-180),(this._active==1?this.block1:this.block3).rsRotate(i)}}else this["_handle"+this._active]={angle:t,value:n},this.options.value=n,this.bar.rsRotate(i),this._updateARIA(n)},_updateARIA:function(n){var i=this.options.min,r=this.options.max,t;this.bar.children().attr({"aria-valuenow":n}),this.options.sliderType=="range"?(t=this._handles(),t.eq(0).attr({"aria-valuemin":i}),t.eq(1).attr({"aria-valuemax":r}),this._active==1?t.eq(1).attr({"aria-valuemin":n}):t.eq(0).attr({"aria-valuemax":n})):this.bar.children().attr({"aria-valuemin":i,"aria-valuemax":r})},_checkKO:function(){var f=this._dataElement().data("bind"),t,i,r,n,u;if(typeof f=="string"&&typeof ko=="object"){if(t=ko.dataFor(this._dataElement()[0]),typeof t=="undefined")return!0;for(i=f.split(","),n=0;nthis._end){if(!t)return i;n=this._start+(r<=this._end-r?0:this._end)}else if(t&&(u=this._handleDragDistance,this.isNumber(u)&&Math.abs(f-r)>u))return i;return n},_processStepByAngle:function(n){var t=this._angleToValue(n);return this._processStepByValue(t)},_processStepByValue:function(n){var r=this.options.step,e,t,u,f,i,o;return e=(n-this.options.min)%r,t=n-e,u=this._limitValue(t+r),f=this._limitValue(t-r),i=n>=t?n-tn-f?t:f,i=this._round(i),o=this._valueToAngle(i),{value:i,angle:o}},_round:function(n){var t=this.options.step.toString().split(".");return t[1]?parseFloat(n.toFixed(t[1].length)):Math.round(n)},_oriAngle:function(n){var t=n-this._start;return t<0&&(t+=360),t},_limitAngle:function(n){return n>360+this._start&&(n-=360),nthis.options.max&&(n=this.options.max),n},_angleToValue:function(n){var t=this.options;return this._oriAngle(n)/this._end*(t.max-t.min)+t.min},_valueToAngle:function(n){var t=this.options;return(n-t.min)/(t.max-t.min)*this._end+this._start},_appendHiddenField:function(){this._hiddenField=this._hiddenField||this.$createElement("input"),this._hiddenField.attr({type:"hidden",name:this._dataElement()[0].id||""}),this.control.append(this._hiddenField),this._updateHidden()},_updateHidden:function(){var n=this.options.value;this._hiddenField.val(n),(this._isKO||this._isAngular)&&this._hiddenField.trigger("change"),this._isAngular&&(this._scope()[this._ngName]=n)},_updateTooltip:function(){this.tooltip&&!this.tooltip.hasClass("hover")&&this.tooltip.html(this._getTooltipValue()),this._updateTooltipPos()},_updateTooltipPos:function(){this.tooltip&&this.tooltip.css(this._getTooltipPos())},_getTooltipPos:function(){var n=this.options.circleShape,t;if(n=="full"||n=="pie"||n.indexOf("custom")===0)return{"margin-top":-this.tooltip.outerHeight()/2,"margin-left":-this.tooltip.outerWidth()/2};if(n.indexOf("half")!=-1){switch(n){case"half-top":case"half-bottom":t={"margin-left":-this.tooltip.outerWidth()/2};break;case"half-left":case"half-right":t={"margin-top":-this.tooltip.outerHeight()/2}}return t}return{}},_getTooltipValue:function(n){if(this._rangeSlider){var t=this.options.value.split(",");return n?t[0]+" - "+t[1]:this._tooltipValue(t[0],1)+" - "+this._tooltipValue(t[1],2)}return n?this.options.value:this._tooltipValue(this.options.value)},_tooltipValue:function(n,t){var i=this._raise("tooltipFormat",{value:n,handle:this._handleArgs(t)});return i!=null&&typeof i!="boolean"?i:n},_validateStartAngle:function(){var n=this.options.startAngle;return n=(this.isNumber(n)?parseFloat(n):0)%360,n<0&&(n+=360),this.options.startAngle=n,n},_validateEndAngle:function(){var end=this.options.endAngle;if(typeof end=="string"&&this.isNumber(end)&&(end.charAt(0)==="+"||end.charAt(0)==="-"))try{end=eval(this.options.startAngle+end.charAt(0)+Math.abs(parseFloat(end)))}catch(e){console.warn(e)}return end=(this.isNumber(end)?parseFloat(end):360)%360,end<=this.options.startAngle&&(end+=360),end},_refreshCircleShape:function(){var n=this.options.circleShape,i=["half-top","half-bottom","half-left","half-right","quarter-top-left","quarter-top-right","quarter-bottom-right","quarter-bottom-left","pie","custom-half","custom-quarter"],t;i.indexOf(n)==-1&&(t=["h1","h2","h3","h4","q1","q2","q3","q4","3/4","ch","cq"].indexOf(n),n=t!=-1?i[t]:n=="half"?"half-top":n=="quarter"?"quarter-top-left":"full"),this.options.circleShape=n},_appendOverlay:function(){var n=this.options.circleShape;n=="pie"?this._checkOverlay(".rs-overlay",270):(n=="custom-half"||n=="custom-quarter")&&(this._checkOverlay(".rs-overlay1",180),n=="custom-quarter"&&this._checkOverlay(".rs-overlay2",this._end))},_checkOverlay:function(n,t){var i=this.container.children(n);i.length==0&&(i=this.$createElement("div"+n+" rs-transition rs-bg-color"),this.container.append(i)),i.rsRotate(this._start+t)},_checkDataType:function(){var i=this.options,r,n,t,u=this._props();for(r in u.numberType)n=u.numberType[r],t=i[n],i[n]=this.isNumber(t)?parseFloat(t):this.defaults[n];for(r in u.booleanType)n=u.booleanType[r],t=i[n],i[n]=t=="false"?!1:!!t;for(r in u.stringType)n=u.stringType[r],t=i[n],i[n]=(""+t).toLowerCase()},_validateSliderType:function(){var n=this.options.sliderType.toLowerCase();this._rangeSlider=this._showRange=!1,n=="range"?this._rangeSlider=this._showRange=!0:n.indexOf("min")!=-1?(this._showRange=!0,n="min-range"):n="default",this.options.sliderType=n},_updateStartEnd:function(){var n=this.options.circleShape;n!="full"&&(n.indexOf("quarter")!=-1?this.options.endAngle="+90":n.indexOf("half")!=-1?this.options.endAngle="+180":n=="pie"&&(this.options.endAngle="+270"),n=="quarter-top-left"||n=="half-top"?this.options.startAngle=0:n=="quarter-top-right"||n=="half-right"?this.options.startAngle=90:n=="quarter-bottom-right"||n=="half-bottom"?this.options.startAngle=180:(n=="quarter-bottom-left"||n=="half-left")&&(this.options.startAngle=270))},_validateStartEnd:function(){this._start=this._validateStartAngle(),this._end=this._validateEndAngle();var n=this._start=2?(r(i[0])?i[0]:t)+","+(r(i[1])?i[1]:e):r(i[0])?t+","+i[0]:t+","+t:r(n)?t+","+n:t+","+t:typeof n=="string"?(f=i.pop(),u=r(f)?parseFloat(f):t):u=r(n)?parseFloat(n):t,this.options.value=u},_validateModelValue:function(){var r=this.options.value,i;if(this._rangeSlider){var u=r.split(","),n=parseFloat(u[0]),t=parseFloat(u[1]);n=this._limitValue(n),t=this._limitValue(t),this._invertRange||n>t&&(t=n),this._handle1=this._processStepByValue(n),this._handle2=this._processStepByValue(t),this.options.value=this._handle1.value+","+this._handle2.value}else i=this._showRange?2:this._active||1,this["_handle"+i]=this._processStepByValue(this._limitValue(r)),this._showRange&&(this._handle1=this._handleDefaults()),this.options.value=this["_handle"+i].value},$createElement:function(n){var t=n.split(".");return $(document.createElement(t[0])).addClass(t[1]||"")},isNumber:function(n){return n=parseFloat(n),typeof n=="number"&&!isNaN(n)},getBrowserName:function(){var n="",t=window.navigator.userAgent;return!!window.opr&&!!opr.addons||!!window.opera||t.indexOf(" OPR/")>=0?n="opera":typeof InstallTrigger!="undefined"?n="firefox":/*@cc_on!@*/!1&&!document.documentMode?window.StyleMedia?n="edge":t.indexOf("Safari")!=-1&&t.indexOf("Chrome")==-1?n="safari":(!window.chrome||!window.chrome.webstore)&&t.indexOf("Chrome")==-1||(n="chrome"):n="ie",n},_isBrowserSupported:function(){for(var t=["borderRadius","WebkitBorderRadius","MozBorderRadius","OBorderRadius","msBorderRadius","KhtmlBorderRadius"],n=0;n