materialize-sass 1.0.0.alpha3 → 1.0.0.alpha4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/assets/javascripts/materialize.js +289 -184
  4. data/assets/javascripts/materialize/autocomplete.js +7 -0
  5. data/assets/javascripts/materialize/buttons.js +1 -1
  6. data/assets/javascripts/materialize/chips.js +1 -1
  7. data/assets/javascripts/materialize/component.js +1 -1
  8. data/assets/javascripts/materialize/datepicker.js +30 -7
  9. data/assets/javascripts/materialize/dropdown.js +27 -16
  10. data/assets/javascripts/materialize/extras/nouislider.js +1 -1
  11. data/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  12. data/assets/javascripts/materialize/forms.js +8 -3
  13. data/assets/javascripts/materialize/global.js +12 -9
  14. data/assets/javascripts/materialize/materialbox.js +34 -13
  15. data/assets/javascripts/materialize/modal.js +16 -10
  16. data/assets/javascripts/materialize/parallax.js +6 -5
  17. data/assets/javascripts/materialize/select.js +26 -19
  18. data/assets/javascripts/materialize/sidenav.js +17 -3
  19. data/assets/javascripts/materialize/timepicker.js +19 -12
  20. data/assets/stylesheets/materialize/components/_badges.scss +8 -0
  21. data/assets/stylesheets/materialize/components/_buttons.scss +35 -37
  22. data/assets/stylesheets/materialize/components/_datepicker.scss +2 -2
  23. data/assets/stylesheets/materialize/components/_dropdown.scss +3 -1
  24. data/assets/stylesheets/materialize/components/_global.scss +11 -1
  25. data/assets/stylesheets/materialize/components/_sidenav.scss +1 -1
  26. data/assets/stylesheets/materialize/components/_timepicker.scss +2 -2
  27. data/assets/stylesheets/materialize/components/_variables.scss +11 -3
  28. data/assets/stylesheets/materialize/components/forms/_input-fields.scss +4 -3
  29. data/assets/stylesheets/materialize/components/forms/_select.scss +3 -2
  30. data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
  31. data/lib/materialize-sass/version.rb +1 -1
  32. metadata +2 -2
@@ -287,6 +287,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
287
287
  $(this.container).empty();
288
288
  this._resetCurrentElement();
289
289
  this.oldVal = null;
290
+ $(this.container).css({
291
+ display: ''
292
+ });
290
293
  this.isOpen = false;
291
294
  }
292
295
 
@@ -348,6 +351,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
348
351
  };
349
352
  matchingData.sort(sortFunctionBound);
350
353
 
354
+ $(this.container).css({
355
+ display: 'block'
356
+ });
357
+
351
358
  // Render
352
359
  for (var i = 0; i < matchingData.length; i++) {
353
360
  var _entry = matchingData[i];
@@ -325,7 +325,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
325
325
  var windowWidth = window.innerWidth;
326
326
  var windowHeight = window.innerHeight;
327
327
  var backdrop = this.$el.find('.fab-backdrop');
328
- var fabColor = anchor.css('background-color');
328
+ var fabColor = this.$anchor.css('background-color');
329
329
 
330
330
  this.offsetX = this.btnLeft - windowWidth / 2 + this.btnWidth / 2;
331
331
  this.offsetY = windowHeight - this.btnBottom;
@@ -297,7 +297,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
297
297
  _this2.$input[0].focus();
298
298
  };
299
299
 
300
- this.autocomplete = M.Autocomplete.init(this.$input, this.options.autocompleteOptions)[0];
300
+ this.autocomplete = M.Autocomplete.init(this.$input[0], this.options.autocompleteOptions);
301
301
  }
302
302
 
303
303
  /**
@@ -41,7 +41,7 @@ var Component = function () {
41
41
  var instances = null;
42
42
  if (els instanceof Element) {
43
43
  instances = new classDef(els, options);
44
- } else if (!!els.jquery || els instanceof NodeList) {
44
+ } else if (!!els && (els.jquery || els.cash || els instanceof NodeList)) {
45
45
  var instancesArr = [];
46
46
  for (var i = 0; i < els.length; i++) {
47
47
  instancesArr.push(new classDef(els[i], options));
@@ -69,8 +69,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
69
69
  nextMonth: '›',
70
70
  months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
71
71
  monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
72
- weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
73
72
  weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
73
+ weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
74
74
  weekdaysAbbrev: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
75
75
  },
76
76
 
@@ -107,6 +107,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
107
107
 
108
108
  _this.options = $.extend({}, Datepicker.defaults, options);
109
109
 
110
+ // make sure i18n defaults are not lost when only few i18n option properties are passed
111
+ if (!!options && options.hasOwnProperty('i18n') && typeof options.i18n === 'object') {
112
+ _this.options.i18n = $.extend({}, Datepicker.defaults.i18n, options.i18n);
113
+ }
114
+
110
115
  // Remove time component from minDate and maxDate options
111
116
  if (_this.options.minDate) _this.options.minDate.setHours(0, 0, 0, 0);
112
117
  if (_this.options.maxDate) _this.options.maxDate.setHours(0, 0, 0, 0);
@@ -574,13 +579,23 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
574
579
  html += this.renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId);
575
580
  }
576
581
 
582
+ // Destroy Materialize Select
583
+ var oldYearSelect = this.calendarEl.querySelector('.pika-select-year');
584
+ if (oldYearSelect) {
585
+ M.FormSelect.getInstance(oldYearSelect).destroy();
586
+ }
587
+ var oldMonthSelect = this.calendarEl.querySelector('.pika-select-month');
588
+ if (oldMonthSelect) {
589
+ M.FormSelect.getInstance(oldMonthSelect).destroy();
590
+ }
591
+
577
592
  this.calendarEl.innerHTML = html;
578
593
 
579
594
  // Init Materialize Select
580
595
  var yearSelect = this.calendarEl.querySelector('.pika-select-year');
581
596
  var monthSelect = this.calendarEl.querySelector('.pika-select-month');
582
- M.Select.init(yearSelect, { classes: 'select-year' });
583
- M.Select.init(monthSelect, { classes: 'select-month' });
597
+ M.FormSelect.init(yearSelect, { classes: 'select-year', dropdownOptions: { container: document.body, constrainWidth: false } });
598
+ M.FormSelect.init(monthSelect, { classes: 'select-month', dropdownOptions: { container: document.body, constrainWidth: false } });
584
599
 
585
600
  // Add change handlers for select
586
601
  yearSelect.addEventListener('change', this._handleYearChange.bind(this));
@@ -633,26 +648,34 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
633
648
 
634
649
  this.formats = {
635
650
 
636
- dd: function () {
651
+ d: function () {
637
652
  return _this4.date.getDate();
638
653
  },
654
+ dd: function () {
655
+ var d = _this4.date.getDate();
656
+ return (d < 10 ? '0' : '') + d;
657
+ },
639
658
  ddd: function () {
640
659
  return _this4.options.i18n.weekdaysShort[_this4.date.getDay()];
641
660
  },
642
661
  dddd: function () {
643
662
  return _this4.options.i18n.weekdays[_this4.date.getDay()];
644
663
  },
645
- mm: function () {
664
+ m: function () {
646
665
  return _this4.date.getMonth() + 1;
647
666
  },
667
+ mm: function () {
668
+ var m = _this4.date.getMonth() + 1;
669
+ return (m < 10 ? '0' : '') + m;
670
+ },
648
671
  mmm: function () {
649
672
  return _this4.options.i18n.monthsShort[_this4.date.getMonth()];
650
673
  },
651
674
  mmmm: function () {
652
- return _this4.options.i18n.monthsShort[_this4.date.getMonth()];
675
+ return _this4.options.i18n.months[_this4.date.getMonth()];
653
676
  },
654
677
  yy: function () {
655
- return _this4.date.getFullYear().slice(2);
678
+ return ('' + _this4.date.getFullYear()).slice(2);
656
679
  },
657
680
  yyyy: function () {
658
681
  return _this4.date.getFullYear();
@@ -14,6 +14,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
14
14
  var _defaults = {
15
15
  alignment: 'left',
16
16
  constrainWidth: true,
17
+ container: null,
17
18
  coverTrigger: true,
18
19
  closeOnClick: true,
19
20
  hover: false,
@@ -47,10 +48,18 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
47
48
  /**
48
49
  * Options for the dropdown
49
50
  * @member Dropdown#options
50
- * @prop {Function} onOpenStart - Function called when sidenav starts entering
51
- * @prop {Function} onOpenEnd - Function called when sidenav finishes entering
52
- * @prop {Function} onCloseStart - Function called when sidenav starts exiting
53
- * @prop {Function} onCloseEnd - Function called when sidenav finishes exiting
51
+ * @prop {String} [alignment='left'] - Edge which the dropdown is aligned to
52
+ * @prop {Boolean} [constrainWidth=true] - Constrain width to width of the button
53
+ * @prop {Element} container - Container element to attach dropdown to (optional)
54
+ * @prop {Boolean} [coverTrigger=true] - Place dropdown over trigger
55
+ * @prop {Boolean} [closeOnClick=true] - Close on click of dropdown item
56
+ * @prop {Boolean} [hover=false] - Open dropdown on hover
57
+ * @prop {Number} [inDuration=150] - Duration of open animation in ms
58
+ * @prop {Number} [outDuration=250] - Duration of close animation in ms
59
+ * @prop {Function} onOpenStart - Function called when dropdown starts opening
60
+ * @prop {Function} onOpenEnd - Function called when dropdown finishes opening
61
+ * @prop {Function} onCloseStart - Function called when dropdown starts closing
62
+ * @prop {Function} onCloseEnd - Function called when dropdown finishes closing
54
63
  */
