/*! nouislider - 9.1.0 - 2016-12-10 16:00:32 */ !function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}((function(){"use strict";function t(t,e){var n=document.createElement("div");return o(n,e),t.appendChild(n),n}function e(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function n(t,e,n){n>0&&(o(t,e),setTimeout((function(){s(t,e)}),n))}function r(t){return Array.isArray(t)?t:[t]}function i(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function o(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function s(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function a(){var t=void 0!==window.pageXOffset,e="CSS1Compat"===(document.compatMode||"");return{x:t?window.pageXOffset:e?document.documentElement.scrollLeft:document.body.scrollLeft,y:t?window.pageYOffset:e?document.documentElement.scrollTop:document.body.scrollTop}}function l(t,e){return 100/(e-t)}function u(t,e){return 100*e/(t[1]-t[0])}function c(t,e){for(var n=1;t>=e[n];)n+=1;return n}function p(t,e,n){if(n>=t.slice(-1)[0])return 100;var r,i,o,s,a=c(n,t);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],o+function(t,e){return u(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}([r,i],n)/l(o,s)}function f(t,e,n,r){if(100===r)return r;var i,o,s=c(r,t);return n?r-(i=t[s-1])>((o=t[s])-i)/2?o:i:e[s-1]?t[s-1]+function(t,e){return Math.round(t/e)*e}(r-t[s-1],e[s-1]):r}function d(t,n,r){var i;if("number"==typeof n&&(n=[n]),"[object Array]"!==Object.prototype.toString.call(n))throw new Error("noUiSlider: 'range' contains invalid value.");if(!e(i="min"===t?0:"max"===t?100:parseFloat(t))||!e(n[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");r.xPct.push(i),r.xVal.push(n[0]),i?r.xSteps.push(!isNaN(n[1])&&n[1]):isNaN(n[1])||(r.xSteps[0]=n[1]),r.xHighestCompleteStep.push(0)}function h(t,e,n){if(!e)return!0;n.xSteps[t]=u([n.xVal[t],n.xVal[t+1]],e)/l(n.xPct[t],n.xPct[t+1]);var r=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*i;n.xHighestCompleteStep[t]=o}function m(t,e,n,r){this.xPct=[],this.xVal=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e,this.direction=n;var i,o=[];for(i in t)t.hasOwnProperty(i)&&o.push([t[i],i]);for(o.length&&"object"==typeof o[0][0]?o.sort((function(t,e){return t[0][0]-e[0][0]})):o.sort((function(t,e){return t[0]-e[0]})),i=0;i=100)return t.slice(-1)[0];var r,i=c(n,e);return function(t,e){return e*(t[1]-t[0])/100+t[0]}([t[i-1],t[i]],(n-(r=e[i-1]))*l(r,e[i]))}(this.xVal,this.xPct,t)},m.prototype.getStep=function(t){return t=f(this.xPct,this.xSteps,this.snap,t)},m.prototype.getNearbySteps=function(t){var e=c(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},m.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(i);return Math.max.apply(null,t)},m.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var g={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};function v(t,n){if(!e(n))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=n}function b(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");t.spectrum=new m(e,t.snap,t.dir,t.singleStep)}function S(t,e){if(e=r(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function w(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function x(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function y(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function E(t,e){var n,r=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function M(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function k(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var n=e.indexOf("tap")>=0,r=e.indexOf("drag")>=0,i=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,s=e.indexOf("hover")>=0;if(i){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");N(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:r,fixed:i,snap:o,hover:s}}function O(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n",r[1]&&(s+="
"+n.to(r[0])+"
")}(r,t[r])})),r.innerHTML=s,r}function P(t){var e=t.mode,n=t.density||1,r=t.filter||!1,i=function(t,e,n){if("range"===t||"steps"===t)return w.xVal;if("count"===t){var r,i=100/(e-1),o=0;for(e=[];(r=o++*i)<=100;)e.push(r);t="positions"}return"positions"===t?e.map((function(t){return w.fromStepping(n?w.getStep(t):t)})):"values"===t?n?e.map((function(t){return w.fromStepping(w.getStep(w.toStepping(t)))})):e:void 0}(e,t.values||!1,t.stepped||!1),o=function(t,e,n){var r,i={},o=w.xVal[0],s=w.xVal[w.xVal.length-1],a=!1,l=!1,u=0;return r=n.slice().sort((function(t,e){return t-e})),(n=r.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==o&&(n.unshift(o),a=!0),n[n.length-1]!==s&&(n.push(s),l=!0),n.forEach((function(r,o){var s,c,p,f,d,h,m,g,v,b=r,S=n[o+1];if("steps"===e&&(s=w.xNumSteps[o]),s||(s=S-b),!1!==b&&void 0!==S)for(s=Math.max(s,1e-7),c=b;c<=S;c=(c+s).toFixed(7)/1){for(m=(d=(f=w.toStepping(c))-u)/t,v=d/(g=Math.round(m)),p=1;p<=g;p+=1)i[(u+p*v).toFixed(5)]=["x",0];h=n.indexOf(c)>-1?1:"steps"===e?2:0,!o&&a&&(h=0),c===S&&l||(i[f.toFixed(5)]=[c,h]),u=f}})),i}(n,e,i),s=t.format||{to:Math.round};return g.appendChild(U(o,r,s))}function M(){var t=u.getBoundingClientRect(),e="offset"+["Width","Height"][i.ort];return 0===i.ort?t.width||u[e]:t.height||u[e]}function k(t,e,n,r){var o=function(e){return!g.hasAttribute("disabled")&&(o=g,s=i.cssClasses.tap,!(o.classList?o.classList.contains(s):new RegExp("\\b"+s+"\\b").test(o.className))&&(!!(e=function(t,e){t.preventDefault();var n,r,i=0===t.type.indexOf("touch"),o=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");0===t.type.indexOf("MSPointer")&&(s=!0);if(i){if(t.touches.length>1)return!1;n=t.changedTouches[0].pageX,r=t.changedTouches[0].pageY}e=e||a(),(o||s)&&(n=t.clientX+e.x,r=t.clientY+e.y);return t.pageOffset=e,t.points=[n,r],t.cursor=o||s,t}(e,r.pageOffset))&&(!(t===m.start&&void 0!==e.buttons&&e.buttons>1)&&((!r.hover||!e.buttons)&&(e.calcPoint=e.points[i.ort],void n(e,r))))));var o,s},s=[];return t.split(" ").forEach((function(t){e.addEventListener(t,o,!1),s.push([t,o])})),s}function O(t){var e,n,r,o,s,l=100*(t-(e=u,n=i.ort,r=e.getBoundingClientRect(),o=e.ownerDocument.documentElement,s=a(),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(s.x=0),n?r.top+s.y-o.clientTop:r.left+s.x-o.clientLeft))/M();return i.dir?100-l:l}function V(t,e,n,r){var i=n.slice(),o=[!t,t],s=[t,!t];r=r.slice(),t&&r.reverse(),r.length>1?r.forEach((function(t,n){var r=q(i,t,i[t]+e,o[n],s[n]);!1===r?e=0:(e=r-i[t],i[t]=r)})):o=s=[!0];var a=!1;r.forEach((function(t,r){a=X(t,n[t]+e,o[r],s[r])||a})),a&&r.forEach((function(t){A("update",t),A("slide",t)}))}function A(t,e,n){Object.keys(y).forEach((function(r){var o=r.split(".")[0];t===o&&y[r].forEach((function(t){t.call(f,x.map(i.format.to),e,x.slice(),n||!1,v.slice())}))}))}function L(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&F(t,e)}function z(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return F(t,e);var n=(i.dir?-1:1)*(t.calcPoint-e.startCalcPoint);V(n>0,100*n/e.baseSize,e.locations,e.handleNumbers)}function F(t,e){S&&(s(S,i.cssClasses.active),S=!1),t.cursor&&(document.body.style.cursor="",document.body.removeEventListener("selectstart",document.body.noUiListener)),document.documentElement.noUiListeners.forEach((function(t){document.documentElement.removeEventListener(t[0],t[1])})),s(g,i.cssClasses.drag),B(),e.handleNumbers.forEach((function(t){A("set",t),A("change",t),A("end",t)}))}function j(t,e){if(1===e.handleNumbers.length){var n=c[e.handleNumbers[0]];if(n.hasAttribute("disabled"))return!1;o(S=n.children[0],i.cssClasses.active)}t.preventDefault(),t.stopPropagation();var r=k(m.move,document.documentElement,z,{startCalcPoint:t.calcPoint,baseSize:M(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:v.slice()}),s=k(m.end,document.documentElement,F,{handleNumbers:e.handleNumbers}),a=k("mouseout",document.documentElement,L,{handleNumbers:e.handleNumbers});if(document.documentElement.noUiListeners=r.concat(s,a),t.cursor){document.body.style.cursor=getComputedStyle(t.target).cursor,c.length>1&&o(g,i.cssClasses.drag);var l=function(){return!1};document.body.noUiListener=l,document.body.addEventListener("selectstart",l,!1)}e.handleNumbers.forEach((function(t){A("start",t)}))}function D(t){t.stopPropagation();var e=O(t.calcPoint),r=function(t){var e=100,n=!1;return c.forEach((function(r,i){if(!r.hasAttribute("disabled")){var o=Math.abs(v[i]-t);o1&&(r&&e>0&&(n=Math.max(n,t[e-1]+i.margin)),o&&e1&&i.limit&&(r&&e>0&&(n=Math.min(n,t[e-1]+i.limit)),o&&e50?-1:1,n=3+(c.length+e*t);c[t].childNodes[0].style.zIndex=n}))}function X(t,e,n,r){return!1!==(e=q(v,t,e,n,r))&&(function(t,e){v[t]=e,x[t]=w.fromStepping(e);var n=function(){c[t].style[i.style]=R(e),Y(t),Y(t+1)};window.requestAnimationFrame&&i.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}(t,e),!0)}function Y(t){if(p[t]){var e=0,n=100;0!==t&&(e=v[t-1]),t!==p.length-1&&(n=v[t]),p[t].style[i.style]=R(e),p[t].style[i.styleOposite]=R(100-n)}}function I(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=i.format.from(t))||isNaN(t)||X(e,w.toStepping(t),!1,!1))}function _(t,e){var o=r(t),s=void 0===v[0];e=void 0===e||!!e,o.forEach(I),i.animate&&!s&&n(g,i.cssClasses.tap,i.animationDuration),b.forEach((function(t){X(t,v[t],!0,!1)})),B(),b.forEach((function(t){A("update",t),null!==o[t]&&e&&A("set",t)}))}function W(){var t=x.map(i.format.to);return 1===t.length?t[0]:t}function $(t,e){y[t]=y[t]||[],y[t].push(e),"update"===t.split(".")[0]&&c.forEach((function(t,e){A("update",e)}))}if(g.noUiSlider)throw new Error("Slider was already initialized.");return function(e){o(e,i.cssClasses.target),0===i.dir?o(e,i.cssClasses.ltr):o(e,i.cssClasses.rtl),0===i.ort?o(e,i.cssClasses.horizontal):o(e,i.cssClasses.vertical),u=t(e,i.cssClasses.base)}(g),function(t,e){c=[],(p=[]).push(C(e,t[0]));for(var n=0;nn.stepAfter.startValue&&(i=n.stepAfter.startValue-r),o=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===t?i=null:0===t&&(o=null);var s=w.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,i]}))},on:$,off:function(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(y).forEach((function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete y[t]}))},get:W,set:_,reset:function(t){_(i.start,t)},__moveHandles:function(t,e,n){V(t,e,v,n)},options:l,updateOptions:function(t,e){var n=W(),r=["margin","limit","padding","range","animate","snap","step","format"];r.forEach((function(e){void 0!==t[e]&&(l[e]=t[e])}));var o=H(l);r.forEach((function(e){void 0!==t[e]&&(i[e]=o[e])})),o.spectrum.direction=w.direction,w=o.spectrum,i.margin=o.margin,i.limit=o.limit,i.padding=o.padding,v=[],_(t.start||n,e)},target:g,pips:P},(d=i.events).fixed||c.forEach((function(t,e){k(m.start,t.children[0],j,{handleNumbers:[e]})})),d.tap&&k(m.start,u,D,{}),d.hover&&k(m.move,u,T,{hover:!0}),d.drag&&p.forEach((function(t,e){if(!1!==t&&0!==e&&e!==p.length-1){var n=c[e-1],r=c[e],s=[t];o(t,i.cssClasses.draggable),d.fixed&&(s.push(n.children[0]),s.push(r.children[0])),s.forEach((function(t){k(m.start,t,j,{handles:[n,r],handleNumbers:[e-1,e]})}))}})),_(i.start),i.pips&&P(i.pips),i.tooltips&&(h=c.map(N),$("update",(function(t,e,n){if(h[e]){var r=t[e];!0!==i.tooltips[e]&&(r=i.tooltips[e].to(n[e])),h[e].innerHTML=""+r+""}}))),f}return{create:function(t,e){if(!t.nodeName)throw new Error("noUiSlider.create requires a single element.");void 0===e.tooltips&&(e.tooltips=!0);var n=F(t,H(e),e);return t.noUiSlider=n,n}}}));