From 8974d1fca54bdfb12363782e7dae9914cbf79f2b Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 17:54:36 +1100 Subject: [PATCH 01/14] perf(utils): add early return if array lengths do not match in arraysEqual function --- src/utils/arraysEqual.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/arraysEqual.js b/src/utils/arraysEqual.js index 5cf4f4f..dabc23e 100644 --- a/src/utils/arraysEqual.js +++ b/src/utils/arraysEqual.js @@ -5,9 +5,13 @@ export default function arraysEqual (array1, array2) { return false } + if (array1.length !== array2.length) { + return false; + } + const array2Sorted = array2.slice().sort() - return array1.length === array2.length && array1.slice().sort().every(function(value, index) { + return array1.slice().sort().every(function(value, index) { return value === array2Sorted[index]; }) } \ No newline at end of file From 38b159531f50a94b12fc37c17e35cfa76d47c244 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 17:55:04 +1100 Subject: [PATCH 02/14] perf(utils): optimize isNullish function Refactor isNullish to use strict equality checks instead of indexOf. This enhances performance and readability. --- src/utils/isNullish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/isNullish.js b/src/utils/isNullish.js index e084b9f..b43d22e 100644 --- a/src/utils/isNullish.js +++ b/src/utils/isNullish.js @@ -1,3 +1,3 @@ export default function isNullish (val) { - return [null, undefined, false].indexOf(val) !== -1 + return val === null || val === undefined } \ No newline at end of file From 6201b4694f4e7e9937ac1cfc59a9802e33e0b7e7 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 17:58:01 +1100 Subject: [PATCH 03/14] refactor(composables): do not check toRefs props that are defined in SFC --- src/composables/useSlider.js | 6 +++--- src/composables/useValue.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/composables/useSlider.js b/src/composables/useSlider.js index 0167b20..254e7cc 100644 --- a/src/composables/useSlider.js +++ b/src/composables/useSlider.js @@ -56,10 +56,10 @@ export default function useSlider (props, context, dependencies) defaultOptions.connect = true } - if ((ariaLabelledby && ariaLabelledby.value) || (aria && Object.keys(aria.value).length)) { + if ((ariaLabelledby.value) || (aria && Object.keys(aria.value).length)) { let handles = Array.isArray(value.value) ? value.value : [value.value] - defaultOptions.handleAttributes = handles.map(h => (Object.assign({}, aria.value, ariaLabelledby && ariaLabelledby.value ? { + defaultOptions.handleAttributes = handles.map(h => (Object.assign({}, aria.value, ariaLabelledby.value ? { 'aria-labelledby': ariaLabelledby.value, }: {}))) } @@ -73,7 +73,7 @@ export default function useSlider (props, context, dependencies) const sliderProps = computed(() => { let sliderProps = { - id: id && id.value ? id.value : undefined, + id: id.value ? id.value : undefined, } if (disabled.value) { diff --git a/src/composables/useValue.js b/src/composables/useValue.js index dce4515..a8e24e8 100644 --- a/src/composables/useValue.js +++ b/src/composables/useValue.js @@ -8,7 +8,7 @@ export default function useValue (props, context, dependencies) // ================ DATA ================ /* istanbul ignore next */ - let value = modelValue && modelValue.value !== undefined ? modelValue : baseValue + let value = modelValue.value !== undefined ? modelValue : baseValue const initialValue = ref(value.value) From 1c93d39bdbf6a5ccd6d6ad6e71ab79e47067464c Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:02:33 +1100 Subject: [PATCH 04/14] perf(composables): use shallowRef for HTML ref --- src/composables/useSlider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/composables/useSlider.js b/src/composables/useSlider.js index 254e7cc..3251f61 100644 --- a/src/composables/useSlider.js +++ b/src/composables/useSlider.js @@ -1,4 +1,4 @@ -import { ref, computed, toRefs, watch, onMounted, onUnmounted, nextTick } from 'vue' +import { ref, shallowRef, computed, toRefs, watch, onMounted, onUnmounted, nextTick } from 'vue' import nouislider from 'nouislider' import isNullish from './../utils/isNullish' import arraysEqual from './../utils/arraysEqual' @@ -23,7 +23,7 @@ export default function useSlider (props, context, dependencies) // ================ DATA ================ - const slider = ref(null) + const slider = shallowRef(null) const slider$ = ref(null) From 11364e56e5dd6d02cfbdc2c6bc2102a7db87ddd8 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:03:01 +1100 Subject: [PATCH 05/14] perf(composables): use shallowRef for nouislider instance --- src/composables/useSlider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/composables/useSlider.js b/src/composables/useSlider.js index 3251f61..94806db 100644 --- a/src/composables/useSlider.js +++ b/src/composables/useSlider.js @@ -25,7 +25,7 @@ export default function useSlider (props, context, dependencies) const slider = shallowRef(null) - const slider$ = ref(null) + const slider$ = shallowRef(null) // no export const inited = ref(false) From 15d7d8e510d0dca7732a137eb612b4924990c98f Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:29:01 +1100 Subject: [PATCH 06/14] perf(composables): use toRef instead of computed where it's better toRef does not create a WatchEffect, unlike computed --- src/composables/useClasses.js | 7 ++++--- src/composables/useSlider.js | 9 +++++---- src/composables/useTooltip.js | 3 ++- src/utils/toRef.js | 7 +++++++ 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 src/utils/toRef.js diff --git a/src/composables/useClasses.js b/src/composables/useClasses.js index a8326e3..fe0fcb4 100644 --- a/src/composables/useClasses.js +++ b/src/composables/useClasses.js @@ -1,4 +1,5 @@ -import { computed, ref, toRefs } from 'vue' +import { toRefs } from 'vue' +import toRef from '../utils/toRef' export default function useClasses (props, context, dependencies) { @@ -8,7 +9,7 @@ export default function useClasses (props, context, dependencies) // ============== COMPUTED ============== - const classes = computed(() => ({ + const classes = toRef(() => ({ target: 'slider-target', focused: 'slider-focused', tooltipFocus: 'slider-tooltip-focus', @@ -58,7 +59,7 @@ export default function useClasses (props, context, dependencies) ...classes_.value, })) - const classList = computed(() => { + const classList = toRef(() => { const classList = { ...classes.value } Object.keys(classList).forEach((className) => { diff --git a/src/composables/useSlider.js b/src/composables/useSlider.js index 94806db..55f0061 100644 --- a/src/composables/useSlider.js +++ b/src/composables/useSlider.js @@ -1,7 +1,8 @@ -import { ref, shallowRef, computed, toRefs, watch, onMounted, onUnmounted, nextTick } from 'vue' +import { ref, shallowRef, toRefs, watch, onMounted, onUnmounted, nextTick } from 'vue' import nouislider from 'nouislider' import isNullish from './../utils/isNullish' import arraysEqual from './../utils/arraysEqual' +import toRef from '../utils/toRef' export default function useSlider (props, context, dependencies) { @@ -33,7 +34,7 @@ export default function useSlider (props, context, dependencies) // ============== COMPUTED ============== // no export - const defaultOptions = computed(() => { + const defaultOptions = toRef(() => { let defaultOptions = { cssPrefix: '', cssClasses: classList.value, @@ -71,7 +72,7 @@ export default function useSlider (props, context, dependencies) return defaultOptions }) - const sliderProps = computed(() => { + const sliderProps = toRef(() => { let sliderProps = { id: id.value ? id.value : undefined, } @@ -83,7 +84,7 @@ export default function useSlider (props, context, dependencies) return sliderProps }) - const isRange = computed(() => { + const isRange = toRef(() => { return Array.isArray(value.value) }) diff --git a/src/composables/useTooltip.js b/src/composables/useTooltip.js index 19e2e91..cd43a4f 100644 --- a/src/composables/useTooltip.js +++ b/src/composables/useTooltip.js @@ -1,5 +1,6 @@ import { computed, toRefs } from 'vue' import wnumb from 'wnumb' +import toRef from '../utils/toRef' export default function useTooltip (props, context, dependencies) { @@ -25,7 +26,7 @@ export default function useTooltip (props, context, dependencies) return wnumb({...format.value}) }) - const tooltipsFormat = computed(() => { + const tooltipsFormat = toRef(() => { return Array.isArray(value.value) ? value.value.map(v => tooltipFormat.value) : tooltipFormat.value }) diff --git a/src/utils/toRef.js b/src/utils/toRef.js new file mode 100644 index 0000000..dcd4d26 --- /dev/null +++ b/src/utils/toRef.js @@ -0,0 +1,7 @@ +import { customRef } from 'vue' + +// Polyfill for Vue <3.3 for getters only +// https://vuejs.org/api/reactivity-utilities.html#toref +export default function toRef (get) { + return customRef(() => ({ get, set: () => { } })) +} \ No newline at end of file From 39b5071e4532cc52a3c5ba42d9b1373681649be5 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:29:50 +1100 Subject: [PATCH 07/14] chore(composables): replace invisible character U+00a0 --- src/composables/useSlider.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/composables/useSlider.js b/src/composables/useSlider.js index 55f0061..e65623c 100644 --- a/src/composables/useSlider.js +++ b/src/composables/useSlider.js @@ -213,17 +213,17 @@ export default function useSlider (props, context, dependencies) // ============== WATCHERS ============== - watch(isRange, refresh, { immediate: false }) - watch(min, refresh, { immediate: false }) - watch(max, refresh, { immediate: false }) - watch(step, refresh, { immediate: false }) - watch(orientation, refresh, { immediate: false }) - watch(direction, refresh, { immediate: false }) - watch(tooltips, refresh, { immediate: false }) - watch(merge, refresh, { immediate: false }) - watch(format, refresh, { immediate: false, deep: true }) - watch(options, refresh, { immediate: false, deep: true }) - watch(classes, refresh, { immediate: false, deep: true }) + watch(isRange, refresh, { immediate: false }) + watch(min, refresh, { immediate: false }) + watch(max, refresh, { immediate: false }) + watch(step, refresh, { immediate: false }) + watch(orientation, refresh, { immediate: false }) + watch(direction, refresh, { immediate: false }) + watch(tooltips, refresh, { immediate: false }) + watch(merge, refresh, { immediate: false }) + watch(format, refresh, { immediate: false, deep: true }) + watch(options, refresh, { immediate: false, deep: true }) + watch(classes, refresh, { immediate: false, deep: true }) watch(value, (value, old) => { // If old was 0, null, undefined, '', false @@ -245,7 +245,7 @@ export default function useSlider (props, context, dependencies) ) { refresh() } - }, { immediate: false }) + }, { immediate: false }) watch(value, (newValue) => { if (isNullish(newValue)) { From a06ff566c0e02025df23eb76b1632ad9c70eb7b1 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:38:55 +1100 Subject: [PATCH 08/14] perf(composables): combine multiple watches into one for performance --- src/composables/useSlider.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/composables/useSlider.js b/src/composables/useSlider.js index e65623c..771f8ab 100644 --- a/src/composables/useSlider.js +++ b/src/composables/useSlider.js @@ -213,17 +213,8 @@ export default function useSlider (props, context, dependencies) // ============== WATCHERS ============== - watch(isRange, refresh, { immediate: false }) - watch(min, refresh, { immediate: false }) - watch(max, refresh, { immediate: false }) - watch(step, refresh, { immediate: false }) - watch(orientation, refresh, { immediate: false }) - watch(direction, refresh, { immediate: false }) - watch(tooltips, refresh, { immediate: false }) - watch(merge, refresh, { immediate: false }) - watch(format, refresh, { immediate: false, deep: true }) - watch(options, refresh, { immediate: false, deep: true }) - watch(classes, refresh, { immediate: false, deep: true }) + watch([isRange, min, max, step, orientation, direction, tooltips, merge], refresh, { immediate: false }) + watch([format, options, classes], refresh, { immediate: false, deep: true }) watch(value, (value, old) => { // If old was 0, null, undefined, '', false From 37cf5be5ad3947790ee46b7e15178830a8a49455 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:40:48 +1100 Subject: [PATCH 09/14] refactor(sfc): remove the unnecessary spread for the props --- src/Slider.vue | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/Slider.vue b/src/Slider.vue index 37e2ec9..48fc77f 100644 --- a/src/Slider.vue +++ b/src/Slider.vue @@ -8,22 +8,6 @@ import useTooltip from './composables/useTooltip' import useSlider from './composables/useSlider' - /* istanbul ignore next */ - const valueProps = { - value: { - validator: function(p) { - return p => typeof p === 'number' || p instanceof Array || p === null || p === undefined || p === false - }, - required: false, - }, - modelValue: { - validator: function(p) { - return p => typeof p === 'number' || p instanceof Array || p === null || p === undefined || p === false - }, - required: false, - }, - } - export default { name: 'Slider', emits: [ @@ -31,7 +15,19 @@ 'start', 'slide', 'drag', 'update', 'change', 'set', 'end', ], props: { - ...valueProps, + value: { + validator: function(p) { + return p => typeof p === 'number' || p instanceof Array || p === null || p === undefined || p === false + }, + required: false, + }, + modelValue: { + validator: function(p) { + return p => typeof p === 'number' || p instanceof Array || p === null || p === undefined || p === false + }, + required: false, + }, + id: { type: [String, Number], required: false, From b01fa546a7e02c508f3b80251f5f60954c572d37 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:57:54 +1100 Subject: [PATCH 10/14] fix(utils): add missing check to false in isNullish --- src/utils/isNullish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/isNullish.js b/src/utils/isNullish.js index b43d22e..a26740d 100644 --- a/src/utils/isNullish.js +++ b/src/utils/isNullish.js @@ -1,3 +1,3 @@ export default function isNullish (val) { - return val === null || val === undefined + return val === null || val === undefined || val === false } \ No newline at end of file From 90cf1a7b9850bec90b2b3124ecbc110f862d99c1 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 18:59:07 +1100 Subject: [PATCH 11/14] chore: build --- dist/slider.global.js | 2 +- dist/slider.js | 2 +- themes/default.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/slider.global.js b/dist/slider.global.js index 704d210..b3aee25 100644 --- a/dist/slider.global.js +++ b/dist/slider.global.js @@ -1 +1 @@ -var VueformSlider=function(e){"use strict";function t(e){return-1!==[null,void 0,!1].indexOf(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e){var t={exports:{}};return e(t,t.exports),t.exports}var n=i((function(e,t){e.exports=function(){var e=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function t(e){return e.split("").reverse().join("")}function r(e,t){return e.substring(0,t.length)===t}function i(e,t){return e.slice(-1*t.length)===t}function n(e,t,r){if((e[t]||e[r])&&e[t]===e[r])throw new Error(t)}function o(e){return"number"==typeof e&&isFinite(e)}function a(e,t){return e=e.toString().split("e"),(+((e=(e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]-t:-t))).toFixed(t)}function s(e,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==e&&0===parseFloat(h.toFixed(e))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==e&&(h=a(h,e)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=t(g).match(/.{1,3}/g),g=t(g.join(t(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(e,t,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),t&&(h=h.split(t).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(t){var r,i,o,a={};for(void 0===t.suffix&&(t.suffix=t.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(t,r,i){var n,o=[];for(n=0;n0&&(h(e,t),setTimeout((function(){m(e,t)}),r))}function p(e){return Math.max(Math.min(e,100),0)}function d(e){return Array.isArray(e)?e:[e]}function f(e){var t=(e=String(e)).split(".");return t.length>1?t[1].length:0}function h(e,t){e.classList&&!/\s/.test(t)?e.classList.add(t):e.className+=" "+t}function m(e,t){e.classList&&!/\s/.test(t)?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function v(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function g(e){var t=void 0!==window.pageXOffset,r="CSS1Compat"===(e.compatMode||"");return{x:t?window.pageXOffset:r?e.documentElement.scrollLeft:e.body.scrollLeft,y:t?window.pageYOffset:r?e.documentElement.scrollTop:e.body.scrollTop}}function b(){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 y(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}function S(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function x(e,t){return 100/(t-e)}function w(e,t,r){return 100*t/(e[r+1]-e[r])}function E(e,t){return w(e,e[0]<0?t+Math.abs(e[0]):t-e[0],0)}function P(e,t){return t*(e[1]-e[0])/100+e[0]}function N(e,t){for(var r=1;e>=t[r];)r+=1;return r}function C(e,t,r){if(r>=e.slice(-1)[0])return 100;var i=N(r,e),n=e[i-1],o=e[i],a=t[i-1],s=t[i];return a+E([n,o],r)/x(a,s)}function k(e,t,r){if(r>=100)return e.slice(-1)[0];var i=N(r,t),n=e[i-1],o=e[i],a=t[i-1];return P([n,o],(r-a)*x(a,t[i]))}function V(e,t,r,i){if(100===i)return i;var n=N(i,e),o=e[n-1],a=e[n];return r?i-o>(a-o)/2?a:o:t[n-1]?e[n-1]+s(i-e[n-1],t[n-1]):i}var A,M;e.PipsMode=void 0,(M=e.PipsMode||(e.PipsMode={})).Range="range",M.Steps="steps",M.Positions="positions",M.Count="count",M.Values="values",e.PipsType=void 0,(A=e.PipsType||(e.PipsType={}))[A.None=-1]="None",A[A.NoValue=0]="NoValue",A[A.LargeValue=1]="LargeValue",A[A.SmallValue=2]="SmallValue";var L=function(){function e(e,t,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=t;var n=[];for(Object.keys(e).forEach((function(t){n.push([d(e[t]),t])})),n.sort((function(e,t){return e[0][0]-t[0][0]})),i=0;ithis.xPct[n+1];)n++;else e===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||e!==this.xPct[n+1]||n++,null===t&&(t=[]);var o=1,a=t[n],s=0,l=0,u=0,c=0;for(i=r?(e-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-e)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],t[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/t[n+c],i=1):(l=t[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=t[n+c]*o;return e+u},e.prototype.toStepping=function(e){return e=C(this.xVal,this.xPct,e)},e.prototype.fromStepping=function(e){return k(this.xVal,this.xPct,e)},e.prototype.getStep=function(e){return e=V(this.xPct,this.xSteps,this.snap,e)},e.prototype.getDefaultStep=function(e,t,r){var i=N(e,this.xPct);return(100===e||t&&e===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},e.prototype.getNearbySteps=function(e){var t=N(e,this.xPct);return{stepBefore:{startValue:this.xVal[t-2],step:this.xNumSteps[t-2],highestStep:this.xHighestCompleteStep[t-2]},thisStep:{startValue:this.xVal[t-1],step:this.xNumSteps[t-1],highestStep:this.xHighestCompleteStep[t-1]},stepAfter:{startValue:this.xVal[t],step:this.xNumSteps[t],highestStep:this.xHighestCompleteStep[t]}}},e.prototype.countStepDecimals=function(){var e=this.xNumSteps.map(f);return Math.max.apply(null,e)},e.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},e.prototype.convert=function(e){return this.getStep(this.toStepping(e))},e.prototype.handleEntryPoint=function(e,t){var r;if(!u(r="min"===e?0:"max"===e?100:parseFloat(e))||!u(t[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(t[0]);var i=Number(t[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},e.prototype.handleStepPoint=function(e,t){if(t)if(this.xVal[e]!==this.xVal[e+1]){this.xSteps[e]=w([this.xVal[e],this.xVal[e+1]],t,0)/x(this.xPct[e],this.xPct[e+1]);var r=(this.xVal[e+1]-this.xVal[e])/this.xNumSteps[e],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[e]+this.xNumSteps[e]*i;this.xHighestCompleteStep[e]=n}else this.xSteps[e]=this.xHighestCompleteStep[e]=this.xVal[e]},e}(),U={to:function(e){return void 0===e?"":e.toFixed(2)},from:Number},O={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},D={tooltips:".__tooltips",aria:".__aria"};function j(e,t){if(!u(t))throw new Error("noUiSlider: 'step' is not numeric.");e.singleStep=t}function F(e,t){if(!u(t))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");e.keyboardPageMultiplier=t}function T(e,t){if(!u(t))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");e.keyboardMultiplier=t}function z(e,t){if(!u(t))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");e.keyboardDefaultStep=t}function H(e,t){if("object"!=typeof t||Array.isArray(t))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===t.min||void 0===t.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");e.spectrum=new L(t,e.snap||!1,e.singleStep)}function q(e,t){if(t=d(t),!Array.isArray(t)||!t.length)throw new Error("noUiSlider: 'start' option is incorrect.");e.handles=t.length,e.start=t}function R(e,t){if("boolean"!=typeof t)throw new Error("noUiSlider: 'snap' option must be a boolean.");e.snap=t}function B(e,t){if("boolean"!=typeof t)throw new Error("noUiSlider: 'animate' option must be a boolean.");e.animate=t}function _(e,t){if("number"!=typeof t)throw new Error("noUiSlider: 'animationDuration' option must be a number.");e.animationDuration=t}function $(e,t){var r,i=[!1];if("lower"===t?t=[!0,!1]:"upper"===t&&(t=[!1,!0]),!0===t||!1===t){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function G(e,t){switch(t){case"ltr":e.dir=0;break;case"rtl":e.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function J(e,t){if("string"!=typeof t)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=t.indexOf("tap")>=0,i=t.indexOf("drag")>=0,n=t.indexOf("fixed")>=0,o=t.indexOf("snap")>=0,a=t.indexOf("hover")>=0,s=t.indexOf("unconstrained")>=0,l=t.indexOf("drag-all")>=0,u=t.indexOf("smooth-steps")>=0;if(n){if(2!==e.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");Y(e,e.start[1]-e.start[0])}if(s&&(e.margin||e.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");e.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function K(e,t){if(!1!==t)if(!0===t||r(t)){e.tooltips=[];for(var i=0;i= 2) required for mode 'count'.");for(var r=t.values-1,i=100/r,n=[];r--;)n[r]=r*i;return n.push(100),J(n,t.stepped)}return t.mode===e.PipsMode.Positions?J(t.values,t.stepped):t.mode===e.PipsMode.Values?t.stepped?t.values.map((function(e){return k.fromStepping(k.getStep(k.toStepping(e)))})):t.values:[]}function J(e,t){return e.map((function(e){return k.fromStepping(t?k.getStep(e):e)}))}function K(t){function r(e,t){return Number((e+t).toFixed(7))}var i=G(t),n={},o=k.xVal[0],s=k.xVal[k.xVal.length-1],l=!1,u=!1,c=0;return(i=a(i.slice().sort((function(e,t){return e-t}))))[0]!==o&&(i.unshift(o),l=!0),i[i.length-1]!==s&&(i.push(s),u=!0),i.forEach((function(o,a){var s,p,d,f,h,m,v,g,b,y,S=o,x=i[a+1],w=t.mode===e.PipsMode.Steps;for(w&&(s=k.xNumSteps[a]),s||(s=x-S),void 0===x&&(x=S),s=Math.max(s,1e-7),p=S;p<=x;p=r(p,s)){for(g=(h=(f=k.toStepping(p))-c)/(t.density||1),y=h/(b=Math.round(g)),d=1;d<=b;d+=1)n[(m=c+d*y).toFixed(5)]=[k.fromStepping(m),0];v=i.indexOf(p)>-1?e.PipsType.LargeValue:w?e.PipsType.SmallValue:e.PipsType.NoValue,!a&&l&&p!==x&&(v=0),p===x&&u||(n[f.toFixed(5)]=[p,v]),c=f}})),n}function Q(t,i,n){var o,a,s=O.createElement("div"),l=((o={})[e.PipsType.None]="",o[e.PipsType.NoValue]=r.cssClasses.valueNormal,o[e.PipsType.LargeValue]=r.cssClasses.valueLarge,o[e.PipsType.SmallValue]=r.cssClasses.valueSub,o),u=((a={})[e.PipsType.None]="",a[e.PipsType.NoValue]=r.cssClasses.markerNormal,a[e.PipsType.LargeValue]=r.cssClasses.markerLarge,a[e.PipsType.SmallValue]=r.cssClasses.markerSub,a),c=[r.cssClasses.valueHorizontal,r.cssClasses.valueVertical],p=[r.cssClasses.markerHorizontal,r.cssClasses.markerVertical];function d(e,t){var i=t===r.cssClasses.value,n=i?l:u;return t+" "+(i?c:p)[r.ort]+" "+n[e]}function f(t,o,a){if((a=i?i(o,a):a)!==e.PipsType.None){var l=z(s,!1);l.className=d(a,r.cssClasses.marker),l.style[r.style]=t+"%",a>e.PipsType.NoValue&&((l=z(s,!1)).className=d(a,r.cssClasses.value),l.setAttribute("data-value",String(o)),l.style[r.style]=t+"%",l.innerHTML=String(n.to(o)))}}return h(s,r.cssClasses.pips),h(s,0===r.ort?r.cssClasses.pipsHorizontal:r.cssClasses.pipsVertical),Object.keys(t).forEach((function(e){f(e,t[e][0],t[e][1])})),s}function Z(){w&&(i(w),w=null)}function ee(e){Z();var t=K(e),r=e.filter,i=e.format||{to:function(e){return String(Math.round(e))}};return w=C.appendChild(Q(t,r,i))}function te(){var e=u.getBoundingClientRect(),t="offset"+["Width","Height"][r.ort];return 0===r.ort?e.width||u[t]:e.height||u[t]}function re(e,t,i,n){var o=function(o){var a=ie(o,n.pageOffset,n.target||t);return!!a&&!($()&&!n.doNotReject)&&!(v(C,r.cssClasses.tap)&&!n.doNotReject)&&!(e===P.start&&void 0!==a.buttons&&a.buttons>1)&&(!n.hover||!a.buttons)&&(N||a.preventDefault(),a.calcPoint=a.points[r.ort],void i(a,n))},a=[];return e.split(" ").forEach((function(e){t.addEventListener(e,o,!!N&&{passive:!0}),a.push([e,o])})),a}function ie(e,t,r){var i=0===e.type.indexOf("touch"),n=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),a=0,s=0;if(0===e.type.indexOf("MSPointer")&&(o=!0),"mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(i){var l=function(t){var i=t.target;return i===r||r.contains(i)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){var u=Array.prototype.filter.call(e.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(e.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}return t=t||g(O),(n||o)&&(a=e.clientX+t.x,s=e.clientY+t.y),e.pageOffset=t,e.points=[a,s],e.cursor=n||o,e}function ne(e){var t=100*(e-l(u,r.ort))/te();return t=p(t),r.dir?100-t:t}function ae(e){var t=100,r=!1;return f.forEach((function(i,n){if(!X(n)){var o=A[n],a=Math.abs(o-e);(ao||100===a&&100===t)&&(r=n,t=a)}})),r}function se(e,t){"mouseout"===e.type&&"HTML"===e.target.nodeName&&null===e.relatedTarget&&ue(e,t)}function le(e,t){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===e.buttons&&0!==t.buttonsProperty)return ue(e,t);var i=(r.dir?-1:1)*(e.calcPoint-t.startCalcPoint);xe(i>0,100*i/t.baseSize,t.locations,t.handleNumbers,t.connect)}function ue(e,t){t.handle&&(m(t.handle,r.cssClasses.active),L-=1),t.listeners.forEach((function(e){j.removeEventListener(e[0],e[1])})),0===L&&(m(C,r.cssClasses.drag),Pe(),e.cursor&&(F.style.cursor="",F.removeEventListener("selectstart",o))),r.events.smoothSteps&&(t.handleNumbers.forEach((function(e){Ne(e,A[e],!0,!0,!1,!1)})),t.handleNumbers.forEach((function(e){be("update",e)}))),t.handleNumbers.forEach((function(e){be("change",e),be("set",e),be("end",e)}))}function ce(e,t){if(!t.handleNumbers.some(X)){var i;1===t.handleNumbers.length&&(i=f[t.handleNumbers[0]].children[0],L+=1,h(i,r.cssClasses.active)),e.stopPropagation();var n=[],a=re(P.move,j,le,{target:e.target,handle:i,connect:t.connect,listeners:n,startCalcPoint:e.calcPoint,baseSize:te(),pageOffset:e.pageOffset,handleNumbers:t.handleNumbers,buttonsProperty:e.buttons,locations:A.slice()}),s=re(P.end,j,ue,{target:e.target,handle:i,listeners:n,doNotReject:!0,handleNumbers:t.handleNumbers}),l=re("mouseout",j,se,{target:e.target,handle:i,listeners:n,doNotReject:!0,handleNumbers:t.handleNumbers});n.push.apply(n,a.concat(s,l)),e.cursor&&(F.style.cursor=getComputedStyle(e.target).cursor,f.length>1&&h(C,r.cssClasses.drag),F.addEventListener("selectstart",o,!1)),t.handleNumbers.forEach((function(e){be("start",e)}))}}function pe(e){e.stopPropagation();var t=ne(e.calcPoint),i=ae(t);!1!==i&&(r.events.snap||c(C,r.cssClasses.tap,r.animationDuration),Ne(i,t,!0,!0),Pe(),be("slide",i,!0),be("update",i,!0),r.events.snap?ce(e,{handleNumbers:[i]}):(be("change",i,!0),be("set",i,!0)))}function de(e){var t=ne(e.calcPoint),r=k.getStep(t),i=k.fromStepping(r);Object.keys(U).forEach((function(e){"hover"===e.split(".")[0]&&U[e].forEach((function(e){e.call(Te,i)}))}))}function fe(e,t){if($()||X(t))return!1;var i=["Left","Right"],n=["Down","Up"],o=["PageDown","PageUp"],a=["Home","End"];r.dir&&!r.ort?i.reverse():r.ort&&!r.dir&&(n.reverse(),o.reverse());var s,l=e.key.replace("Arrow",""),u=l===o[0],c=l===o[1],p=l===n[0]||l===i[0]||u,d=l===n[1]||l===i[1]||c,f=l===a[0],h=l===a[1];if(!(p||d||f||h))return!0;if(e.preventDefault(),d||p){var m=p?0:1,v=Oe(t)[m];if(null===v)return!1;!1===v&&(v=k.getDefaultStep(A[t],p,r.keyboardDefaultStep)),v*=c||u?r.keyboardPageMultiplier:r.keyboardMultiplier,v=Math.max(v,1e-7),v*=p?-1:1,s=V[t]+v}else s=h?r.spectrum.xVal[r.spectrum.xVal.length-1]:r.spectrum.xVal[0];return Ne(t,k.toStepping(s),!0,!0),be("slide",t),be("update",t),be("change",t),be("set",t),!1}function he(e){e.fixed||f.forEach((function(e,t){re(P.start,e.children[0],ce,{handleNumbers:[t]})})),e.tap&&re(P.start,u,pe,{}),e.hover&&re(P.move,u,de,{hover:!0}),e.drag&&x.forEach((function(t,i){if(!1!==t&&0!==i&&i!==x.length-1){var n=f[i-1],o=f[i],a=[t],s=[n,o],l=[i-1,i];h(t,r.cssClasses.draggable),e.fixed&&(a.push(n.children[0]),a.push(o.children[0])),e.dragAll&&(s=f,l=M),a.forEach((function(e){re(P.start,e,ce,{handles:s,handleNumbers:l,connect:t})}))}}))}function me(e,t){U[e]=U[e]||[],U[e].push(t),"update"===e.split(".")[0]&&f.forEach((function(e,t){be("update",t)}))}function ve(e){return e===D.aria||e===D.tooltips}function ge(e){var t=e&&e.split(".")[0],r=t?e.substring(t.length):e;Object.keys(U).forEach((function(e){var i=e.split(".")[0],n=e.substring(i.length);t&&t!==i||r&&r!==n||ve(n)&&r!==n||delete U[e]}))}function be(e,t,i){Object.keys(U).forEach((function(n){var o=n.split(".")[0];e===o&&U[n].forEach((function(e){e.call(Te,V.map(r.format.to),t,V.slice(),i||!1,A.slice(),Te)}))}))}function ye(e,t,i,n,o,a,s){var l;return f.length>1&&!r.events.unconstrained&&(n&&t>0&&(l=k.getAbsoluteDistance(e[t-1],r.margin,!1),i=Math.max(i,l)),o&&t1&&r.limit&&(n&&t>0&&(l=k.getAbsoluteDistance(e[t-1],r.limit,!1),i=Math.min(i,l)),o&&t1?n.forEach((function(e,r){var i=ye(a,e,a[e]+t,u[r],c[r],!1,l);!1===i?t=0:(t=i-a[e],a[e]=i)})):u=c=[!0];var p=!1;n.forEach((function(e,r){p=Ne(e,i[e]+t,u[r],c[r],!1,l)||p})),p&&(n.forEach((function(e){be("update",e),be("slide",e)})),null!=o&&be("drag",s))}function we(e,t){return r.dir?100-e-t:e}function Ee(e,t){A[e]=t,V[e]=k.fromStepping(t);var i="translate("+Se(we(t,0)-T+"%","0")+")";f[e].style[r.transformRule]=i,Ce(e),Ce(e+1)}function Pe(){M.forEach((function(e){var t=A[e]>50?-1:1,r=3+(f.length+t*e);f[e].style.zIndex=String(r)}))}function Ne(e,t,r,i,n,o){return n||(t=ye(A,e,t,r,i,!1,o)),!1!==t&&(Ee(e,t),!0)}function Ce(e){if(x[e]){var t=0,i=100;0!==e&&(t=A[e-1]),e!==x.length-1&&(i=A[e]);var n=i-t,o="translate("+Se(we(t,n)+"%","0")+")",a="scale("+Se(n/100,"1")+")";x[e].style[r.transformRule]=o+" "+a}}function ke(e,t){return null===e||!1===e||void 0===e?A[t]:("number"==typeof e&&(e=String(e)),!1!==(e=r.format.from(e))&&(e=k.toStepping(e)),!1===e||isNaN(e)?A[t]:e)}function Ve(e,t,i){var n=d(e),o=void 0===A[0];t=void 0===t||t,r.animate&&!o&&c(C,r.cssClasses.tap,r.animationDuration),M.forEach((function(e){Ne(e,ke(n[e],e),!0,!1,i)}));var a=1===M.length?0:1;if(o&&k.hasNoSize()&&(i=!0,A[0]=0,M.length>1)){var s=100/(M.length-1);M.forEach((function(e){A[e]=e*s}))}for(;a=0&&ei.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===t?o=null:0===t&&(a=null);var s=k.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}function De(){return M.map(Oe)}function je(e,t){var i=Le(),o=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];o.forEach((function(t){void 0!==e[t]&&(s[t]=e[t])}));var a=oe(s);o.forEach((function(t){void 0!==e[t]&&(r[t]=a[t])})),k=a.spectrum,r.margin=a.margin,r.limit=a.limit,r.padding=a.padding,r.pips?ee(r.pips):Z(),r.tooltips?I():Y(),A=[],Ve(n(e.start)?e.start:i,t)}function Fe(){u=B(C),R(r.connect,u),he(r.events),Ve(r.start),r.pips&&ee(r.pips),r.tooltips&&I(),W()}Fe();var Te={destroy:Ue,steps:De,on:me,off:ge,get:Le,set:Ve,setHandle:Me,reset:Ae,__moveHandles:function(e,t,r){xe(e,t,A,r)},options:s,updateOptions:je,target:C,removePips:Z,removeTooltips:Y,getPositions:function(){return A.slice()},getTooltips:function(){return E},getOrigins:function(){return f},pips:ee};return Te}function se(e,t){if(!e||!e.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+e);if(e.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var r=ae(e,oe(t),t);return e.noUiSlider=r,r}var le={__spectrum:L,cssClasses:O,create:se};e.create=se,e.cssClasses=O,e.default=le,Object.defineProperty(e,"__esModule",{value:!0})}(t)})));function a(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=t.slice().sort();return e.length===t.length&&e.slice().sort().every((function(e,t){return e===r[t]}))}var s={name:"Slider",emits:["input","update:modelValue","start","slide","drag","update","change","set","end"],props:{...{value:{validator:function(e){return e=>"number"==typeof e||e instanceof Array||null==e||!1===e},required:!1},modelValue:{validator:function(e){return e=>"number"==typeof e||e instanceof Array||null==e||!1===e},required:!1}},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(r,i){const s=function(r,i,n){const{value:o,modelValue:a,min:s}=e.toRefs(r);let l=a&&void 0!==a.value?a:o;const u=e.ref(l.value);if(t(l.value)&&(l=e.ref(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:u}}(r),l=function(t,r,i){const{classes:n,showTooltip:o,tooltipPosition:a,orientation:s}=e.toRefs(t),l=e.computed((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...n.value})));return{classList:e.computed((()=>{const e={...l.value};return Object.keys(e).forEach((t=>{e[t]=Array.isArray(e[t])?e[t].filter((e=>null!==e)).join(" "):e[t]})),"always"!==o.value&&(e.target+=` ${"drag"===o.value?e.tooltipDrag:e.tooltipFocus}`),"horizontal"===s.value&&(e.tooltip+="bottom"===a.value?` ${e.tooltipBottom}`:` ${e.tooltipTop}`),"vertical"===s.value&&(e.tooltip+="right"===a.value?` ${e.tooltipRight}`:` ${e.tooltipLeft}`),e}))}}(r),u=function(t,r,i){const{format:o,step:a}=e.toRefs(t),s=i.value,l=i.classList,u=e.computed((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:n({...o.value}):n({decimals:a.value>=0?0:2}))),c=e.computed((()=>Array.isArray(s.value)?s.value.map((e=>u.value)):u.value));return{tooltipFormat:u,tooltipsFormat:c,tooltipsMerge:(e,t,r)=>{var i="rtl"===getComputedStyle(e).direction,n="rtl"===e.noUiSlider.options.direction,o="vertical"===e.noUiSlider.options.orientation,a=e.noUiSlider.getTooltips(),s=e.noUiSlider.getOrigins();a.forEach((function(e,t){e&&s[t].appendChild(e)})),e.noUiSlider.on("update",(function(e,s,c,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=u.value.to(parseFloat(e[0])));for(var g=1;gt)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(u.value.to(parseFloat(e[g]))),h[v].push(d[g]));f.forEach((function(e,t){for(var s=e.length,u=0;u{a[c].classList.contains(e)&&a[c].classList.remove(e)}))}else a[c].style.display="none",l.value.tooltipHidden.split(" ").forEach((e=>{a[c].classList.add(e)}))}}))}))}}}(r,0,{value:s.value,classList:l.classList}),c=function(r,i,n){const{orientation:s,direction:l,tooltips:u,step:c,min:p,max:d,merge:f,id:h,disabled:m,options:v,classes:g,format:b,lazy:y,ariaLabelledby:S,aria:x}=e.toRefs(r),w=n.value,E=n.initialValue,P=n.tooltipsFormat,N=n.tooltipsMerge,C=n.tooltipFormat,k=n.classList,V=e.ref(null),A=e.ref(null),M=e.ref(!1),L=e.computed((()=>{let e={cssPrefix:"",cssClasses:k.value,orientation:s.value,direction:l.value,tooltips:!!u.value&&P.value,connect:"lower",start:t(w.value)?p.value:w.value,range:{min:p.value,max:d.value}};if(c.value>0&&(e.step=c.value),Array.isArray(w.value)&&(e.connect=!0),S&&S.value||x&&Object.keys(x.value).length){let t=Array.isArray(w.value)?w.value:[w.value];e.handleAttributes=t.map((e=>Object.assign({},x.value,S&&S.value?{"aria-labelledby":S.value}:{})))}return b.value&&(e.ariaFormat=C.value),e})),U=e.computed((()=>{let e={id:h&&h.value?h.value:void 0};return m.value&&(e.disabled=!0),e})),O=e.computed((()=>Array.isArray(w.value))),D=()=>{let e=A.value.get();return Array.isArray(e)?e.map((e=>parseFloat(e))):parseFloat(e)},j=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];A.value.set(e,t)},F=e=>{i.emit("input",e),i.emit("update:modelValue",e),i.emit("update",e)},T=()=>{A.value=o.create(V.value,Object.assign({},L.value,v.value)),u.value&&O.value&&f.value>=0&&N(V.value,f.value," - "),A.value.on("set",(()=>{const e=D();i.emit("change",e),i.emit("set",e),y.value&&F(e)})),A.value.on("update",(()=>{if(!M.value)return;const e=D();O.value&&a(w.value,e)||!O.value&&w.value==e?i.emit("update",e):y.value||F(e)})),A.value.on("start",(()=>{i.emit("start",D())})),A.value.on("end",(()=>{i.emit("end",D())})),A.value.on("slide",(()=>{i.emit("slide",D())})),A.value.on("drag",(()=>{i.emit("drag",D())})),V.value.querySelectorAll("[data-handle]").forEach((e=>{e.onblur=()=>{V.value&&k.value.focused.split(" ").forEach((e=>{V.value.classList.remove(e)}))},e.onfocus=()=>{k.value.focused.split(" ").forEach((e=>{V.value.classList.add(e)}))}})),M.value=!0},z=()=>{A.value.off(),A.value.destroy(),A.value=null},H=(e,t)=>{M.value=!1,z(),T()};return e.onMounted(T),e.onUnmounted(z),e.watch(O,H,{immediate:!1}),e.watch(p,H,{immediate:!1}),e.watch(d,H,{immediate:!1}),e.watch(c,H,{immediate:!1}),e.watch(s,H,{immediate:!1}),e.watch(l,H,{immediate:!1}),e.watch(u,H,{immediate:!1}),e.watch(f,H,{immediate:!1}),e.watch(b,H,{immediate:!1,deep:!0}),e.watch(v,H,{immediate:!1,deep:!0}),e.watch(g,H,{immediate:!1,deep:!0}),e.watch(w,((e,r)=>{r&&("object"==typeof r&&"object"==typeof e&&e&&Object.keys(r)>Object.keys(e)||"object"==typeof r&&"object"!=typeof e||t(e))&&H()}),{immediate:!1}),e.watch(w,(e=>{if(t(e))return void j(p.value,!1);let r=D();O.value&&!Array.isArray(r)&&(r=[r]),(O.value&&!a(e,r)||!O.value&&e!=r)&&j(e,!1)}),{deep:!0}),{slider:V,slider$:A,isRange:O,sliderProps:U,init:T,destroy:z,refresh:H,update:j,reset:()=>{F(E.value)}}}(r,i,{value:s.value,initialValue:s.initialValue,tooltipFormat:u.tooltipFormat,tooltipsFormat:u.tooltipsFormat,tooltipsMerge:u.tooltipsMerge,classList:l.classList});return{...l,...u,...c}}};return s.render=function(t,r,i,n,o,a){return e.openBlock(),e.createElementBlock("div",e.mergeProps(t.sliderProps,{ref:"slider"}),null,16)},s.__file="src/Slider.vue",s}(Vue); +var VueformSlider=function(t){"use strict";function e(t){return null==t||!1===t}function r(e){return t.customRef((()=>({get:e,set:()=>{}})))}var i,n,o,a,s=(i=function(t,e){t.exports=function(){var t=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function e(t){return t.split("").reverse().join("")}function r(t,e){return t.substring(0,e.length)===e}function i(t,e){return t.slice(-1*e.length)===e}function n(t,e,r){if((t[e]||t[r])&&t[e]===t[r])throw new Error(e)}function o(t){return"number"==typeof t&&isFinite(t)}function a(t,e){return t=t.toString().split("e"),(+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]+e:e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]-e:-e))).toFixed(e)}function s(t,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==t&&0===parseFloat(h.toFixed(t))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==t&&(h=a(h,t)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=e(g).match(/.{1,3}/g),g=e(g.join(e(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(t,e,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),e&&(h=h.split(e).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(e){var r,i,o,a={};for(void 0===e.suffix&&(e.suffix=e.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(e,r,i){var n,o=[];for(n=0;n0&&(b(t,e),setTimeout((function(){y(t,e)}),r))}function m(t){return Math.max(Math.min(t,100),0)}function v(t){return Array.isArray(t)?t:[t]}function g(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function b(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function y(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function S(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 x(t,e){return 100/(e-t)}function w(t,e,r){return 100*e/(t[r+1]-t[r])}function E(t,e){for(var r=1;t>=e[r];)r+=1;return r}function N(t,e,r){if(r>=t.slice(-1)[0])return 100;var i=E(r,t),n=t[i-1],o=t[i],a=e[i-1],s=e[i];return a+function(t,e){return w(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([n,o],r)/x(a,s)}function A(t,e,r,i){if(100===i)return i;var n=E(i,t),o=t[n-1],a=t[n];return r?i-o>(a-o)/2?a:o:e[n-1]?t[n-1]+function(t,e){return Math.round(t/e)*e}(i-t[n-1],e[n-1]):i}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(o||(o={})),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(a||(a={}));var C=function(){function t(t,e,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=e;var n=[];for(Object.keys(t).forEach((function(e){n.push([v(t[e]),e])})),n.sort((function(t,e){return t[0][0]-e[0][0]})),i=0;ithis.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++,null===e&&(e=[]);var o=1,a=e[n],s=0,l=0,u=0,c=0;for(i=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],e[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/e[n+c],i=1):(l=e[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=e[n+c]*o;return t+u},t.prototype.toStepping=function(t){return t=N(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,r){if(r>=100)return t.slice(-1)[0];var i=E(r,e),n=t[i-1],o=t[i],a=e[i-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([n,o],(r-a)*x(a,e[i]))}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=A(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var i=E(t,this.xPct);return(100===t||e&&t===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},t.prototype.getNearbySteps=function(t){var e=E(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],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(g);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){var r;if(!f(r="min"===t?0:"max"===t?100:parseFloat(t))||!f(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(e[0]);var i=Number(e[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){if(e)if(this.xVal[t]!==this.xVal[t+1]){this.xSteps[t]=w([this.xVal[t],this.xVal[t+1]],e,0)/x(this.xPct[t],this.xPct[t+1]);var r=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[t]+this.xNumSteps[t]*i;this.xHighestCompleteStep[t]=n}else this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t]},t}(),k={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},V={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},P={tooltips:".__tooltips",aria:".__aria"};function L(t,e){if(!f(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function U(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function M(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function O(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function D(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'.");t.spectrum=new C(e,t.snap||!1,t.singleStep)}function j(t,e){if(e=v(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function F(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function z(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function H(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function R(t,e){var r,i=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function $(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 X(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=e.indexOf("tap")>=0,i=e.indexOf("drag")>=0,n=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0,s=e.indexOf("unconstrained")>=0,l=e.indexOf("drag-all")>=0,u=e.indexOf("smooth-steps")>=0;if(n){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");T(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function Y(t,e){if(!1!==e)if(!0===e||u(e)){t.tooltips=[];for(var r=0;r= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,i=[];e--;)i[e]=e*r;return i.push(100),_(i,t.stepped)}return t.mode===o.Positions?_(t.values,t.stepped):t.mode===o.Values?t.stepped?t.values.map((function(t){return N.fromStepping(N.getStep(N.toStepping(t)))})):t.values:[]}(t),i={},n=N.xVal[0],s=N.xVal[N.xVal.length-1],l=!1,u=!1,c=0;return e=r.slice().sort((function(t,e){return t-e})),(r=e.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==n&&(r.unshift(n),l=!0),r[r.length-1]!==s&&(r.push(s),u=!0),r.forEach((function(e,n){var s,p,d,f,h,m,v,g,b,y,S=e,x=r[n+1],w=t.mode===o.Steps;for(w&&(s=N.xNumSteps[n]),s||(s=x-S),void 0===x&&(x=S),s=Math.max(s,1e-7),p=S;p<=x;p=Number((p+s).toFixed(7))){for(g=(h=(f=N.toStepping(p))-c)/(t.density||1),y=h/(b=Math.round(g)),d=1;d<=b;d+=1)i[(m=c+d*y).toFixed(5)]=[N.fromStepping(m),0];v=r.indexOf(p)>-1?a.LargeValue:w?a.SmallValue:a.NoValue,!n&&l&&p!==x&&(v=0),p===x&&u||(i[f.toFixed(5)]=[p,v]),c=f}})),i}function X(t,r,i){var n,o,s=U.createElement("div"),l=((n={})[a.None]="",n[a.NoValue]=e.cssClasses.valueNormal,n[a.LargeValue]=e.cssClasses.valueLarge,n[a.SmallValue]=e.cssClasses.valueSub,n),u=((o={})[a.None]="",o[a.NoValue]=e.cssClasses.markerNormal,o[a.LargeValue]=e.cssClasses.markerLarge,o[a.SmallValue]=e.cssClasses.markerSub,o),c=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],p=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];function d(t,r){var i=r===e.cssClasses.value,n=i?l:u;return r+" "+(i?c:p)[e.ort]+" "+n[t]}return b(s,e.cssClasses.pips),b(s,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(t).forEach((function(n){!function(t,n,o){if((o=r?r(n,o):o)!==a.None){var l=j(s,!1);l.className=d(o,e.cssClasses.marker),l.style[e.style]=t+"%",o>a.NoValue&&((l=j(s,!1)).className=d(o,e.cssClasses.value),l.setAttribute("data-value",String(n)),l.style[e.style]=t+"%",l.innerHTML=String(i.to(n)))}}(n,t[n][0],t[n][1])})),s}function Y(){l&&(c(l),l=null)}function I(t){Y();var e=$(t),r=t.filter,i=t.format||{to:function(t){return String(Math.round(t))}};return l=E.appendChild(X(e,r,i))}function W(){var t=i.getBoundingClientRect(),r="offset"+["Width","Height"][e.ort];return 0===e.ort?t.width||i[r]:t.height||i[r]}function G(t,r,i,n){var o=function(o){var a,s,l=function(t,e,r){var i=0===t.type.indexOf("touch"),n=0===t.type.indexOf("mouse"),o=0===t.type.indexOf("pointer"),a=0,s=0;0===t.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===t.type&&!t.buttons&&!t.touches)return!1;if(i){var l=function(e){var i=e.target;return i===r||r.contains(i)||t.composed&&t.composedPath().shift()===r};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}e=e||S(U),(n||o)&&(a=t.clientX+e.x,s=t.clientY+e.y);return t.pageOffset=e,t.points=[a,s],t.cursor=n||o,t}(o,n.pageOffset,n.target||r);return!!l&&(!(R()&&!n.doNotReject)&&(a=E,s=e.cssClasses.tap,!((a.classList?a.classList.contains(s):new RegExp("\\b"+s+"\\b").test(a.className))&&!n.doNotReject)&&(!(t===x.start&&void 0!==l.buttons&&l.buttons>1)&&((!n.hover||!l.buttons)&&(w||l.preventDefault(),l.calcPoint=l.points[e.ort],void i(l,n))))))},a=[];return t.split(" ").forEach((function(t){r.addEventListener(t,o,!!w&&{passive:!0}),a.push([t,o])})),a}function J(t){var r,n,o,a,s,l,u=100*(t-(r=i,n=e.ort,o=r.getBoundingClientRect(),a=r.ownerDocument,s=a.documentElement,l=S(a),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?o.top+l.y-s.clientTop:o.left+l.x-s.clientLeft))/W();return u=m(u),e.dir?100-u:u}function K(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&Z(t,e)}function Q(t,r){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==r.buttonsProperty)return Z(t,r);var i=(e.dir?-1:1)*(t.calcPoint-r.startCalcPoint);ut(i>0,100*i/r.baseSize,r.locations,r.handleNumbers,r.connect)}function Z(t,r){r.handle&&(y(r.handle,e.cssClasses.active),V-=1),r.listeners.forEach((function(t){M.removeEventListener(t[0],t[1])})),0===V&&(y(E,e.cssClasses.drag),pt(),t.cursor&&(O.style.cursor="",O.removeEventListener("selectstart",d))),e.events.smoothSteps&&(r.handleNumbers.forEach((function(t){dt(t,C[t],!0,!0,!1,!1)})),r.handleNumbers.forEach((function(t){at("update",t)}))),r.handleNumbers.forEach((function(t){at("change",t),at("set",t),at("end",t)}))}function et(t,r){if(!r.handleNumbers.some(q)){var i;if(1===r.handleNumbers.length)i=n[r.handleNumbers[0]].children[0],V+=1,b(i,e.cssClasses.active);t.stopPropagation();var o=[],a=G(x.move,M,Q,{target:t.target,handle:i,connect:r.connect,listeners:o,startCalcPoint:t.calcPoint,baseSize:W(),pageOffset:t.pageOffset,handleNumbers:r.handleNumbers,buttonsProperty:t.buttons,locations:C.slice()}),s=G(x.end,M,Z,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers}),l=G("mouseout",M,K,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers});o.push.apply(o,a.concat(s,l)),t.cursor&&(O.style.cursor=getComputedStyle(t.target).cursor,n.length>1&&b(E,e.cssClasses.drag),O.addEventListener("selectstart",d,!1)),r.handleNumbers.forEach((function(t){at("start",t)}))}}function rt(t){t.stopPropagation();var r=J(t.calcPoint),i=function(t){var e=100,r=!1;return n.forEach((function(i,n){if(!q(n)){var o=C[n],a=Math.abs(o-t);(ao||100===a&&100===e)&&(r=n,e=a)}})),r}(r);!1!==i&&(e.events.snap||h(E,e.cssClasses.tap,e.animationDuration),dt(i,r,!0,!0),pt(),at("slide",i,!0),at("update",i,!0),e.events.snap?et(t,{handleNumbers:[i]}):(at("change",i,!0),at("set",i,!0)))}function it(t){var e=J(t.calcPoint),r=N.getStep(e),i=N.fromStepping(r);Object.keys(L).forEach((function(t){"hover"===t.split(".")[0]&&L[t].forEach((function(t){t.call(bt,i)}))}))}function nt(t,e){L[t]=L[t]||[],L[t].push(e),"update"===t.split(".")[0]&&n.forEach((function(t,e){at("update",e)}))}function ot(t){var e=t&&t.split(".")[0],r=e?t.substring(e.length):t;Object.keys(L).forEach((function(t){var i=t.split(".")[0],n=t.substring(i.length);e&&e!==i||r&&r!==n||function(t){return t===P.aria||t===P.tooltips}(n)&&r!==n||delete L[t]}))}function at(t,r,i){Object.keys(L).forEach((function(n){var o=n.split(".")[0];t===o&&L[n].forEach((function(t){t.call(bt,A.map(e.format.to),r,A.slice(),i||!1,C.slice(),bt)}))}))}function st(t,r,i,o,a,s,l){var u;return n.length>1&&!e.events.unconstrained&&(o&&r>0&&(u=N.getAbsoluteDistance(t[r-1],e.margin,!1),i=Math.max(i,u)),a&&r1&&e.limit&&(o&&r>0&&(u=N.getAbsoluteDistance(t[r-1],e.limit,!1),i=Math.min(i,u)),a&&r1?n.forEach((function(t,e){var i=st(a,t,a[t]+r,u[e],c[e],!1,l);!1===i?r=0:(r=i-a[t],a[t]=i)})):u=c=[!0];var p=!1;n.forEach((function(t,e){p=dt(t,i[t]+r,u[e],c[e],!1,l)||p})),p&&(n.forEach((function(t){at("update",t),at("slide",t)})),null!=o&&at("drag",s))}function ct(t,r){return e.dir?100-t-r:t}function pt(){k.forEach((function(t){var e=C[t]>50?-1:1,r=3+(n.length+e*t);n[t].style.zIndex=String(r)}))}function dt(t,r,i,o,a,s){return a||(r=st(C,t,r,i,o,!1,s)),!1!==r&&(function(t,r){C[t]=r,A[t]=N.fromStepping(r);var i="translate("+lt(ct(r,0)-D+"%","0")+")";n[t].style[e.transformRule]=i,ft(t),ft(t+1)}(t,r),!0)}function ft(t){if(s[t]){var r=0,i=100;0!==t&&(r=C[t-1]),t!==s.length-1&&(i=C[t]);var n=i-r,o="translate("+lt(ct(r,n)+"%","0")+")",a="scale("+lt(n/100,"1")+")";s[t].style[e.transformRule]=o+" "+a}}function ht(t,r){return null===t||!1===t||void 0===t?C[r]:("number"==typeof t&&(t=String(t)),!1!==(t=e.format.from(t))&&(t=N.toStepping(t)),!1===t||isNaN(t)?C[r]:t)}function mt(t,r,i){var n=v(t),o=void 0===C[0];r=void 0===r||r,e.animate&&!o&&h(E,e.cssClasses.tap,e.animationDuration),k.forEach((function(t){dt(t,ht(n[t],t),!0,!1,i)}));var a=1===k.length?0:1;if(o&&N.hasNoSize()&&(i=!0,C[0]=0,k.length>1)){var s=100/(k.length-1);k.forEach((function(t){C[t]=t*s}))}for(;ai.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===r?o=null:0===r&&(a=null);var s=N.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}b(f=E,e.cssClasses.target),0===e.dir?b(f,e.cssClasses.ltr):b(f,e.cssClasses.rtl),0===e.ort?b(f,e.cssClasses.horizontal):b(f,e.cssClasses.vertical),b(f,"rtl"===getComputedStyle(f).direction?e.cssClasses.textDirectionRtl:e.cssClasses.textDirectionLtr),i=j(f,e.cssClasses.base),function(t,r){var i=j(r,e.cssClasses.connects);n=[],(s=[]).push(z(i,t[0]));for(var o=0;o=0&&t"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},modelValue:{validator:function(t){return t=>"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(i,n){const o=function(r,i,n){const{value:o,modelValue:a,min:s}=t.toRefs(r);let l=void 0!==a.value?a:o;const u=t.ref(l.value);if(e(l.value)&&(l=t.ref(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:u}}(i),a=function(e,i,n){const{classes:o,showTooltip:a,tooltipPosition:s,orientation:l}=t.toRefs(e),u=r((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...o.value})));return{classList:r((()=>{const t={...u.value};return Object.keys(t).forEach((e=>{t[e]=Array.isArray(t[e])?t[e].filter((t=>null!==t)).join(" "):t[e]})),"always"!==a.value&&(t.target+=` ${"drag"===a.value?t.tooltipDrag:t.tooltipFocus}`),"horizontal"===l.value&&(t.tooltip+="bottom"===s.value?` ${t.tooltipBottom}`:` ${t.tooltipTop}`),"vertical"===l.value&&(t.tooltip+="right"===s.value?` ${t.tooltipRight}`:` ${t.tooltipLeft}`),t}))}}(i),s=function(e,i,n){const{format:o,step:a}=t.toRefs(e),s=n.value,u=n.classList,c=t.computed((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:l({...o.value}):l({decimals:a.value>=0?0:2}))),p=r((()=>Array.isArray(s.value)?s.value.map((t=>c.value)):c.value));return{tooltipFormat:c,tooltipsFormat:p,tooltipsMerge:(t,e,r)=>{var i="rtl"===getComputedStyle(t).direction,n="rtl"===t.noUiSlider.options.direction,o="vertical"===t.noUiSlider.options.orientation,a=t.noUiSlider.getTooltips(),s=t.noUiSlider.getOrigins();a.forEach((function(t,e){t&&s[e].appendChild(t)})),t.noUiSlider.on("update",(function(t,s,l,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=c.value.to(parseFloat(t[0])));for(var g=1;ge)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(c.value.to(parseFloat(t[g]))),h[v].push(d[g]));f.forEach((function(t,e){for(var s=t.length,l=0;l{a[c].classList.contains(t)&&a[c].classList.remove(t)}))}else a[c].style.display="none",u.value.tooltipHidden.split(" ").forEach((t=>{a[c].classList.add(t)}))}}))}))}}}(i,0,{value:o.value,classList:a.classList}),u=function(i,n,o){const{orientation:a,direction:s,tooltips:l,step:u,min:c,max:p,merge:d,id:f,disabled:h,options:m,classes:v,format:g,lazy:b,ariaLabelledby:y,aria:S}=t.toRefs(i),x=o.value,w=o.initialValue,E=o.tooltipsFormat,N=o.tooltipsMerge,A=o.tooltipFormat,C=o.classList,k=t.shallowRef(null),V=t.shallowRef(null),P=t.ref(!1),L=r((()=>{let t={cssPrefix:"",cssClasses:C.value,orientation:a.value,direction:s.value,tooltips:!!l.value&&E.value,connect:"lower",start:e(x.value)?c.value:x.value,range:{min:c.value,max:p.value}};if(u.value>0&&(t.step=u.value),Array.isArray(x.value)&&(t.connect=!0),y.value||S&&Object.keys(S.value).length){let e=Array.isArray(x.value)?x.value:[x.value];t.handleAttributes=e.map((t=>Object.assign({},S.value,y.value?{"aria-labelledby":y.value}:{})))}return g.value&&(t.ariaFormat=A.value),t})),U=r((()=>{let t={id:f.value?f.value:void 0};return h.value&&(t.disabled=!0),t})),M=r((()=>Array.isArray(x.value))),O=()=>{let t=V.value.get();return Array.isArray(t)?t.map((t=>parseFloat(t))):parseFloat(t)},D=(t,e=!0)=>{V.value.set(t,e)},j=t=>{n.emit("input",t),n.emit("update:modelValue",t),n.emit("update",t)},F=()=>{V.value=rt.create(k.value,Object.assign({},L.value,m.value)),l.value&&M.value&&d.value>=0&&N(k.value,d.value," - "),V.value.on("set",(()=>{const t=O();n.emit("change",t),n.emit("set",t),b.value&&j(t)})),V.value.on("update",(()=>{if(!P.value)return;const t=O();M.value&&it(x.value,t)||!M.value&&x.value==t?n.emit("update",t):b.value||j(t)})),V.value.on("start",(()=>{n.emit("start",O())})),V.value.on("end",(()=>{n.emit("end",O())})),V.value.on("slide",(()=>{n.emit("slide",O())})),V.value.on("drag",(()=>{n.emit("drag",O())})),k.value.querySelectorAll("[data-handle]").forEach((t=>{t.onblur=()=>{k.value&&C.value.focused.split(" ").forEach((t=>{k.value.classList.remove(t)}))},t.onfocus=()=>{C.value.focused.split(" ").forEach((t=>{k.value.classList.add(t)}))}})),P.value=!0},z=()=>{V.value.off(),V.value.destroy(),V.value=null},H=(t,e)=>{P.value=!1,z(),F()};return t.onMounted(F),t.onUnmounted(z),t.watch([M,c,p,u,a,s,l,d],H,{immediate:!1}),t.watch([g,m,v],H,{immediate:!1,deep:!0}),t.watch(x,((t,r)=>{r&&("object"==typeof r&&"object"==typeof t&&t&&Object.keys(r)>Object.keys(t)||"object"==typeof r&&"object"!=typeof t||e(t))&&H()}),{immediate:!1}),t.watch(x,(t=>{if(e(t))return void D(c.value,!1);let r=O();M.value&&!Array.isArray(r)&&(r=[r]),(M.value&&!it(t,r)||!M.value&&t!=r)&&D(t,!1)}),{deep:!0}),{slider:k,slider$:V,isRange:M,sliderProps:U,init:F,destroy:z,refresh:H,update:D,reset:()=>{j(w.value)}}}(i,n,{value:o.value,initialValue:o.initialValue,tooltipFormat:s.tooltipFormat,tooltipsFormat:s.tooltipsFormat,tooltipsMerge:s.tooltipsMerge,classList:a.classList});return{...a,...s,...u}}};return nt.render=function(e,r,i,n,o,a){return t.openBlock(),t.createElementBlock("div",t.mergeProps(e.sliderProps,{ref:"slider"}),null,16)},nt.__file="src/Slider.vue",nt}(Vue); diff --git a/dist/slider.js b/dist/slider.js index 84a14d4..367251f 100644 --- a/dist/slider.js +++ b/dist/slider.js @@ -1 +1 @@ -import{toRefs as e,ref as t,computed as r,onMounted as i,onUnmounted as n,watch as o,openBlock as a,createElementBlock as s,mergeProps as l}from"vue";function u(e){return-1!==[null,void 0,!1].indexOf(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function p(e){var t={exports:{}};return e(t,t.exports),t.exports}var d=p((function(e,t){e.exports=function(){var e=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function t(e){return e.split("").reverse().join("")}function r(e,t){return e.substring(0,t.length)===t}function i(e,t){return e.slice(-1*t.length)===t}function n(e,t,r){if((e[t]||e[r])&&e[t]===e[r])throw new Error(t)}function o(e){return"number"==typeof e&&isFinite(e)}function a(e,t){return e=e.toString().split("e"),(+((e=(e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]-t:-t))).toFixed(t)}function s(e,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==e&&0===parseFloat(h.toFixed(e))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==e&&(h=a(h,e)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=t(g).match(/.{1,3}/g),g=t(g.join(t(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(e,t,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),t&&(h=h.split(t).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(t){var r,i,o,a={};for(void 0===t.suffix&&(t.suffix=t.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(t,r,i){var n,o=[];for(n=0;n0&&(h(e,t),setTimeout((function(){m(e,t)}),r))}function p(e){return Math.max(Math.min(e,100),0)}function d(e){return Array.isArray(e)?e:[e]}function f(e){var t=(e=String(e)).split(".");return t.length>1?t[1].length:0}function h(e,t){e.classList&&!/\s/.test(t)?e.classList.add(t):e.className+=" "+t}function m(e,t){e.classList&&!/\s/.test(t)?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function v(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function g(e){var t=void 0!==window.pageXOffset,r="CSS1Compat"===(e.compatMode||"");return{x:t?window.pageXOffset:r?e.documentElement.scrollLeft:e.body.scrollLeft,y:t?window.pageYOffset:r?e.documentElement.scrollTop:e.body.scrollTop}}function b(){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 y(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}function S(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function x(e,t){return 100/(t-e)}function w(e,t,r){return 100*t/(e[r+1]-e[r])}function E(e,t){return w(e,e[0]<0?t+Math.abs(e[0]):t-e[0],0)}function P(e,t){return t*(e[1]-e[0])/100+e[0]}function N(e,t){for(var r=1;e>=t[r];)r+=1;return r}function C(e,t,r){if(r>=e.slice(-1)[0])return 100;var i=N(r,e),n=e[i-1],o=e[i],a=t[i-1],s=t[i];return a+E([n,o],r)/x(a,s)}function k(e,t,r){if(r>=100)return e.slice(-1)[0];var i=N(r,t),n=e[i-1],o=e[i],a=t[i-1];return P([n,o],(r-a)*x(a,t[i]))}function V(e,t,r,i){if(100===i)return i;var n=N(i,e),o=e[n-1],a=e[n];return r?i-o>(a-o)/2?a:o:t[n-1]?e[n-1]+s(i-e[n-1],t[n-1]):i}var A,M;e.PipsMode=void 0,(M=e.PipsMode||(e.PipsMode={})).Range="range",M.Steps="steps",M.Positions="positions",M.Count="count",M.Values="values",e.PipsType=void 0,(A=e.PipsType||(e.PipsType={}))[A.None=-1]="None",A[A.NoValue=0]="NoValue",A[A.LargeValue=1]="LargeValue",A[A.SmallValue=2]="SmallValue";var L=function(){function e(e,t,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=t;var n=[];for(Object.keys(e).forEach((function(t){n.push([d(e[t]),t])})),n.sort((function(e,t){return e[0][0]-t[0][0]})),i=0;ithis.xPct[n+1];)n++;else e===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||e!==this.xPct[n+1]||n++,null===t&&(t=[]);var o=1,a=t[n],s=0,l=0,u=0,c=0;for(i=r?(e-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-e)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],t[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/t[n+c],i=1):(l=t[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=t[n+c]*o;return e+u},e.prototype.toStepping=function(e){return e=C(this.xVal,this.xPct,e)},e.prototype.fromStepping=function(e){return k(this.xVal,this.xPct,e)},e.prototype.getStep=function(e){return e=V(this.xPct,this.xSteps,this.snap,e)},e.prototype.getDefaultStep=function(e,t,r){var i=N(e,this.xPct);return(100===e||t&&e===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},e.prototype.getNearbySteps=function(e){var t=N(e,this.xPct);return{stepBefore:{startValue:this.xVal[t-2],step:this.xNumSteps[t-2],highestStep:this.xHighestCompleteStep[t-2]},thisStep:{startValue:this.xVal[t-1],step:this.xNumSteps[t-1],highestStep:this.xHighestCompleteStep[t-1]},stepAfter:{startValue:this.xVal[t],step:this.xNumSteps[t],highestStep:this.xHighestCompleteStep[t]}}},e.prototype.countStepDecimals=function(){var e=this.xNumSteps.map(f);return Math.max.apply(null,e)},e.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},e.prototype.convert=function(e){return this.getStep(this.toStepping(e))},e.prototype.handleEntryPoint=function(e,t){var r;if(!u(r="min"===e?0:"max"===e?100:parseFloat(e))||!u(t[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(t[0]);var i=Number(t[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},e.prototype.handleStepPoint=function(e,t){if(t)if(this.xVal[e]!==this.xVal[e+1]){this.xSteps[e]=w([this.xVal[e],this.xVal[e+1]],t,0)/x(this.xPct[e],this.xPct[e+1]);var r=(this.xVal[e+1]-this.xVal[e])/this.xNumSteps[e],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[e]+this.xNumSteps[e]*i;this.xHighestCompleteStep[e]=n}else this.xSteps[e]=this.xHighestCompleteStep[e]=this.xVal[e]},e}(),U={to:function(e){return void 0===e?"":e.toFixed(2)},from:Number},O={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},D={tooltips:".__tooltips",aria:".__aria"};function j(e,t){if(!u(t))throw new Error("noUiSlider: 'step' is not numeric.");e.singleStep=t}function F(e,t){if(!u(t))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");e.keyboardPageMultiplier=t}function T(e,t){if(!u(t))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");e.keyboardMultiplier=t}function z(e,t){if(!u(t))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");e.keyboardDefaultStep=t}function H(e,t){if("object"!=typeof t||Array.isArray(t))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===t.min||void 0===t.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");e.spectrum=new L(t,e.snap||!1,e.singleStep)}function q(e,t){if(t=d(t),!Array.isArray(t)||!t.length)throw new Error("noUiSlider: 'start' option is incorrect.");e.handles=t.length,e.start=t}function R(e,t){if("boolean"!=typeof t)throw new Error("noUiSlider: 'snap' option must be a boolean.");e.snap=t}function B(e,t){if("boolean"!=typeof t)throw new Error("noUiSlider: 'animate' option must be a boolean.");e.animate=t}function _(e,t){if("number"!=typeof t)throw new Error("noUiSlider: 'animationDuration' option must be a number.");e.animationDuration=t}function $(e,t){var r,i=[!1];if("lower"===t?t=[!0,!1]:"upper"===t&&(t=[!1,!0]),!0===t||!1===t){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function G(e,t){switch(t){case"ltr":e.dir=0;break;case"rtl":e.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function J(e,t){if("string"!=typeof t)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=t.indexOf("tap")>=0,i=t.indexOf("drag")>=0,n=t.indexOf("fixed")>=0,o=t.indexOf("snap")>=0,a=t.indexOf("hover")>=0,s=t.indexOf("unconstrained")>=0,l=t.indexOf("drag-all")>=0,u=t.indexOf("smooth-steps")>=0;if(n){if(2!==e.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");Y(e,e.start[1]-e.start[0])}if(s&&(e.margin||e.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");e.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function K(e,t){if(!1!==t)if(!0===t||r(t)){e.tooltips=[];for(var i=0;i= 2) required for mode 'count'.");for(var r=t.values-1,i=100/r,n=[];r--;)n[r]=r*i;return n.push(100),J(n,t.stepped)}return t.mode===e.PipsMode.Positions?J(t.values,t.stepped):t.mode===e.PipsMode.Values?t.stepped?t.values.map((function(e){return k.fromStepping(k.getStep(k.toStepping(e)))})):t.values:[]}function J(e,t){return e.map((function(e){return k.fromStepping(t?k.getStep(e):e)}))}function K(t){function r(e,t){return Number((e+t).toFixed(7))}var i=G(t),n={},o=k.xVal[0],s=k.xVal[k.xVal.length-1],l=!1,u=!1,c=0;return(i=a(i.slice().sort((function(e,t){return e-t}))))[0]!==o&&(i.unshift(o),l=!0),i[i.length-1]!==s&&(i.push(s),u=!0),i.forEach((function(o,a){var s,p,d,f,h,m,v,g,b,y,S=o,x=i[a+1],w=t.mode===e.PipsMode.Steps;for(w&&(s=k.xNumSteps[a]),s||(s=x-S),void 0===x&&(x=S),s=Math.max(s,1e-7),p=S;p<=x;p=r(p,s)){for(g=(h=(f=k.toStepping(p))-c)/(t.density||1),y=h/(b=Math.round(g)),d=1;d<=b;d+=1)n[(m=c+d*y).toFixed(5)]=[k.fromStepping(m),0];v=i.indexOf(p)>-1?e.PipsType.LargeValue:w?e.PipsType.SmallValue:e.PipsType.NoValue,!a&&l&&p!==x&&(v=0),p===x&&u||(n[f.toFixed(5)]=[p,v]),c=f}})),n}function Q(t,i,n){var o,a,s=O.createElement("div"),l=((o={})[e.PipsType.None]="",o[e.PipsType.NoValue]=r.cssClasses.valueNormal,o[e.PipsType.LargeValue]=r.cssClasses.valueLarge,o[e.PipsType.SmallValue]=r.cssClasses.valueSub,o),u=((a={})[e.PipsType.None]="",a[e.PipsType.NoValue]=r.cssClasses.markerNormal,a[e.PipsType.LargeValue]=r.cssClasses.markerLarge,a[e.PipsType.SmallValue]=r.cssClasses.markerSub,a),c=[r.cssClasses.valueHorizontal,r.cssClasses.valueVertical],p=[r.cssClasses.markerHorizontal,r.cssClasses.markerVertical];function d(e,t){var i=t===r.cssClasses.value,n=i?l:u;return t+" "+(i?c:p)[r.ort]+" "+n[e]}function f(t,o,a){if((a=i?i(o,a):a)!==e.PipsType.None){var l=z(s,!1);l.className=d(a,r.cssClasses.marker),l.style[r.style]=t+"%",a>e.PipsType.NoValue&&((l=z(s,!1)).className=d(a,r.cssClasses.value),l.setAttribute("data-value",String(o)),l.style[r.style]=t+"%",l.innerHTML=String(n.to(o)))}}return h(s,r.cssClasses.pips),h(s,0===r.ort?r.cssClasses.pipsHorizontal:r.cssClasses.pipsVertical),Object.keys(t).forEach((function(e){f(e,t[e][0],t[e][1])})),s}function Z(){w&&(i(w),w=null)}function ee(e){Z();var t=K(e),r=e.filter,i=e.format||{to:function(e){return String(Math.round(e))}};return w=C.appendChild(Q(t,r,i))}function te(){var e=u.getBoundingClientRect(),t="offset"+["Width","Height"][r.ort];return 0===r.ort?e.width||u[t]:e.height||u[t]}function re(e,t,i,n){var o=function(o){var a=ie(o,n.pageOffset,n.target||t);return!!a&&!($()&&!n.doNotReject)&&!(v(C,r.cssClasses.tap)&&!n.doNotReject)&&!(e===P.start&&void 0!==a.buttons&&a.buttons>1)&&(!n.hover||!a.buttons)&&(N||a.preventDefault(),a.calcPoint=a.points[r.ort],void i(a,n))},a=[];return e.split(" ").forEach((function(e){t.addEventListener(e,o,!!N&&{passive:!0}),a.push([e,o])})),a}function ie(e,t,r){var i=0===e.type.indexOf("touch"),n=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),a=0,s=0;if(0===e.type.indexOf("MSPointer")&&(o=!0),"mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(i){var l=function(t){var i=t.target;return i===r||r.contains(i)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){var u=Array.prototype.filter.call(e.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(e.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}return t=t||g(O),(n||o)&&(a=e.clientX+t.x,s=e.clientY+t.y),e.pageOffset=t,e.points=[a,s],e.cursor=n||o,e}function ne(e){var t=100*(e-l(u,r.ort))/te();return t=p(t),r.dir?100-t:t}function ae(e){var t=100,r=!1;return f.forEach((function(i,n){if(!X(n)){var o=A[n],a=Math.abs(o-e);(ao||100===a&&100===t)&&(r=n,t=a)}})),r}function se(e,t){"mouseout"===e.type&&"HTML"===e.target.nodeName&&null===e.relatedTarget&&ue(e,t)}function le(e,t){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===e.buttons&&0!==t.buttonsProperty)return ue(e,t);var i=(r.dir?-1:1)*(e.calcPoint-t.startCalcPoint);xe(i>0,100*i/t.baseSize,t.locations,t.handleNumbers,t.connect)}function ue(e,t){t.handle&&(m(t.handle,r.cssClasses.active),L-=1),t.listeners.forEach((function(e){j.removeEventListener(e[0],e[1])})),0===L&&(m(C,r.cssClasses.drag),Pe(),e.cursor&&(F.style.cursor="",F.removeEventListener("selectstart",o))),r.events.smoothSteps&&(t.handleNumbers.forEach((function(e){Ne(e,A[e],!0,!0,!1,!1)})),t.handleNumbers.forEach((function(e){be("update",e)}))),t.handleNumbers.forEach((function(e){be("change",e),be("set",e),be("end",e)}))}function ce(e,t){if(!t.handleNumbers.some(X)){var i;1===t.handleNumbers.length&&(i=f[t.handleNumbers[0]].children[0],L+=1,h(i,r.cssClasses.active)),e.stopPropagation();var n=[],a=re(P.move,j,le,{target:e.target,handle:i,connect:t.connect,listeners:n,startCalcPoint:e.calcPoint,baseSize:te(),pageOffset:e.pageOffset,handleNumbers:t.handleNumbers,buttonsProperty:e.buttons,locations:A.slice()}),s=re(P.end,j,ue,{target:e.target,handle:i,listeners:n,doNotReject:!0,handleNumbers:t.handleNumbers}),l=re("mouseout",j,se,{target:e.target,handle:i,listeners:n,doNotReject:!0,handleNumbers:t.handleNumbers});n.push.apply(n,a.concat(s,l)),e.cursor&&(F.style.cursor=getComputedStyle(e.target).cursor,f.length>1&&h(C,r.cssClasses.drag),F.addEventListener("selectstart",o,!1)),t.handleNumbers.forEach((function(e){be("start",e)}))}}function pe(e){e.stopPropagation();var t=ne(e.calcPoint),i=ae(t);!1!==i&&(r.events.snap||c(C,r.cssClasses.tap,r.animationDuration),Ne(i,t,!0,!0),Pe(),be("slide",i,!0),be("update",i,!0),r.events.snap?ce(e,{handleNumbers:[i]}):(be("change",i,!0),be("set",i,!0)))}function de(e){var t=ne(e.calcPoint),r=k.getStep(t),i=k.fromStepping(r);Object.keys(U).forEach((function(e){"hover"===e.split(".")[0]&&U[e].forEach((function(e){e.call(Te,i)}))}))}function fe(e,t){if($()||X(t))return!1;var i=["Left","Right"],n=["Down","Up"],o=["PageDown","PageUp"],a=["Home","End"];r.dir&&!r.ort?i.reverse():r.ort&&!r.dir&&(n.reverse(),o.reverse());var s,l=e.key.replace("Arrow",""),u=l===o[0],c=l===o[1],p=l===n[0]||l===i[0]||u,d=l===n[1]||l===i[1]||c,f=l===a[0],h=l===a[1];if(!(p||d||f||h))return!0;if(e.preventDefault(),d||p){var m=p?0:1,v=Oe(t)[m];if(null===v)return!1;!1===v&&(v=k.getDefaultStep(A[t],p,r.keyboardDefaultStep)),v*=c||u?r.keyboardPageMultiplier:r.keyboardMultiplier,v=Math.max(v,1e-7),v*=p?-1:1,s=V[t]+v}else s=h?r.spectrum.xVal[r.spectrum.xVal.length-1]:r.spectrum.xVal[0];return Ne(t,k.toStepping(s),!0,!0),be("slide",t),be("update",t),be("change",t),be("set",t),!1}function he(e){e.fixed||f.forEach((function(e,t){re(P.start,e.children[0],ce,{handleNumbers:[t]})})),e.tap&&re(P.start,u,pe,{}),e.hover&&re(P.move,u,de,{hover:!0}),e.drag&&x.forEach((function(t,i){if(!1!==t&&0!==i&&i!==x.length-1){var n=f[i-1],o=f[i],a=[t],s=[n,o],l=[i-1,i];h(t,r.cssClasses.draggable),e.fixed&&(a.push(n.children[0]),a.push(o.children[0])),e.dragAll&&(s=f,l=M),a.forEach((function(e){re(P.start,e,ce,{handles:s,handleNumbers:l,connect:t})}))}}))}function me(e,t){U[e]=U[e]||[],U[e].push(t),"update"===e.split(".")[0]&&f.forEach((function(e,t){be("update",t)}))}function ve(e){return e===D.aria||e===D.tooltips}function ge(e){var t=e&&e.split(".")[0],r=t?e.substring(t.length):e;Object.keys(U).forEach((function(e){var i=e.split(".")[0],n=e.substring(i.length);t&&t!==i||r&&r!==n||ve(n)&&r!==n||delete U[e]}))}function be(e,t,i){Object.keys(U).forEach((function(n){var o=n.split(".")[0];e===o&&U[n].forEach((function(e){e.call(Te,V.map(r.format.to),t,V.slice(),i||!1,A.slice(),Te)}))}))}function ye(e,t,i,n,o,a,s){var l;return f.length>1&&!r.events.unconstrained&&(n&&t>0&&(l=k.getAbsoluteDistance(e[t-1],r.margin,!1),i=Math.max(i,l)),o&&t1&&r.limit&&(n&&t>0&&(l=k.getAbsoluteDistance(e[t-1],r.limit,!1),i=Math.min(i,l)),o&&t1?n.forEach((function(e,r){var i=ye(a,e,a[e]+t,u[r],c[r],!1,l);!1===i?t=0:(t=i-a[e],a[e]=i)})):u=c=[!0];var p=!1;n.forEach((function(e,r){p=Ne(e,i[e]+t,u[r],c[r],!1,l)||p})),p&&(n.forEach((function(e){be("update",e),be("slide",e)})),null!=o&&be("drag",s))}function we(e,t){return r.dir?100-e-t:e}function Ee(e,t){A[e]=t,V[e]=k.fromStepping(t);var i="translate("+Se(we(t,0)-T+"%","0")+")";f[e].style[r.transformRule]=i,Ce(e),Ce(e+1)}function Pe(){M.forEach((function(e){var t=A[e]>50?-1:1,r=3+(f.length+t*e);f[e].style.zIndex=String(r)}))}function Ne(e,t,r,i,n,o){return n||(t=ye(A,e,t,r,i,!1,o)),!1!==t&&(Ee(e,t),!0)}function Ce(e){if(x[e]){var t=0,i=100;0!==e&&(t=A[e-1]),e!==x.length-1&&(i=A[e]);var n=i-t,o="translate("+Se(we(t,n)+"%","0")+")",a="scale("+Se(n/100,"1")+")";x[e].style[r.transformRule]=o+" "+a}}function ke(e,t){return null===e||!1===e||void 0===e?A[t]:("number"==typeof e&&(e=String(e)),!1!==(e=r.format.from(e))&&(e=k.toStepping(e)),!1===e||isNaN(e)?A[t]:e)}function Ve(e,t,i){var n=d(e),o=void 0===A[0];t=void 0===t||t,r.animate&&!o&&c(C,r.cssClasses.tap,r.animationDuration),M.forEach((function(e){Ne(e,ke(n[e],e),!0,!1,i)}));var a=1===M.length?0:1;if(o&&k.hasNoSize()&&(i=!0,A[0]=0,M.length>1)){var s=100/(M.length-1);M.forEach((function(e){A[e]=e*s}))}for(;a=0&&ei.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===t?o=null:0===t&&(a=null);var s=k.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}function De(){return M.map(Oe)}function je(e,t){var i=Le(),o=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];o.forEach((function(t){void 0!==e[t]&&(s[t]=e[t])}));var a=oe(s);o.forEach((function(t){void 0!==e[t]&&(r[t]=a[t])})),k=a.spectrum,r.margin=a.margin,r.limit=a.limit,r.padding=a.padding,r.pips?ee(r.pips):Z(),r.tooltips?I():Y(),A=[],Ve(n(e.start)?e.start:i,t)}function Fe(){u=B(C),R(r.connect,u),he(r.events),Ve(r.start),r.pips&&ee(r.pips),r.tooltips&&I(),W()}Fe();var Te={destroy:Ue,steps:De,on:me,off:ge,get:Le,set:Ve,setHandle:Me,reset:Ae,__moveHandles:function(e,t,r){xe(e,t,A,r)},options:s,updateOptions:je,target:C,removePips:Z,removeTooltips:Y,getPositions:function(){return A.slice()},getTooltips:function(){return E},getOrigins:function(){return f},pips:ee};return Te}function se(e,t){if(!e||!e.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+e);if(e.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var r=ae(e,oe(t),t);return e.noUiSlider=r,r}var le={__spectrum:L,cssClasses:O,create:se};e.create=se,e.cssClasses=O,e.default=le,Object.defineProperty(e,"__esModule",{value:!0})}(t)})));function h(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=t.slice().sort();return e.length===t.length&&e.slice().sort().every((function(e,t){return e===r[t]}))}var m={name:"Slider",emits:["input","update:modelValue","start","slide","drag","update","change","set","end"],props:{...{value:{validator:function(e){return e=>"number"==typeof e||e instanceof Array||null==e||!1===e},required:!1},modelValue:{validator:function(e){return e=>"number"==typeof e||e instanceof Array||null==e||!1===e},required:!1}},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(a,s){const l=function(r,i,n){const{value:o,modelValue:a,min:s}=e(r);let l=a&&void 0!==a.value?a:o;const c=t(l.value);if(u(l.value)&&(l=t(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:c}}(a),c=function(t,i,n){const{classes:o,showTooltip:a,tooltipPosition:s,orientation:l}=e(t),u=r((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...o.value})));return{classList:r((()=>{const e={...u.value};return Object.keys(e).forEach((t=>{e[t]=Array.isArray(e[t])?e[t].filter((e=>null!==e)).join(" "):e[t]})),"always"!==a.value&&(e.target+=` ${"drag"===a.value?e.tooltipDrag:e.tooltipFocus}`),"horizontal"===l.value&&(e.tooltip+="bottom"===s.value?` ${e.tooltipBottom}`:` ${e.tooltipTop}`),"vertical"===l.value&&(e.tooltip+="right"===s.value?` ${e.tooltipRight}`:` ${e.tooltipLeft}`),e}))}}(a),p=function(t,i,n){const{format:o,step:a}=e(t),s=n.value,l=n.classList,u=r((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:d({...o.value}):d({decimals:a.value>=0?0:2}))),c=r((()=>Array.isArray(s.value)?s.value.map((e=>u.value)):u.value));return{tooltipFormat:u,tooltipsFormat:c,tooltipsMerge:(e,t,r)=>{var i="rtl"===getComputedStyle(e).direction,n="rtl"===e.noUiSlider.options.direction,o="vertical"===e.noUiSlider.options.orientation,a=e.noUiSlider.getTooltips(),s=e.noUiSlider.getOrigins();a.forEach((function(e,t){e&&s[t].appendChild(e)})),e.noUiSlider.on("update",(function(e,s,c,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=u.value.to(parseFloat(e[0])));for(var g=1;gt)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(u.value.to(parseFloat(e[g]))),h[v].push(d[g]));f.forEach((function(e,t){for(var s=e.length,u=0;u{a[c].classList.contains(e)&&a[c].classList.remove(e)}))}else a[c].style.display="none",l.value.tooltipHidden.split(" ").forEach((e=>{a[c].classList.add(e)}))}}))}))}}}(a,0,{value:l.value,classList:c.classList}),m=function(a,s,l){const{orientation:c,direction:p,tooltips:d,step:m,min:v,max:g,merge:b,id:y,disabled:S,options:x,classes:w,format:E,lazy:P,ariaLabelledby:N,aria:C}=e(a),k=l.value,V=l.initialValue,A=l.tooltipsFormat,M=l.tooltipsMerge,L=l.tooltipFormat,U=l.classList,O=t(null),D=t(null),j=t(!1),F=r((()=>{let e={cssPrefix:"",cssClasses:U.value,orientation:c.value,direction:p.value,tooltips:!!d.value&&A.value,connect:"lower",start:u(k.value)?v.value:k.value,range:{min:v.value,max:g.value}};if(m.value>0&&(e.step=m.value),Array.isArray(k.value)&&(e.connect=!0),N&&N.value||C&&Object.keys(C.value).length){let t=Array.isArray(k.value)?k.value:[k.value];e.handleAttributes=t.map((e=>Object.assign({},C.value,N&&N.value?{"aria-labelledby":N.value}:{})))}return E.value&&(e.ariaFormat=L.value),e})),T=r((()=>{let e={id:y&&y.value?y.value:void 0};return S.value&&(e.disabled=!0),e})),z=r((()=>Array.isArray(k.value))),H=()=>{let e=D.value.get();return Array.isArray(e)?e.map((e=>parseFloat(e))):parseFloat(e)},q=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];D.value.set(e,t)},R=e=>{s.emit("input",e),s.emit("update:modelValue",e),s.emit("update",e)},B=()=>{D.value=f.create(O.value,Object.assign({},F.value,x.value)),d.value&&z.value&&b.value>=0&&M(O.value,b.value," - "),D.value.on("set",(()=>{const e=H();s.emit("change",e),s.emit("set",e),P.value&&R(e)})),D.value.on("update",(()=>{if(!j.value)return;const e=H();z.value&&h(k.value,e)||!z.value&&k.value==e?s.emit("update",e):P.value||R(e)})),D.value.on("start",(()=>{s.emit("start",H())})),D.value.on("end",(()=>{s.emit("end",H())})),D.value.on("slide",(()=>{s.emit("slide",H())})),D.value.on("drag",(()=>{s.emit("drag",H())})),O.value.querySelectorAll("[data-handle]").forEach((e=>{e.onblur=()=>{O.value&&U.value.focused.split(" ").forEach((e=>{O.value.classList.remove(e)}))},e.onfocus=()=>{U.value.focused.split(" ").forEach((e=>{O.value.classList.add(e)}))}})),j.value=!0},_=()=>{D.value.off(),D.value.destroy(),D.value=null},$=(e,t)=>{j.value=!1,_(),B()};return i(B),n(_),o(z,$,{immediate:!1}),o(v,$,{immediate:!1}),o(g,$,{immediate:!1}),o(m,$,{immediate:!1}),o(c,$,{immediate:!1}),o(p,$,{immediate:!1}),o(d,$,{immediate:!1}),o(b,$,{immediate:!1}),o(E,$,{immediate:!1,deep:!0}),o(x,$,{immediate:!1,deep:!0}),o(w,$,{immediate:!1,deep:!0}),o(k,((e,t)=>{t&&("object"==typeof t&&"object"==typeof e&&e&&Object.keys(t)>Object.keys(e)||"object"==typeof t&&"object"!=typeof e||u(e))&&$()}),{immediate:!1}),o(k,(e=>{if(u(e))return void q(v.value,!1);let t=H();z.value&&!Array.isArray(t)&&(t=[t]),(z.value&&!h(e,t)||!z.value&&e!=t)&&q(e,!1)}),{deep:!0}),{slider:O,slider$:D,isRange:z,sliderProps:T,init:B,destroy:_,refresh:$,update:q,reset:()=>{R(V.value)}}}(a,s,{value:l.value,initialValue:l.initialValue,tooltipFormat:p.tooltipFormat,tooltipsFormat:p.tooltipsFormat,tooltipsMerge:p.tooltipsMerge,classList:c.classList});return{...c,...p,...m}}};m.render=function(e,t,r,i,n,o){return a(),s("div",l(e.sliderProps,{ref:"slider"}),null,16)},m.__file="src/Slider.vue";export{m as default}; +import{toRefs as t,ref as e,customRef as r,computed as i,shallowRef as n,onMounted as o,onUnmounted as a,watch as s,openBlock as l,createElementBlock as u,mergeProps as c}from"vue";function p(t){return null==t||!1===t}function d(t){return r((()=>({get:t,set:()=>{}})))}var f,h,m,v,g=(f=function(t,e){t.exports=function(){var t=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function e(t){return t.split("").reverse().join("")}function r(t,e){return t.substring(0,e.length)===e}function i(t,e){return t.slice(-1*e.length)===e}function n(t,e,r){if((t[e]||t[r])&&t[e]===t[r])throw new Error(e)}function o(t){return"number"==typeof t&&isFinite(t)}function a(t,e){return t=t.toString().split("e"),(+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]+e:e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]-e:-e))).toFixed(e)}function s(t,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==t&&0===parseFloat(h.toFixed(t))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==t&&(h=a(h,t)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=e(g).match(/.{1,3}/g),g=e(g.join(e(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(t,e,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),e&&(h=h.split(e).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(e){var r,i,o,a={};for(void 0===e.suffix&&(e.suffix=e.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(e,r,i){var n,o=[];for(n=0;n0&&(V(t,e),setTimeout((function(){P(t,e)}),r))}function A(t){return Math.max(Math.min(t,100),0)}function C(t){return Array.isArray(t)?t:[t]}function k(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function V(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function P(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function L(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 U(t,e){return 100/(e-t)}function M(t,e,r){return 100*e/(t[r+1]-t[r])}function O(t,e){for(var r=1;t>=e[r];)r+=1;return r}function D(t,e,r){if(r>=t.slice(-1)[0])return 100;var i=O(r,t),n=t[i-1],o=t[i],a=e[i-1],s=e[i];return a+function(t,e){return M(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([n,o],r)/U(a,s)}function j(t,e,r,i){if(100===i)return i;var n=O(i,t),o=t[n-1],a=t[n];return r?i-o>(a-o)/2?a:o:e[n-1]?t[n-1]+function(t,e){return Math.round(t/e)*e}(i-t[n-1],e[n-1]):i}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(m||(m={})),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(v||(v={}));var F=function(){function t(t,e,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=e;var n=[];for(Object.keys(t).forEach((function(e){n.push([C(t[e]),e])})),n.sort((function(t,e){return t[0][0]-e[0][0]})),i=0;ithis.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++,null===e&&(e=[]);var o=1,a=e[n],s=0,l=0,u=0,c=0;for(i=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],e[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/e[n+c],i=1):(l=e[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=e[n+c]*o;return t+u},t.prototype.toStepping=function(t){return t=D(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,r){if(r>=100)return t.slice(-1)[0];var i=O(r,e),n=t[i-1],o=t[i],a=e[i-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([n,o],(r-a)*U(a,e[i]))}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=j(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var i=O(t,this.xPct);return(100===t||e&&t===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},t.prototype.getNearbySteps=function(t){var e=O(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],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(k);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){var r;if(!E(r="min"===t?0:"max"===t?100:parseFloat(t))||!E(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(e[0]);var i=Number(e[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){if(e)if(this.xVal[t]!==this.xVal[t+1]){this.xSteps[t]=M([this.xVal[t],this.xVal[t+1]],e,0)/U(this.xPct[t],this.xPct[t+1]);var r=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[t]+this.xNumSteps[t]*i;this.xHighestCompleteStep[t]=n}else this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t]},t}(),z={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},H={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},q={tooltips:".__tooltips",aria:".__aria"};function R(t,e){if(!E(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function T(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function B(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function _(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function $(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'.");t.spectrum=new F(e,t.snap||!1,t.singleStep)}function X(t,e){if(e=C(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function Y(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function I(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function W(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function G(t,e){var r,i=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function tt(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 et(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=e.indexOf("tap")>=0,i=e.indexOf("drag")>=0,n=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0,s=e.indexOf("unconstrained")>=0,l=e.indexOf("drag-all")>=0,u=e.indexOf("smooth-steps")>=0;if(n){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");K(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function rt(t,e){if(!1!==e)if(!0===e||y(e)){t.tooltips=[];for(var r=0;r= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,i=[];e--;)i[e]=e*r;return i.push(100),_(i,t.stepped)}return t.mode===m.Positions?_(t.values,t.stepped):t.mode===m.Values?t.stepped?t.values.map((function(t){return f.fromStepping(f.getStep(f.toStepping(t)))})):t.values:[]}(t),i={},n=f.xVal[0],o=f.xVal[f.xVal.length-1],a=!1,s=!1,l=0;return e=r.slice().sort((function(t,e){return t-e})),(r=e.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==n&&(r.unshift(n),a=!0),r[r.length-1]!==o&&(r.push(o),s=!0),r.forEach((function(e,n){var o,u,c,p,d,h,g,b,y,S,x=e,w=r[n+1],E=t.mode===m.Steps;for(E&&(o=f.xNumSteps[n]),o||(o=w-x),void 0===w&&(w=x),o=Math.max(o,1e-7),u=x;u<=w;u=Number((u+o).toFixed(7))){for(b=(d=(p=f.toStepping(u))-l)/(t.density||1),S=d/(y=Math.round(b)),c=1;c<=y;c+=1)i[(h=l+c*S).toFixed(5)]=[f.fromStepping(h),0];g=r.indexOf(u)>-1?v.LargeValue:E?v.SmallValue:v.NoValue,!n&&a&&u!==w&&(g=0),u===w&&s||(i[p.toFixed(5)]=[u,g]),l=p}})),i}function X(t,r,i){var n,o,a=k.createElement("div"),s=((n={})[v.None]="",n[v.NoValue]=e.cssClasses.valueNormal,n[v.LargeValue]=e.cssClasses.valueLarge,n[v.SmallValue]=e.cssClasses.valueSub,n),l=((o={})[v.None]="",o[v.NoValue]=e.cssClasses.markerNormal,o[v.LargeValue]=e.cssClasses.markerLarge,o[v.SmallValue]=e.cssClasses.markerSub,o),u=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],c=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];function p(t,r){var i=r===e.cssClasses.value,n=i?s:l;return r+" "+(i?u:c)[e.ort]+" "+n[t]}return V(a,e.cssClasses.pips),V(a,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(t).forEach((function(n){!function(t,n,o){if((o=r?r(n,o):o)!==v.None){var s=D(a,!1);s.className=p(o,e.cssClasses.marker),s.style[e.style]=t+"%",o>v.NoValue&&((s=D(a,!1)).className=p(o,e.cssClasses.value),s.setAttribute("data-value",String(n)),s.style[e.style]=t+"%",s.innerHTML=String(i.to(n)))}}(n,t[n][0],t[n][1])})),a}function Y(){a&&(S(a),a=null)}function I(t){Y();var e=$(t),r=t.filter,i=t.format||{to:function(t){return String(Math.round(t))}};return a=d.appendChild(X(e,r,i))}function W(){var t=i.getBoundingClientRect(),r="offset"+["Width","Height"][e.ort];return 0===e.ort?t.width||i[r]:t.height||i[r]}function G(t,r,i,n){var o=function(o){var a,s,l=function(t,e,r){var i=0===t.type.indexOf("touch"),n=0===t.type.indexOf("mouse"),o=0===t.type.indexOf("pointer"),a=0,s=0;0===t.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===t.type&&!t.buttons&&!t.touches)return!1;if(i){var l=function(e){var i=e.target;return i===r||r.contains(i)||t.composed&&t.composedPath().shift()===r};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}e=e||L(k),(n||o)&&(a=t.clientX+e.x,s=t.clientY+e.y);return t.pageOffset=e,t.points=[a,s],t.cursor=n||o,t}(o,n.pageOffset,n.target||r);return!!l&&(!(H()&&!n.doNotReject)&&(a=d,s=e.cssClasses.tap,!((a.classList?a.classList.contains(s):new RegExp("\\b"+s+"\\b").test(a.className))&&!n.doNotReject)&&(!(t===c.start&&void 0!==l.buttons&&l.buttons>1)&&((!n.hover||!l.buttons)&&(p||l.preventDefault(),l.calcPoint=l.points[e.ort],void i(l,n))))))},a=[];return t.split(" ").forEach((function(t){r.addEventListener(t,o,!!p&&{passive:!0}),a.push([t,o])})),a}function J(t){var r,n,o,a,s,l,u=100*(t-(r=i,n=e.ort,o=r.getBoundingClientRect(),a=r.ownerDocument,s=a.documentElement,l=L(a),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?o.top+l.y-s.clientTop:o.left+l.x-s.clientLeft))/W();return u=A(u),e.dir?100-u:u}function K(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&Z(t,e)}function Q(t,r){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==r.buttonsProperty)return Z(t,r);var i=(e.dir?-1:1)*(t.calcPoint-r.startCalcPoint);lt(i>0,100*i/r.baseSize,r.locations,r.handleNumbers,r.connect)}function Z(t,r){r.handle&&(P(r.handle,e.cssClasses.active),y-=1),r.listeners.forEach((function(t){U.removeEventListener(t[0],t[1])})),0===y&&(P(d,e.cssClasses.drag),pt(),t.cursor&&(M.style.cursor="",M.removeEventListener("selectstart",w))),e.events.smoothSteps&&(r.handleNumbers.forEach((function(t){dt(t,g[t],!0,!0,!1,!1)})),r.handleNumbers.forEach((function(t){ot("update",t)}))),r.handleNumbers.forEach((function(t){ot("change",t),ot("set",t),ot("end",t)}))}function tt(t,r){if(!r.handleNumbers.some(R)){var i;if(1===r.handleNumbers.length)i=n[r.handleNumbers[0]].children[0],y+=1,V(i,e.cssClasses.active);t.stopPropagation();var o=[],a=G(c.move,U,Q,{target:t.target,handle:i,connect:r.connect,listeners:o,startCalcPoint:t.calcPoint,baseSize:W(),pageOffset:t.pageOffset,handleNumbers:r.handleNumbers,buttonsProperty:t.buttons,locations:g.slice()}),s=G(c.end,U,Z,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers}),l=G("mouseout",U,K,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers});o.push.apply(o,a.concat(s,l)),t.cursor&&(M.style.cursor=getComputedStyle(t.target).cursor,n.length>1&&V(d,e.cssClasses.drag),M.addEventListener("selectstart",w,!1)),r.handleNumbers.forEach((function(t){ot("start",t)}))}}function et(t){t.stopPropagation();var r=J(t.calcPoint),i=function(t){var e=100,r=!1;return n.forEach((function(i,n){if(!R(n)){var o=g[n],a=Math.abs(o-t);(ao||100===a&&100===e)&&(r=n,e=a)}})),r}(r);!1!==i&&(e.events.snap||N(d,e.cssClasses.tap,e.animationDuration),dt(i,r,!0,!0),pt(),ot("slide",i,!0),ot("update",i,!0),e.events.snap?tt(t,{handleNumbers:[i]}):(ot("change",i,!0),ot("set",i,!0)))}function rt(t){var e=J(t.calcPoint),r=f.getStep(e),i=f.fromStepping(r);Object.keys(E).forEach((function(t){"hover"===t.split(".")[0]&&E[t].forEach((function(t){t.call(bt,i)}))}))}function it(t,e){E[t]=E[t]||[],E[t].push(e),"update"===t.split(".")[0]&&n.forEach((function(t,e){ot("update",e)}))}function nt(t){var e=t&&t.split(".")[0],r=e?t.substring(e.length):t;Object.keys(E).forEach((function(t){var i=t.split(".")[0],n=t.substring(i.length);e&&e!==i||r&&r!==n||function(t){return t===q.aria||t===q.tooltips}(n)&&r!==n||delete E[t]}))}function ot(t,r,i){Object.keys(E).forEach((function(n){var o=n.split(".")[0];t===o&&E[n].forEach((function(t){t.call(bt,h.map(e.format.to),r,h.slice(),i||!1,g.slice(),bt)}))}))}function at(t,r,i,o,a,s,l){var u;return n.length>1&&!e.events.unconstrained&&(o&&r>0&&(u=f.getAbsoluteDistance(t[r-1],e.margin,!1),i=Math.max(i,u)),a&&r1&&e.limit&&(o&&r>0&&(u=f.getAbsoluteDistance(t[r-1],e.limit,!1),i=Math.min(i,u)),a&&r1?n.forEach((function(t,e){var i=at(a,t,a[t]+r,u[e],c[e],!1,l);!1===i?r=0:(r=i-a[t],a[t]=i)})):u=c=[!0];var p=!1;n.forEach((function(t,e){p=dt(t,i[t]+r,u[e],c[e],!1,l)||p})),p&&(n.forEach((function(t){ot("update",t),ot("slide",t)})),null!=o&&ot("drag",s))}function ut(t,r){return e.dir?100-t-r:t}function pt(){b.forEach((function(t){var e=g[t]>50?-1:1,r=3+(n.length+e*t);n[t].style.zIndex=String(r)}))}function dt(t,r,i,o,a,s){return a||(r=at(g,t,r,i,o,!1,s)),!1!==r&&(function(t,r){g[t]=r,h[t]=f.fromStepping(r);var i="translate("+st(ut(r,0)-O+"%","0")+")";n[t].style[e.transformRule]=i,ft(t),ft(t+1)}(t,r),!0)}function ft(t){if(o[t]){var r=0,i=100;0!==t&&(r=g[t-1]),t!==o.length-1&&(i=g[t]);var n=i-r,a="translate("+st(ut(r,n)+"%","0")+")",s="scale("+st(n/100,"1")+")";o[t].style[e.transformRule]=a+" "+s}}function ht(t,r){return null===t||!1===t||void 0===t?g[r]:("number"==typeof t&&(t=String(t)),!1!==(t=e.format.from(t))&&(t=f.toStepping(t)),!1===t||isNaN(t)?g[r]:t)}function mt(t,r,i){var n=C(t),o=void 0===g[0];r=void 0===r||r,e.animate&&!o&&N(d,e.cssClasses.tap,e.animationDuration),b.forEach((function(t){dt(t,ht(n[t],t),!0,!1,i)}));var a=1===b.length?0:1;if(o&&f.hasNoSize()&&(i=!0,g[0]=0,b.length>1)){var s=100/(b.length-1);b.forEach((function(t){g[t]=t*s}))}for(;ai.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===r?o=null:0===r&&(a=null);var s=f.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}V(l=d,e.cssClasses.target),0===e.dir?V(l,e.cssClasses.ltr):V(l,e.cssClasses.rtl),0===e.ort?V(l,e.cssClasses.horizontal):V(l,e.cssClasses.vertical),V(l,"rtl"===getComputedStyle(l).direction?e.cssClasses.textDirectionRtl:e.cssClasses.textDirectionLtr),i=D(l,e.cssClasses.base),function(t,r){var i=D(r,e.cssClasses.connects);n=[],(o=[]).push(F(i,t[0]));for(var a=0;a=0&&t"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},modelValue:{validator:function(t){return t=>"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(r,l){const u=function(r,i,n){const{value:o,modelValue:a,min:s}=t(r);let l=void 0!==a.value?a:o;const u=e(l.value);if(p(l.value)&&(l=e(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:u}}(r),c=function(e,r,i){const{classes:n,showTooltip:o,tooltipPosition:a,orientation:s}=t(e),l=d((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...n.value})));return{classList:d((()=>{const t={...l.value};return Object.keys(t).forEach((e=>{t[e]=Array.isArray(t[e])?t[e].filter((t=>null!==t)).join(" "):t[e]})),"always"!==o.value&&(t.target+=` ${"drag"===o.value?t.tooltipDrag:t.tooltipFocus}`),"horizontal"===s.value&&(t.tooltip+="bottom"===a.value?` ${t.tooltipBottom}`:` ${t.tooltipTop}`),"vertical"===s.value&&(t.tooltip+="right"===a.value?` ${t.tooltipRight}`:` ${t.tooltipLeft}`),t}))}}(r),f=function(e,r,n){const{format:o,step:a}=t(e),s=n.value,l=n.classList,u=i((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:b({...o.value}):b({decimals:a.value>=0?0:2}))),c=d((()=>Array.isArray(s.value)?s.value.map((t=>u.value)):u.value));return{tooltipFormat:u,tooltipsFormat:c,tooltipsMerge:(t,e,r)=>{var i="rtl"===getComputedStyle(t).direction,n="rtl"===t.noUiSlider.options.direction,o="vertical"===t.noUiSlider.options.orientation,a=t.noUiSlider.getTooltips(),s=t.noUiSlider.getOrigins();a.forEach((function(t,e){t&&s[e].appendChild(t)})),t.noUiSlider.on("update",(function(t,s,c,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=u.value.to(parseFloat(t[0])));for(var g=1;ge)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(u.value.to(parseFloat(t[g]))),h[v].push(d[g]));f.forEach((function(t,e){for(var s=t.length,u=0;u{a[c].classList.contains(t)&&a[c].classList.remove(t)}))}else a[c].style.display="none",l.value.tooltipHidden.split(" ").forEach((t=>{a[c].classList.add(t)}))}}))}))}}}(r,0,{value:u.value,classList:c.classList}),h=function(r,i,l){const{orientation:u,direction:c,tooltips:f,step:h,min:m,max:v,merge:g,id:b,disabled:y,options:S,classes:x,format:w,lazy:E,ariaLabelledby:N,aria:A}=t(r),C=l.value,k=l.initialValue,V=l.tooltipsFormat,P=l.tooltipsMerge,L=l.tooltipFormat,U=l.classList,M=n(null),O=n(null),D=e(!1),j=d((()=>{let t={cssPrefix:"",cssClasses:U.value,orientation:u.value,direction:c.value,tooltips:!!f.value&&V.value,connect:"lower",start:p(C.value)?m.value:C.value,range:{min:m.value,max:v.value}};if(h.value>0&&(t.step=h.value),Array.isArray(C.value)&&(t.connect=!0),N.value||A&&Object.keys(A.value).length){let e=Array.isArray(C.value)?C.value:[C.value];t.handleAttributes=e.map((t=>Object.assign({},A.value,N.value?{"aria-labelledby":N.value}:{})))}return w.value&&(t.ariaFormat=L.value),t})),F=d((()=>{let t={id:b.value?b.value:void 0};return y.value&&(t.disabled=!0),t})),z=d((()=>Array.isArray(C.value))),H=()=>{let t=O.value.get();return Array.isArray(t)?t.map((t=>parseFloat(t))):parseFloat(t)},q=(t,e=!0)=>{O.value.set(t,e)},R=t=>{i.emit("input",t),i.emit("update:modelValue",t),i.emit("update",t)},T=()=>{O.value=dt.create(M.value,Object.assign({},j.value,S.value)),f.value&&z.value&&g.value>=0&&P(M.value,g.value," - "),O.value.on("set",(()=>{const t=H();i.emit("change",t),i.emit("set",t),E.value&&R(t)})),O.value.on("update",(()=>{if(!D.value)return;const t=H();z.value&&ft(C.value,t)||!z.value&&C.value==t?i.emit("update",t):E.value||R(t)})),O.value.on("start",(()=>{i.emit("start",H())})),O.value.on("end",(()=>{i.emit("end",H())})),O.value.on("slide",(()=>{i.emit("slide",H())})),O.value.on("drag",(()=>{i.emit("drag",H())})),M.value.querySelectorAll("[data-handle]").forEach((t=>{t.onblur=()=>{M.value&&U.value.focused.split(" ").forEach((t=>{M.value.classList.remove(t)}))},t.onfocus=()=>{U.value.focused.split(" ").forEach((t=>{M.value.classList.add(t)}))}})),D.value=!0},B=()=>{O.value.off(),O.value.destroy(),O.value=null},_=(t,e)=>{D.value=!1,B(),T()};return o(T),a(B),s([z,m,v,h,u,c,f,g],_,{immediate:!1}),s([w,S,x],_,{immediate:!1,deep:!0}),s(C,((t,e)=>{e&&("object"==typeof e&&"object"==typeof t&&t&&Object.keys(e)>Object.keys(t)||"object"==typeof e&&"object"!=typeof t||p(t))&&_()}),{immediate:!1}),s(C,(t=>{if(p(t))return void q(m.value,!1);let e=H();z.value&&!Array.isArray(e)&&(e=[e]),(z.value&&!ft(t,e)||!z.value&&t!=e)&&q(t,!1)}),{deep:!0}),{slider:M,slider$:O,isRange:z,sliderProps:F,init:T,destroy:B,refresh:_,update:q,reset:()=>{R(k.value)}}}(r,l,{value:u.value,initialValue:u.initialValue,tooltipFormat:f.tooltipFormat,tooltipsFormat:f.tooltipsFormat,tooltipsMerge:f.tooltipsMerge,classList:c.classList});return{...c,...f,...h}}};ht.render=function(t,e,r,i,n,o){return l(),u("div",c(t.sliderProps,{ref:"slider"}),null,16)},ht.__file="src/Slider.vue";export{ht as default}; diff --git a/themes/default.css b/themes/default.css index a98ce14..ca594d7 100644 --- a/themes/default.css +++ b/themes/default.css @@ -1 +1 @@ -.slider-target,.slider-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.slider-target{position:relative}.slider-base,.slider-connects{height:100%;position:relative;width:100%;z-index:1}.slider-connects{overflow:hidden;z-index:0}.slider-connect,.slider-origin{height:100%;position:absolute;right:0;top:0;-ms-transform-origin:0 0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform-style:preserve-3d;transform-style:flat;width:100%;will-change:transform;z-index:1}.slider-txt-dir-rtl.slider-horizontal .slider-origin{left:0;right:auto}.slider-vertical .slider-origin{top:-100%;width:0}.slider-horizontal .slider-origin{height:0}.slider-handle{-webkit-backface-visibility:hidden;backface-visibility:hidden;position:absolute}.slider-touch-area{height:100%;width:100%}.slider-state-tap .slider-connect,.slider-state-tap .slider-origin{transition:transform .3s}.slider-state-drag *{cursor:inherit!important}.slider-tooltip-drag .slider-tooltip,.slider-tooltip-focus .slider-tooltip{display:none!important}.slider-tooltip-drag .slider-active .slider-tooltip,.slider-tooltip-drag.slider-state-drag .slider-tooltip:not(.slider-tooltip-hidden),.slider-tooltip-focus.slider-focused .slider-tooltip:not(.slider-tooltip-hidden){display:block!important}.slider-horizontal{height:var(--slider-height,6px)}.slider-horizontal .slider-handle{height:var(--slider-handle-height,16px);right:calc(var(--slider-handle-width, 16px)/2*-1);top:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-width,16px)}.slider-vertical{height:var(--slider-vertical-height,300px);width:var(--slider-height,6px)}.slider-vertical .slider-handle{bottom:calc(var(--slider-handle-width, 16px)/2*-1);height:var(--slider-handle-width,16px);right:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-height,16px)}.slider-txt-dir-rtl.slider-horizontal .slider-handle{left:calc(var(--slider-handle-width, 16px)/2*-1);right:auto}.slider-base{background-color:var(--slider-bg,#d1d5db)}.slider-base,.slider-connects{border-radius:var(--slider-radius,9999px)}.slider-connect{background:var(--slider-connect-bg,#10b981);cursor:pointer}.slider-draggable{cursor:ew-resize}.slider-vertical .slider-draggable{cursor:ns-resize}.slider-handle{background:var(--slider-handle-bg,#fff);border:var(--slider-handle-border,0);border-radius:var(--slider-handle-radius,9999px);box-shadow:var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));cursor:-webkit-grab;cursor:grab;height:var(--slider-handle-height,16px);width:var(--slider-handle-width,16px)}.slider-handle:focus{box-shadow:0 0 0 var(--slider-handle-ring-width,3px) var(--slider-handle-ring-color,rgba(16,185,129,.188)),var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));outline:none}.slider-active{box-shadow:var(--slider-handle-shadow-active,.5px .5px 2px 1px rgba(0,0,0,.42));cursor:-webkit-grabbing;cursor:grabbing}[disabled] .slider-connect{background:var(--slider-connect-bg-disabled,#9ca3af)}[disabled] .slider-handle,[disabled].slider-handle,[disabled].slider-target{cursor:not-allowed}[disabled] .slider-tooltip{background:var(--slider-tooltip-bg-disabled,#9ca3af);border-color:var(--slider-tooltip-bg-disabled,#9ca3af)}.slider-tooltip{background:var(--slider-tooltip-bg,#10b981);border:1px solid var(--slider-tooltip-bg,#10b981);border-radius:var(--slider-tooltip-radius,5px);color:var(--slider-tooltip-color,#fff);display:block;font-size:var(--slider-tooltip-font-size,.875rem);font-weight:var(--slider-tooltip-font-weight,600);line-height:var(--slider-tooltip-line-height,1.25rem);min-width:var(--slider-tooltip-min-width,20px);padding:var(--slider-tooltip-py,2px) var(--slider-tooltip-px,6px);position:absolute;text-align:center;white-space:nowrap}.slider-horizontal .slider-tooltip-top{bottom:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));left:50%;transform:translate(-50%)}.slider-horizontal .slider-tooltip-top:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-top-color:inherit;bottom:calc(var(--slider-tooltip-arrow-size, 5px)*-2);content:"";height:0;left:50%;position:absolute;transform:translate(-50%);width:0}.slider-horizontal .slider-tooltip-bottom{left:50%;top:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));transform:translate(-50%)}.slider-horizontal .slider-tooltip-bottom:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-bottom-color:inherit;content:"";height:0;left:50%;position:absolute;top:calc(var(--slider-tooltip-arrow-size, 5px)*-2);transform:translate(-50%);width:0}.slider-vertical .slider-tooltip-left{right:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-left:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-left-color:inherit;content:"";height:0;position:absolute;right:calc(var(--slider-tooltip-arrow-size, 5px)*-2);top:50%;transform:translateY(-50%);width:0}.slider-vertical .slider-tooltip-right{left:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-right:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-right-color:inherit;content:"";height:0;left:calc(var(--slider-tooltip-arrow-size, 5px)*-2);position:absolute;top:50%;transform:translateY(-50%);width:0}.slider-horizontal .slider-origin>.slider-tooltip{left:auto;transform:translate(50%)}.slider-horizontal .slider-origin>.slider-tooltip-top{bottom:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + 1px)}.slider-horizontal .slider-origin>.slider-tooltip-bottom{top:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + var(--slider-height, 6px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip{top:auto;transform:translateY(calc((var(--slider-tooltip-line-height, 1.25rem) - var(--slider-tooltip-py, 2px))*-1 + 1px))}.slider-vertical .slider-origin>.slider-tooltip-left{right:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip-right{left:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - var(--slider-height, 6px) + 1px)} \ No newline at end of file +.slider-target,.slider-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.slider-target{position:relative}.slider-base,.slider-connects{height:100%;position:relative;width:100%;z-index:1}.slider-connects{overflow:hidden;z-index:0}.slider-connect,.slider-origin{height:100%;position:absolute;right:0;top:0;-ms-transform-origin:0 0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform-style:preserve-3d;transform-style:flat;width:100%;will-change:transform;z-index:1}.slider-txt-dir-rtl.slider-horizontal .slider-origin{left:0;right:auto}.slider-vertical .slider-origin{top:-100%;width:0}.slider-horizontal .slider-origin{height:0}.slider-handle{backface-visibility:hidden;position:absolute}.slider-touch-area{height:100%;width:100%}.slider-state-tap .slider-connect,.slider-state-tap .slider-origin{transition:transform .3s}.slider-state-drag *{cursor:inherit!important}.slider-tooltip-drag .slider-tooltip,.slider-tooltip-focus .slider-tooltip{display:none!important}.slider-tooltip-drag .slider-active .slider-tooltip,.slider-tooltip-drag.slider-state-drag .slider-tooltip:not(.slider-tooltip-hidden),.slider-tooltip-focus.slider-focused .slider-tooltip:not(.slider-tooltip-hidden){display:block!important}.slider-horizontal{height:var(--slider-height,6px)}.slider-horizontal .slider-handle{height:var(--slider-handle-height,16px);right:calc(var(--slider-handle-width, 16px)/2*-1);top:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-width,16px)}.slider-vertical{height:var(--slider-vertical-height,300px);width:var(--slider-height,6px)}.slider-vertical .slider-handle{bottom:calc(var(--slider-handle-width, 16px)/2*-1);height:var(--slider-handle-width,16px);right:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-height,16px)}.slider-txt-dir-rtl.slider-horizontal .slider-handle{left:calc(var(--slider-handle-width, 16px)/2*-1);right:auto}.slider-base{background-color:var(--slider-bg,#d1d5db)}.slider-base,.slider-connects{border-radius:var(--slider-radius,9999px)}.slider-connect{background:var(--slider-connect-bg,#10b981);cursor:pointer}.slider-draggable{cursor:ew-resize}.slider-vertical .slider-draggable{cursor:ns-resize}.slider-handle{background:var(--slider-handle-bg,#fff);border:var(--slider-handle-border,0);border-radius:var(--slider-handle-radius,9999px);box-shadow:var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));cursor:grab;height:var(--slider-handle-height,16px);width:var(--slider-handle-width,16px)}.slider-handle:focus{box-shadow:0 0 0 var(--slider-handle-ring-width,3px) var(--slider-handle-ring-color,rgba(16,185,129,.188)),var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));outline:none}.slider-active{box-shadow:var(--slider-handle-shadow-active,.5px .5px 2px 1px rgba(0,0,0,.42));cursor:grabbing}[disabled] .slider-connect{background:var(--slider-connect-bg-disabled,#9ca3af)}[disabled] .slider-handle,[disabled].slider-handle,[disabled].slider-target{cursor:not-allowed}[disabled] .slider-tooltip{background:var(--slider-tooltip-bg-disabled,#9ca3af);border-color:var(--slider-tooltip-bg-disabled,#9ca3af)}.slider-tooltip{background:var(--slider-tooltip-bg,#10b981);border:1px solid var(--slider-tooltip-bg,#10b981);border-radius:var(--slider-tooltip-radius,5px);color:var(--slider-tooltip-color,#fff);display:block;font-size:var(--slider-tooltip-font-size,.875rem);font-weight:var(--slider-tooltip-font-weight,600);line-height:var(--slider-tooltip-line-height,1.25rem);min-width:var(--slider-tooltip-min-width,20px);padding:var(--slider-tooltip-py,2px) var(--slider-tooltip-px,6px);position:absolute;text-align:center;white-space:nowrap}.slider-horizontal .slider-tooltip-top{bottom:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));left:50%;transform:translate(-50%)}.slider-horizontal .slider-tooltip-top:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-top-color:inherit;bottom:calc(var(--slider-tooltip-arrow-size, 5px)*-2);content:"";height:0;left:50%;position:absolute;transform:translate(-50%);width:0}.slider-horizontal .slider-tooltip-bottom{left:50%;top:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));transform:translate(-50%)}.slider-horizontal .slider-tooltip-bottom:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-bottom-color:inherit;content:"";height:0;left:50%;position:absolute;top:calc(var(--slider-tooltip-arrow-size, 5px)*-2);transform:translate(-50%);width:0}.slider-vertical .slider-tooltip-left{right:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-left:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-left-color:inherit;content:"";height:0;position:absolute;right:calc(var(--slider-tooltip-arrow-size, 5px)*-2);top:50%;transform:translateY(-50%);width:0}.slider-vertical .slider-tooltip-right{left:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-right:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-right-color:inherit;content:"";height:0;left:calc(var(--slider-tooltip-arrow-size, 5px)*-2);position:absolute;top:50%;transform:translateY(-50%);width:0}.slider-horizontal .slider-origin>.slider-tooltip{left:auto;transform:translate(50%)}.slider-horizontal .slider-origin>.slider-tooltip-top{bottom:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + 1px)}.slider-horizontal .slider-origin>.slider-tooltip-bottom{top:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + var(--slider-height, 6px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip{top:auto;transform:translateY(calc((var(--slider-tooltip-line-height, 1.25rem) - var(--slider-tooltip-py, 2px))*-1 + 1px))}.slider-vertical .slider-origin>.slider-tooltip-left{right:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip-right{left:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - var(--slider-height, 6px) + 1px)} \ No newline at end of file From b89086c28c9af0599cb0349013a81a68b6c93653 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 2 Jun 2024 19:01:59 +1100 Subject: [PATCH 12/14] chore(deps): bump nouislider to 15.7.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f12c7b9..a905547 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "jest": "^27.3.1", "jest-environment-jsdom-sixteen": "^1.0.3", "node-sass": "^7.0.0", - "nouislider": "^15.4.0", + "nouislider": "^15.7.2", "postcss": "^8.2.1", "rollup": "^2.77.0", "rollup-plugin-postcss": "^4.0.0", From 5ace204f5e154d171d3c2077a4624fce116fbf44 Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 16 Jun 2024 21:43:01 +1100 Subject: [PATCH 13/14] fix(composables): fix edge case when the slider is not initialized and is already unmounted --- src/composables/useSlider.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/composables/useSlider.js b/src/composables/useSlider.js index 771f8ab..f5cb720 100644 --- a/src/composables/useSlider.js +++ b/src/composables/useSlider.js @@ -195,6 +195,10 @@ export default function useSlider (props, context, dependencies) } const destroy = () => { + if (!slider$.value) { + return; + } + slider$.value.off() slider$.value.destroy() slider$.value = null From 46d893b36e39d49d3829bf31a0e8f8533b7ca0ae Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 16 Jun 2024 21:44:58 +1100 Subject: [PATCH 14/14] chore: build --- dist/slider.global.js | 2 +- dist/slider.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/slider.global.js b/dist/slider.global.js index b3aee25..5feab87 100644 --- a/dist/slider.global.js +++ b/dist/slider.global.js @@ -1 +1 @@ -var VueformSlider=function(t){"use strict";function e(t){return null==t||!1===t}function r(e){return t.customRef((()=>({get:e,set:()=>{}})))}var i,n,o,a,s=(i=function(t,e){t.exports=function(){var t=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function e(t){return t.split("").reverse().join("")}function r(t,e){return t.substring(0,e.length)===e}function i(t,e){return t.slice(-1*e.length)===e}function n(t,e,r){if((t[e]||t[r])&&t[e]===t[r])throw new Error(e)}function o(t){return"number"==typeof t&&isFinite(t)}function a(t,e){return t=t.toString().split("e"),(+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]+e:e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]-e:-e))).toFixed(e)}function s(t,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==t&&0===parseFloat(h.toFixed(t))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==t&&(h=a(h,t)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=e(g).match(/.{1,3}/g),g=e(g.join(e(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(t,e,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),e&&(h=h.split(e).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(e){var r,i,o,a={};for(void 0===e.suffix&&(e.suffix=e.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(e,r,i){var n,o=[];for(n=0;n0&&(b(t,e),setTimeout((function(){y(t,e)}),r))}function m(t){return Math.max(Math.min(t,100),0)}function v(t){return Array.isArray(t)?t:[t]}function g(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function b(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function y(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function S(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 x(t,e){return 100/(e-t)}function w(t,e,r){return 100*e/(t[r+1]-t[r])}function E(t,e){for(var r=1;t>=e[r];)r+=1;return r}function N(t,e,r){if(r>=t.slice(-1)[0])return 100;var i=E(r,t),n=t[i-1],o=t[i],a=e[i-1],s=e[i];return a+function(t,e){return w(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([n,o],r)/x(a,s)}function A(t,e,r,i){if(100===i)return i;var n=E(i,t),o=t[n-1],a=t[n];return r?i-o>(a-o)/2?a:o:e[n-1]?t[n-1]+function(t,e){return Math.round(t/e)*e}(i-t[n-1],e[n-1]):i}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(o||(o={})),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(a||(a={}));var C=function(){function t(t,e,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=e;var n=[];for(Object.keys(t).forEach((function(e){n.push([v(t[e]),e])})),n.sort((function(t,e){return t[0][0]-e[0][0]})),i=0;ithis.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++,null===e&&(e=[]);var o=1,a=e[n],s=0,l=0,u=0,c=0;for(i=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],e[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/e[n+c],i=1):(l=e[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=e[n+c]*o;return t+u},t.prototype.toStepping=function(t){return t=N(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,r){if(r>=100)return t.slice(-1)[0];var i=E(r,e),n=t[i-1],o=t[i],a=e[i-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([n,o],(r-a)*x(a,e[i]))}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=A(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var i=E(t,this.xPct);return(100===t||e&&t===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},t.prototype.getNearbySteps=function(t){var e=E(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],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(g);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){var r;if(!f(r="min"===t?0:"max"===t?100:parseFloat(t))||!f(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(e[0]);var i=Number(e[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){if(e)if(this.xVal[t]!==this.xVal[t+1]){this.xSteps[t]=w([this.xVal[t],this.xVal[t+1]],e,0)/x(this.xPct[t],this.xPct[t+1]);var r=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[t]+this.xNumSteps[t]*i;this.xHighestCompleteStep[t]=n}else this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t]},t}(),k={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},V={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},P={tooltips:".__tooltips",aria:".__aria"};function L(t,e){if(!f(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function U(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function M(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function O(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function D(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'.");t.spectrum=new C(e,t.snap||!1,t.singleStep)}function j(t,e){if(e=v(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function F(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function z(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function H(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function R(t,e){var r,i=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function $(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 X(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=e.indexOf("tap")>=0,i=e.indexOf("drag")>=0,n=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0,s=e.indexOf("unconstrained")>=0,l=e.indexOf("drag-all")>=0,u=e.indexOf("smooth-steps")>=0;if(n){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");T(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function Y(t,e){if(!1!==e)if(!0===e||u(e)){t.tooltips=[];for(var r=0;r= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,i=[];e--;)i[e]=e*r;return i.push(100),_(i,t.stepped)}return t.mode===o.Positions?_(t.values,t.stepped):t.mode===o.Values?t.stepped?t.values.map((function(t){return N.fromStepping(N.getStep(N.toStepping(t)))})):t.values:[]}(t),i={},n=N.xVal[0],s=N.xVal[N.xVal.length-1],l=!1,u=!1,c=0;return e=r.slice().sort((function(t,e){return t-e})),(r=e.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==n&&(r.unshift(n),l=!0),r[r.length-1]!==s&&(r.push(s),u=!0),r.forEach((function(e,n){var s,p,d,f,h,m,v,g,b,y,S=e,x=r[n+1],w=t.mode===o.Steps;for(w&&(s=N.xNumSteps[n]),s||(s=x-S),void 0===x&&(x=S),s=Math.max(s,1e-7),p=S;p<=x;p=Number((p+s).toFixed(7))){for(g=(h=(f=N.toStepping(p))-c)/(t.density||1),y=h/(b=Math.round(g)),d=1;d<=b;d+=1)i[(m=c+d*y).toFixed(5)]=[N.fromStepping(m),0];v=r.indexOf(p)>-1?a.LargeValue:w?a.SmallValue:a.NoValue,!n&&l&&p!==x&&(v=0),p===x&&u||(i[f.toFixed(5)]=[p,v]),c=f}})),i}function X(t,r,i){var n,o,s=U.createElement("div"),l=((n={})[a.None]="",n[a.NoValue]=e.cssClasses.valueNormal,n[a.LargeValue]=e.cssClasses.valueLarge,n[a.SmallValue]=e.cssClasses.valueSub,n),u=((o={})[a.None]="",o[a.NoValue]=e.cssClasses.markerNormal,o[a.LargeValue]=e.cssClasses.markerLarge,o[a.SmallValue]=e.cssClasses.markerSub,o),c=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],p=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];function d(t,r){var i=r===e.cssClasses.value,n=i?l:u;return r+" "+(i?c:p)[e.ort]+" "+n[t]}return b(s,e.cssClasses.pips),b(s,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(t).forEach((function(n){!function(t,n,o){if((o=r?r(n,o):o)!==a.None){var l=j(s,!1);l.className=d(o,e.cssClasses.marker),l.style[e.style]=t+"%",o>a.NoValue&&((l=j(s,!1)).className=d(o,e.cssClasses.value),l.setAttribute("data-value",String(n)),l.style[e.style]=t+"%",l.innerHTML=String(i.to(n)))}}(n,t[n][0],t[n][1])})),s}function Y(){l&&(c(l),l=null)}function I(t){Y();var e=$(t),r=t.filter,i=t.format||{to:function(t){return String(Math.round(t))}};return l=E.appendChild(X(e,r,i))}function W(){var t=i.getBoundingClientRect(),r="offset"+["Width","Height"][e.ort];return 0===e.ort?t.width||i[r]:t.height||i[r]}function G(t,r,i,n){var o=function(o){var a,s,l=function(t,e,r){var i=0===t.type.indexOf("touch"),n=0===t.type.indexOf("mouse"),o=0===t.type.indexOf("pointer"),a=0,s=0;0===t.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===t.type&&!t.buttons&&!t.touches)return!1;if(i){var l=function(e){var i=e.target;return i===r||r.contains(i)||t.composed&&t.composedPath().shift()===r};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}e=e||S(U),(n||o)&&(a=t.clientX+e.x,s=t.clientY+e.y);return t.pageOffset=e,t.points=[a,s],t.cursor=n||o,t}(o,n.pageOffset,n.target||r);return!!l&&(!(R()&&!n.doNotReject)&&(a=E,s=e.cssClasses.tap,!((a.classList?a.classList.contains(s):new RegExp("\\b"+s+"\\b").test(a.className))&&!n.doNotReject)&&(!(t===x.start&&void 0!==l.buttons&&l.buttons>1)&&((!n.hover||!l.buttons)&&(w||l.preventDefault(),l.calcPoint=l.points[e.ort],void i(l,n))))))},a=[];return t.split(" ").forEach((function(t){r.addEventListener(t,o,!!w&&{passive:!0}),a.push([t,o])})),a}function J(t){var r,n,o,a,s,l,u=100*(t-(r=i,n=e.ort,o=r.getBoundingClientRect(),a=r.ownerDocument,s=a.documentElement,l=S(a),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?o.top+l.y-s.clientTop:o.left+l.x-s.clientLeft))/W();return u=m(u),e.dir?100-u:u}function K(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&Z(t,e)}function Q(t,r){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==r.buttonsProperty)return Z(t,r);var i=(e.dir?-1:1)*(t.calcPoint-r.startCalcPoint);ut(i>0,100*i/r.baseSize,r.locations,r.handleNumbers,r.connect)}function Z(t,r){r.handle&&(y(r.handle,e.cssClasses.active),V-=1),r.listeners.forEach((function(t){M.removeEventListener(t[0],t[1])})),0===V&&(y(E,e.cssClasses.drag),pt(),t.cursor&&(O.style.cursor="",O.removeEventListener("selectstart",d))),e.events.smoothSteps&&(r.handleNumbers.forEach((function(t){dt(t,C[t],!0,!0,!1,!1)})),r.handleNumbers.forEach((function(t){at("update",t)}))),r.handleNumbers.forEach((function(t){at("change",t),at("set",t),at("end",t)}))}function et(t,r){if(!r.handleNumbers.some(q)){var i;if(1===r.handleNumbers.length)i=n[r.handleNumbers[0]].children[0],V+=1,b(i,e.cssClasses.active);t.stopPropagation();var o=[],a=G(x.move,M,Q,{target:t.target,handle:i,connect:r.connect,listeners:o,startCalcPoint:t.calcPoint,baseSize:W(),pageOffset:t.pageOffset,handleNumbers:r.handleNumbers,buttonsProperty:t.buttons,locations:C.slice()}),s=G(x.end,M,Z,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers}),l=G("mouseout",M,K,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers});o.push.apply(o,a.concat(s,l)),t.cursor&&(O.style.cursor=getComputedStyle(t.target).cursor,n.length>1&&b(E,e.cssClasses.drag),O.addEventListener("selectstart",d,!1)),r.handleNumbers.forEach((function(t){at("start",t)}))}}function rt(t){t.stopPropagation();var r=J(t.calcPoint),i=function(t){var e=100,r=!1;return n.forEach((function(i,n){if(!q(n)){var o=C[n],a=Math.abs(o-t);(ao||100===a&&100===e)&&(r=n,e=a)}})),r}(r);!1!==i&&(e.events.snap||h(E,e.cssClasses.tap,e.animationDuration),dt(i,r,!0,!0),pt(),at("slide",i,!0),at("update",i,!0),e.events.snap?et(t,{handleNumbers:[i]}):(at("change",i,!0),at("set",i,!0)))}function it(t){var e=J(t.calcPoint),r=N.getStep(e),i=N.fromStepping(r);Object.keys(L).forEach((function(t){"hover"===t.split(".")[0]&&L[t].forEach((function(t){t.call(bt,i)}))}))}function nt(t,e){L[t]=L[t]||[],L[t].push(e),"update"===t.split(".")[0]&&n.forEach((function(t,e){at("update",e)}))}function ot(t){var e=t&&t.split(".")[0],r=e?t.substring(e.length):t;Object.keys(L).forEach((function(t){var i=t.split(".")[0],n=t.substring(i.length);e&&e!==i||r&&r!==n||function(t){return t===P.aria||t===P.tooltips}(n)&&r!==n||delete L[t]}))}function at(t,r,i){Object.keys(L).forEach((function(n){var o=n.split(".")[0];t===o&&L[n].forEach((function(t){t.call(bt,A.map(e.format.to),r,A.slice(),i||!1,C.slice(),bt)}))}))}function st(t,r,i,o,a,s,l){var u;return n.length>1&&!e.events.unconstrained&&(o&&r>0&&(u=N.getAbsoluteDistance(t[r-1],e.margin,!1),i=Math.max(i,u)),a&&r1&&e.limit&&(o&&r>0&&(u=N.getAbsoluteDistance(t[r-1],e.limit,!1),i=Math.min(i,u)),a&&r1?n.forEach((function(t,e){var i=st(a,t,a[t]+r,u[e],c[e],!1,l);!1===i?r=0:(r=i-a[t],a[t]=i)})):u=c=[!0];var p=!1;n.forEach((function(t,e){p=dt(t,i[t]+r,u[e],c[e],!1,l)||p})),p&&(n.forEach((function(t){at("update",t),at("slide",t)})),null!=o&&at("drag",s))}function ct(t,r){return e.dir?100-t-r:t}function pt(){k.forEach((function(t){var e=C[t]>50?-1:1,r=3+(n.length+e*t);n[t].style.zIndex=String(r)}))}function dt(t,r,i,o,a,s){return a||(r=st(C,t,r,i,o,!1,s)),!1!==r&&(function(t,r){C[t]=r,A[t]=N.fromStepping(r);var i="translate("+lt(ct(r,0)-D+"%","0")+")";n[t].style[e.transformRule]=i,ft(t),ft(t+1)}(t,r),!0)}function ft(t){if(s[t]){var r=0,i=100;0!==t&&(r=C[t-1]),t!==s.length-1&&(i=C[t]);var n=i-r,o="translate("+lt(ct(r,n)+"%","0")+")",a="scale("+lt(n/100,"1")+")";s[t].style[e.transformRule]=o+" "+a}}function ht(t,r){return null===t||!1===t||void 0===t?C[r]:("number"==typeof t&&(t=String(t)),!1!==(t=e.format.from(t))&&(t=N.toStepping(t)),!1===t||isNaN(t)?C[r]:t)}function mt(t,r,i){var n=v(t),o=void 0===C[0];r=void 0===r||r,e.animate&&!o&&h(E,e.cssClasses.tap,e.animationDuration),k.forEach((function(t){dt(t,ht(n[t],t),!0,!1,i)}));var a=1===k.length?0:1;if(o&&N.hasNoSize()&&(i=!0,C[0]=0,k.length>1)){var s=100/(k.length-1);k.forEach((function(t){C[t]=t*s}))}for(;ai.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===r?o=null:0===r&&(a=null);var s=N.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}b(f=E,e.cssClasses.target),0===e.dir?b(f,e.cssClasses.ltr):b(f,e.cssClasses.rtl),0===e.ort?b(f,e.cssClasses.horizontal):b(f,e.cssClasses.vertical),b(f,"rtl"===getComputedStyle(f).direction?e.cssClasses.textDirectionRtl:e.cssClasses.textDirectionLtr),i=j(f,e.cssClasses.base),function(t,r){var i=j(r,e.cssClasses.connects);n=[],(s=[]).push(z(i,t[0]));for(var o=0;o=0&&t"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},modelValue:{validator:function(t){return t=>"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(i,n){const o=function(r,i,n){const{value:o,modelValue:a,min:s}=t.toRefs(r);let l=void 0!==a.value?a:o;const u=t.ref(l.value);if(e(l.value)&&(l=t.ref(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:u}}(i),a=function(e,i,n){const{classes:o,showTooltip:a,tooltipPosition:s,orientation:l}=t.toRefs(e),u=r((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...o.value})));return{classList:r((()=>{const t={...u.value};return Object.keys(t).forEach((e=>{t[e]=Array.isArray(t[e])?t[e].filter((t=>null!==t)).join(" "):t[e]})),"always"!==a.value&&(t.target+=` ${"drag"===a.value?t.tooltipDrag:t.tooltipFocus}`),"horizontal"===l.value&&(t.tooltip+="bottom"===s.value?` ${t.tooltipBottom}`:` ${t.tooltipTop}`),"vertical"===l.value&&(t.tooltip+="right"===s.value?` ${t.tooltipRight}`:` ${t.tooltipLeft}`),t}))}}(i),s=function(e,i,n){const{format:o,step:a}=t.toRefs(e),s=n.value,u=n.classList,c=t.computed((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:l({...o.value}):l({decimals:a.value>=0?0:2}))),p=r((()=>Array.isArray(s.value)?s.value.map((t=>c.value)):c.value));return{tooltipFormat:c,tooltipsFormat:p,tooltipsMerge:(t,e,r)=>{var i="rtl"===getComputedStyle(t).direction,n="rtl"===t.noUiSlider.options.direction,o="vertical"===t.noUiSlider.options.orientation,a=t.noUiSlider.getTooltips(),s=t.noUiSlider.getOrigins();a.forEach((function(t,e){t&&s[e].appendChild(t)})),t.noUiSlider.on("update",(function(t,s,l,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=c.value.to(parseFloat(t[0])));for(var g=1;ge)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(c.value.to(parseFloat(t[g]))),h[v].push(d[g]));f.forEach((function(t,e){for(var s=t.length,l=0;l{a[c].classList.contains(t)&&a[c].classList.remove(t)}))}else a[c].style.display="none",u.value.tooltipHidden.split(" ").forEach((t=>{a[c].classList.add(t)}))}}))}))}}}(i,0,{value:o.value,classList:a.classList}),u=function(i,n,o){const{orientation:a,direction:s,tooltips:l,step:u,min:c,max:p,merge:d,id:f,disabled:h,options:m,classes:v,format:g,lazy:b,ariaLabelledby:y,aria:S}=t.toRefs(i),x=o.value,w=o.initialValue,E=o.tooltipsFormat,N=o.tooltipsMerge,A=o.tooltipFormat,C=o.classList,k=t.shallowRef(null),V=t.shallowRef(null),P=t.ref(!1),L=r((()=>{let t={cssPrefix:"",cssClasses:C.value,orientation:a.value,direction:s.value,tooltips:!!l.value&&E.value,connect:"lower",start:e(x.value)?c.value:x.value,range:{min:c.value,max:p.value}};if(u.value>0&&(t.step=u.value),Array.isArray(x.value)&&(t.connect=!0),y.value||S&&Object.keys(S.value).length){let e=Array.isArray(x.value)?x.value:[x.value];t.handleAttributes=e.map((t=>Object.assign({},S.value,y.value?{"aria-labelledby":y.value}:{})))}return g.value&&(t.ariaFormat=A.value),t})),U=r((()=>{let t={id:f.value?f.value:void 0};return h.value&&(t.disabled=!0),t})),M=r((()=>Array.isArray(x.value))),O=()=>{let t=V.value.get();return Array.isArray(t)?t.map((t=>parseFloat(t))):parseFloat(t)},D=(t,e=!0)=>{V.value.set(t,e)},j=t=>{n.emit("input",t),n.emit("update:modelValue",t),n.emit("update",t)},F=()=>{V.value=rt.create(k.value,Object.assign({},L.value,m.value)),l.value&&M.value&&d.value>=0&&N(k.value,d.value," - "),V.value.on("set",(()=>{const t=O();n.emit("change",t),n.emit("set",t),b.value&&j(t)})),V.value.on("update",(()=>{if(!P.value)return;const t=O();M.value&&it(x.value,t)||!M.value&&x.value==t?n.emit("update",t):b.value||j(t)})),V.value.on("start",(()=>{n.emit("start",O())})),V.value.on("end",(()=>{n.emit("end",O())})),V.value.on("slide",(()=>{n.emit("slide",O())})),V.value.on("drag",(()=>{n.emit("drag",O())})),k.value.querySelectorAll("[data-handle]").forEach((t=>{t.onblur=()=>{k.value&&C.value.focused.split(" ").forEach((t=>{k.value.classList.remove(t)}))},t.onfocus=()=>{C.value.focused.split(" ").forEach((t=>{k.value.classList.add(t)}))}})),P.value=!0},z=()=>{V.value.off(),V.value.destroy(),V.value=null},H=(t,e)=>{P.value=!1,z(),F()};return t.onMounted(F),t.onUnmounted(z),t.watch([M,c,p,u,a,s,l,d],H,{immediate:!1}),t.watch([g,m,v],H,{immediate:!1,deep:!0}),t.watch(x,((t,r)=>{r&&("object"==typeof r&&"object"==typeof t&&t&&Object.keys(r)>Object.keys(t)||"object"==typeof r&&"object"!=typeof t||e(t))&&H()}),{immediate:!1}),t.watch(x,(t=>{if(e(t))return void D(c.value,!1);let r=O();M.value&&!Array.isArray(r)&&(r=[r]),(M.value&&!it(t,r)||!M.value&&t!=r)&&D(t,!1)}),{deep:!0}),{slider:k,slider$:V,isRange:M,sliderProps:U,init:F,destroy:z,refresh:H,update:D,reset:()=>{j(w.value)}}}(i,n,{value:o.value,initialValue:o.initialValue,tooltipFormat:s.tooltipFormat,tooltipsFormat:s.tooltipsFormat,tooltipsMerge:s.tooltipsMerge,classList:a.classList});return{...a,...s,...u}}};return nt.render=function(e,r,i,n,o,a){return t.openBlock(),t.createElementBlock("div",t.mergeProps(e.sliderProps,{ref:"slider"}),null,16)},nt.__file="src/Slider.vue",nt}(Vue); +var VueformSlider=function(t){"use strict";function e(t){return null==t||!1===t}function r(e){return t.customRef((()=>({get:e,set:()=>{}})))}var i,n,o,a,s=(i=function(t,e){t.exports=function(){var t=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function e(t){return t.split("").reverse().join("")}function r(t,e){return t.substring(0,e.length)===e}function i(t,e){return t.slice(-1*e.length)===e}function n(t,e,r){if((t[e]||t[r])&&t[e]===t[r])throw new Error(e)}function o(t){return"number"==typeof t&&isFinite(t)}function a(t,e){return t=t.toString().split("e"),(+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]+e:e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]-e:-e))).toFixed(e)}function s(t,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==t&&0===parseFloat(h.toFixed(t))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==t&&(h=a(h,t)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=e(g).match(/.{1,3}/g),g=e(g.join(e(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(t,e,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),e&&(h=h.split(e).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(e){var r,i,o,a={};for(void 0===e.suffix&&(e.suffix=e.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(e,r,i){var n,o=[];for(n=0;n0&&(b(t,e),setTimeout((function(){y(t,e)}),r))}function m(t){return Math.max(Math.min(t,100),0)}function v(t){return Array.isArray(t)?t:[t]}function g(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function b(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function y(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function S(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 x(t,e){return 100/(e-t)}function w(t,e,r){return 100*e/(t[r+1]-t[r])}function E(t,e){for(var r=1;t>=e[r];)r+=1;return r}function N(t,e,r){if(r>=t.slice(-1)[0])return 100;var i=E(r,t),n=t[i-1],o=t[i],a=e[i-1],s=e[i];return a+function(t,e){return w(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([n,o],r)/x(a,s)}function A(t,e,r,i){if(100===i)return i;var n=E(i,t),o=t[n-1],a=t[n];return r?i-o>(a-o)/2?a:o:e[n-1]?t[n-1]+function(t,e){return Math.round(t/e)*e}(i-t[n-1],e[n-1]):i}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(o||(o={})),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(a||(a={}));var C=function(){function t(t,e,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=e;var n=[];for(Object.keys(t).forEach((function(e){n.push([v(t[e]),e])})),n.sort((function(t,e){return t[0][0]-e[0][0]})),i=0;ithis.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++,null===e&&(e=[]);var o=1,a=e[n],s=0,l=0,u=0,c=0;for(i=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],e[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/e[n+c],i=1):(l=e[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=e[n+c]*o;return t+u},t.prototype.toStepping=function(t){return t=N(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,r){if(r>=100)return t.slice(-1)[0];var i=E(r,e),n=t[i-1],o=t[i],a=e[i-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([n,o],(r-a)*x(a,e[i]))}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=A(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var i=E(t,this.xPct);return(100===t||e&&t===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},t.prototype.getNearbySteps=function(t){var e=E(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],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(g);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){var r;if(!f(r="min"===t?0:"max"===t?100:parseFloat(t))||!f(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(e[0]);var i=Number(e[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){if(e)if(this.xVal[t]!==this.xVal[t+1]){this.xSteps[t]=w([this.xVal[t],this.xVal[t+1]],e,0)/x(this.xPct[t],this.xPct[t+1]);var r=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[t]+this.xNumSteps[t]*i;this.xHighestCompleteStep[t]=n}else this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t]},t}(),k={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},V={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},P={tooltips:".__tooltips",aria:".__aria"};function L(t,e){if(!f(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function U(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function M(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function O(t,e){if(!f(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function D(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'.");t.spectrum=new C(e,t.snap||!1,t.singleStep)}function j(t,e){if(e=v(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function F(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function z(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function H(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function R(t,e){var r,i=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function $(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 X(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=e.indexOf("tap")>=0,i=e.indexOf("drag")>=0,n=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0,s=e.indexOf("unconstrained")>=0,l=e.indexOf("drag-all")>=0,u=e.indexOf("smooth-steps")>=0;if(n){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");T(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function Y(t,e){if(!1!==e)if(!0===e||u(e)){t.tooltips=[];for(var r=0;r= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,i=[];e--;)i[e]=e*r;return i.push(100),_(i,t.stepped)}return t.mode===o.Positions?_(t.values,t.stepped):t.mode===o.Values?t.stepped?t.values.map((function(t){return N.fromStepping(N.getStep(N.toStepping(t)))})):t.values:[]}(t),i={},n=N.xVal[0],s=N.xVal[N.xVal.length-1],l=!1,u=!1,c=0;return e=r.slice().sort((function(t,e){return t-e})),(r=e.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==n&&(r.unshift(n),l=!0),r[r.length-1]!==s&&(r.push(s),u=!0),r.forEach((function(e,n){var s,p,d,f,h,m,v,g,b,y,S=e,x=r[n+1],w=t.mode===o.Steps;for(w&&(s=N.xNumSteps[n]),s||(s=x-S),void 0===x&&(x=S),s=Math.max(s,1e-7),p=S;p<=x;p=Number((p+s).toFixed(7))){for(g=(h=(f=N.toStepping(p))-c)/(t.density||1),y=h/(b=Math.round(g)),d=1;d<=b;d+=1)i[(m=c+d*y).toFixed(5)]=[N.fromStepping(m),0];v=r.indexOf(p)>-1?a.LargeValue:w?a.SmallValue:a.NoValue,!n&&l&&p!==x&&(v=0),p===x&&u||(i[f.toFixed(5)]=[p,v]),c=f}})),i}function X(t,r,i){var n,o,s=U.createElement("div"),l=((n={})[a.None]="",n[a.NoValue]=e.cssClasses.valueNormal,n[a.LargeValue]=e.cssClasses.valueLarge,n[a.SmallValue]=e.cssClasses.valueSub,n),u=((o={})[a.None]="",o[a.NoValue]=e.cssClasses.markerNormal,o[a.LargeValue]=e.cssClasses.markerLarge,o[a.SmallValue]=e.cssClasses.markerSub,o),c=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],p=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];function d(t,r){var i=r===e.cssClasses.value,n=i?l:u;return r+" "+(i?c:p)[e.ort]+" "+n[t]}return b(s,e.cssClasses.pips),b(s,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(t).forEach((function(n){!function(t,n,o){if((o=r?r(n,o):o)!==a.None){var l=j(s,!1);l.className=d(o,e.cssClasses.marker),l.style[e.style]=t+"%",o>a.NoValue&&((l=j(s,!1)).className=d(o,e.cssClasses.value),l.setAttribute("data-value",String(n)),l.style[e.style]=t+"%",l.innerHTML=String(i.to(n)))}}(n,t[n][0],t[n][1])})),s}function Y(){l&&(c(l),l=null)}function I(t){Y();var e=$(t),r=t.filter,i=t.format||{to:function(t){return String(Math.round(t))}};return l=E.appendChild(X(e,r,i))}function W(){var t=i.getBoundingClientRect(),r="offset"+["Width","Height"][e.ort];return 0===e.ort?t.width||i[r]:t.height||i[r]}function G(t,r,i,n){var o=function(o){var a,s,l=function(t,e,r){var i=0===t.type.indexOf("touch"),n=0===t.type.indexOf("mouse"),o=0===t.type.indexOf("pointer"),a=0,s=0;0===t.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===t.type&&!t.buttons&&!t.touches)return!1;if(i){var l=function(e){var i=e.target;return i===r||r.contains(i)||t.composed&&t.composedPath().shift()===r};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}e=e||S(U),(n||o)&&(a=t.clientX+e.x,s=t.clientY+e.y);return t.pageOffset=e,t.points=[a,s],t.cursor=n||o,t}(o,n.pageOffset,n.target||r);return!!l&&(!(R()&&!n.doNotReject)&&(a=E,s=e.cssClasses.tap,!((a.classList?a.classList.contains(s):new RegExp("\\b"+s+"\\b").test(a.className))&&!n.doNotReject)&&(!(t===x.start&&void 0!==l.buttons&&l.buttons>1)&&((!n.hover||!l.buttons)&&(w||l.preventDefault(),l.calcPoint=l.points[e.ort],void i(l,n))))))},a=[];return t.split(" ").forEach((function(t){r.addEventListener(t,o,!!w&&{passive:!0}),a.push([t,o])})),a}function J(t){var r,n,o,a,s,l,u=100*(t-(r=i,n=e.ort,o=r.getBoundingClientRect(),a=r.ownerDocument,s=a.documentElement,l=S(a),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?o.top+l.y-s.clientTop:o.left+l.x-s.clientLeft))/W();return u=m(u),e.dir?100-u:u}function K(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&Z(t,e)}function Q(t,r){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==r.buttonsProperty)return Z(t,r);var i=(e.dir?-1:1)*(t.calcPoint-r.startCalcPoint);ut(i>0,100*i/r.baseSize,r.locations,r.handleNumbers,r.connect)}function Z(t,r){r.handle&&(y(r.handle,e.cssClasses.active),V-=1),r.listeners.forEach((function(t){M.removeEventListener(t[0],t[1])})),0===V&&(y(E,e.cssClasses.drag),pt(),t.cursor&&(O.style.cursor="",O.removeEventListener("selectstart",d))),e.events.smoothSteps&&(r.handleNumbers.forEach((function(t){dt(t,C[t],!0,!0,!1,!1)})),r.handleNumbers.forEach((function(t){at("update",t)}))),r.handleNumbers.forEach((function(t){at("change",t),at("set",t),at("end",t)}))}function et(t,r){if(!r.handleNumbers.some(q)){var i;if(1===r.handleNumbers.length)i=n[r.handleNumbers[0]].children[0],V+=1,b(i,e.cssClasses.active);t.stopPropagation();var o=[],a=G(x.move,M,Q,{target:t.target,handle:i,connect:r.connect,listeners:o,startCalcPoint:t.calcPoint,baseSize:W(),pageOffset:t.pageOffset,handleNumbers:r.handleNumbers,buttonsProperty:t.buttons,locations:C.slice()}),s=G(x.end,M,Z,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers}),l=G("mouseout",M,K,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers});o.push.apply(o,a.concat(s,l)),t.cursor&&(O.style.cursor=getComputedStyle(t.target).cursor,n.length>1&&b(E,e.cssClasses.drag),O.addEventListener("selectstart",d,!1)),r.handleNumbers.forEach((function(t){at("start",t)}))}}function rt(t){t.stopPropagation();var r=J(t.calcPoint),i=function(t){var e=100,r=!1;return n.forEach((function(i,n){if(!q(n)){var o=C[n],a=Math.abs(o-t);(ao||100===a&&100===e)&&(r=n,e=a)}})),r}(r);!1!==i&&(e.events.snap||h(E,e.cssClasses.tap,e.animationDuration),dt(i,r,!0,!0),pt(),at("slide",i,!0),at("update",i,!0),e.events.snap?et(t,{handleNumbers:[i]}):(at("change",i,!0),at("set",i,!0)))}function it(t){var e=J(t.calcPoint),r=N.getStep(e),i=N.fromStepping(r);Object.keys(L).forEach((function(t){"hover"===t.split(".")[0]&&L[t].forEach((function(t){t.call(bt,i)}))}))}function nt(t,e){L[t]=L[t]||[],L[t].push(e),"update"===t.split(".")[0]&&n.forEach((function(t,e){at("update",e)}))}function ot(t){var e=t&&t.split(".")[0],r=e?t.substring(e.length):t;Object.keys(L).forEach((function(t){var i=t.split(".")[0],n=t.substring(i.length);e&&e!==i||r&&r!==n||function(t){return t===P.aria||t===P.tooltips}(n)&&r!==n||delete L[t]}))}function at(t,r,i){Object.keys(L).forEach((function(n){var o=n.split(".")[0];t===o&&L[n].forEach((function(t){t.call(bt,A.map(e.format.to),r,A.slice(),i||!1,C.slice(),bt)}))}))}function st(t,r,i,o,a,s,l){var u;return n.length>1&&!e.events.unconstrained&&(o&&r>0&&(u=N.getAbsoluteDistance(t[r-1],e.margin,!1),i=Math.max(i,u)),a&&r1&&e.limit&&(o&&r>0&&(u=N.getAbsoluteDistance(t[r-1],e.limit,!1),i=Math.min(i,u)),a&&r1?n.forEach((function(t,e){var i=st(a,t,a[t]+r,u[e],c[e],!1,l);!1===i?r=0:(r=i-a[t],a[t]=i)})):u=c=[!0];var p=!1;n.forEach((function(t,e){p=dt(t,i[t]+r,u[e],c[e],!1,l)||p})),p&&(n.forEach((function(t){at("update",t),at("slide",t)})),null!=o&&at("drag",s))}function ct(t,r){return e.dir?100-t-r:t}function pt(){k.forEach((function(t){var e=C[t]>50?-1:1,r=3+(n.length+e*t);n[t].style.zIndex=String(r)}))}function dt(t,r,i,o,a,s){return a||(r=st(C,t,r,i,o,!1,s)),!1!==r&&(function(t,r){C[t]=r,A[t]=N.fromStepping(r);var i="translate("+lt(ct(r,0)-D+"%","0")+")";n[t].style[e.transformRule]=i,ft(t),ft(t+1)}(t,r),!0)}function ft(t){if(s[t]){var r=0,i=100;0!==t&&(r=C[t-1]),t!==s.length-1&&(i=C[t]);var n=i-r,o="translate("+lt(ct(r,n)+"%","0")+")",a="scale("+lt(n/100,"1")+")";s[t].style[e.transformRule]=o+" "+a}}function ht(t,r){return null===t||!1===t||void 0===t?C[r]:("number"==typeof t&&(t=String(t)),!1!==(t=e.format.from(t))&&(t=N.toStepping(t)),!1===t||isNaN(t)?C[r]:t)}function mt(t,r,i){var n=v(t),o=void 0===C[0];r=void 0===r||r,e.animate&&!o&&h(E,e.cssClasses.tap,e.animationDuration),k.forEach((function(t){dt(t,ht(n[t],t),!0,!1,i)}));var a=1===k.length?0:1;if(o&&N.hasNoSize()&&(i=!0,C[0]=0,k.length>1)){var s=100/(k.length-1);k.forEach((function(t){C[t]=t*s}))}for(;ai.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===r?o=null:0===r&&(a=null);var s=N.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}b(f=E,e.cssClasses.target),0===e.dir?b(f,e.cssClasses.ltr):b(f,e.cssClasses.rtl),0===e.ort?b(f,e.cssClasses.horizontal):b(f,e.cssClasses.vertical),b(f,"rtl"===getComputedStyle(f).direction?e.cssClasses.textDirectionRtl:e.cssClasses.textDirectionLtr),i=j(f,e.cssClasses.base),function(t,r){var i=j(r,e.cssClasses.connects);n=[],(s=[]).push(z(i,t[0]));for(var o=0;o=0&&t"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},modelValue:{validator:function(t){return t=>"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(i,n){const o=function(r,i,n){const{value:o,modelValue:a,min:s}=t.toRefs(r);let l=void 0!==a.value?a:o;const u=t.ref(l.value);if(e(l.value)&&(l=t.ref(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:u}}(i),a=function(e,i,n){const{classes:o,showTooltip:a,tooltipPosition:s,orientation:l}=t.toRefs(e),u=r((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...o.value})));return{classList:r((()=>{const t={...u.value};return Object.keys(t).forEach((e=>{t[e]=Array.isArray(t[e])?t[e].filter((t=>null!==t)).join(" "):t[e]})),"always"!==a.value&&(t.target+=` ${"drag"===a.value?t.tooltipDrag:t.tooltipFocus}`),"horizontal"===l.value&&(t.tooltip+="bottom"===s.value?` ${t.tooltipBottom}`:` ${t.tooltipTop}`),"vertical"===l.value&&(t.tooltip+="right"===s.value?` ${t.tooltipRight}`:` ${t.tooltipLeft}`),t}))}}(i),s=function(e,i,n){const{format:o,step:a}=t.toRefs(e),s=n.value,u=n.classList,c=t.computed((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:l({...o.value}):l({decimals:a.value>=0?0:2}))),p=r((()=>Array.isArray(s.value)?s.value.map((t=>c.value)):c.value));return{tooltipFormat:c,tooltipsFormat:p,tooltipsMerge:(t,e,r)=>{var i="rtl"===getComputedStyle(t).direction,n="rtl"===t.noUiSlider.options.direction,o="vertical"===t.noUiSlider.options.orientation,a=t.noUiSlider.getTooltips(),s=t.noUiSlider.getOrigins();a.forEach((function(t,e){t&&s[e].appendChild(t)})),t.noUiSlider.on("update",(function(t,s,l,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=c.value.to(parseFloat(t[0])));for(var g=1;ge)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(c.value.to(parseFloat(t[g]))),h[v].push(d[g]));f.forEach((function(t,e){for(var s=t.length,l=0;l{a[c].classList.contains(t)&&a[c].classList.remove(t)}))}else a[c].style.display="none",u.value.tooltipHidden.split(" ").forEach((t=>{a[c].classList.add(t)}))}}))}))}}}(i,0,{value:o.value,classList:a.classList}),u=function(i,n,o){const{orientation:a,direction:s,tooltips:l,step:u,min:c,max:p,merge:d,id:f,disabled:h,options:m,classes:v,format:g,lazy:b,ariaLabelledby:y,aria:S}=t.toRefs(i),x=o.value,w=o.initialValue,E=o.tooltipsFormat,N=o.tooltipsMerge,A=o.tooltipFormat,C=o.classList,k=t.shallowRef(null),V=t.shallowRef(null),P=t.ref(!1),L=r((()=>{let t={cssPrefix:"",cssClasses:C.value,orientation:a.value,direction:s.value,tooltips:!!l.value&&E.value,connect:"lower",start:e(x.value)?c.value:x.value,range:{min:c.value,max:p.value}};if(u.value>0&&(t.step=u.value),Array.isArray(x.value)&&(t.connect=!0),y.value||S&&Object.keys(S.value).length){let e=Array.isArray(x.value)?x.value:[x.value];t.handleAttributes=e.map((t=>Object.assign({},S.value,y.value?{"aria-labelledby":y.value}:{})))}return g.value&&(t.ariaFormat=A.value),t})),U=r((()=>{let t={id:f.value?f.value:void 0};return h.value&&(t.disabled=!0),t})),M=r((()=>Array.isArray(x.value))),O=()=>{let t=V.value.get();return Array.isArray(t)?t.map((t=>parseFloat(t))):parseFloat(t)},D=(t,e=!0)=>{V.value.set(t,e)},j=t=>{n.emit("input",t),n.emit("update:modelValue",t),n.emit("update",t)},F=()=>{V.value=rt.create(k.value,Object.assign({},L.value,m.value)),l.value&&M.value&&d.value>=0&&N(k.value,d.value," - "),V.value.on("set",(()=>{const t=O();n.emit("change",t),n.emit("set",t),b.value&&j(t)})),V.value.on("update",(()=>{if(!P.value)return;const t=O();M.value&&it(x.value,t)||!M.value&&x.value==t?n.emit("update",t):b.value||j(t)})),V.value.on("start",(()=>{n.emit("start",O())})),V.value.on("end",(()=>{n.emit("end",O())})),V.value.on("slide",(()=>{n.emit("slide",O())})),V.value.on("drag",(()=>{n.emit("drag",O())})),k.value.querySelectorAll("[data-handle]").forEach((t=>{t.onblur=()=>{k.value&&C.value.focused.split(" ").forEach((t=>{k.value.classList.remove(t)}))},t.onfocus=()=>{C.value.focused.split(" ").forEach((t=>{k.value.classList.add(t)}))}})),P.value=!0},z=()=>{V.value&&(V.value.off(),V.value.destroy(),V.value=null)},H=(t,e)=>{P.value=!1,z(),F()};return t.onMounted(F),t.onUnmounted(z),t.watch([M,c,p,u,a,s,l,d],H,{immediate:!1}),t.watch([g,m,v],H,{immediate:!1,deep:!0}),t.watch(x,((t,r)=>{r&&("object"==typeof r&&"object"==typeof t&&t&&Object.keys(r)>Object.keys(t)||"object"==typeof r&&"object"!=typeof t||e(t))&&H()}),{immediate:!1}),t.watch(x,(t=>{if(e(t))return void D(c.value,!1);let r=O();M.value&&!Array.isArray(r)&&(r=[r]),(M.value&&!it(t,r)||!M.value&&t!=r)&&D(t,!1)}),{deep:!0}),{slider:k,slider$:V,isRange:M,sliderProps:U,init:F,destroy:z,refresh:H,update:D,reset:()=>{j(w.value)}}}(i,n,{value:o.value,initialValue:o.initialValue,tooltipFormat:s.tooltipFormat,tooltipsFormat:s.tooltipsFormat,tooltipsMerge:s.tooltipsMerge,classList:a.classList});return{...a,...s,...u}}};return nt.render=function(e,r,i,n,o,a){return t.openBlock(),t.createElementBlock("div",t.mergeProps(e.sliderProps,{ref:"slider"}),null,16)},nt.__file="src/Slider.vue",nt}(Vue); diff --git a/dist/slider.js b/dist/slider.js index 367251f..4b2f259 100644 --- a/dist/slider.js +++ b/dist/slider.js @@ -1 +1 @@ -import{toRefs as t,ref as e,customRef as r,computed as i,shallowRef as n,onMounted as o,onUnmounted as a,watch as s,openBlock as l,createElementBlock as u,mergeProps as c}from"vue";function p(t){return null==t||!1===t}function d(t){return r((()=>({get:t,set:()=>{}})))}var f,h,m,v,g=(f=function(t,e){t.exports=function(){var t=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function e(t){return t.split("").reverse().join("")}function r(t,e){return t.substring(0,e.length)===e}function i(t,e){return t.slice(-1*e.length)===e}function n(t,e,r){if((t[e]||t[r])&&t[e]===t[r])throw new Error(e)}function o(t){return"number"==typeof t&&isFinite(t)}function a(t,e){return t=t.toString().split("e"),(+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]+e:e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]-e:-e))).toFixed(e)}function s(t,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==t&&0===parseFloat(h.toFixed(t))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==t&&(h=a(h,t)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=e(g).match(/.{1,3}/g),g=e(g.join(e(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(t,e,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),e&&(h=h.split(e).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(e){var r,i,o,a={};for(void 0===e.suffix&&(e.suffix=e.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(e,r,i){var n,o=[];for(n=0;n0&&(V(t,e),setTimeout((function(){P(t,e)}),r))}function A(t){return Math.max(Math.min(t,100),0)}function C(t){return Array.isArray(t)?t:[t]}function k(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function V(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function P(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function L(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 U(t,e){return 100/(e-t)}function M(t,e,r){return 100*e/(t[r+1]-t[r])}function O(t,e){for(var r=1;t>=e[r];)r+=1;return r}function D(t,e,r){if(r>=t.slice(-1)[0])return 100;var i=O(r,t),n=t[i-1],o=t[i],a=e[i-1],s=e[i];return a+function(t,e){return M(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([n,o],r)/U(a,s)}function j(t,e,r,i){if(100===i)return i;var n=O(i,t),o=t[n-1],a=t[n];return r?i-o>(a-o)/2?a:o:e[n-1]?t[n-1]+function(t,e){return Math.round(t/e)*e}(i-t[n-1],e[n-1]):i}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(m||(m={})),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(v||(v={}));var F=function(){function t(t,e,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=e;var n=[];for(Object.keys(t).forEach((function(e){n.push([C(t[e]),e])})),n.sort((function(t,e){return t[0][0]-e[0][0]})),i=0;ithis.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++,null===e&&(e=[]);var o=1,a=e[n],s=0,l=0,u=0,c=0;for(i=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],e[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/e[n+c],i=1):(l=e[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=e[n+c]*o;return t+u},t.prototype.toStepping=function(t){return t=D(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,r){if(r>=100)return t.slice(-1)[0];var i=O(r,e),n=t[i-1],o=t[i],a=e[i-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([n,o],(r-a)*U(a,e[i]))}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=j(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var i=O(t,this.xPct);return(100===t||e&&t===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},t.prototype.getNearbySteps=function(t){var e=O(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],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(k);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){var r;if(!E(r="min"===t?0:"max"===t?100:parseFloat(t))||!E(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(e[0]);var i=Number(e[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){if(e)if(this.xVal[t]!==this.xVal[t+1]){this.xSteps[t]=M([this.xVal[t],this.xVal[t+1]],e,0)/U(this.xPct[t],this.xPct[t+1]);var r=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[t]+this.xNumSteps[t]*i;this.xHighestCompleteStep[t]=n}else this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t]},t}(),z={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},H={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},q={tooltips:".__tooltips",aria:".__aria"};function R(t,e){if(!E(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function T(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function B(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function _(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function $(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'.");t.spectrum=new F(e,t.snap||!1,t.singleStep)}function X(t,e){if(e=C(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function Y(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function I(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function W(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function G(t,e){var r,i=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function tt(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 et(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=e.indexOf("tap")>=0,i=e.indexOf("drag")>=0,n=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0,s=e.indexOf("unconstrained")>=0,l=e.indexOf("drag-all")>=0,u=e.indexOf("smooth-steps")>=0;if(n){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");K(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function rt(t,e){if(!1!==e)if(!0===e||y(e)){t.tooltips=[];for(var r=0;r= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,i=[];e--;)i[e]=e*r;return i.push(100),_(i,t.stepped)}return t.mode===m.Positions?_(t.values,t.stepped):t.mode===m.Values?t.stepped?t.values.map((function(t){return f.fromStepping(f.getStep(f.toStepping(t)))})):t.values:[]}(t),i={},n=f.xVal[0],o=f.xVal[f.xVal.length-1],a=!1,s=!1,l=0;return e=r.slice().sort((function(t,e){return t-e})),(r=e.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==n&&(r.unshift(n),a=!0),r[r.length-1]!==o&&(r.push(o),s=!0),r.forEach((function(e,n){var o,u,c,p,d,h,g,b,y,S,x=e,w=r[n+1],E=t.mode===m.Steps;for(E&&(o=f.xNumSteps[n]),o||(o=w-x),void 0===w&&(w=x),o=Math.max(o,1e-7),u=x;u<=w;u=Number((u+o).toFixed(7))){for(b=(d=(p=f.toStepping(u))-l)/(t.density||1),S=d/(y=Math.round(b)),c=1;c<=y;c+=1)i[(h=l+c*S).toFixed(5)]=[f.fromStepping(h),0];g=r.indexOf(u)>-1?v.LargeValue:E?v.SmallValue:v.NoValue,!n&&a&&u!==w&&(g=0),u===w&&s||(i[p.toFixed(5)]=[u,g]),l=p}})),i}function X(t,r,i){var n,o,a=k.createElement("div"),s=((n={})[v.None]="",n[v.NoValue]=e.cssClasses.valueNormal,n[v.LargeValue]=e.cssClasses.valueLarge,n[v.SmallValue]=e.cssClasses.valueSub,n),l=((o={})[v.None]="",o[v.NoValue]=e.cssClasses.markerNormal,o[v.LargeValue]=e.cssClasses.markerLarge,o[v.SmallValue]=e.cssClasses.markerSub,o),u=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],c=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];function p(t,r){var i=r===e.cssClasses.value,n=i?s:l;return r+" "+(i?u:c)[e.ort]+" "+n[t]}return V(a,e.cssClasses.pips),V(a,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(t).forEach((function(n){!function(t,n,o){if((o=r?r(n,o):o)!==v.None){var s=D(a,!1);s.className=p(o,e.cssClasses.marker),s.style[e.style]=t+"%",o>v.NoValue&&((s=D(a,!1)).className=p(o,e.cssClasses.value),s.setAttribute("data-value",String(n)),s.style[e.style]=t+"%",s.innerHTML=String(i.to(n)))}}(n,t[n][0],t[n][1])})),a}function Y(){a&&(S(a),a=null)}function I(t){Y();var e=$(t),r=t.filter,i=t.format||{to:function(t){return String(Math.round(t))}};return a=d.appendChild(X(e,r,i))}function W(){var t=i.getBoundingClientRect(),r="offset"+["Width","Height"][e.ort];return 0===e.ort?t.width||i[r]:t.height||i[r]}function G(t,r,i,n){var o=function(o){var a,s,l=function(t,e,r){var i=0===t.type.indexOf("touch"),n=0===t.type.indexOf("mouse"),o=0===t.type.indexOf("pointer"),a=0,s=0;0===t.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===t.type&&!t.buttons&&!t.touches)return!1;if(i){var l=function(e){var i=e.target;return i===r||r.contains(i)||t.composed&&t.composedPath().shift()===r};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}e=e||L(k),(n||o)&&(a=t.clientX+e.x,s=t.clientY+e.y);return t.pageOffset=e,t.points=[a,s],t.cursor=n||o,t}(o,n.pageOffset,n.target||r);return!!l&&(!(H()&&!n.doNotReject)&&(a=d,s=e.cssClasses.tap,!((a.classList?a.classList.contains(s):new RegExp("\\b"+s+"\\b").test(a.className))&&!n.doNotReject)&&(!(t===c.start&&void 0!==l.buttons&&l.buttons>1)&&((!n.hover||!l.buttons)&&(p||l.preventDefault(),l.calcPoint=l.points[e.ort],void i(l,n))))))},a=[];return t.split(" ").forEach((function(t){r.addEventListener(t,o,!!p&&{passive:!0}),a.push([t,o])})),a}function J(t){var r,n,o,a,s,l,u=100*(t-(r=i,n=e.ort,o=r.getBoundingClientRect(),a=r.ownerDocument,s=a.documentElement,l=L(a),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?o.top+l.y-s.clientTop:o.left+l.x-s.clientLeft))/W();return u=A(u),e.dir?100-u:u}function K(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&Z(t,e)}function Q(t,r){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==r.buttonsProperty)return Z(t,r);var i=(e.dir?-1:1)*(t.calcPoint-r.startCalcPoint);lt(i>0,100*i/r.baseSize,r.locations,r.handleNumbers,r.connect)}function Z(t,r){r.handle&&(P(r.handle,e.cssClasses.active),y-=1),r.listeners.forEach((function(t){U.removeEventListener(t[0],t[1])})),0===y&&(P(d,e.cssClasses.drag),pt(),t.cursor&&(M.style.cursor="",M.removeEventListener("selectstart",w))),e.events.smoothSteps&&(r.handleNumbers.forEach((function(t){dt(t,g[t],!0,!0,!1,!1)})),r.handleNumbers.forEach((function(t){ot("update",t)}))),r.handleNumbers.forEach((function(t){ot("change",t),ot("set",t),ot("end",t)}))}function tt(t,r){if(!r.handleNumbers.some(R)){var i;if(1===r.handleNumbers.length)i=n[r.handleNumbers[0]].children[0],y+=1,V(i,e.cssClasses.active);t.stopPropagation();var o=[],a=G(c.move,U,Q,{target:t.target,handle:i,connect:r.connect,listeners:o,startCalcPoint:t.calcPoint,baseSize:W(),pageOffset:t.pageOffset,handleNumbers:r.handleNumbers,buttonsProperty:t.buttons,locations:g.slice()}),s=G(c.end,U,Z,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers}),l=G("mouseout",U,K,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers});o.push.apply(o,a.concat(s,l)),t.cursor&&(M.style.cursor=getComputedStyle(t.target).cursor,n.length>1&&V(d,e.cssClasses.drag),M.addEventListener("selectstart",w,!1)),r.handleNumbers.forEach((function(t){ot("start",t)}))}}function et(t){t.stopPropagation();var r=J(t.calcPoint),i=function(t){var e=100,r=!1;return n.forEach((function(i,n){if(!R(n)){var o=g[n],a=Math.abs(o-t);(ao||100===a&&100===e)&&(r=n,e=a)}})),r}(r);!1!==i&&(e.events.snap||N(d,e.cssClasses.tap,e.animationDuration),dt(i,r,!0,!0),pt(),ot("slide",i,!0),ot("update",i,!0),e.events.snap?tt(t,{handleNumbers:[i]}):(ot("change",i,!0),ot("set",i,!0)))}function rt(t){var e=J(t.calcPoint),r=f.getStep(e),i=f.fromStepping(r);Object.keys(E).forEach((function(t){"hover"===t.split(".")[0]&&E[t].forEach((function(t){t.call(bt,i)}))}))}function it(t,e){E[t]=E[t]||[],E[t].push(e),"update"===t.split(".")[0]&&n.forEach((function(t,e){ot("update",e)}))}function nt(t){var e=t&&t.split(".")[0],r=e?t.substring(e.length):t;Object.keys(E).forEach((function(t){var i=t.split(".")[0],n=t.substring(i.length);e&&e!==i||r&&r!==n||function(t){return t===q.aria||t===q.tooltips}(n)&&r!==n||delete E[t]}))}function ot(t,r,i){Object.keys(E).forEach((function(n){var o=n.split(".")[0];t===o&&E[n].forEach((function(t){t.call(bt,h.map(e.format.to),r,h.slice(),i||!1,g.slice(),bt)}))}))}function at(t,r,i,o,a,s,l){var u;return n.length>1&&!e.events.unconstrained&&(o&&r>0&&(u=f.getAbsoluteDistance(t[r-1],e.margin,!1),i=Math.max(i,u)),a&&r1&&e.limit&&(o&&r>0&&(u=f.getAbsoluteDistance(t[r-1],e.limit,!1),i=Math.min(i,u)),a&&r1?n.forEach((function(t,e){var i=at(a,t,a[t]+r,u[e],c[e],!1,l);!1===i?r=0:(r=i-a[t],a[t]=i)})):u=c=[!0];var p=!1;n.forEach((function(t,e){p=dt(t,i[t]+r,u[e],c[e],!1,l)||p})),p&&(n.forEach((function(t){ot("update",t),ot("slide",t)})),null!=o&&ot("drag",s))}function ut(t,r){return e.dir?100-t-r:t}function pt(){b.forEach((function(t){var e=g[t]>50?-1:1,r=3+(n.length+e*t);n[t].style.zIndex=String(r)}))}function dt(t,r,i,o,a,s){return a||(r=at(g,t,r,i,o,!1,s)),!1!==r&&(function(t,r){g[t]=r,h[t]=f.fromStepping(r);var i="translate("+st(ut(r,0)-O+"%","0")+")";n[t].style[e.transformRule]=i,ft(t),ft(t+1)}(t,r),!0)}function ft(t){if(o[t]){var r=0,i=100;0!==t&&(r=g[t-1]),t!==o.length-1&&(i=g[t]);var n=i-r,a="translate("+st(ut(r,n)+"%","0")+")",s="scale("+st(n/100,"1")+")";o[t].style[e.transformRule]=a+" "+s}}function ht(t,r){return null===t||!1===t||void 0===t?g[r]:("number"==typeof t&&(t=String(t)),!1!==(t=e.format.from(t))&&(t=f.toStepping(t)),!1===t||isNaN(t)?g[r]:t)}function mt(t,r,i){var n=C(t),o=void 0===g[0];r=void 0===r||r,e.animate&&!o&&N(d,e.cssClasses.tap,e.animationDuration),b.forEach((function(t){dt(t,ht(n[t],t),!0,!1,i)}));var a=1===b.length?0:1;if(o&&f.hasNoSize()&&(i=!0,g[0]=0,b.length>1)){var s=100/(b.length-1);b.forEach((function(t){g[t]=t*s}))}for(;ai.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===r?o=null:0===r&&(a=null);var s=f.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}V(l=d,e.cssClasses.target),0===e.dir?V(l,e.cssClasses.ltr):V(l,e.cssClasses.rtl),0===e.ort?V(l,e.cssClasses.horizontal):V(l,e.cssClasses.vertical),V(l,"rtl"===getComputedStyle(l).direction?e.cssClasses.textDirectionRtl:e.cssClasses.textDirectionLtr),i=D(l,e.cssClasses.base),function(t,r){var i=D(r,e.cssClasses.connects);n=[],(o=[]).push(F(i,t[0]));for(var a=0;a=0&&t"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},modelValue:{validator:function(t){return t=>"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(r,l){const u=function(r,i,n){const{value:o,modelValue:a,min:s}=t(r);let l=void 0!==a.value?a:o;const u=e(l.value);if(p(l.value)&&(l=e(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:u}}(r),c=function(e,r,i){const{classes:n,showTooltip:o,tooltipPosition:a,orientation:s}=t(e),l=d((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...n.value})));return{classList:d((()=>{const t={...l.value};return Object.keys(t).forEach((e=>{t[e]=Array.isArray(t[e])?t[e].filter((t=>null!==t)).join(" "):t[e]})),"always"!==o.value&&(t.target+=` ${"drag"===o.value?t.tooltipDrag:t.tooltipFocus}`),"horizontal"===s.value&&(t.tooltip+="bottom"===a.value?` ${t.tooltipBottom}`:` ${t.tooltipTop}`),"vertical"===s.value&&(t.tooltip+="right"===a.value?` ${t.tooltipRight}`:` ${t.tooltipLeft}`),t}))}}(r),f=function(e,r,n){const{format:o,step:a}=t(e),s=n.value,l=n.classList,u=i((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:b({...o.value}):b({decimals:a.value>=0?0:2}))),c=d((()=>Array.isArray(s.value)?s.value.map((t=>u.value)):u.value));return{tooltipFormat:u,tooltipsFormat:c,tooltipsMerge:(t,e,r)=>{var i="rtl"===getComputedStyle(t).direction,n="rtl"===t.noUiSlider.options.direction,o="vertical"===t.noUiSlider.options.orientation,a=t.noUiSlider.getTooltips(),s=t.noUiSlider.getOrigins();a.forEach((function(t,e){t&&s[e].appendChild(t)})),t.noUiSlider.on("update",(function(t,s,c,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=u.value.to(parseFloat(t[0])));for(var g=1;ge)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(u.value.to(parseFloat(t[g]))),h[v].push(d[g]));f.forEach((function(t,e){for(var s=t.length,u=0;u{a[c].classList.contains(t)&&a[c].classList.remove(t)}))}else a[c].style.display="none",l.value.tooltipHidden.split(" ").forEach((t=>{a[c].classList.add(t)}))}}))}))}}}(r,0,{value:u.value,classList:c.classList}),h=function(r,i,l){const{orientation:u,direction:c,tooltips:f,step:h,min:m,max:v,merge:g,id:b,disabled:y,options:S,classes:x,format:w,lazy:E,ariaLabelledby:N,aria:A}=t(r),C=l.value,k=l.initialValue,V=l.tooltipsFormat,P=l.tooltipsMerge,L=l.tooltipFormat,U=l.classList,M=n(null),O=n(null),D=e(!1),j=d((()=>{let t={cssPrefix:"",cssClasses:U.value,orientation:u.value,direction:c.value,tooltips:!!f.value&&V.value,connect:"lower",start:p(C.value)?m.value:C.value,range:{min:m.value,max:v.value}};if(h.value>0&&(t.step=h.value),Array.isArray(C.value)&&(t.connect=!0),N.value||A&&Object.keys(A.value).length){let e=Array.isArray(C.value)?C.value:[C.value];t.handleAttributes=e.map((t=>Object.assign({},A.value,N.value?{"aria-labelledby":N.value}:{})))}return w.value&&(t.ariaFormat=L.value),t})),F=d((()=>{let t={id:b.value?b.value:void 0};return y.value&&(t.disabled=!0),t})),z=d((()=>Array.isArray(C.value))),H=()=>{let t=O.value.get();return Array.isArray(t)?t.map((t=>parseFloat(t))):parseFloat(t)},q=(t,e=!0)=>{O.value.set(t,e)},R=t=>{i.emit("input",t),i.emit("update:modelValue",t),i.emit("update",t)},T=()=>{O.value=dt.create(M.value,Object.assign({},j.value,S.value)),f.value&&z.value&&g.value>=0&&P(M.value,g.value," - "),O.value.on("set",(()=>{const t=H();i.emit("change",t),i.emit("set",t),E.value&&R(t)})),O.value.on("update",(()=>{if(!D.value)return;const t=H();z.value&&ft(C.value,t)||!z.value&&C.value==t?i.emit("update",t):E.value||R(t)})),O.value.on("start",(()=>{i.emit("start",H())})),O.value.on("end",(()=>{i.emit("end",H())})),O.value.on("slide",(()=>{i.emit("slide",H())})),O.value.on("drag",(()=>{i.emit("drag",H())})),M.value.querySelectorAll("[data-handle]").forEach((t=>{t.onblur=()=>{M.value&&U.value.focused.split(" ").forEach((t=>{M.value.classList.remove(t)}))},t.onfocus=()=>{U.value.focused.split(" ").forEach((t=>{M.value.classList.add(t)}))}})),D.value=!0},B=()=>{O.value.off(),O.value.destroy(),O.value=null},_=(t,e)=>{D.value=!1,B(),T()};return o(T),a(B),s([z,m,v,h,u,c,f,g],_,{immediate:!1}),s([w,S,x],_,{immediate:!1,deep:!0}),s(C,((t,e)=>{e&&("object"==typeof e&&"object"==typeof t&&t&&Object.keys(e)>Object.keys(t)||"object"==typeof e&&"object"!=typeof t||p(t))&&_()}),{immediate:!1}),s(C,(t=>{if(p(t))return void q(m.value,!1);let e=H();z.value&&!Array.isArray(e)&&(e=[e]),(z.value&&!ft(t,e)||!z.value&&t!=e)&&q(t,!1)}),{deep:!0}),{slider:M,slider$:O,isRange:z,sliderProps:F,init:T,destroy:B,refresh:_,update:q,reset:()=>{R(k.value)}}}(r,l,{value:u.value,initialValue:u.initialValue,tooltipFormat:f.tooltipFormat,tooltipsFormat:f.tooltipsFormat,tooltipsMerge:f.tooltipsMerge,classList:c.classList});return{...c,...f,...h}}};ht.render=function(t,e,r,i,n,o){return l(),u("div",c(t.sliderProps,{ref:"slider"}),null,16)},ht.__file="src/Slider.vue";export{ht as default}; +import{toRefs as t,ref as e,customRef as r,computed as i,shallowRef as n,onMounted as o,onUnmounted as a,watch as s,openBlock as l,createElementBlock as u,mergeProps as c}from"vue";function p(t){return null==t||!1===t}function d(t){return r((()=>({get:t,set:()=>{}})))}var f,h,m,v,g=(f=function(t,e){t.exports=function(){var t=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function e(t){return t.split("").reverse().join("")}function r(t,e){return t.substring(0,e.length)===e}function i(t,e){return t.slice(-1*e.length)===e}function n(t,e,r){if((t[e]||t[r])&&t[e]===t[r])throw new Error(e)}function o(t){return"number"==typeof t&&isFinite(t)}function a(t,e){return t=t.toString().split("e"),(+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]+e:e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]-e:-e))).toFixed(e)}function s(t,r,i,n,s,l,u,c,p,d,f,h){var m,v,g,b=h,y="",S="";return l&&(h=l(h)),!!o(h)&&(!1!==t&&0===parseFloat(h.toFixed(t))&&(h=0),h<0&&(m=!0,h=Math.abs(h)),!1!==t&&(h=a(h,t)),-1!==(h=h.toString()).indexOf(".")?(g=(v=h.split("."))[0],i&&(y=i+v[1])):g=h,r&&(g=e(g).match(/.{1,3}/g),g=e(g.join(e(r)))),m&&c&&(S+=c),n&&(S+=n),m&&p&&(S+=p),S+=g,S+=y,s&&(S+=s),d&&(S=d(S,b)),S)}function l(t,e,n,a,s,l,u,c,p,d,f,h){var m,v="";return f&&(h=f(h)),!(!h||"string"!=typeof h)&&(c&&r(h,c)&&(h=h.replace(c,""),m=!0),a&&r(h,a)&&(h=h.replace(a,"")),p&&r(h,p)&&(h=h.replace(p,""),m=!0),s&&i(h,s)&&(h=h.slice(0,-1*s.length)),e&&(h=h.split(e).join("")),n&&(h=h.replace(n,".")),m&&(v+="-"),""!==(v=(v+=h).replace(/[^0-9\.\-.]/g,""))&&(v=Number(v),u&&(v=u(v)),!!o(v)&&v))}function u(e){var r,i,o,a={};for(void 0===e.suffix&&(e.suffix=e.postfix),r=0;r=0&&o<8))throw new Error(i);a[i]=o}else if("encoder"===i||"decoder"===i||"edit"===i||"undo"===i){if("function"!=typeof o)throw new Error(i);a[i]=o}else{if("string"!=typeof o)throw new Error(i);a[i]=o}return n(a,"mark","thousand"),n(a,"prefix","negative"),n(a,"prefix","negativeBefore"),a}function c(e,r,i){var n,o=[];for(n=0;n0&&(V(t,e),setTimeout((function(){P(t,e)}),r))}function A(t){return Math.max(Math.min(t,100),0)}function C(t){return Array.isArray(t)?t:[t]}function k(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function V(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function P(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function L(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 U(t,e){return 100/(e-t)}function M(t,e,r){return 100*e/(t[r+1]-t[r])}function O(t,e){for(var r=1;t>=e[r];)r+=1;return r}function D(t,e,r){if(r>=t.slice(-1)[0])return 100;var i=O(r,t),n=t[i-1],o=t[i],a=e[i-1],s=e[i];return a+function(t,e){return M(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([n,o],r)/U(a,s)}function j(t,e,r,i){if(100===i)return i;var n=O(i,t),o=t[n-1],a=t[n];return r?i-o>(a-o)/2?a:o:e[n-1]?t[n-1]+function(t,e){return Math.round(t/e)*e}(i-t[n-1],e[n-1]):i}!function(t){t.Range="range",t.Steps="steps",t.Positions="positions",t.Count="count",t.Values="values"}(m||(m={})),function(t){t[t.None=-1]="None",t[t.NoValue=0]="NoValue",t[t.LargeValue=1]="LargeValue",t[t.SmallValue=2]="SmallValue"}(v||(v={}));var F=function(){function t(t,e,r){var i;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=e;var n=[];for(Object.keys(t).forEach((function(e){n.push([C(t[e]),e])})),n.sort((function(t,e){return t[0][0]-e[0][0]})),i=0;ithis.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++,null===e&&(e=[]);var o=1,a=e[n],s=0,l=0,u=0,c=0;for(i=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);a>0;)s=this.xPct[n+1+c]-this.xPct[n+c],e[n+c]*o+100-100*i>100?(l=s*i,o=(a-100*i)/e[n+c],i=1):(l=e[n+c]*s/100*o,o=0),r?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=e[n+c]*o;return t+u},t.prototype.toStepping=function(t){return t=D(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,r){if(r>=100)return t.slice(-1)[0];var i=O(r,e),n=t[i-1],o=t[i],a=e[i-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([n,o],(r-a)*U(a,e[i]))}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=j(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var i=O(t,this.xPct);return(100===t||e&&t===this.xPct[i-1])&&(i=Math.max(i-1,1)),(this.xVal[i]-this.xVal[i-1])/r},t.prototype.getNearbySteps=function(t){var e=O(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],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(k);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){var r;if(!E(r="min"===t?0:"max"===t?100:parseFloat(t))||!E(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(e[0]);var i=Number(e[1]);r?this.xSteps.push(!isNaN(i)&&i):isNaN(i)||(this.xSteps[0]=i),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){if(e)if(this.xVal[t]!==this.xVal[t+1]){this.xSteps[t]=M([this.xVal[t],this.xVal[t+1]],e,0)/U(this.xPct[t],this.xPct[t+1]);var r=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),n=this.xVal[t]+this.xNumSteps[t]*i;this.xHighestCompleteStep[t]=n}else this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t]},t}(),z={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},H={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-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"},q={tooltips:".__tooltips",aria:".__aria"};function R(t,e){if(!E(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function T(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function B(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function _(t,e){if(!E(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function $(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'.");t.spectrum=new F(e,t.snap||!1,t.singleStep)}function X(t,e){if(e=C(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function Y(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function I(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function W(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function G(t,e){var r,i=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function tt(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 et(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=e.indexOf("tap")>=0,i=e.indexOf("drag")>=0,n=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0,s=e.indexOf("unconstrained")>=0,l=e.indexOf("drag-all")>=0,u=e.indexOf("smooth-steps")>=0;if(n){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");K(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:i,dragAll:l,smoothSteps:u,fixed:n,snap:o,hover:a,unconstrained:s}}function rt(t,e){if(!1!==e)if(!0===e||y(e)){t.tooltips=[];for(var r=0;r= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,i=[];e--;)i[e]=e*r;return i.push(100),_(i,t.stepped)}return t.mode===m.Positions?_(t.values,t.stepped):t.mode===m.Values?t.stepped?t.values.map((function(t){return f.fromStepping(f.getStep(f.toStepping(t)))})):t.values:[]}(t),i={},n=f.xVal[0],o=f.xVal[f.xVal.length-1],a=!1,s=!1,l=0;return e=r.slice().sort((function(t,e){return t-e})),(r=e.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==n&&(r.unshift(n),a=!0),r[r.length-1]!==o&&(r.push(o),s=!0),r.forEach((function(e,n){var o,u,c,p,d,h,g,b,y,S,x=e,w=r[n+1],E=t.mode===m.Steps;for(E&&(o=f.xNumSteps[n]),o||(o=w-x),void 0===w&&(w=x),o=Math.max(o,1e-7),u=x;u<=w;u=Number((u+o).toFixed(7))){for(b=(d=(p=f.toStepping(u))-l)/(t.density||1),S=d/(y=Math.round(b)),c=1;c<=y;c+=1)i[(h=l+c*S).toFixed(5)]=[f.fromStepping(h),0];g=r.indexOf(u)>-1?v.LargeValue:E?v.SmallValue:v.NoValue,!n&&a&&u!==w&&(g=0),u===w&&s||(i[p.toFixed(5)]=[u,g]),l=p}})),i}function X(t,r,i){var n,o,a=k.createElement("div"),s=((n={})[v.None]="",n[v.NoValue]=e.cssClasses.valueNormal,n[v.LargeValue]=e.cssClasses.valueLarge,n[v.SmallValue]=e.cssClasses.valueSub,n),l=((o={})[v.None]="",o[v.NoValue]=e.cssClasses.markerNormal,o[v.LargeValue]=e.cssClasses.markerLarge,o[v.SmallValue]=e.cssClasses.markerSub,o),u=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],c=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];function p(t,r){var i=r===e.cssClasses.value,n=i?s:l;return r+" "+(i?u:c)[e.ort]+" "+n[t]}return V(a,e.cssClasses.pips),V(a,0===e.ort?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical),Object.keys(t).forEach((function(n){!function(t,n,o){if((o=r?r(n,o):o)!==v.None){var s=D(a,!1);s.className=p(o,e.cssClasses.marker),s.style[e.style]=t+"%",o>v.NoValue&&((s=D(a,!1)).className=p(o,e.cssClasses.value),s.setAttribute("data-value",String(n)),s.style[e.style]=t+"%",s.innerHTML=String(i.to(n)))}}(n,t[n][0],t[n][1])})),a}function Y(){a&&(S(a),a=null)}function I(t){Y();var e=$(t),r=t.filter,i=t.format||{to:function(t){return String(Math.round(t))}};return a=d.appendChild(X(e,r,i))}function W(){var t=i.getBoundingClientRect(),r="offset"+["Width","Height"][e.ort];return 0===e.ort?t.width||i[r]:t.height||i[r]}function G(t,r,i,n){var o=function(o){var a,s,l=function(t,e,r){var i=0===t.type.indexOf("touch"),n=0===t.type.indexOf("mouse"),o=0===t.type.indexOf("pointer"),a=0,s=0;0===t.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===t.type&&!t.buttons&&!t.touches)return!1;if(i){var l=function(e){var i=e.target;return i===r||r.contains(i)||t.composed&&t.composedPath().shift()===r};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;a=u[0].pageX,s=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;a=c.pageX,s=c.pageY}}e=e||L(k),(n||o)&&(a=t.clientX+e.x,s=t.clientY+e.y);return t.pageOffset=e,t.points=[a,s],t.cursor=n||o,t}(o,n.pageOffset,n.target||r);return!!l&&(!(H()&&!n.doNotReject)&&(a=d,s=e.cssClasses.tap,!((a.classList?a.classList.contains(s):new RegExp("\\b"+s+"\\b").test(a.className))&&!n.doNotReject)&&(!(t===c.start&&void 0!==l.buttons&&l.buttons>1)&&((!n.hover||!l.buttons)&&(p||l.preventDefault(),l.calcPoint=l.points[e.ort],void i(l,n))))))},a=[];return t.split(" ").forEach((function(t){r.addEventListener(t,o,!!p&&{passive:!0}),a.push([t,o])})),a}function J(t){var r,n,o,a,s,l,u=100*(t-(r=i,n=e.ort,o=r.getBoundingClientRect(),a=r.ownerDocument,s=a.documentElement,l=L(a),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?o.top+l.y-s.clientTop:o.left+l.x-s.clientLeft))/W();return u=A(u),e.dir?100-u:u}function K(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&Z(t,e)}function Q(t,r){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==r.buttonsProperty)return Z(t,r);var i=(e.dir?-1:1)*(t.calcPoint-r.startCalcPoint);lt(i>0,100*i/r.baseSize,r.locations,r.handleNumbers,r.connect)}function Z(t,r){r.handle&&(P(r.handle,e.cssClasses.active),y-=1),r.listeners.forEach((function(t){U.removeEventListener(t[0],t[1])})),0===y&&(P(d,e.cssClasses.drag),pt(),t.cursor&&(M.style.cursor="",M.removeEventListener("selectstart",w))),e.events.smoothSteps&&(r.handleNumbers.forEach((function(t){dt(t,g[t],!0,!0,!1,!1)})),r.handleNumbers.forEach((function(t){ot("update",t)}))),r.handleNumbers.forEach((function(t){ot("change",t),ot("set",t),ot("end",t)}))}function tt(t,r){if(!r.handleNumbers.some(R)){var i;if(1===r.handleNumbers.length)i=n[r.handleNumbers[0]].children[0],y+=1,V(i,e.cssClasses.active);t.stopPropagation();var o=[],a=G(c.move,U,Q,{target:t.target,handle:i,connect:r.connect,listeners:o,startCalcPoint:t.calcPoint,baseSize:W(),pageOffset:t.pageOffset,handleNumbers:r.handleNumbers,buttonsProperty:t.buttons,locations:g.slice()}),s=G(c.end,U,Z,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers}),l=G("mouseout",U,K,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:r.handleNumbers});o.push.apply(o,a.concat(s,l)),t.cursor&&(M.style.cursor=getComputedStyle(t.target).cursor,n.length>1&&V(d,e.cssClasses.drag),M.addEventListener("selectstart",w,!1)),r.handleNumbers.forEach((function(t){ot("start",t)}))}}function et(t){t.stopPropagation();var r=J(t.calcPoint),i=function(t){var e=100,r=!1;return n.forEach((function(i,n){if(!R(n)){var o=g[n],a=Math.abs(o-t);(ao||100===a&&100===e)&&(r=n,e=a)}})),r}(r);!1!==i&&(e.events.snap||N(d,e.cssClasses.tap,e.animationDuration),dt(i,r,!0,!0),pt(),ot("slide",i,!0),ot("update",i,!0),e.events.snap?tt(t,{handleNumbers:[i]}):(ot("change",i,!0),ot("set",i,!0)))}function rt(t){var e=J(t.calcPoint),r=f.getStep(e),i=f.fromStepping(r);Object.keys(E).forEach((function(t){"hover"===t.split(".")[0]&&E[t].forEach((function(t){t.call(bt,i)}))}))}function it(t,e){E[t]=E[t]||[],E[t].push(e),"update"===t.split(".")[0]&&n.forEach((function(t,e){ot("update",e)}))}function nt(t){var e=t&&t.split(".")[0],r=e?t.substring(e.length):t;Object.keys(E).forEach((function(t){var i=t.split(".")[0],n=t.substring(i.length);e&&e!==i||r&&r!==n||function(t){return t===q.aria||t===q.tooltips}(n)&&r!==n||delete E[t]}))}function ot(t,r,i){Object.keys(E).forEach((function(n){var o=n.split(".")[0];t===o&&E[n].forEach((function(t){t.call(bt,h.map(e.format.to),r,h.slice(),i||!1,g.slice(),bt)}))}))}function at(t,r,i,o,a,s,l){var u;return n.length>1&&!e.events.unconstrained&&(o&&r>0&&(u=f.getAbsoluteDistance(t[r-1],e.margin,!1),i=Math.max(i,u)),a&&r1&&e.limit&&(o&&r>0&&(u=f.getAbsoluteDistance(t[r-1],e.limit,!1),i=Math.min(i,u)),a&&r1?n.forEach((function(t,e){var i=at(a,t,a[t]+r,u[e],c[e],!1,l);!1===i?r=0:(r=i-a[t],a[t]=i)})):u=c=[!0];var p=!1;n.forEach((function(t,e){p=dt(t,i[t]+r,u[e],c[e],!1,l)||p})),p&&(n.forEach((function(t){ot("update",t),ot("slide",t)})),null!=o&&ot("drag",s))}function ut(t,r){return e.dir?100-t-r:t}function pt(){b.forEach((function(t){var e=g[t]>50?-1:1,r=3+(n.length+e*t);n[t].style.zIndex=String(r)}))}function dt(t,r,i,o,a,s){return a||(r=at(g,t,r,i,o,!1,s)),!1!==r&&(function(t,r){g[t]=r,h[t]=f.fromStepping(r);var i="translate("+st(ut(r,0)-O+"%","0")+")";n[t].style[e.transformRule]=i,ft(t),ft(t+1)}(t,r),!0)}function ft(t){if(o[t]){var r=0,i=100;0!==t&&(r=g[t-1]),t!==o.length-1&&(i=g[t]);var n=i-r,a="translate("+st(ut(r,n)+"%","0")+")",s="scale("+st(n/100,"1")+")";o[t].style[e.transformRule]=a+" "+s}}function ht(t,r){return null===t||!1===t||void 0===t?g[r]:("number"==typeof t&&(t=String(t)),!1!==(t=e.format.from(t))&&(t=f.toStepping(t)),!1===t||isNaN(t)?g[r]:t)}function mt(t,r,i){var n=C(t),o=void 0===g[0];r=void 0===r||r,e.animate&&!o&&N(d,e.cssClasses.tap,e.animationDuration),b.forEach((function(t){dt(t,ht(n[t],t),!0,!1,i)}));var a=1===b.length?0:1;if(o&&f.hasNoSize()&&(i=!0,g[0]=0,b.length>1)){var s=100/(b.length-1);b.forEach((function(t){g[t]=t*s}))}for(;ai.stepAfter.startValue&&(o=i.stepAfter.startValue-n),a=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===r?o=null:0===r&&(a=null);var s=f.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}V(l=d,e.cssClasses.target),0===e.dir?V(l,e.cssClasses.ltr):V(l,e.cssClasses.rtl),0===e.ort?V(l,e.cssClasses.horizontal):V(l,e.cssClasses.vertical),V(l,"rtl"===getComputedStyle(l).direction?e.cssClasses.textDirectionRtl:e.cssClasses.textDirectionLtr),i=D(l,e.cssClasses.base),function(t,r){var i=D(r,e.cssClasses.connects);n=[],(o=[]).push(F(i,t[0]));for(var a=0;a=0&&t"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},modelValue:{validator:function(t){return t=>"number"==typeof t||t instanceof Array||null==t||!1===t},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(r,l){const u=function(r,i,n){const{value:o,modelValue:a,min:s}=t(r);let l=void 0!==a.value?a:o;const u=e(l.value);if(p(l.value)&&(l=e(s.value)),Array.isArray(l.value)&&0==l.value.length)throw new Error("Slider v-model must not be an empty array");return{value:l,initialValue:u}}(r),c=function(e,r,i){const{classes:n,showTooltip:o,tooltipPosition:a,orientation:s}=t(e),l=d((()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...n.value})));return{classList:d((()=>{const t={...l.value};return Object.keys(t).forEach((e=>{t[e]=Array.isArray(t[e])?t[e].filter((t=>null!==t)).join(" "):t[e]})),"always"!==o.value&&(t.target+=` ${"drag"===o.value?t.tooltipDrag:t.tooltipFocus}`),"horizontal"===s.value&&(t.tooltip+="bottom"===a.value?` ${t.tooltipBottom}`:` ${t.tooltipTop}`),"vertical"===s.value&&(t.tooltip+="right"===a.value?` ${t.tooltipRight}`:` ${t.tooltipLeft}`),t}))}}(r),f=function(e,r,n){const{format:o,step:a}=t(e),s=n.value,l=n.classList,u=i((()=>o&&o.value?"function"==typeof o.value?{to:o.value}:b({...o.value}):b({decimals:a.value>=0?0:2}))),c=d((()=>Array.isArray(s.value)?s.value.map((t=>u.value)):u.value));return{tooltipFormat:u,tooltipsFormat:c,tooltipsMerge:(t,e,r)=>{var i="rtl"===getComputedStyle(t).direction,n="rtl"===t.noUiSlider.options.direction,o="vertical"===t.noUiSlider.options.orientation,a=t.noUiSlider.getTooltips(),s=t.noUiSlider.getOrigins();a.forEach((function(t,e){t&&s[e].appendChild(t)})),t.noUiSlider.on("update",(function(t,s,c,p,d){var f=[[]],h=[[]],m=[[]],v=0;a[0]&&(f[0][0]=0,h[0][0]=d[0],m[0][0]=u.value.to(parseFloat(t[0])));for(var g=1;ge)&&(f[++v]=[],m[v]=[],h[v]=[]),a[g]&&(f[v].push(g),m[v].push(u.value.to(parseFloat(t[g]))),h[v].push(d[g]));f.forEach((function(t,e){for(var s=t.length,u=0;u{a[c].classList.contains(t)&&a[c].classList.remove(t)}))}else a[c].style.display="none",l.value.tooltipHidden.split(" ").forEach((t=>{a[c].classList.add(t)}))}}))}))}}}(r,0,{value:u.value,classList:c.classList}),h=function(r,i,l){const{orientation:u,direction:c,tooltips:f,step:h,min:m,max:v,merge:g,id:b,disabled:y,options:S,classes:x,format:w,lazy:E,ariaLabelledby:N,aria:A}=t(r),C=l.value,k=l.initialValue,V=l.tooltipsFormat,P=l.tooltipsMerge,L=l.tooltipFormat,U=l.classList,M=n(null),O=n(null),D=e(!1),j=d((()=>{let t={cssPrefix:"",cssClasses:U.value,orientation:u.value,direction:c.value,tooltips:!!f.value&&V.value,connect:"lower",start:p(C.value)?m.value:C.value,range:{min:m.value,max:v.value}};if(h.value>0&&(t.step=h.value),Array.isArray(C.value)&&(t.connect=!0),N.value||A&&Object.keys(A.value).length){let e=Array.isArray(C.value)?C.value:[C.value];t.handleAttributes=e.map((t=>Object.assign({},A.value,N.value?{"aria-labelledby":N.value}:{})))}return w.value&&(t.ariaFormat=L.value),t})),F=d((()=>{let t={id:b.value?b.value:void 0};return y.value&&(t.disabled=!0),t})),z=d((()=>Array.isArray(C.value))),H=()=>{let t=O.value.get();return Array.isArray(t)?t.map((t=>parseFloat(t))):parseFloat(t)},q=(t,e=!0)=>{O.value.set(t,e)},R=t=>{i.emit("input",t),i.emit("update:modelValue",t),i.emit("update",t)},T=()=>{O.value=dt.create(M.value,Object.assign({},j.value,S.value)),f.value&&z.value&&g.value>=0&&P(M.value,g.value," - "),O.value.on("set",(()=>{const t=H();i.emit("change",t),i.emit("set",t),E.value&&R(t)})),O.value.on("update",(()=>{if(!D.value)return;const t=H();z.value&&ft(C.value,t)||!z.value&&C.value==t?i.emit("update",t):E.value||R(t)})),O.value.on("start",(()=>{i.emit("start",H())})),O.value.on("end",(()=>{i.emit("end",H())})),O.value.on("slide",(()=>{i.emit("slide",H())})),O.value.on("drag",(()=>{i.emit("drag",H())})),M.value.querySelectorAll("[data-handle]").forEach((t=>{t.onblur=()=>{M.value&&U.value.focused.split(" ").forEach((t=>{M.value.classList.remove(t)}))},t.onfocus=()=>{U.value.focused.split(" ").forEach((t=>{M.value.classList.add(t)}))}})),D.value=!0},B=()=>{O.value&&(O.value.off(),O.value.destroy(),O.value=null)},_=(t,e)=>{D.value=!1,B(),T()};return o(T),a(B),s([z,m,v,h,u,c,f,g],_,{immediate:!1}),s([w,S,x],_,{immediate:!1,deep:!0}),s(C,((t,e)=>{e&&("object"==typeof e&&"object"==typeof t&&t&&Object.keys(e)>Object.keys(t)||"object"==typeof e&&"object"!=typeof t||p(t))&&_()}),{immediate:!1}),s(C,(t=>{if(p(t))return void q(m.value,!1);let e=H();z.value&&!Array.isArray(e)&&(e=[e]),(z.value&&!ft(t,e)||!z.value&&t!=e)&&q(t,!1)}),{deep:!0}),{slider:M,slider$:O,isRange:z,sliderProps:F,init:T,destroy:B,refresh:_,update:q,reset:()=>{R(k.value)}}}(r,l,{value:u.value,initialValue:u.initialValue,tooltipFormat:f.tooltipFormat,tooltipsFormat:f.tooltipsFormat,tooltipsMerge:f.tooltipsMerge,classList:c.classList});return{...c,...f,...h}}};ht.render=function(t,e,r,i,n,o){return l(),u("div",c(t.sliderProps,{ref:"slider"}),null,16)},ht.__file="src/Slider.vue";export{ht as default};