UNPKG

balm-ui

Version:

A modular and customizable UI library based on Material Design and Vue 3

1 lines 54.5 kB
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define("UiSlider",["vue"],e):"object"===typeof exports?exports.UiSlider=e(require("vue")):t.UiSlider=e(t.Vue)}("undefined"!==typeof self?self:this,(function(t){return function(){"use strict";var e={744:function(t){var e=function(t){return function(t){return!!t&&"object"===typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===i}(t)}(t)};var i="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?u((i=t,Array.isArray(i)?[]:{}),t,e):t;var i}function r(t,e,i){return t.concat(e).map((function(t){return n(t,i)}))}function a(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function s(t,e){try{return e in t}catch(i){return!1}}function o(t,e,i){var r={};return i.isMergeableObject(t)&&a(t).forEach((function(e){r[e]=n(t[e],i)})),a(e).forEach((function(a){(function(t,e){return s(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,a)||(s(t,a)&&i.isMergeableObject(e[a])?r[a]=function(t,e){if(!e.customMerge)return u;var i=e.customMerge(t);return"function"===typeof i?i:u}(a,i)(t[a],e[a],i):r[a]=n(e[a],i))})),r}function u(t,i,a){(a=a||{}).arrayMerge=a.arrayMerge||r,a.isMergeableObject=a.isMergeableObject||e,a.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(i);return s===Array.isArray(t)?s?a.arrayMerge(t,i,a):o(t,i,a):n(i,a)}u.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,i){return u(t,i,e)}),{})};var l=u;t.exports=l},154:function(e){e.exports=t}},i={};function n(t){var r=i[t];if(void 0!==r)return r.exports;var a=i[t]={exports:{}};return e[t](a,a.exports,n),a.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};n.d(r,{default:function(){return jt}});var a=n(744),s=n.n(a);const o=/(?:^\[object\s(.*?)\]$)/;var u=t=>Object.prototype.toString.call(t).replace(o,"$1").toLowerCase();const l=t=>{let{componentProps:e,propName:i,props:n}=t,r=n[i];if("object"===u(r)){const t=e[i].default;e[i].default=()=>s()(t,r)}else Array.isArray(r)?e[i].default=()=>r:e[i].default=r},d=t=>{let{componentMixins:e,propName:i,props:n}=t;if(e.length){let t=e.length;for(;t--;)if(e[t].props&&void 0!==e[t].props[i]){l({componentProps:e[t].props,propName:i,props:n});break}}};var c=(t,e)=>{for(const i of Object.keys(e))t.props?void 0===t.props[i]?d({componentMixins:t.mixins,propName:i,props:e}):l({componentProps:t.props,propName:i,props:e}):d({componentMixins:t.mixins,propName:i,props:e})};var p=t=>{const e={install(e){c(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),e.component(t.name,t)}};return e},h=n(154),m=function(t,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},m(t,e)};function v(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var f=function(){return f=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},f.apply(this,arguments)};Object.create;function g(t){var e="function"===typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(t,e){var i="function"===typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,a=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(o){r={error:o}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s}function y(t,e,i){if(i||2===arguments.length)for(var n,r=0,a=e.length;r<a;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var T=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),E=function(){function t(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];this.root=t,this.initialize.apply(this,y([],b(i))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new T({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,i){this.root.addEventListener(t,e,i)},t.prototype.unlisten=function(t,e,i){this.root.removeEventListener(t,e,i)},t.prototype.emit=function(t,e,i){var n;void 0===i&&(i=!1),"function"===typeof CustomEvent?n=new CustomEvent(t,{bubbles:i,detail:e}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,i,!1,e),this.root.dispatchEvent(n)},t}();function S(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var i={get passive(){return e=!0,!1}},n=function(){};t.document.addEventListener("test",n,i),t.document.removeEventListener("test",n,i)}catch(r){e=!1}return e}(t)&&{passive:!0}}function A(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}var I,R={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},C={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},D={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};var w,V,N,P=["touchstart","pointerdown","mousedown","keydown"],H=["touchend","pointerup","mouseup","contextmenu"],k=[],_=function(t){function e(i){var n=t.call(this,f(f({},e.defaultAdapter),i))||this;return n.activationAnimationHasEnded=!1,n.activationTimer=0,n.fgDeactivationRemovalTimer=0,n.fgScale="0",n.frame={width:0,height:0},n.initialSize=0,n.layoutFrame=0,n.maxRadius=0,n.unboundedCoords={left:0,top:0},n.activationState=n.defaultActivationState(),n.activationTimerCallback=function(){n.activationAnimationHasEnded=!0,n.runDeactivationUXLogicIfReady()},n.activateHandler=function(t){n.activateImpl(t)},n.deactivateHandler=function(){n.deactivateImpl()},n.focusHandler=function(){n.handleFocus()},n.blurHandler=function(){n.handleBlur()},n.resizeHandler=function(){n.layout()},n}return v(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return R},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return C},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this,i=this.supportsPressRipple();if(this.registerRootHandlers(i),i){var n=e.cssClasses,r=n.ROOT,a=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(r),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var i=e.cssClasses,n=i.ROOT,r=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(n),t.adapter.removeClass(r),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},e.prototype.activate=function(t){this.activateImpl(t)},e.prototype.deactivate=function(){this.deactivateImpl()},e.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},e.prototype.setUnbounded=function(t){var i=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers=function(t){var e,i;if(t){try{for(var n=g(P),r=n.next();!r.done;r=n.next()){var a=r.value;this.adapter.registerInteractionHandler(a,this.activateHandler)}}catch(s){e={error:s}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},e.prototype.registerDeactivationHandlers=function(t){var e,i;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var n=g(H),r=n.next();!r.done;r=n.next()){var a=r.value;this.adapter.registerDocumentInteractionHandler(a,this.deactivateHandler)}}catch(s){e={error:s}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},e.prototype.deregisterRootHandlers=function(){var t,e;try{for(var i=g(P),n=i.next();!n.done;n=i.next()){var r=n.value;this.adapter.deregisterInteractionHandler(r,this.activateHandler)}}catch(a){t={error:a}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},e.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=g(H),n=i.next();!n.done;n=i.next()){var r=n.value;this.adapter.deregisterDocumentInteractionHandler(r,this.deactivateHandler)}}catch(a){t={error:a}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},e.prototype.removeCssVars=function(){var t=this,i=e.strings;Object.keys(i).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(i[e],null)}))},e.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var n=this.previousActivationEvent;if(!(n&&void 0!==t&&n.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&k.length>0&&k.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(k.push(t.target),this.registerDeactivationHandlers(t)),i.wasElementMadeActive=this.checkElementMadeActive(t),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){k=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive(t),i.wasElementMadeActive&&e.animateActivation()),i.wasElementMadeActive||(e.activationState=e.defaultActivationState())})))}}},e.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation=function(){var t=this,i=e.strings,n=i.VAR_FG_TRANSLATE_START,r=i.VAR_FG_TRANSLATE_END,a=e.cssClasses,s=a.FG_DEACTIVATION,o=a.FG_ACTIVATION,u=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var l="",d="";if(!this.adapter.isUnbounded()){var c=this.getFgTranslationCoordinates(),p=c.startPoint,h=c.endPoint;l=p.x+"px, "+p.y+"px",d=h.x+"px, "+h.y+"px"}this.adapter.updateCssVariable(n,l),this.adapter.updateCssVariable(r,d),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(s),this.adapter.computeBoundingRect(),this.adapter.addClass(o),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),u)},e.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var n,r,a=e.x,s=e.y,o=a+i.left,u=s+i.top;if("touchstart"===t.type){var l=t;n=l.changedTouches[0].pageX-o,r=l.changedTouches[0].pageY-u}else{var d=t;n=d.pageX-o,r=d.pageY-u}return{x:n,y:r}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2}).x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},e.prototype.runDeactivationUXLogicIfReady=function(){var t=this,i=e.cssClasses.FG_DEACTIVATION,n=this.activationState,r=n.hasDeactivationUXRun,a=n.isActivated;(r||!a)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(i)}),D.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var i=f({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(i)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(i),t.resetActivationState()})))}},e.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady()},e.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var i=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?i:Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2))+e.numbers.PADDING;var n=Math.floor(i*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&n%2!==0?this.initialSize=n-1:this.initialSize=n,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},e.prototype.updateLayoutCssVars=function(){var t=e.strings,i=t.VAR_FG_SIZE,n=t.VAR_LEFT,r=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize+"px"),this.adapter.updateCssVariable(a,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(n,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(r,this.unboundedCoords.top+"px"))},e}(T),x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return v(e,t),e.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var n=new e(t);return void 0!==i.isUnbounded&&(n.unbounded=i.isUnbounded),n},e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var i,n=t.CSS;if("boolean"===typeof I&&!e)return I;if(!n||"function"!==typeof n.supports)return!1;var r=n.supports("--css-vars","yes"),a=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return i=r||a,e||(I=i),i}(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,S())},deregisterInteractionHandler:function(e,i){return t.root.removeEventListener(e,i,S())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return A(t.root,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,S())},registerInteractionHandler:function(e,i){return t.root.addEventListener(e,i,S())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,i){return t.root.style.setProperty(e,i)}}},Object.defineProperty(e.prototype,"unbounded",{get:function(){return Boolean(this.isUnbounded)},set:function(t){this.isUnbounded=Boolean(t),this.setUnbounded()},enumerable:!1,configurable:!0}),e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getDefaultFoundation=function(){return new _(e.createAdapter(this))},e.prototype.initialSyncWithDOM=function(){var t=this.root;this.isUnbounded="mdcRippleIsUnbounded"in t.dataset},e.prototype.setUnbounded=function(){this.foundation.setUnbounded(Boolean(this.isUnbounded))},e}(E),M="mdc-slider--disabled",L="mdc-slider--discrete",F="mdc-slider__input",O="mdc-slider--range",B="mdc-slider__thumb",U="mdc-slider__thumb--focused",j="mdc-slider__thumb-knob",z="mdc-slider__thumb--top",X="mdc-slider__thumb--with-indicator",G="mdc-slider--tick-marks",q="mdc-slider__tick-marks",W="mdc-slider__tick-mark--active",$="mdc-slider__tick-mark--inactive",K="mdc-slider__track",Y="mdc-slider__track--active_fill",Z="mdc-slider__value-indicator-container",Q="mdc-slider__value-indicator-text",J=1,tt=0,et=5,it="aria-valuetext",nt="disabled",rt="min",at="max",st="value",ot="step",ut="data-min-range",lt="MDCSlider:change",dt="MDCSlider:input",ct="--slider-value-indicator-caret-left",pt="--slider-value-indicator-caret-right",ht="--slider-value-indicator-caret-transform",mt="--slider-value-indicator-container-left",vt="--slider-value-indicator-container-right",ft="--slider-value-indicator-container-transform",gt=function(){function t(){this.rafIDs=new Map}return t.prototype.request=function(t,e){var i=this;this.cancel(t);var n=requestAnimationFrame((function(n){i.rafIDs.delete(t),e(n)}));this.rafIDs.set(t,n)},t.prototype.cancel=function(t){var e=this.rafIDs.get(t);e&&(cancelAnimationFrame(e),this.rafIDs.delete(t))},t.prototype.cancelAll=function(){var t=this;this.rafIDs.forEach((function(e,i){t.cancel(i)}))},t.prototype.getQueue=function(){var t=[];return this.rafIDs.forEach((function(e,i){t.push(i)})),t},t}(),bt={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}};function yt(t){return Boolean(t.document)&&"function"===typeof t.document.createElement}function Tt(t,e){if(yt(t)&&e in bt){var i=t.document.createElement("div"),n=bt[e],r=n.standard,a=n.prefixed;return r in i.style?r:a}return e}!function(t){t[t.ACTIVE=0]="ACTIVE",t[t.INACTIVE=1]="INACTIVE"}(w||(w={})),function(t){t[t.START=1]="START",t[t.END=2]="END"}(V||(V={})),function(t){t.SLIDER_UPDATE="slider_update"}(N||(N={}));var Et="undefined"!==typeof window,St=function(t){function e(i){var n=t.call(this,f(f({},e.defaultAdapter),i))||this;return n.initialStylesRemoved=!1,n.isDisabled=!1,n.isDiscrete=!1,n.step=J,n.minRange=tt,n.hasTickMarks=!1,n.isRange=!1,n.thumb=null,n.downEventClientX=null,n.startThumbKnobWidth=0,n.endThumbKnobWidth=0,n.animFrame=new gt,n}return v(e,t),Object.defineProperty(e,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},shouldHideFocusStylesForPointerEvents:function(){return!1},getThumbKnobWidth:function(){return 0},getValueIndicatorContainerWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this;this.isDisabled=this.adapter.hasClass(M),this.isDiscrete=this.adapter.hasClass(L),this.hasTickMarks=this.adapter.hasClass(G),this.isRange=this.adapter.hasClass(O);var e=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(rt,this.isRange?V.START:V.END),rt),i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(at,V.END),at),n=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(st,V.END),st),r=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(st,V.START),st):e,a=this.adapter.getInputAttribute(ot,V.END),s=a?this.convertAttributeValueToNumber(a,ot):this.step,o=this.adapter.getAttribute(ut),u=o?this.convertAttributeValueToNumber(o,ut):this.minRange;this.validateProperties({min:e,max:i,value:n,valueStart:r,step:s,minRange:u}),this.min=e,this.max=i,this.value=n,this.valueStart=r,this.step=s,this.minRange=u,this.numDecimalPlaces=At(this.step),this.valueBeforeDownEvent=n,this.valueStartBeforeDownEvent=r,this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){t.handleInputChange(V.START)},this.inputEndChangeListener=function(){t.handleInputChange(V.END)},this.inputStartFocusListener=function(){t.handleInputFocus(V.START)},this.inputEndFocusListener=function(){t.handleInputFocus(V.END)},this.inputStartBlurListener=function(){t.handleInputBlur(V.START)},this.inputEndBlurListener=function(){t.handleInputBlur(V.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},e.prototype.destroy=function(){this.deregisterEventHandlers()},e.prototype.setMin=function(t){this.min=t,this.isRange||(this.valueStart=t),this.updateUI()},e.prototype.setMax=function(t){this.max=t,this.updateUI()},e.prototype.getMin=function(){return this.min},e.prototype.getMax=function(){return this.max},e.prototype.getValue=function(){return this.value},e.prototype.setValue=function(t){if(this.isRange&&t<this.valueStart+this.minRange)throw new Error("end thumb value ("+t+") must be >= start thumb value ("+this.valueStart+") + min range ("+this.minRange+")");this.updateValue(t,V.END)},e.prototype.getValueStart=function(){if(!this.isRange)throw new Error("`valueStart` is only applicable for range sliders.");return this.valueStart},e.prototype.setValueStart=function(t){if(!this.isRange)throw new Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&t>this.value-this.minRange)throw new Error("start thumb value ("+t+") must be <= end thumb value ("+this.value+") - min range ("+this.minRange+")");this.updateValue(t,V.START)},e.prototype.setStep=function(t){this.step=t,this.numDecimalPlaces=At(t),this.updateUI()},e.prototype.setMinRange=function(t){if(!this.isRange)throw new Error("`minRange` is only applicable for range sliders.");if(t<0)throw new Error("`minRange` must be non-negative. Current value: "+t);if(this.value-this.valueStart<t)throw new Error("start thumb value ("+this.valueStart+") and end thumb value ("+this.value+") must differ by at least "+t+".");this.minRange=t},e.prototype.setIsDiscrete=function(t){this.isDiscrete=t,this.updateValueIndicatorUI(),this.updateTickMarksUI()},e.prototype.getStep=function(){return this.step},e.prototype.getMinRange=function(){if(!this.isRange)throw new Error("`minRange` is only applicable for range sliders.");return this.minRange},e.prototype.setHasTickMarks=function(t){this.hasTickMarks=t,this.updateTickMarksUI()},e.prototype.getDisabled=function(){return this.isDisabled},e.prototype.setDisabled=function(t){this.isDisabled=t,t?(this.adapter.addClass(M),this.isRange&&this.adapter.setInputAttribute(nt,"",V.START),this.adapter.setInputAttribute(nt,"",V.END)):(this.adapter.removeClass(M),this.isRange&&this.adapter.removeInputAttribute(nt,V.START),this.adapter.removeInputAttribute(nt,V.END))},e.prototype.getIsRange=function(){return this.isRange},e.prototype.layout=function(t){var e=(void 0===t?{}:t).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(V.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(V.END)),e||this.updateUI()},e.prototype.handleResize=function(){this.layout()},e.prototype.handleDown=function(t){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var e=null!=t.clientX?t.clientX:t.targetTouches[0].clientX;this.downEventClientX=e;var i=this.mapClientXOnSliderScale(e);this.thumb=this.getThumbFromDownEvent(e,i),null!==this.thumb&&(this.handleDragStart(t,i,this.thumb),this.updateValue(i,this.thumb,{emitInputEvent:!0}))}},e.prototype.handleMove=function(t){if(!this.isDisabled){t.preventDefault();var e=null!=t.clientX?t.clientX:t.targetTouches[0].clientX,i=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(e),null!==this.thumb){var n=this.mapClientXOnSliderScale(e);i||(this.handleDragStart(t,n,this.thumb),this.adapter.emitDragStartEvent(n,this.thumb)),this.updateValue(n,this.thumb,{emitInputEvent:!0})}}},e.prototype.handleUp=function(){var t,e;if(!this.isDisabled&&null!==this.thumb){(null===(e=(t=this.adapter).shouldHideFocusStylesForPointerEvents)||void 0===e?void 0:e.call(t))&&this.handleInputBlur(this.thumb);var i=this.thumb===V.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent,n=this.thumb===V.START?this.valueStart:this.value;i!==n&&this.adapter.emitChangeEvent(n,this.thumb),this.adapter.emitDragEndEvent(n,this.thumb),this.thumb=null}},e.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(X,V.START),this.adapter.addThumbClass(X,V.END))},e.prototype.handleThumbMouseleave=function(){var t,e;this.isDiscrete&&this.isRange&&(!(null===(e=(t=this.adapter).shouldHideFocusStylesForPointerEvents)||void 0===e?void 0:e.call(t))&&(this.adapter.isInputFocused(V.START)||this.adapter.isInputFocused(V.END))||this.thumb||(this.adapter.removeThumbClass(X,V.START),this.adapter.removeThumbClass(X,V.END)))},e.prototype.handleMousedownOrTouchstart=function(t){var e=this,i="mousedown"===t.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(i,this.moveListener);var n=function(){e.handleUp(),e.adapter.deregisterBodyEventHandler(i,e.moveListener),e.adapter.deregisterEventHandler("mouseup",n),e.adapter.deregisterEventHandler("touchend",n)};this.adapter.registerBodyEventHandler("mouseup",n),this.adapter.registerBodyEventHandler("touchend",n),this.handleDown(t)},e.prototype.handlePointerdown=function(t){0===t.button&&(null!=t.pointerId&&this.adapter.setPointerCapture(t.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(t))},e.prototype.handleInputChange=function(t){var e=Number(this.adapter.getInputValue(t));t===V.START?this.setValueStart(e):this.setValue(e),this.adapter.emitChangeEvent(t===V.START?this.valueStart:this.value,t),this.adapter.emitInputEvent(t===V.START?this.valueStart:this.value,t)},e.prototype.handleInputFocus=function(t){if(this.adapter.addThumbClass(U,t),this.isDiscrete&&(this.adapter.addThumbClass(X,t),this.isRange)){var e=t===V.START?V.END:V.START;this.adapter.addThumbClass(X,e)}},e.prototype.handleInputBlur=function(t){if(this.adapter.removeThumbClass(U,t),this.isDiscrete&&(this.adapter.removeThumbClass(X,t),this.isRange)){var e=t===V.START?V.END:V.START;this.adapter.removeThumbClass(X,e)}},e.prototype.handleDragStart=function(t,e,i){var n,r;this.adapter.emitDragStartEvent(e,i),this.adapter.focusInput(i),(null===(r=(n=this.adapter).shouldHideFocusStylesForPointerEvents)||void 0===r?void 0:r.call(n))&&this.handleInputFocus(i),t.preventDefault()},e.prototype.getThumbFromDownEvent=function(t,e){if(!this.isRange)return V.END;var i=this.adapter.getThumbBoundingClientRect(V.START),n=this.adapter.getThumbBoundingClientRect(V.END),r=t>=i.left&&t<=i.right,a=t>=n.left&&t<=n.right;return r&&a?null:r?V.START:a?V.END:e<this.valueStart?V.START:e>this.value?V.END:e-this.valueStart<=this.value-e?V.START:V.END},e.prototype.getThumbFromMoveEvent=function(t){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw new Error("`downEventClientX` is null after move event.");return Math.abs(this.downEventClientX-t)<et?this.thumb:t<this.downEventClientX?this.adapter.isRTL()?V.END:V.START:this.adapter.isRTL()?V.START:V.END},e.prototype.updateUI=function(t){t?this.updateThumbAndInputAttributes(t):(this.updateThumbAndInputAttributes(V.START),this.updateThumbAndInputAttributes(V.END)),this.updateThumbAndTrackUI(t),this.updateValueIndicatorUI(t),this.updateTickMarksUI()},e.prototype.updateThumbAndInputAttributes=function(t){if(t){var e=this.isRange&&t===V.START?this.valueStart:this.value,i=String(e);this.adapter.setInputAttribute(st,i,t),this.isRange&&t===V.START?this.adapter.setInputAttribute(rt,String(e+this.minRange),V.END):this.isRange&&t===V.END&&this.adapter.setInputAttribute(at,String(e-this.minRange),V.START),this.adapter.getInputValue(t)!==i&&this.adapter.setInputValue(i,t);var n=this.adapter.getValueToAriaValueTextFn();n&&this.adapter.setInputAttribute(it,n(e,t),t)}},e.prototype.updateValueIndicatorUI=function(t){if(this.isDiscrete){var e=this.isRange&&t===V.START?this.valueStart:this.value;this.adapter.setValueIndicatorText(e,t===V.START?V.START:V.END),!t&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,V.START)}},e.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var t=(this.valueStart-this.min)/this.step,e=(this.value-this.valueStart)/this.step+1,i=(this.max-this.value)/this.step,n=Array.from({length:t}).fill(w.INACTIVE),r=Array.from({length:e}).fill(w.ACTIVE),a=Array.from({length:i}).fill(w.INACTIVE);this.adapter.updateTickMarks(n.concat(r).concat(a))}},e.prototype.mapClientXOnSliderScale=function(t){var e=(t-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(e=1-e);var i=this.min+e*(this.max-this.min);return i===this.max||i===this.min?i:Number(this.quantize(i).toFixed(this.numDecimalPlaces))},e.prototype.quantize=function(t){var e=Math.round((t-this.min)/this.step);return this.min+e*this.step},e.prototype.updateValue=function(t,e,i){var n=(void 0===i?{}:i).emitInputEvent;if(t=this.clampValue(t,e),this.isRange&&e===V.START){if(this.valueStart===t)return;this.valueStart=t}else{if(this.value===t)return;this.value=t}this.updateUI(e),n&&this.adapter.emitInputEvent(e===V.START?this.valueStart:this.value,e)},e.prototype.clampValue=function(t,e){return t=Math.min(Math.max(t,this.min),this.max),this.isRange&&e===V.START&&t>this.value-this.minRange?this.value-this.minRange:this.isRange&&e===V.END&&t<this.valueStart+this.minRange?this.valueStart+this.minRange:t},e.prototype.updateThumbAndTrackUI=function(t){var e=this,i=this.max,n=this.min,r=(this.value-this.valueStart)/(i-n),a=r*this.rect.width,s=this.adapter.isRTL(),o=Et?Tt(window,"transform"):"transform";if(this.isRange){var u=this.adapter.isRTL()?(i-this.value)/(i-n)*this.rect.width:(this.valueStart-n)/(i-n)*this.rect.width,l=u+a;this.animFrame.request(N.SLIDER_UPDATE,(function(){!s&&t===V.START||s&&t!==V.START?(e.adapter.setTrackActiveStyleProperty("transform-origin","right"),e.adapter.setTrackActiveStyleProperty("left","auto"),e.adapter.setTrackActiveStyleProperty("right",e.rect.width-l+"px")):(e.adapter.setTrackActiveStyleProperty("transform-origin","left"),e.adapter.setTrackActiveStyleProperty("right","auto"),e.adapter.setTrackActiveStyleProperty("left",u+"px")),e.adapter.setTrackActiveStyleProperty(o,"scaleX("+r+")");var i=s?l:u,n=e.adapter.isRTL()?u:l;t!==V.START&&t&&e.initialStylesRemoved||(e.adapter.setThumbStyleProperty(o,"translateX("+i+"px)",V.START),e.alignValueIndicator(V.START,i)),t!==V.END&&t&&e.initialStylesRemoved||(e.adapter.setThumbStyleProperty(o,"translateX("+n+"px)",V.END),e.alignValueIndicator(V.END,n)),e.removeInitialStyles(s),e.updateOverlappingThumbsUI(i,n,t)}))}else this.animFrame.request(N.SLIDER_UPDATE,(function(){var t=s?e.rect.width-a:a;e.adapter.setThumbStyleProperty(o,"translateX("+t+"px)",V.END),e.alignValueIndicator(V.END,t),e.adapter.setTrackActiveStyleProperty(o,"scaleX("+r+")"),e.removeInitialStyles(s)}))},e.prototype.alignValueIndicator=function(t,e){if(this.isDiscrete){var i=this.adapter.getThumbBoundingClientRect(t).width/2,n=this.adapter.getValueIndicatorContainerWidth(t),r=this.adapter.getBoundingClientRect().width;n/2>e+i?(this.adapter.setThumbStyleProperty(ct,i+"px",t),this.adapter.setThumbStyleProperty(pt,"auto",t),this.adapter.setThumbStyleProperty(ht,"translateX(-50%)",t),this.adapter.setThumbStyleProperty(mt,"0",t),this.adapter.setThumbStyleProperty(vt,"auto",t),this.adapter.setThumbStyleProperty(ft,"none",t)):n/2>r-e+i?(this.adapter.setThumbStyleProperty(ct,"auto",t),this.adapter.setThumbStyleProperty(pt,i+"px",t),this.adapter.setThumbStyleProperty(ht,"translateX(50%)",t),this.adapter.setThumbStyleProperty(mt,"auto",t),this.adapter.setThumbStyleProperty(vt,"0",t),this.adapter.setThumbStyleProperty(ft,"none",t)):(this.adapter.setThumbStyleProperty(ct,"50%",t),this.adapter.setThumbStyleProperty(pt,"auto",t),this.adapter.setThumbStyleProperty(ht,"translateX(-50%)",t),this.adapter.setThumbStyleProperty(mt,"50%",t),this.adapter.setThumbStyleProperty(vt,"auto",t),this.adapter.setThumbStyleProperty(ft,"translateX(-50%)",t))}},e.prototype.removeInitialStyles=function(t){if(!this.initialStylesRemoved){var e=t?"right":"left";this.adapter.removeThumbStyleProperty(e,V.END),this.isRange&&this.adapter.removeThumbStyleProperty(e,V.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},e.prototype.resetTrackAndThumbAnimation=function(){var t=this;if(this.isDiscrete){var e=Et?Tt(window,"transition"):"transition",i="none 0s ease 0s";this.adapter.setThumbStyleProperty(e,i,V.END),this.isRange&&this.adapter.setThumbStyleProperty(e,i,V.START),this.adapter.setTrackActiveStyleProperty(e,i),requestAnimationFrame((function(){t.adapter.removeThumbStyleProperty(e,V.END),t.adapter.removeTrackActiveStyleProperty(e),t.isRange&&t.adapter.removeThumbStyleProperty(e,V.START)}))}},e.prototype.updateOverlappingThumbsUI=function(t,e,i){var n=!1;if(this.adapter.isRTL()){var r=t-this.startThumbKnobWidth/2;n=e+this.endThumbKnobWidth/2>=r}else{n=t+this.startThumbKnobWidth/2>=e-this.endThumbKnobWidth/2}n?(this.adapter.addThumbClass(z,i||V.END),this.adapter.removeThumbClass(z,i===V.START?V.END:V.START)):(this.adapter.removeThumbClass(z,V.START),this.adapter.removeThumbClass(z,V.END))},e.prototype.convertAttributeValueToNumber=function(t,e){if(null===t)throw new Error("MDCSliderFoundation: `"+e+"` must be non-null.");var i=Number(t);if(isNaN(i))throw new Error("MDCSliderFoundation: `"+e+"` value is `"+t+"`, but must be a number.");return i},e.prototype.validateProperties=function(t){var e=t.min,i=t.max,n=t.value,r=t.valueStart,a=t.step,s=t.minRange;if(e>=i)throw new Error("MDCSliderFoundation: min must be strictly less than max. Current: [min: "+e+", max: "+i+"]");if(a<=0)throw new Error("MDCSliderFoundation: step must be a positive number. Current step: "+a);if(this.isRange){if(n<e||n>i||r<e||r>i)throw new Error("MDCSliderFoundation: values must be in [min, max] range. Current values: [start value: "+r+", end value: "+n+", min: "+e+", max: "+i+"]");if(r>n)throw new Error("MDCSliderFoundation: start value must be <= end value. Current values: [start value: "+r+", end value: "+n+"]");if(s<0)throw new Error("MDCSliderFoundation: minimum range must be non-negative. Current min range: "+s);if(n-r<s)throw new Error("MDCSliderFoundation: start value and end value must differ by at least "+s+". Current values: [start value: "+r+", end value: "+n+"]");var o=(r-e)/a,u=(n-e)/a;if(!Number.isInteger(parseFloat(o.toFixed(6)))||!Number.isInteger(parseFloat(u.toFixed(6))))throw new Error("MDCSliderFoundation: Slider values must be valid based on the step value ("+a+"). Current values: [start value: "+r+", end value: "+n+", min: "+e+"]")}else{if(n<e||n>i)throw new Error("MDCSliderFoundation: value must be in [min, max] range. Current values: [value: "+n+", min: "+e+", max: "+i+"]");u=(n-e)/a;if(!Number.isInteger(parseFloat(u.toFixed(6))))throw new Error("MDCSliderFoundation: Slider value must be valid based on the step value ("+a+"). Current value: "+n)}},e.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),e.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(V.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(V.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(V.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(V.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(V.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(V.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(V.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(V.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(V.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(V.END,"blur",this.inputEndBlurListener)},e.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),e.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(V.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(V.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(V.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(V.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(V.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(V.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(V.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(V.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(V.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(V.END,"blur",this.inputEndBlurListener)},e.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},e.SUPPORTS_POINTER_EVENTS=Et&&Boolean(window.PointerEvent)&&!(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document),e}(T);function At(t){var e=/(?:\.(\d+))?(?:[eE]([+\-]?\d+))?$/.exec(String(t));if(!e)return 0;var i=e[1]||"",n=e[2]||0;return Math.max(0,("0"===i?0:i.length)-Number(n))}var It=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.skipInitialUIUpdate=!1,e.valueToAriaValueTextFn=null,e}return v(e,t),e.attachTo=function(t,i){return void 0===i&&(i={}),new e(t,void 0,i)},e.prototype.getDefaultFoundation=function(){var t=this;return new St({hasClass:function(e){return t.root.classList.contains(e)},addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},addThumbClass:function(e,i){t.getThumbEl(i).classList.add(e)},removeThumbClass:function(e,i){t.getThumbEl(i).classList.remove(e)},getAttribute:function(e){return t.root.getAttribute(e)},getInputValue:function(e){return t.getInput(e).value},setInputValue:function(e,i){t.getInput(i).value=e},getInputAttribute:function(e,i){return t.getInput(i).getAttribute(e)},setInputAttribute:function(e,i,n){t.getInput(n).setAttribute(e,i)},removeInputAttribute:function(e,i){t.getInput(i).removeAttribute(e)},focusInput:function(e){t.getInput(e).focus()},isInputFocused:function(e){return t.getInput(e)===document.activeElement},shouldHideFocusStylesForPointerEvents:function(){return!1},getThumbKnobWidth:function(e){return t.getThumbEl(e).querySelector("."+j).getBoundingClientRect().width},getThumbBoundingClientRect:function(e){return t.getThumbEl(e).getBoundingClientRect()},getBoundingClientRect:function(){return t.root.getBoundingClientRect()},getValueIndicatorContainerWidth:function(e){return t.getThumbEl(e).querySelector("."+Z).getBoundingClientRect().width},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},setThumbStyleProperty:function(e,i,n){t.getThumbEl(n).style.setProperty(e,i)},removeThumbStyleProperty:function(e,i){t.getThumbEl(i).style.removeProperty(e)},setTrackActiveStyleProperty:function(e,i){t.trackActive.style.setProperty(e,i)},removeTrackActiveStyleProperty:function(e){t.trackActive.style.removeProperty(e)},setValueIndicatorText:function(e,i){t.getThumbEl(i).querySelector("."+Q).textContent=String(e)},getValueToAriaValueTextFn:function(){return t.valueToAriaValueTextFn},updateTickMarks:function(e){var i=t.root.querySelector("."+q);i||((i=document.createElement("div")).classList.add(q),t.root.querySelector("."+K).appendChild(i));if(e.length!==i.children.length){for(;i.firstChild;)i.removeChild(i.firstChild);t.addTickMarks(i,e)}else t.updateTickMarks(i,e)},setPointerCapture:function(e){t.root.setPointerCapture(e)},emitChangeEvent:function(e,i){t.emit(lt,{value:e,thumb:i})},emitInputEvent:function(e,i){t.emit(dt,{value:e,thumb:i})},emitDragStartEvent:function(e,i){t.getRipple(i).activate()},emitDragEndEvent:function(e,i){t.getRipple(i).deactivate()},registerEventHandler:function(e,i){t.listen(e,i)},deregisterEventHandler:function(e,i){t.unlisten(e,i)},registerThumbEventHandler:function(e,i,n){t.getThumbEl(e).addEventListener(i,n)},deregisterThumbEventHandler:function(e,i,n){t.getThumbEl(e).removeEventListener(i,n)},registerInputEventHandler:function(e,i,n){t.getInput(e).addEventListener(i,n)},deregisterInputEventHandler:function(e,i,n){t.getInput(e).removeEventListener(i,n)},registerBodyEventHandler:function(t,e){document.body.addEventListener(t,e)},deregisterBodyEventHandler:function(t,e){document.body.removeEventListener(t,e)},registerWindowEventHandler:function(t,e){window.addEventListener(t,e)},deregisterWindowEventHandler:function(t,e){window.removeEventListener(t,e)}})},e.prototype.initialize=function(t){var e=(void 0===t?{}:t).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll("."+F)),this.thumbs=[].slice.call(this.root.querySelectorAll("."+B)),this.trackActive=this.root.querySelector("."+Y),this.ripples=this.createRipples(),e&&(this.skipInitialUIUpdate=!0)},e.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getValueStart=function(){return this.foundation.getValueStart()},e.prototype.setValueStart=function(t){this.foundation.setValueStart(t)},e.prototype.getValue=function(){return this.foundation.getValue()},e.prototype.setValue=function(t){this.foundation.setValue(t)},e.prototype.getDisabled=function(){return this.foundation.getDisabled()},e.prototype.setDisabled=function(t){this.foundation.setDisabled(t)},e.prototype.setValueToAriaValueTextFn=function(t){this.valueToAriaValueTextFn=t},e.prototype.getThumbEl=function(t){return t===V.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},e.prototype.getInput=function(t){return t===V.END?this.inputs[this.inputs.length-1]:this.inputs[0]},e.prototype.getRipple=function(t){return t===V.END?this.ripples[this.ripples.length-1]:this.ripples[0]},e.prototype.addTickMarks=function(t,e){for(var i=document.createDocumentFragment(),n=0;n<e.length;n++){var r=document.createElement("div"),a=e[n]===w.ACTIVE?W:$;r.classList.add(a),i.appendChild(r)}t.appendChild(i)},e.prototype.updateTickMarks=function(t,e){for(var i=Array.from(t.children),n=0;n<i.length;n++)e[n]===w.ACTIVE?(i[n].classList.add(W),i[n].classList.remove($)):(i[n].classList.add($),i[n].classList.remove(W))},e.prototype.createRipples=function(){for(var t=[],e=[].slice.call(this.root.querySelectorAll("."+B)),i=function(i){var r=e[i],a=n.inputs[i],s=f(f({},x.createAdapter(n)),{addClass:function(t){r.classList.add(t)},computeBoundingRect:function(){return r.getBoundingClientRect()},deregisterInteractionHandler:function(t,e){a.removeEventListener(t,e)},isSurfaceActive:function(){return A(a,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,e){a.addEventListener(t,e,S())},removeClass:function(t){r.classList.remove(t)},updateCssVariable:function(t,e){r.style.setProperty(t,e)}}),o=new x(r,new _(s));o.unbounded=!0,t.push(o)},n=this,r=0;r<e.length;r++)i(r);return t},e}(E);const Rt=["min","max","value","step","disabled"],Ct={name:"MdcSliderInput",customOptions:{}};var Dt=Object.assign(Ct,{props:{min:{type:Number,default:0},max:{type:Number,default:100},value:{type:Number,default:0,required:!0},step:{type:Number,default:1},disabled:{type:Boolean,default:!1}},emits:["input"],setup(t,