55
64
  _this.options = $.extend({}, Dropdown.defaults, options);
56
65
 
@@ -64,7 +73,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
64
73
  _this.filterQuery = [];
65
74
 
66
75
  // Move dropdown-content after dropdown-trigger
67
- _this.$el.after(_this.dropdownEl);
76
+ if (!!_this.options.container) {
77
+ $(_this.options.container).append(_this.dropdownEl);
78
+ } else {
79
+ _this.$el.after(_this.dropdownEl);
80
+ }
68
81
 
69
82
  _this._makeDropdownFocusable();
70
83
  _this._resetFilterQueryBound = _this._resetFilterQuery.bind(_this);
@@ -137,6 +150,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
137
150
  value: function _setupTemporaryEventHandlers() {
138
151
  // Use capture phase event handler to prevent click
139
152
  document.body.addEventListener('click', this._handleDocumentClickBound, true);
153
+ document.body.addEventListener('touchend', this._handleDocumentClickBound);
140
154
  this.dropdownEl.addEventListener('keydown', this._handleDropdownKeydownBound);
141
155
  }
142
156
  }, {
@@ -144,6 +158,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
144
158
  value: function _removeTemporaryEventHandlers() {
145
159
  // Use capture phase event handler to prevent click
146
160
  document.body.removeEventListener('click', this._handleDocumentClickBound, true);
161
+ document.body.removeEventListener('touchend', this._handleDocumentClickBound);
147
162
  this.dropdownEl.removeEventListener('keydown', this._handleDropdownKeydownBound);
148
163
  }
149
164
  }, {
@@ -184,11 +199,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
184
199
  setTimeout(function () {
185
200
  _this2.close();
186
201
  }, 0);
187
- } else if ($target.closest('.dropdown-trigger').length) {
188
- setTimeout(function () {
189
- _this2.close();
190
- }, 0);
191
- } else if (!$target.closest('.dropdown-content').length) {
202
+ } else if ($target.closest('.dropdown-trigger').length || !$target.closest('.dropdown-content').length) {
192
203
  setTimeout(function () {
193
204
  _this2.close();
194
205
  }, 0);
@@ -301,15 +312,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
301
312
  key: '_getDropdownPosition',
302
313
  value: function _getDropdownPosition() {
303
314
  var offsetParentBRect = this.el.offsetParent.getBoundingClientRect();
304
- var triggerOffset = { left: this.el.offsetLeft, top: this.el.offsetTop, width: this.el.offsetWidth, height: this.el.offsetHeight };
305
- var dropdownOffset = { left: this.dropdownEl.offsetLeft, top: this.dropdownEl.offsetTop, width: this.dropdownEl.offsetWidth, height: this.dropdownEl.offsetHeight };
306
315
  var triggerBRect = this.el.getBoundingClientRect();
307
316
  var dropdownBRect = this.dropdownEl.getBoundingClientRect();
308
317
 
309
318
  var idealHeight = dropdownBRect.height;
310
319
  var idealWidth = dropdownBRect.width;
311
- var idealXPos = triggerOffset.left;
312
- var idealYPos = triggerOffset.top;
320
+ var idealXPos = triggerBRect.left - dropdownBRect.left;
321
+ var idealYPos = triggerBRect.top - dropdownBRect.top;
313
322
 
314
323
  var dropdownBounds = {
315
324
  left: idealXPos,
@@ -364,12 +373,14 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
364
373
  if (horizontalAlignment === 'right') {
365
374
  idealXPos = idealXPos - dropdownBRect.width + triggerBRect.width;
366
375
  }
367
- return { x: idealXPos,
376
+ return {
377
+ x: idealXPos,
368
378
  y: idealYPos,
369
379
  verticalAlignment: verticalAlignment,
370
380
  horizontalAlignment: horizontalAlignment,
371
381
  height: idealHeight,
372
- width: idealWidth };
382
+ width: idealWidth
383
+ };
373
384
  }
374
385
 
375
386
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Materialize v1.0.0-alpha.3 (http://materializecss.com)
2
+ * Materialize v1.0.0-alpha.4 (http://materializecss.com)
3
3
  * Copyright 2014-2015 Materialize
4
4
  * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
5
  */
@@ -1 +1 @@
1
- !function(){function t(t){return t.split("").reverse().join("")}function e(t,e,n){if((t[e]||t[n])&&t[e]===t[n])throw Error(e)}function n(e,n,r,i,o,s,a,u,l,c,p,f){a=f;var d,h=p="";return s&&(f=s(f)),!("number"!=typeof f||!isFinite(f))&&(e&&0===parseFloat(f.toFixed(e))&&(f=0),0>f&&(d=!0,f=Math.abs(f)),e&&(s=Math.pow(10,e),f=(Math.round(f*s)/s).toFixed(e)),-1!==(f=f.toString()).indexOf(".")&&(e=f.split("."),f=e[0],r&&(p=r+e[1])),n&&(f=t(f).match(/.{1,3}/g),f=t(f.join(t(n)))),d&&u&&(h+=u),i&&(h+=i),d&&l&&(h+=l),h=h+f+p,o&&(h+=o),c&&(h=c(h,a)),h)}function r(t,e,n,r,i,o,s,a,u,l,c,p){var f;return t="",c&&(p=c(p)),!(!p||"string"!=typeof p)&&(a&&p.substring(0,a.length)===a&&(p=p.replace(a,""),f=!0),r&&p.substring(0,r.length)===r&&(p=p.replace(r,"")),u&&p.substring(0,u.length)===u&&(p=p.replace(u,""),f=!0),i&&p.slice(-1*i.length)===i&&(p=p.slice(0,-1*i.length)),e&&(p=p.split(e).join("")),n&&(p=p.replace(n,".")),f&&(t+="-"),t=Number((t+p).replace(/[^0-9\.\-.]/g,"")),s&&(t=s(t)),!("number"!=typeof t||!isFinite(t))&&t)}function i(t,e,n){var r,i=[];for(r=0;r<o.length;r+=1)i.push(t[o[r]]);return i.push(n),e.apply("",i)}var o="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=function t(s){if(!(this instanceof t))return new t(s);"object"==typeof s&&(s=function(t){var n,r,i,s={};for(n=0;n<o.length;n+=1)r=o[n],i=t[r],void 0===i?s[r]="negative"!==r||s.negativeBefore?"mark"===r&&"."!==s.thousand&&".":"-":"decimals"===r?0<i&&8>i&&(s[r]=i):"encoder"===r||"decoder"===r||"edit"===r||"undo"===r?"function"==typeof i&&(s[r]=i):"string"==typeof i&&(s[r]=i);return e(s,"mark","thousand"),e(s,"prefix","negative"),e(s,"prefix","negativeBefore"),s}(s),this.to=function(t){return i(s,n,t)},this.from=function(t){return i(s,r,t)})}}(),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 u(t,e){return 100/(e-t)}function l(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+(p=[r,i],f=n,l(p,p[0]<0?f+Math.abs(p[0]):f-p[0])/u(o,s));var p,f}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]+(a=r-t[s-1],u=e[s-1],Math.round(a/u)*u):r;var a,u}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]=l([n.xVal[t],n.xVal[t+1]],e)/u(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<o.length;i++)d(o[i][1],o[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)h(i,this.xNumSteps[i],this)}m.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&l(this.xVal,t)},m.prototype.toStepping=function(t){return t=p(this.xVal,this.xPct,t)},m.prototype.fromStepping=function(t){return function(t,e,n){if(n>=100)return t.slice(-1)[0];var r,i,o,s,a=c(n,e);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],l=[r,i],(n-o)*u(o,s)*(l[1]-l[0])/100+l[0];var l}(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 w(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 S(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<t.handles;n++)r.push(e);r.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");r=e}t.connect=r}function C(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function N(t,n){if(!e(n))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==n&&(t.margin=t.spectrum.getMargin(n),!t.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function U(t,n){if(!e(n))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(n),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function M(t,n){if(!e(n))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==n){if(t.padding=t.spectrum.getMargin(n),!t.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(t.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(t.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function P(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<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=r(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function V(t,e){if(t.format=e,"function"==typeof e.to&&"function"==typeof e.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function A(t,e){if(void 0!==e&&"string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function L(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix){t.cssClasses={};for(var n in e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n])}else t.cssClasses=e}function F(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function j(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:g},n={step:{r:!1,t:v},start:{r:!0,t:w},connect:{r:!0,t:E},direction:{r:!0,t:P},snap:{r:!1,t:S},animate:{r:!1,t:x},animationDuration:{r:!1,t:y},range:{r:!0,t:b},orientation:{r:!1,t:C},margin:{r:!1,t:N},limit:{r:!1,t:U},padding:{r:!1,t:M},behaviour:{r:!0,t:k},format:{r:!1,t:V},tooltips:{r:!1,t:O},cssPrefix:{r:!1,t:A},cssClasses:{r:!1,t:L},useRequestAnimationFrame:{r:!1,t:F}},r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleTouchArea:"handle-touch-area",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(n).forEach(function(i){if(void 0===t[i]&&void 0===r[i]){if(n[i].r)throw new Error("noUiSlider: '"+i+"' is required.");return!0}n[i].t(e,void 0===t[i]?r[i]:t[i])}),e.pips=t.pips;var i=[["left","top"],["right","bottom"]];return e.style=i[e.dir][e.ort],e.styleOposite=i[e.dir?0:1][e.ort],e}function z(e,i,u){var l,c,p,f,d=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},h=e,m=[],g=[],v=!1,b=i.spectrum,w=[],S={};function x(e,n){var r=t(e,i.cssClasses.origin),s=t(r,i.cssClasses.handle);return t(s,i.cssClasses.handleTouchArea),s.setAttribute("data-handle",n),0===n?o(s,i.cssClasses.handleLower):n===i.handles-1&&o(s,i.cssClasses.handleUpper),r}function y(e,n){return!!n&&t(e,i.cssClasses.connect)}function E(e,n){return!!i.tooltips[n]&&t(e.firstChild,i.cssClasses.tooltip)}function C(t,e,n){var r=document.createElement("div"),s="",a=[i.cssClasses.valueNormal,i.cssClasses.valueLarge,i.cssClasses.valueSub],u=[i.cssClasses.markerNormal,i.cssClasses.markerLarge,i.cssClasses.markerSub],l=[i.cssClasses.valueHorizontal,i.cssClasses.valueVertical],c=[i.cssClasses.markerHorizontal,i.cssClasses.markerVertical];o(r,i.cssClasses.pips),o(r,0===i.ort?i.cssClasses.pipsHorizontal:i.cssClasses.pipsVertical);function p(t,e,n){return'class="'+function(t,e){var n=e===i.cssClasses.value,r=n?a:u;return e+" "+(n?l:c)[i.ort]+" "+r[t]}(n[1],e)+'" style="'+i.style+": "+t+'%"'}return Object.keys(t).forEach(function(r){o=r,(a=t[r])[1]=a[1]&&e?e(a[0],a[1]):a[1],s+="<div "+p(o,i.cssClasses.marker,a)+"></div>",a[1]&&(s+="<div "+p(o,i.cssClasses.value,a)+">"+n.to(a[0])+"</div>");var o,a}),r.innerHTML=s,r}function N(t){var e=t.mode,n=t.density||1,r=t.filter||!1,i=function(t,e,n){var r={},i=b.xVal[0],o=b.xVal[b.xVal.length-1],s=!1,a=!1,u=0;l=n.slice().sort(function(t,e){return t-e});var l;return(n=l.filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==i&&(n.unshift(i),s=!0),n[n.length-1]!==o&&(n.push(o),a=!0),n.forEach(function(i,o){var l,c,p,f,d,h,m,g,v,w=i,S=n[o+1];if("steps"===e&&(l=b.xNumSteps[o]),l||(l=S-w),!1!==w&&void 0!==S){for(l=Math.max(l,1e-7),c=w;c<=S;x=c,y=l,c=(x+y).toFixed(7)/1){for(m=(d=(f=b.toStepping(c))-u)/t,v=d/(g=Math.round(m)),p=1;p<=g;p+=1)r[(u+p*v).toFixed(5)]=["x",0];h=n.indexOf(c)>-1?1:"steps"===e?2:0,!o&&s&&(h=0),c===S&&a||(r[f.toFixed(5)]=[c,h]),u=f}var x,y}}),r}(n,e,function(t,e,n){if("range"===t||"steps"===t)return b.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 b.fromStepping(n?b.getStep(t):t)}):"values"===t?n?e.map(function(t){return b.fromStepping(b.getStep(b.toStepping(t)))}):e:void 0}(e,t.values||!1,t.stepped||!1)),o=t.format||{to:Math.round};return h.appendChild(C(i,r,o))}function U(){var t=l.getBoundingClientRect(),e="offset"+["Width","Height"][i.ort];return 0===i.ort?t.width||l[e]:t.height||l[e]}function M(t,e,n,r){var o=function(e){if(h.hasAttribute("disabled"))return!1;if(o=h,s=i.cssClasses.tap,o.classList?o.classList.contains(s):new RegExp("\\b"+s+"\\b").test(o.className))return!1;var o,s;return!!(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===d.start&&void 0!==e.buttons&&e.buttons>1)&&((!r.hover||!e.buttons)&&(e.calcPoint=e.points[i.ort],void n(e,r))))},s=[];return t.split(" ").forEach(function(t){e.addEventListener(t,o,!1),s.push([t,o])}),s}function P(t){var e=100*(t-function(t,e){var n=t.getBoundingClientRect(),r=t.ownerDocument.documentElement,i=a();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(i.x=0),e?n.top+i.y-r.clientTop:n.left+i.x-r.clientLeft}(l,i.ort))/U();return i.dir?100-e:e}function k(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=D(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=R(t,n[t]+e,o[r],s[r])||a}),a&&r.forEach(function(t){O("update",t),O("slide",t)})}function O(t,e,n){Object.keys(S).forEach(function(r){var o=r.split(".")[0];t===o&&S[r].forEach(function(t){t.call(f,w.map(i.format.to),e,w.slice(),n||!1,m.slice())})})}function V(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&L(t,e)}function A(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return L(t,e);var n=(i.dir?-1:1)*(t.calcPoint-e.startCalcPoint);k(n>0,100*n/e.baseSize,e.locations,e.handleNumbers)}function L(t,e){v&&(s(v,i.cssClasses.active),v=!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(h,i.cssClasses.drag),q(),e.handleNumbers.forEach(function(t){O("set",t),O("change",t),O("end",t)})}function F(t,e){if(1===e.handleNumbers.length){var n=c[e.handleNumbers[0]];if(n.hasAttribute("disabled"))return!1;o(v=n.children[0],i.cssClasses.active)}t.preventDefault(),t.stopPropagation();var r=M(d.move,document.documentElement,A,{startCalcPoint:t.calcPoint,baseSize:U(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:m.slice()}),s=M(d.end,document.documentElement,L,{handleNumbers:e.handleNumbers}),a=M("mouseout",document.documentElement,V,{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(h,i.cssClasses.drag);var u=function(){return!1};document.body.noUiListener=u,document.body.addEventListener("selectstart",u,!1)}e.handleNumbers.forEach(function(t){O("start",t)})}function z(t){t.stopPropagation();var e=P(t.calcPoint),r=function(t){var e=100,n=!1;return c.forEach(function(r,i){if(!r.hasAttribute("disabled")){var o=Math.abs(m[i]-t);o<e&&(n=i,e=o)}}),n}(e);if(!1===r)return!1;i.events.snap||n(h,i.cssClasses.tap,i.animationDuration),R(r,e,!0,!0),q(),O("slide",r,!0),O("set",r,!0),O("change",r,!0),O("update",r,!0),i.events.snap&&F(t,{handleNumbers:[r]})}function H(t){var e=P(t.calcPoint),n=b.getStep(e),r=b.fromStepping(n);Object.keys(S).forEach(function(t){"hover"===t.split(".")[0]&&S[t].forEach(function(t){t.call(f,r)})})}function D(t,e,n,r,o){c.length>1&&(r&&e>0&&(n=Math.max(n,t[e-1]+i.margin)),o&&e<c.length-1&&(n=Math.min(n,t[e+1]-i.margin))),c.length>1&&i.limit&&(r&&e>0&&(n=Math.min(n,t[e-1]+i.limit)),o&&e<c.length-1&&(n=Math.max(n,t[e+1]-i.limit))),i.padding&&(0===e&&(n=Math.max(n,i.padding)),e===c.length-1&&(n=Math.min(n,100-i.padding))),n=b.getStep(n),s=n;var s;return(n=Math.max(Math.min(s,100),0))!==t[e]&&n}function T(t){return t+"%"}function q(){g.forEach(function(t){var e=m[t]>50?-1:1,n=3+(c.length+e*t);c[t].childNodes[0].style.zIndex=n})}function R(t,e,n,r){return!1!==(e=D(m,t,e,n,r))&&(function(t,e){m[t]=e,w[t]=b.fromStepping(e);var n=function(){c[t].style[i.style]=T(e),B(t),B(t+1)};window.requestAnimationFrame&&i.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}(t,e),!0)}function B(t){if(p[t]){var e=0,n=100;0!==t&&(e=m[t-1]),t!==p.length-1&&(n=m[t]),p[t].style[i.style]=T(e),p[t].style[i.styleOposite]=T(100-n)}}function X(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=i.format.from(t))||isNaN(t)||R(e,b.toStepping(t),!1,!1))}function Y(t,e){var o=r(t),s=void 0===m[0];e=void 0===e||!!e,o.forEach(X),i.animate&&!s&&n(h,i.cssClasses.tap,i.animationDuration),g.forEach(function(t){R(t,m[t],!0,!1)}),q(),g.forEach(function(t){O("update",t),null!==o[t]&&e&&O("set",t)})}function I(){var t=w.map(i.format.to);return 1===t.length?t[0]:t}function _(t,e){S[t]=S[t]||[],S[t].push(e),"update"===t.split(".")[0]&&c.forEach(function(t,e){O("update",e)})}if(h.noUiSlider)throw new Error("Slider was already initialized.");o(W=h,i.cssClasses.target),0===i.dir?o(W,i.cssClasses.ltr):o(W,i.cssClasses.rtl),0===i.ort?o(W,i.cssClasses.horizontal):o(W,i.cssClasses.vertical),l=t(W,i.cssClasses.base);var W;!function(t,e){c=[],(p=[]).push(y(e,t[0]));for(var n=0;n<i.handles;n++)c.push(x(e,n)),g[n]=n,p.push(y(e,t[n+1]))}(i.connect,l),f={destroy:function(){for(var t in i.cssClasses)i.cssClasses.hasOwnProperty(t)&&s(h,i.cssClasses[t]);for(;h.firstChild;)h.removeChild(h.firstChild);delete h.noUiSlider},steps:function(){return m.map(function(t,e){var n=b.getNearbySteps(t),r=w[e],i=n.thisStep.step,o=null;!1!==i&&r+i>n.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=b.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(S).forEach(function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete S[t]})},get:I,set:Y,reset:function(t){Y(i.start,t)},__moveHandles:function(t,e,n){k(t,e,m,n)},options:u,updateOptions:function(t,e){var n=I(),r=["margin","limit","padding","range","animate","snap","step","format"];r.forEach(function(e){void 0!==t[e]&&(u[e]=t[e])});var o=j(u);r.forEach(function(e){void 0!==t[e]&&(i[e]=o[e])}),o.spectrum.direction=b.direction,b=o.spectrum,i.margin=o.margin,i.limit=o.limit,i.padding=o.padding,m=[],Y(t.start||n,e)},target:h,pips:N},($=i.events).fixed||c.forEach(function(t,e){M(d.start,t.children[0],F,{handleNumbers:[e]})}),$.tap&&M(d.start,l,z,{}),$.hover&&M(d.move,l,H,{hover:!0}),$.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),$.fixed&&(s.push(n.children[0]),s.push(r.children[0])),s.forEach(function(t){M(d.start,t,F,{handles:[n,r],handleNumbers:[e-1,e]})})}});var $;return Y(i.start),i.pips&&N(i.pips),i.tooltips&&function(){var t=c.map(E);_("update",function(e,n,r){if(t[n]){var o=e[n];!0!==i.tooltips[n]&&(o=i.tooltips[n].to(r[n])),t[n].innerHTML="<span>"+o+"</span>"}})}(),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=z(t,j(e),e);return t.noUiSlider=n,n}}});
1
+ !function(){function t(t){return t.split("").reverse().join("")}function e(t,e,n){if((t[e]||t[n])&&t[e]===t[n])throw Error(e)}function n(e,n,r,i,o,s,a,u,l,c,f,p){a=p;var d,h=f="";return s&&(p=s(p)),!("number"!=typeof p||!isFinite(p))&&(e&&0===parseFloat(p.toFixed(e))&&(p=0),0>p&&(d=!0,p=Math.abs(p)),e&&(s=Math.pow(10,e),p=(Math.round(p*s)/s).toFixed(e)),-1!==(p=p.toString()).indexOf(".")&&(e=p.split("."),p=e[0],r&&(f=r+e[1])),n&&(p=t(p).match(/.{1,3}/g),p=t(p.join(t(n)))),d&&u&&(h+=u),i&&(h+=i),d&&l&&(h+=l),h=h+p+f,o&&(h+=o),c&&(h=c(h,a)),h)}function r(t,e,n,r,i,o,s,a,u,l,c,f){var p;return t="",c&&(f=c(f)),!(!f||"string"!=typeof f)&&(a&&f.substring(0,a.length)===a&&(f=f.replace(a,""),p=!0),r&&f.substring(0,r.length)===r&&(f=f.replace(r,"")),u&&f.substring(0,u.length)===u&&(f=f.replace(u,""),p=!0),i&&f.slice(-1*i.length)===i&&(f=f.slice(0,-1*i.length)),e&&(f=f.split(e).join("")),n&&(f=f.replace(n,".")),p&&(t+="-"),t=Number((t+f).replace(/[^0-9\.\-.]/g,"")),s&&(t=s(t)),!("number"!=typeof t||!isFinite(t))&&t)}function i(t){var n,r,i,o={};for(n=0;n<a.length;n+=1)r=a[n],void 0===(i=t[r])?o[r]="negative"!==r||o.negativeBefore?"mark"===r&&"."!==o.thousand&&".":"-":"decimals"===r?0<i&&8>i&&(o[r]=i):"encoder"===r||"decoder"===r||"edit"===r||"undo"===r?"function"==typeof i&&(o[r]=i):"string"==typeof i&&(o[r]=i);return e(o,"mark","thousand"),e(o,"prefix","negative"),e(o,"prefix","negativeBefore"),o}function o(t,e,n){var r,i=[];for(r=0;r<a.length;r+=1)i.push(t[a[r]]);return i.push(n),e.apply("",i)}function s(t){if(!(this instanceof s))return new s(t);"object"==typeof t&&(t=i(t),this.to=function(e){return o(t,n,e)},this.from=function(e){return o(t,r,e)})}var a="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=s}(),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 l(n,e),t.appendChild(n),n}function e(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}function n(t,e){return Math.round(t/e)*e}function r(t,e){var n=t.getBoundingClientRect(),r=t.ownerDocument.documentElement,i=p();return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(i.x=0),e?n.top+i.y-r.clientTop:n.left+i.x-r.clientLeft}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function o(t,e,n){n>0&&(l(t,e),setTimeout(function(){c(t,e)},n))}function s(t){return Math.max(Math.min(t,100),0)}function a(t){return Array.isArray(t)?t:[t]}function u(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 c(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function p(){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 d(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function h(t,e){return 100/(e-t)}function m(t,e){return 100*e/(t[1]-t[0])}function g(t,e){return m(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}function v(t,e){return e*(t[1]-t[0])/100+t[0]}function b(t,e){for(var n=1;t>=e[n];)n+=1;return n}function w(t,e,n){if(n>=t.slice(-1)[0])return 100;var r,i,o,s,a=b(n,t);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],o+g([r,i],n)/h(o,s)}function S(t,e,n){if(n>=100)return t.slice(-1)[0];var r,i,o,s,a=b(n,e);return r=t[a-1],i=t[a],o=e[a-1],s=e[a],v([r,i],(n-o)*h(o,s))}function x(t,e,r,i){if(100===i)return i;var o,s,a=b(i,t);return r?(o=t[a-1],s=t[a],i-o>(s-o)/2?s:o):e[a-1]?t[a-1]+n(i-t[a-1],e[a-1]):i}function y(t,e,n){var r;if("number"==typeof e&&(e=[e]),"[object Array]"!==Object.prototype.toString.call(e))throw new Error("noUiSlider: 'range' contains invalid value.");if(r="min"===t?0:"max"===t?100:parseFloat(t),!i(r)||!i(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");n.xPct.push(r),n.xVal.push(e[0]),r?n.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(n.xSteps[0]=e[1]),n.xHighestCompleteStep.push(0)}function E(t,e,n){if(!e)return!0;n.xSteps[t]=m([n.xVal[t],n.xVal[t+1]],e)/h(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 C(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<o.length;i++)y(o[i][1],o[i][0],this);for(this.xNumSteps=this.xSteps.slice(0),i=0;i<this.xNumSteps.length;i++)E(i,this.xNumSteps[i],this)}function N(t,e){if(!i(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function U(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 C(e,t.snap,t.dir,t.singleStep)}function M(t,e){if(e=a(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function P(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.")}function k(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.")}function O(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.")}function V(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<t.handles;n++)r.push(e);r.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");r=e}t.connect=r}function A(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function L(t,e){if(!i(e))throw new Error("noUiSlider: 'margin' option must be numeric.");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.")}function F(t,e){if(!i(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function j(t,e){if(!i(e))throw new Error("noUiSlider: 'padding' option must be numeric.");if(0!==e){if(t.padding=t.spectrum.getMargin(e),!t.padding)throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");if(t.padding<0)throw new Error("noUiSlider: 'padding' option must be a positive number.");if(t.padding>=50)throw new Error("noUiSlider: 'padding' option must be less than half the range.")}}function z(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 H(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");L(t,t.start[1]-t.start[0])}t.events={tap:n||o,drag:r,fixed:i,snap:o,hover:s}}function D(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=a(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")})}}function T(t,e){if(t.format=e,"function"==typeof e.to&&"function"==typeof e.from)return!0;throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.")}function q(t,e){if(void 0!==e&&"string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function R(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider: 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix){t.cssClasses={};for(var n in e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n])}else t.cssClasses=e}function B(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function X(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,format:I},n={step:{r:!1,t:N},start:{r:!0,t:M},connect:{r:!0,t:V},direction:{r:!0,t:z},snap:{r:!1,t:P},animate:{r:!1,t:k},animationDuration:{r:!1,t:O},range:{r:!0,t:U},orientation:{r:!1,t:A},margin:{r:!1,t:L},limit:{r:!1,t:F},padding:{r:!1,t:j},behaviour:{r:!0,t:H},format:{r:!1,t:T},tooltips:{r:!1,t:D},cssPrefix:{r:!1,t:q},cssClasses:{r:!1,t:R},useRequestAnimationFrame:{r:!1,t:B}},r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleTouchArea:"handle-touch-area",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};Object.keys(n).forEach(function(i){if(void 0===t[i]&&void 0===r[i]){if(n[i].r)throw new Error("noUiSlider: '"+i+"' is required.");return!0}n[i].t(e,void 0===t[i]?r[i]:t[i])}),e.pips=t.pips;var i=[["left","top"],["right","bottom"]];return e.style=i[e.dir][e.ort],e.styleOposite=i[e.dir?0:1][e.ort],e}function Y(n,i,u){function h(e,n){var r=t(e,i.cssClasses.origin),o=t(r,i.cssClasses.handle);return t(o,i.cssClasses.handleTouchArea),o.setAttribute("data-handle",n),0===n?l(o,i.cssClasses.handleLower):n===i.handles-1&&l(o,i.cssClasses.handleUpper),r}function m(e,n){return!!n&&t(e,i.cssClasses.connect)}function g(e,n){return!!i.tooltips[n]&&t(e.firstChild,i.cssClasses.tooltip)}function v(t,e,n){if("range"===t||"steps"===t)return tt.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 tt.fromStepping(n?tt.getStep(t):t)}):"values"===t?n?e.map(function(t){return tt.fromStepping(tt.getStep(tt.toStepping(t)))}):e:void 0}function b(t,n,r){function i(t,e){return(t+e).toFixed(7)/1}var o={},s=tt.xVal[0],a=tt.xVal[tt.xVal.length-1],u=!1,l=!1,c=0;return(r=e(r.slice().sort(function(t,e){return t-e})))[0]!==s&&(r.unshift(s),u=!0),r[r.length-1]!==a&&(r.push(a),l=!0),r.forEach(function(e,s){var a,f,p,d,h,m,g,v,b,w=e,S=r[s+1];if("steps"===n&&(a=tt.xNumSteps[s]),a||(a=S-w),!1!==w&&void 0!==S)for(a=Math.max(a,1e-7),f=w;f<=S;f=i(f,a)){for(g=(h=(d=tt.toStepping(f))-c)/t,b=h/(v=Math.round(g)),p=1;p<=v;p+=1)o[(c+p*b).toFixed(5)]=["x",0];m=r.indexOf(f)>-1?1:"steps"===n?2:0,!s&&u&&(m=0),f===S&&l||(o[d.toFixed(5)]=[f,m]),c=d}}),o}function w(t,e,n){function r(t,e){var n=e===i.cssClasses.value,r=n?p:d,o=n?c:f;return e+" "+r[i.ort]+" "+o[t]}function o(t,e,n){return'class="'+r(n[1],e)+'" style="'+i.style+": "+t+'%"'}function s(t,r){r[1]=r[1]&&e?e(r[0],r[1]):r[1],u+="<div "+o(t,i.cssClasses.marker,r)+"></div>",r[1]&&(u+="<div "+o(t,i.cssClasses.value,r)+">"+n.to(r[0])+"</div>")}var a=document.createElement("div"),u="",c=[i.cssClasses.valueNormal,i.cssClasses.valueLarge,i.cssClasses.valueSub],f=[i.cssClasses.markerNormal,i.cssClasses.markerLarge,i.cssClasses.markerSub],p=[i.cssClasses.valueHorizontal,i.cssClasses.valueVertical],d=[i.cssClasses.markerHorizontal,i.cssClasses.markerVertical];return l(a,i.cssClasses.pips),l(a,0===i.ort?i.cssClasses.pipsHorizontal:i.cssClasses.pipsVertical),Object.keys(t).forEach(function(e){s(e,t[e])}),a.innerHTML=u,a}function S(t){var e=t.mode,n=t.density||1,r=t.filter||!1,i=b(n,e,v(e,t.values||!1,t.stepped||!1)),o=t.format||{to:Math.round};return J.appendChild(w(i,r,o))}function x(){var t=I.getBoundingClientRect(),e="offset"+["Width","Height"][i.ort];return 0===i.ort?t.width||I[e]:t.height||I[e]}function y(t,e,n,r){var o=function(e){return!J.hasAttribute("disabled")&&(!f(J,i.cssClasses.tap)&&(!!(e=E(e,r.pageOffset))&&(!(t===G.start&&void 0!==e.buttons&&e.buttons>1)&&((!r.hover||!e.buttons)&&(e.calcPoint=e.points[i.ort],void n(e,r))))))},s=[];return t.split(" ").forEach(function(t){e.addEventListener(t,o,!1),s.push([t,o])}),s}function E(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");if(0===t.type.indexOf("MSPointer")&&(s=!0),i){if(t.touches.length>1)return!1;n=t.changedTouches[0].pageX,r=t.changedTouches[0].pageY}return e=e||p(),(o||s)&&(n=t.clientX+e.x,r=t.clientY+e.y),t.pageOffset=e,t.points=[n,r],t.cursor=o||s,t}function C(t){var e=100*(t-r(I,i.ort))/x();return i.dir?100-e:e}function N(t){var e=100,n=!1;return _.forEach(function(r,i){if(!r.hasAttribute("disabled")){var o=Math.abs(K[i]-t);o<e&&(n=i,e=o)}}),n}function U(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=F(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=D(t,n[t]+e,o[r],s[r])||a}),a&&r.forEach(function(t){M("update",t),M("slide",t)})}function M(t,e,n){Object.keys(nt).forEach(function(r){var o=r.split(".")[0];t===o&&nt[r].forEach(function(t){t.call($,et.map(i.format.to),e,et.slice(),n||!1,K.slice())})})}function P(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&O(t,e)}function k(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return O(t,e);var n=(i.dir?-1:1)*(t.calcPoint-e.startCalcPoint);U(n>0,100*n/e.baseSize,e.locations,e.handleNumbers)}function O(t,e){Z&&(c(Z,i.cssClasses.active),Z=!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])}),c(J,i.cssClasses.drag),H(),e.handleNumbers.forEach(function(t){M("set",t),M("change",t),M("end",t)})}function V(t,e){if(1===e.handleNumbers.length){var n=_[e.handleNumbers[0]];if(n.hasAttribute("disabled"))return!1;l(Z=n.children[0],i.cssClasses.active)}t.preventDefault(),t.stopPropagation();var r=y(G.move,document.documentElement,k,{startCalcPoint:t.calcPoint,baseSize:x(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:K.slice()}),o=y(G.end,document.documentElement,O,{handleNumbers:e.handleNumbers}),s=y("mouseout",document.documentElement,P,{handleNumbers:e.handleNumbers});if(document.documentElement.noUiListeners=r.concat(o,s),t.cursor){document.body.style.cursor=getComputedStyle(t.target).cursor,_.length>1&&l(J,i.cssClasses.drag);var a=function(){return!1};document.body.noUiListener=a,document.body.addEventListener("selectstart",a,!1)}e.handleNumbers.forEach(function(t){M("start",t)})}function A(t){t.stopPropagation();var e=C(t.calcPoint),n=N(e);if(!1===n)return!1;i.events.snap||o(J,i.cssClasses.tap,i.animationDuration),D(n,e,!0,!0),H(),M("slide",n,!0),M("set",n,!0),M("change",n,!0),M("update",n,!0),i.events.snap&&V(t,{handleNumbers:[n]})}function L(t){var e=C(t.calcPoint),n=tt.getStep(e),r=tt.fromStepping(n);Object.keys(nt).forEach(function(t){"hover"===t.split(".")[0]&&nt[t].forEach(function(t){t.call($,r)})})}function F(t,e,n,r,o){return _.length>1&&(r&&e>0&&(n=Math.max(n,t[e-1]+i.margin)),o&&e<_.length-1&&(n=Math.min(n,t[e+1]-i.margin))),_.length>1&&i.limit&&(r&&e>0&&(n=Math.min(n,t[e-1]+i.limit)),o&&e<_.length-1&&(n=Math.max(n,t[e+1]-i.limit))),i.padding&&(0===e&&(n=Math.max(n,i.padding)),e===_.length-1&&(n=Math.min(n,100-i.padding))),n=tt.getStep(n),(n=s(n))!==t[e]&&n}function j(t){return t+"%"}function z(t,e){K[t]=e,et[t]=tt.fromStepping(e);var n=function(){_[t].style[i.style]=j(e),T(t),T(t+1)};window.requestAnimationFrame&&i.useRequestAnimationFrame?window.requestAnimationFrame(n):n()}function H(){Q.forEach(function(t){var e=K[t]>50?-1:1,n=3+(_.length+e*t);_[t].childNodes[0].style.zIndex=n})}function D(t,e,n,r){return!1!==(e=F(K,t,e,n,r))&&(z(t,e),!0)}function T(t){if(W[t]){var e=0,n=100;0!==t&&(e=K[t-1]),t!==W.length-1&&(n=K[t]),W[t].style[i.style]=j(e),W[t].style[i.styleOposite]=j(100-n)}}function q(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=i.format.from(t))||isNaN(t)||D(e,tt.toStepping(t),!1,!1))}function R(t,e){var n=a(t),r=void 0===K[0];e=void 0===e||!!e,n.forEach(q),i.animate&&!r&&o(J,i.cssClasses.tap,i.animationDuration),Q.forEach(function(t){D(t,K[t],!0,!1)}),H(),Q.forEach(function(t){M("update",t),null!==n[t]&&e&&M("set",t)})}function B(){var t=et.map(i.format.to);return 1===t.length?t[0]:t}function Y(t,e){nt[t]=nt[t]||[],nt[t].push(e),"update"===t.split(".")[0]&&_.forEach(function(t,e){M("update",e)})}var I,_,W,$,G=d(),J=n,K=[],Q=[],Z=!1,tt=i.spectrum,et=[],nt={};if(J.noUiSlider)throw new Error("Slider was already initialized.");return function(e){l(e,i.cssClasses.target),0===i.dir?l(e,i.cssClasses.ltr):l(e,i.cssClasses.rtl),0===i.ort?l(e,i.cssClasses.horizontal):l(e,i.cssClasses.vertical),I=t(e,i.cssClasses.base)}(J),function(t,e){_=[],(W=[]).push(m(e,t[0]));for(var n=0;n<i.handles;n++)_.push(h(e,n)),Q[n]=n,W.push(m(e,t[n+1]))}(i.connect,I),$={destroy:function(){for(var t in i.cssClasses)i.cssClasses.hasOwnProperty(t)&&c(J,i.cssClasses[t]);for(;J.firstChild;)J.removeChild(J.firstChild);delete J.noUiSlider},steps:function(){return K.map(function(t,e){var n=tt.getNearbySteps(t),r=et[e],i=n.thisStep.step,o=null;!1!==i&&r+i>n.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=tt.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(s))),null!==o&&!1!==o&&(o=Number(o.toFixed(s))),[o,i]})},on:Y,off:function(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(nt).forEach(function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete nt[t]})},get:B,set:R,reset:function(t){R(i.start,t)},__moveHandles:function(t,e,n){U(t,e,K,n)},options:u,updateOptions:function(t,e){var n=B(),r=["margin","limit","padding","range","animate","snap","step","format"];r.forEach(function(e){void 0!==t[e]&&(u[e]=t[e])});var o=X(u);r.forEach(function(e){void 0!==t[e]&&(i[e]=o[e])}),o.spectrum.direction=tt.direction,tt=o.spectrum,i.margin=o.margin,i.limit=o.limit,i.padding=o.padding,K=[],R(t.start||n,e)},target:J,pips:S},function(t){t.fixed||_.forEach(function(t,e){y(G.start,t.children[0],V,{handleNumbers:[e]})}),t.tap&&y(G.start,I,A,{}),t.hover&&y(G.move,I,L,{hover:!0}),t.drag&&W.forEach(function(e,n){if(!1!==e&&0!==n&&n!==W.length-1){var r=_[n-1],o=_[n],s=[e];l(e,i.cssClasses.draggable),t.fixed&&(s.push(r.children[0]),s.push(o.children[0])),s.forEach(function(t){y(G.start,t,V,{handles:[r,o],handleNumbers:[n-1,n]})})}})}(i.events),R(i.start),i.pips&&S(i.pips),i.tooltips&&function(){var t=_.map(g);Y("update",function(e,n,r){if(t[n]){var o=e[n];!0!==i.tooltips[n]&&(o=i.tooltips[n].to(r[n])),t[n].innerHTML="<span>"+o+"</span>"}})}(),$}C.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&m(this.xVal,t)},C.prototype.toStepping=function(t){return t=w(this.xVal,this.xPct,t)},C.prototype.fromStepping=function(t){return S(this.xVal,this.xPct,t)},C.prototype.getStep=function(t){return t=x(this.xPct,this.xSteps,this.snap,t)},C.prototype.getNearbySteps=function(t){var e=b(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]}}},C.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(u);return Math.max.apply(null,t)},C.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var I={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};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=Y(t,X(e,t),e);return t.noUiSlider=n,n}}});
@@ -44,6 +44,11 @@
44
44
  $textarea = $($textarea);
45
45
  }
46
46
 
47
+ if (!$textarea.length) {
48
+ console.error("No textarea element found");
49
+ return;
50
+ }
51
+
47
52
  // Textarea Auto Resize
48
53
  var hiddenDiv = $('.hiddendiv').first();
49
54
  if (!hiddenDiv.length) {
@@ -100,10 +105,10 @@
100
105
  // When textarea is hidden, width goes crazy.
101
106
  // Approximate with half of window size
102
107
 
103
- if ($textarea.css('display') !== 'hidden') {
108
+ if ($textarea[0].offsetWidth > 0 && $textarea[0].offsetHeight > 0) {
104
109
  hiddenDiv.css('width', $textarea.width() + 'px');
105
110
  } else {
106
- hiddenDiv.css('width', $(window).width() / 2 + 'px');
111
+ hiddenDiv.css('width', window.innerWidth / 2 + 'px');
107
112
  }
108
113
 
109
114
  /**
@@ -155,7 +160,7 @@
155
160
  setTimeout(function () {
156
161
  formReset.find('select').each(function () {
157
162
  // check if initialized
158
- if (this.M_Select) {
163
+ if (this.M_FormSelect) {
159
164
  var reset_text = $(this).find('option[selected]').text();
160
165
  $(this).siblings('input.select-dropdown')[0].value = reset_text;
161
166
  }
@@ -112,7 +112,7 @@ M.guid = function () {
112
112
  * @returns {string}
113
113
  */
114
114
  M.escapeHash = function (hash) {
115
- return hash.replace(/(:|\.|\[|\]|,|=)/g, "\\$1");
115
+ return hash.replace(/(:|\.|\[|\]|,|=|\/)/g, "\\$1");
116
116
  };
117
117
 
118
118
  M.elementOrParentIsFixed = function (element) {
@@ -201,35 +201,38 @@ M.checkPossibleAlignments = function (el, container, bounding, offset) {
201
201
 
202
202
  var containerAllowsOverflow = getComputedStyle(container).overflow === 'visible';
203
203
  var containerRect = container.getBoundingClientRect();
204
+ var containerHeight = Math.min(containerRect.height, window.innerHeight);
205
+ var containerWidth = Math.min(containerRect.width, window.innerWidth);
204
206
  var elOffsetRect = el.getBoundingClientRect();
205
207
 
206
208
  var scrollLeft = container.scrollLeft;
207
209
  var scrollTop = container.scrollTop;
208
210
 
209
211
  var scrolledX = bounding.left - scrollLeft;
210
- var scrolledY = bounding.top - scrollTop;
212
+ var scrolledYTopEdge = bounding.top - scrollTop;
213
+ var scrolledYBottomEdge = bounding.top + elOffsetRect.height - scrollTop;
211
214
 
212
215
  // Check for container and viewport for left
213
- canAlign.spaceOnRight = !containerAllowsOverflow ? container.offsetWidth - (scrolledX + bounding.width) : window.innerWidth - (elOffsetRect.left + bounding.width);
214
- if (!containerAllowsOverflow && scrolledX + bounding.width > container.offsetWidth || containerAllowsOverflow && elOffsetRect.left + bounding.width > window.innerWidth) {
216
+ canAlign.spaceOnRight = !containerAllowsOverflow ? containerWidth - (scrolledX + bounding.width) : window.innerWidth - (elOffsetRect.left + bounding.width);
217
+ if (canAlign.spaceOnRight < 0) {
215
218
  canAlign.left = false;
216
219
  }
217
220
 
218
221
  // Check for container and viewport for Right
219
222
  canAlign.spaceOnLeft = !containerAllowsOverflow ? scrolledX - bounding.width + elOffsetRect.width : elOffsetRect.right - bounding.width;
220
- if (!containerAllowsOverflow && scrolledX - bounding.width + elOffsetRect.width < 0 || containerAllowsOverflow && elOffsetRect.right - bounding.width < 0) {
223
+ if (canAlign.spaceOnLeft < 0) {
221
224
  canAlign.right = false;
222
225
  }
223
226
 
224
227
  // Check for container and viewport for Top
225
- canAlign.spaceOnBottom = !containerAllowsOverflow ? containerRect.height - (scrolledY + bounding.height + offset) : window.innerHeight - (elOffsetRect.top + bounding.height + offset);
226
- if (!containerAllowsOverflow && scrolledY + bounding.height + offset > containerRect.height || containerAllowsOverflow && elOffsetRect.top + bounding.height + offset > window.innerHeight) {
228
+ canAlign.spaceOnBottom = !containerAllowsOverflow ? containerHeight - (scrolledYTopEdge + bounding.height + offset) : window.innerHeight - (elOffsetRect.top + bounding.height + offset);
229
+ if (canAlign.spaceOnBottom < 0) {
227
230
  canAlign.top = false;
228
231
  }
229
232
 
230
233
  // Check for container and viewport for Bottom
231
- canAlign.spaceOnTop = !containerAllowsOverflow ? scrolledY - (bounding.height + offset) : elOffsetRect.bottom - (bounding.height + offset);
232
- if (!containerAllowsOverflow && scrolledY - bounding.height - offset < 0 || containerAllowsOverflow && elOffsetRect.bottom - bounding.height - offset < 0) {
234
+ canAlign.spaceOnTop = !containerAllowsOverflow ? scrolledYBottomEdge - (bounding.height - offset) : elOffsetRect.bottom - (bounding.height + offset);
235
+ if (canAlign.spaceOnTop < 0) {
233
236
  canAlign.bottom = false;
234
237
  }
235
238
 
@@ -97,8 +97,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
97
97
  */
98
98
 
99
99
  }, {
100
- key: 'removeEventHandlers',
101
- value: function removeEventHandlers() {
100
+ key: '_removeEventHandlers',
101
+ value: function _removeEventHandlers() {
102
102
  this.el.removeEventListener('click', this._handleMaterialboxClickBound);
103
103
  }
104
104
 
@@ -190,8 +190,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
190
190
 
191
191
  var animOptions = {
192
192
  targets: this.el,
193
- height: this.newHeight,
194
- width: this.newWidth,
193
+ height: [this.originalHeight, this.newHeight],
194
+ width: [this.originalWidth, this.newWidth],
195
195
  left: M.getDocumentScrollLeft() + this.windowWidth / 2 - this.placeholder.offset().left - this.newWidth / 2,
196
196
  top: M.getDocumentScrollTop() + this.windowHeight / 2 - this.placeholder.offset().top - this.newHeight / 2,
197
197
  duration: this.options.inDuration,
@@ -206,12 +206,14 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
206
206
  }
207
207
  };
208
208
 
209
- if (this.$el.hasClass('responsive-img')) {
209
+ // Override max-width or max-height if needed
210
+ this.maxWidth = this.$el.css('max-width');
211
+ this.maxHeight = this.$el.css('max-height');
212
+ if (this.maxWidth !== 'none') {
210
213
  animOptions.maxWidth = this.newWidth;
211
- animOptions.width = [this.originalWidth, animOptions.width];
212
- } else {
213
- animOptions.left = [animOptions.left, 0];
214
- animOptions.top = [animOptions.top, 0];
214
+ }
215
+ if (this.maxHeight !== 'none') {
216
+ animOptions.maxHeight = this.newHeight;
215
217
  }
216
218
 
217
219
  anim(animOptions);
@@ -243,6 +245,14 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
243
245
  left: ''
244
246
  });
245
247
 
248
+ // Revert to width or height attribute
249
+ if (_this3.attrWidth) {
250
+ _this3.$el.attr('width', _this3.attrWidth);
251
+ }
252
+ if (_this3.attrHeight) {
253
+ _this3.$el.attr('height', _this3.attrHeight);
254
+ }
255
+
246
256
  _this3.$el.removeAttr('style');
247
257
  _this3.$el.attr('style', _this3.originInlineStyles);
248
258
 
@@ -318,6 +328,18 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
318
328
  'will-change': 'left, top, width, height'
319
329
  });
320
330
 
331
+ // Change from width or height attribute to css
332
+ this.attrWidth = this.$el.attr('width');
333
+ this.attrHeight = this.$el.attr('height');
334
+ if (this.attrWidth) {
335
+ this.$el.css('width', this.attrWidth + 'px');
336
+ this.$el.removeAttr('width');
337
+ }
338
+ if (this.attrHeight) {
339
+ this.$el.css('width', this.attrHeight + 'px');
340
+ this.$el.removeAttr('height');
341
+ }
342
+
321
343
  // Add overlay
322
344
  this.$overlay = $('<div id="materialbox-overlay"></div>').css({
323
345
  opacity: 0
@@ -342,10 +364,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
342
364
  anim.remove(this.el);
343
365
  anim.remove(this.$overlay[0]);
344
366
 
345
- if (this.caption !== "") {
346
- anim.remove(this.$photoCaption[0]);
347
- }
348
-
349
367
  // Animate Overlay
350
368
  anim({
351
369
  targets: this.$overlay[0],
@@ -356,6 +374,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
356
374
 
357
375
  // Add and animate caption if it exists
358
376
  if (this.caption !== "") {
377
+ if (this.$photocaption) {
378
+ anim.remove(this.$photoCaption[0]);
379
+ }
359
380
  this.$photoCaption = $('<div class="materialbox-caption"></div>');
360
381
  this.$photoCaption.text(this.caption);
361
382
  $('body').append(this.$photoCaption);
@@ -71,10 +71,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
71
71
  _this._openingTrigger = undefined;
72
72
  _this.$overlay = $('<div class="modal-overlay"></div>');
73
73
 
74
- Modal._increment++;
75
74
  Modal._count++;
76
- _this.$overlay[0].style.zIndex = 1000 + Modal._increment * 2;
77
- _this.el.style.zIndex = 1000 + Modal._increment * 2 + 1;
78
75
  _this._setupEventHandlers();
79
76
  return _this;
80
77
  }
@@ -311,20 +308,24 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
311
308
  }
312
309
 
313
310
  this.isOpen = true;
311
+ Modal._modalsOpen++;
312
+
313
+ // Set Z-Index based on number of currently open modals
314
+ this.$overlay[0].style.zIndex = 1000 + Modal._modalsOpen * 2;
315
+ this.el.style.zIndex = 1000 + Modal._modalsOpen * 2 + 1;
316
+
317
+ // Set opening trigger, undefined indicates modal was opened by javascript
318
+ this._openingTrigger = !!$trigger ? $trigger[0] : undefined;
314
319
 
315
320
  // onOpenStart callback
316
321
  if (typeof this.options.onOpenStart === 'function') {
317
322
  this.options.onOpenStart.call(this, this.el, this._openingTrigger);
318
323
  }
319
324
 
320
- var body = document.body;
321
- body.style.overflow = 'hidden';
325
+ document.body.style.overflow = 'hidden';
322
326
  this.el.classList.add('open');
323
327
  this.el.insertAdjacentElement('afterend', this.$overlay[0]);
324
328
 
325
- // Set opening trigger, undefined indicates modal was opened by javascript
326
- this._openingTrigger = !!$trigger ? $trigger[0] : undefined;
327
-
328
329
  if (this.options.dismissible) {
329
330
  this._handleKeydownBound = this._handleKeydown.bind(this);
330
331
  document.addEventListener('keydown', this._handleKeydownBound);
@@ -348,6 +349,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
348
349
  }
349
350
 
350
351
  this.isOpen = false;
352
+ Modal._modalsOpen--;
351
353
 
352
354
  // Call onCloseStart callback
353
355
  if (typeof this.options.onCloseStart === 'function') {
@@ -355,7 +357,11 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
355
357
  }
356
358
 
357
359
  this.el.classList.remove('open');
358
- document.body.style.overflow = '';
360
+
361
+ // Enable body scrolling only if there are no more modals open.
362
+ if (Modal._modalsOpen === 0) {
363
+ document.body.style.overflow = '';
364
+ }
359
365
 
360
366
  if (this.options.dismissible) {
361
367
  document.removeEventListener('keydown', this._handleKeydownBound);
@@ -398,7 +404,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
398
404
  */
399
405
 
400
406
 
401
- Modal._increment = 0;
407
+ Modal._modalsOpen = 0;
402
408
 
403
409
  /**
404
410
  * @static