!function(t,e){"object"==typeofexports&&"object"==typeofmodule?module.exports=e():"function"==typeofdefine&&define.amd?define([],e):"object"==typeofexports?exports.bulmaSlider=e():t.bulmaSlider=e()}("undefined"!=typeofself?self:this,function(){returnfunction(n){varr={};functioni(t){if(r[t])returnr[t].exports;vare=r[t]={i:t,l:!1,exports:{}};returnn[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}returni.m=n,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){vare=t&&t.__esModule?function(){returnt.default}:function(){returnt};returni.d(e,"a",e),e},i.o=function(t,e){returnObject.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"isString",function(){returnl});varr=n(1),i=Object.assign||function(t){for(vare=1;e<arguments.length;e++){varn=arguments[e];for(varrinn)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}returnt},u=function(){functionr(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}returnfunction(t,e,n){returne&&r(t.prototype,e),n&&r(t,n),t}}(),o="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft};varl=function(t){return"string"==typeoft||!!t&&"object"===(void0===t?"undefined":o(t))&&"[object String]"===Object.prototype.toString.call(t)},a=function(t){functiono(t){vare=1<arguments.length&&void0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}(this,o);varn=function(t,e){if(!t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeofe&&"function"!=typeofe?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));if(n.element="string"==typeoft?document.querySelector(t):t,!n.element)thrownewError("An invalid selector or non-DOM node has been provided.");returnn._clickEvents=["click"],n.options=i({},e),n.onSliderInput=n.onSliderInput.bind(n),n.init(),n}returnfunction(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function, not "+typeofe);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,r["a"]),u(o,[{key:"init",value:function(){if(this._id="bulmaSlider"+(newDate).getTime()+Math.floor(Math.random()*Math.floor(9999)),this.output=this._findOutputForSlider(),this._bindEvents(),this.output&&this.element.classList.contains("has-output-tooltip")){vart=this._getSliderOutputPosition();this.output.style.left=t.position}this.emit("bulmaslider:ready",this.element.value)}},{key:"_findOutputForSlider",value:function(){vare=this,n=null,t=document.getElementsByTagName("output")||[];returnArray.from(t).forEach(function(t){if(t.htmlFor==e.element.getAttribute("id"))returnn=t,!0}),n}},{key:"_getSliderOutputPosition",value:function(){vart,e=window.getComputedStyle(this.element,null),n=parseInt(e.getPropertyValue("width"),10);t=this.element.getAttribute("min")?this.element.getAttribute("min"):0;varr=(this.element.value-t)/(this.element.getAttribute("max")-t);return{position:(r<0?0:1<r?n:n*r)+"px"}}},{key:"_bindEvents",value:function(){this.output&&this.element.addEventListener("input",this.onSliderInput,!1)}},{key:"onSliderInput",value:function(t){if(t.preventDefault(),this.element.classList.contains("has-output-tooltip")){vare=this._getSliderOutputPosition();this.output.style.left=e.position}varn=this.output.hasAttribute("data-prefix")?this.output.getAttribute("data-prefix"):"",r=this.output.hasAttribute("data-postfix")?this.output.getAttribute("data-postfix"):"";this.output.value=n+this.element.value+r,this.emit("bulmaslider:ready",this.element.value)}}],[{key:"attach",value:function(){varn=this,t=0<arguments.length&&void0!==arguments[0]?arguments[0]:'input[type="range"].slider',r=1<arguments.length&&void0!==arguments[1]?arguments[1]:{},i=newArray;return(l(t)?document.querySelectorAll(t):Array.isArray(t)?t:[t]).forEach(function(t){if(void0===t[n.constructor.name]){vare=newo(t,r);t[n.constructor.name]=e,i.push(e)}elsei.push(t[n.constructor.name])}),i}}]),o}();e.default=a},function(t,e,n){"use strict";varr=function(){functionr(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}returnfunction(t,e,n){returne&&r(t.prototype,e),n&&r(t,n),t}}();vari=function(){functione(){vart=0<arguments.length&&void0!==arguments[0]?arguments[0]:[];!function(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}(this,e),this._listeners=newMap(t),this._middlewares=newMap}returnr(e,[{key:"listenerCount",value:function(t){returnthis._listeners.has(t)?this._listeners.get(t).length:0}},{key:"removeListeners",value:function(){vare=this,t=0<arguments.length&&void0!==arguments[0]?arguments[0]:null,n=1<arguments.length&&void0!==arguments[1]&&arguments[1];null!==t?Array.isArray(t)?name.forEach(function(t){returne.removeListeners(t,n)}):(this._listeners.delete(t),n&&this.removeMiddleware(t)):this._listeners=newMap}},{key:"middleware",value:function(t,e){varn=this;Array.isArray(t)?name.forEach(function(t){returnn.middleware(t,e)}):(Array.isArray(this._middlewares.get(t))||this._middlewares.set(t,[]),this._middlewares.get(t).push(e))}},{key:"removeMiddleware",value:function(){vare=this,t=0<arguments.length&&void0!==arguments[0]?arguments[0]:null;null!==t?Array.isArray(t)?name.forEach(function(t){returne.removeMiddleware(t)}):this._middlewares.delete(t):this._middlewares=newMap}},{key:"on",value:function(t,e){varn=this,r=2<arguments.length&&void0!==arguments[2]&&arguments[2];if(Array.isArray(t))t.forEach(function(t){returnn.on(t,e)});else{vari=(t=t.toString()).split(/,|, | /);1<i.length?i.forEach(function(t){returnn.on(t,e)}):(Array.isArray(this._listeners.get(t))||this._listeners.set(t,[]),this._listeners.get(t).push({once:r,callback:e}))}}},{key:"once",value:function(t,e){this.on(t,e,!0)}},{key:"emit",value:function(n,r){vari=this,o=2<arguments.length&&void0!==arguments[2]&&arguments[2];n=n.toString();varu=this._listeners.get(n),l=null,a=0,s=o;if(Array.isArray(u))for(u.forEach(function(t,e){o||(l=i._middlewares.get(n),Array.isArray(l)?(l.forEach(function(t){t(r,function(){vart=0<arguments.length&&void0!==arguments[0]?arguments[0]:null;null!==t&&(r=t),a++},n)}),a>=l.length&&(s=!0)):s=!0),s&&(t.once&&(u[e]=null),t.callback(r))});-1!==u.indexOf(null);)u.splice(u.indexOf(null),1)}}]),e}();e.a=i}]).default});