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