| 1 |
- !function(){function e(t,s,i){var n=e.resolve(t);if(null==n){i=i||t,s=s||"root";var o=new Error('Failed to require "'+i+'" from "'+s+'"');throw o.path=i,o.parent=s,o.require=!0,o}var r=e.modules[n];if(!r._resolving&&!r.exports){var a={};a.exports={},a.client=a.component=!0,r._resolving=!0,r.call(this,a.exports,e.relative(n),a),delete r._resolving,r.exports=a.exports}return r.exports}e.modules={},e.aliases={},e.resolve=function(t){"/"===t.charAt(0)&&(t=t.slice(1));for(var s=[t,t+".js",t+".json",t+"/index.js",t+"/index.json"],i=0;i<s.length;i++){var t=s[i];if(e.modules.hasOwnProperty(t))return t;if(e.aliases.hasOwnProperty(t))return e.aliases[t]}},e.normalize=function(e,t){var s=[];if("."!=t.charAt(0))return t;e=e.split("/"),t=t.split("/");for(var i=0;i<t.length;++i)".."==t[i]?e.pop():"."!=t[i]&&""!=t[i]&&s.push(t[i]);return e.concat(s).join("/")},e.register=function(t,s){e.modules[t]=s},e.alias=function(t,s){if(!e.modules.hasOwnProperty(t))throw new Error('Failed to alias "'+t+'", it does not exist');e.aliases[s]=t},e.relative=function(t){function i(e,t){for(var s=e.length;s--;)if(e[s]===t)return s;return-1}function n(s){var i=n.resolve(s);return e(i,t,s)}var s=e.normalize(t,"..");return n.resolve=function(n){var o=n.charAt(0);if("/"==o)return n.slice(1);if("."==o)return e.normalize(s,n);var r=t.split("/"),a=i(r,"deps")+1;return a||(a=0),n=r.slice(0,a+1).join("/")+"/deps/"+n},n.exists=function(t){return e.modules.hasOwnProperty(n.resolve(t))},n},e.register("component-event/index.js",function(e,t,s){var i=window.addEventListener?"addEventListener":"attachEvent",n=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!==i?"on":"";e.bind=function(e,t,s,n){return e[i](o+t,s,n||!1),s},e.unbind=function(e,t,s,i){return e[n](o+t,s,i||!1),s}}),e.register("component-query/index.js",function(e,t,s){function i(e,t){return t.querySelector(e)}e=s.exports=function(e,t){return t=t||document,i(e,t)},e.all=function(e,t){return t=t||document,t.querySelectorAll(e)},e.engine=function(t){if(!t.one)throw new Error(".one callback required");if(!t.all)throw new Error(".all callback required");return i=t.one,e.all=t.all,e}}),e.register("component-matches-selector/index.js",function(e,t,s){function r(e,t){if(o)return o.call(e,t);for(var s=i.all(t,e.parentNode),n=0;n<s.length;++n)if(s[n]==e)return!0;return!1}var i=t("query"),n=Element.prototype,o=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector;s.exports=r}),e.register("discore-closest/index.js",function(e,t,s){var i=t("matches-selector");s.exports=function(e,t,s,n){for(e=s?{parentNode:e}:e,n=n||document;(e=e.parentNode)&&e!==document;){if(i(e,t))return e;if(e===n)return}}}),e.register("component-delegate/index.js",function(e,t,s){var i=t("closest"),n=t("event");e.bind=function(e,t,s,o,r){return n.bind(e,s,function(s){var n=s.target||s.srcElement;s.delegateTarget=i(n,t,!0,e),s.delegateTarget&&o.call(e,s)},r)},e.unbind=function(e,t,s,i){n.unbind(e,t,s,i)}}),e.register("component-events/index.js",function(e,t,s){function o(e,t){if(!(this instanceof o))return new o(e,t);if(!e)throw new Error("element required");if(!t)throw new Error("object required");this.el=e,this.obj=t,this._events={}}function r(e){var t=e.split(/ +/);return{name:t.shift(),selector:t.join(" ")}}var i=t("event"),n=t("delegate");s.exports=o,o.prototype.sub=function(e,t,s){this._events[e]=this._events[e]||{},this._events[e][t]=s},o.prototype.bind=function(e,t){function p(){var e=[].slice.call(arguments).concat(h);a[t].apply(a,e)}var s=r(e),o=this.el,a=this.obj,l=s.name,t=t||"on"+l,h=[].slice.call(arguments,2);return s.selector?p=n.bind(o,s.selector,l,p):i.bind(o,l,p),this.sub(l,t,p),p},o.prototype.unbind=function(e,t){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(e);var s=this._events[e];if(s){var n=s[t];n&&i.unbind(this.el,e,n)}},o.prototype.unbindAll=function(){for(var e in this._events)this.unbindAllOf(e)},o.prototype.unbindAllOf=function(e){var t=this._events[e];if(t)for(var s in t)this.unbind(e,s)}}),e.register("component-indexof/index.js",function(e,t,s){s.exports=function(e,t){if(e.indexOf)return e.indexOf(t);for(var s=0;s<e.length;++s)if(e[s]===t)return s;return-1}}),e.register("component-classes/index.js",function(e,t,s){function r(e){if(!e)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}var i=t("indexof"),n=/\s+/,o=Object.prototype.toString;s.exports=function(e){return new r(e)},r.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array(),s=i(t,e);return~s||t.push(e),this.el.className=t.join(" "),this},r.prototype.remove=function(e){if("[object RegExp]"==o.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),s=i(t,e);return~s&&t.splice(s,1),this.el.className=t.join(" "),this},r.prototype.removeMatching=function(e){for(var t=this.array(),s=0;s<t.length;s++)e.test(t[s])&&this.remove(t[s]);return this},r.prototype.toggle=function(e,t){return this.list?("undefined"!=typeof t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):("undefined"!=typeof t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},r.prototype.array=function(){var e=this.el.className.replace(/^\s+|\s+$/g,""),t=e.split(n);return""===t[0]&&t.shift(),t},r.prototype.has=r.prototype.contains=function(e){return this.list?this.list.contains(e):!!~i(this.array(),e)}}),e.register("component-emitter/index.js",function(e,t,s){function i(e){return e?n(e):void 0}function n(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}s.exports=i,i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},i.prototype.once=function(e,t){function i(){s.off(e,i),t.apply(this,arguments)}var s=this;return this._callbacks=this._callbacks||{},i.fn=t,this.on(e,i),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s=this._callbacks[e];if(!s)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var i,n=0;n<s.length;n++)if(i=s[n],i===t||i.fn===t){s.splice(n,1);break}return this},i.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),s=this._callbacks[e];if(s){s=s.slice(0);for(var i=0,n=s.length;n>i;++i)s[i].apply(this,t)}return this},i.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},i.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),e.register("ui-component-mouse/index.js",function(e,t,s){function o(e,t){this.obj=t||{},this.el=e}var i=t("emitter"),n=t("event");s.exports=function(e,t){return new o(e,t)},i(o.prototype),o.prototype.bind=function(){function s(o){e.onmouseup&&e.onmouseup(o),n.unbind(document,"mousemove",i),n.unbind(document,"mouseup",s),t.emit("up",o)}function i(s){e.onmousemove&&e.onmousemove(s),t.emit("move",s)}var e=this.obj,t=this;return t.down=function(o){e.onmousedown&&e.onmousedown(o),n.bind(document,"mouseup",s),n.bind(document,"mousemove",i),t.emit("down",o)},n.bind(this.el,"mousedown",t.down),this},o.prototype.unbind=function(){n.unbind(this.el,"mousedown",this.down),this.down=null}}),e.register("abpetkov-percentage-calc/percentage-calc.js",function(e,t,s){e.isNumber=function(e){return"number"==typeof e?!0:!1},e.of=function(t,s){return e.isNumber(t)&&e.isNumber(s)?t/100*s:void 0},e.from=function(t,s){return e.isNumber(t)&&e.isNumber(s)?t/s*100:void 0}}),e.register("abpetkov-closest-num/closest-num.js",function(e,t,s){e.find=function(e,t){var s=null,n=null,o=t[0];for(i=0;i<t.length;i++)s=Math.abs(e-o),n=Math.abs(e-t[i]),s>n&&(o=t[i]);return o}}),e.register("vesln-super/lib/super.js",function(e,t,s){function n(){var t=i.call(arguments);if(t.length)return"function"!=typeof t[0]?e.merge(t):void e.inherits.apply(null,t)}var i=Array.prototype.slice,e=s.exports=n;e.extend=function(t,s){var i=this,n=function(){return i.apply(this,arguments)};return e.merge([n,this]),e.inherits(n,this),t&&e.merge([n.prototype,t]),s&&e.merge([n,s]),n.extend=this.extend,n},e.inherits=function(e,t){e.super_=t,Object.create?e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}):(e.prototype=new t,e.prototype.constructor=e)},e.merge=function(e){for(var t=2===e.length?e.shift():{},s=null,i=0,n=e.length;n>i;i++){s=e[i];for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t}}),e.register("powerange/lib/powerange.js",function(e,t,s){var n=(t("./main"),t("./horizontal")),o=t("./vertical"),r={callback:function(){},decimal:!1,disable:!1,disableOpacity:.5,hideRange:!1,klass:"",min:0,max:100,handleDiameter:20,touchDiameter:42,start:null,step:null,vertical:!1};s.exports=function(e,t){t=t||{};for(var s in r)null==t[s]&&(t[s]=r[s]);return t.vertical?new o(e,t):new n(e,t)}}),e.register("powerange/lib/main.js",function(e,t,s){function l(e,t){return this instanceof l?(this.element=e,this.options=t||{},this.slider=this.create("div","range-container"),void(null!==this.element&&"text"===this.element.type&&this.init())):new l(e,t)}var n=t("mouse"),o=t("events"),r=t("classes"),a=t("percentage-calc");s.exports=l,l.prototype.bindEvents=function(){this.handle=this.slider.querySelector(".range-handle"),this.touch=o(this.slider,this),this.touch.bind("touchstart","onmousedown"),this.touch.bind("touchmove","onmousemove"),this.touch.bind("touchend","onmouseup"),this.mouse=n(this.slider,this),this.mouse.bind()},l.prototype.hide=function(){this.element.style.display="none"},l.prototype.append=function(){var e=this.generate();this.insertAfter(this.element,e)},l.prototype.generate=function(){var e={handle:{type:"span",selector:"range-handle"},min:{type:"span",selector:"range-min"},max:{type:"span",selector:"range-max"},quantity:{type:"span",selector:"range-quantity"}},t=this.create("span","range-bar");this.slider.appendChild(t);for(var s in e)if(e.hasOwnProperty(s)){var i=this.create(e[s].type,e[s].selector);t.appendChild(i)}return this.slider},l.prototype.create=function(e,t){var s=document.createElement(e);return s.className=t,s},l.prototype.insertAfter=function(e,t){e.parentNode.insertBefore(t,e.nextSibling)},l.prototype.extraClass=function(e){this.options.klass&&r(this.slider).add(e)},l.prototype.setRange=function(e,t){"number"!=typeof e||"number"!=typeof t||this.options.hideRange||(this.slider.querySelector(".range-min").innerHTML=e,this.slider.querySelector(".range-max").innerHTML=t)},l.prototype.setValue=function(e,t){var s=a.from(parseFloat(e),t),i=a.of(s,this.options.max-this.options.min)+this.options.min,n=!1;i=this.options.decimal?Math.round(100*i)/100:Math.round(i),n=this.element.value!=i?!0:!1,this.element.value=i,this.options.callback(),n&&this.changeEvent()},l.prototype.step=function(e,t){var s=e-t,n=a.from(this.checkStep(this.options.step),this.options.max-this.options.min),o=a.of(n,s),r=[];for(0==o&&(o=1),i=0;i<=s;i+=o)r.push(i);return this.steps=r,this.steps},l.prototype.checkValues=function(e){e<this.options.min&&(this.options.start=this.options.min),e>this.options.max&&(this.options.start=this.options.max),this.options.min>=this.options.max&&(this.options.min=this.options.max)},l.prototype.checkStep=function(e){return 0>e&&(e=Math.abs(e)),this.options.step=e,this.options.step},l.prototype.disable=function(){(this.options.min==this.options.max||this.options.min>this.options.max||this.options.disable)&&(this.mouse.unbind(),this.touch.unbind(),this.slider.style.opacity=this.options.disableOpacity,r(this.handle).add("range-disabled"))},l.prototype.unselectable=function(e,t){r(this.slider).has("unselectable")||t!==!0?r(this.slider).remove("unselectable"):r(this.slider).add("unselectable")},l.prototype.changeEvent=function(e){if("function"!=typeof Event&&document.fireEvent)this.element.fireEvent("onchange");else{var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.element.dispatchEvent(t)}},l.prototype.init=function(){this.hide(),this.append(),this.bindEvents(),this.extraClass(this.options.klass),this.checkValues(this.options.start),this.setRange(this.options.min,this.options.max),this.disable()}}),e.register("powerange/lib/horizontal.js",function(e,t,s){function a(){r.apply(this,arguments),this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",this.handle.style.top=-this.options.handleDiameter/2+2+"px",this.options.step&&this.step($(this.slider).width(),$(this.handle).width()),this.setStart(this.options.start)}var i=t("super"),n=t("closest-num"),o=t("percentage-calc"),r=t("./main");s.exports=a,i(a,r),a.prototype.setStart=function(e){var t=null===e?this.options.min:e,s=o.from(t-this.options.min,this.options.max-this.options.min)||0,i=o.of(s,$(this.slider).width()-$(this.handle).width()),r=this.options.step?n.find(i,this.steps):i;this.setPosition(r),this.setValue(this.handle.style.left,$(this.slider).width()-$(this.handle).width()),this.options.step&&this.step($(this.slider).width(),$(this.handle).width())},a.prototype.setPosition=function(e){this.handle.style.left=e+"px",this.slider.querySelector(".range-quantity").style.width=e+"px"},a.prototype.onmousedown=function(e){if(e.touches&&(e=e.touches[0]),"range-handle"!==e.target.className){if(!this.options.tap)return;for(var t=0,s=this.handle;null!==s;)t+=s.offsetLeft,s=s.offsetParent;this.startX=t-window.scrollX+this.handle.clientWidth/2}else this.startX=e.clientX,this.ht=$(this.handle).css("top"),this.handle.style.marginLeft=-(this.options.touchDiameter-this.options.handleDiameter)/4+"px",this.handle.style.width=this.options.touchDiameter+"px",this.handle.style.height=this.options.touchDiameter+"px",this.handle.style.top=parseInt(this.handle.style.top)-(this.options.touchDiameter-this.options.handleDiameter)/2+"px";this.handleOffsetX=this.handle.offsetLeft,this.restrictHandleX=$(this.slider).width()-$(this.handle).width(),this.unselectable(this.slider,!0),this.onmousemove(e)},a.prototype.onmousemove=function(e){if("range-handle"===e.target.className||this.options.tap){"function"==typeof e.preventDefault&&e.preventDefault(),e.touches&&(e=e.touches[0]);var t=this.handleOffsetX+e.clientX-this.startX,s=this.steps?n.find(t,this.steps):t;0>=t?this.setPosition(0):t>=this.restrictHandleX?this.setPosition(this.restrictHandleX):this.setPosition(s),this.setValue(this.handle.style.left,$(this.slider).width()-this.options.handleDiameter)}},a.prototype.onmouseup=function(e){this.unselectable(this.slider,!1),this.handle.style.marginLeft="0px",this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",this.handle.style.top=this.ht,this.setValue(this.handle.style.left,$(this.slider).width()-$(this.handle).width())}}),e.register("powerange/lib/vertical.js",function(e,t,s){function l(){a.apply(this,arguments),this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",n(this.slider).add("vertical"),this.options.step&&this.step($(this.slider).height(),$(this.handle).height()),this.setStart(this.options.start)}var i=t("super"),n=t("classes"),o=t("closest-num"),r=t("percentage-calc"),a=t("./main");s.exports=l,i(l,a),l.prototype.setStart=function(e){var t=null===e?this.options.min:e,s=r.from(t-this.options.min,this.options.max-this.options.min)||0,i=r.of(s,$(this.slider).height()-$(this.handle).height()),n=this.options.step?o.find(i,this.steps):i;this.setPosition(n),this.setValue(this.handle.style.bottom,$(this.slider).height()-$(this.handle).height()),this.options.step&&this.step($(this.slider).height(),$(this.handle).height())},l.prototype.setPosition=function(e){this.handle.style.bottom=e+"px",this.slider.querySelector(".range-quantity").style.height=e+"px"},l.prototype.onmousedown=function(e){if(e.touches&&(e=e.touches[0]),"range-handle"!==e.target.className){if(!this.options.tap)return;for(var t=0,s=this.handle;null!==s;)t+=s.offsetTop,s=s.offsetParent;this.startY=t-window.scrollY+this.handle.clientHeight/2}else this.startY=e.clientY,this.handle.style.marginLeft=-(this.options.touchDiameter-this.options.handleDiameter)/2+"px",this.handle.style.width=this.options.touchDiameter+"px",this.handle.style.height=this.options.touchDiameter+"px";this.handleOffsetY=$(this.slider).height()-$(this.handle).height()-this.handle.offsetTop,this.restrictHandleY=$(this.slider).height()-$(this.handle).height(),this.unselectable(this.slider,!0),this.onmousemove(e)},l.prototype.onmousemove=function(e){if("range-handle"===e.target.className||this.options.tap){"function"==typeof e.preventDefault&&e.preventDefault(),e.touches&&(e=e.touches[0]);var t=this.handleOffsetY+this.startY-e.clientY,s=this.steps?o.find(t,this.steps):t;0>=t?this.setPosition(0):t>=this.restrictHandleY?this.setPosition(this.restrictHandleY):this.setPosition(s),this.setValue(this.handle.style.bottom,$(this.slider).height()-$(this.handle).height())}},l.prototype.onmouseup=function(e){this.unselectable(this.slider,!1),this.handle.style.marginLeft="0px",this.handle.style.width=this.options.handleDiameter+"px",this.handle.style.height=this.options.handleDiameter+"px",this.setValue(this.handle.style.bottom,$(this.slider).height()-$(this.handle).height())}}),e.alias("component-events/index.js","powerange/deps/events/index.js"),e.alias("component-events/index.js","events/index.js"),e.alias("component-event/index.js","component-events/deps/event/index.js"),e.alias("component-delegate/index.js","component-events/deps/delegate/index.js"),e.alias("discore-closest/index.js","component-delegate/deps/closest/index.js"),e.alias("discore-closest/index.js","component-delegate/deps/closest/index.js"),e.alias("component-matches-selector/index.js","discore-closest/deps/matches-selector/index.js"),e.alias("component-query/index.js","component-matches-selector/deps/query/index.js"),e.alias("discore-closest/index.js","discore-closest/index.js"),e.alias("component-event/index.js","component-delegate/deps/event/index.js"),e.alias("component-classes/index.js","powerange/deps/classes/index.js"),e.alias("component-classes/index.js","classes/index.js"),e.alias("component-indexof/index.js","component-classes/deps/indexof/index.js"),e.alias("ui-component-mouse/index.js","powerange/deps/mouse/index.js"),e.alias("ui-component-mouse/index.js","mouse/index.js"),e.alias("component-emitter/index.js","ui-component-mouse/deps/emitter/index.js"),e.alias("component-event/index.js","ui-component-mouse/deps/event/index.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","powerange/deps/percentage-calc/percentage-calc.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","powerange/deps/percentage-calc/index.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","percentage-calc/index.js"),e.alias("abpetkov-percentage-calc/percentage-calc.js","abpetkov-percentage-calc/index.js"),e.alias("abpetkov-closest-num/closest-num.js","powerange/deps/closest-num/closest-num.js"),e.alias("abpetkov-closest-num/closest-num.js","powerange/deps/closest-num/index.js"),e.alias("abpetkov-closest-num/closest-num.js","closest-num/index.js"),e.alias("abpetkov-closest-num/closest-num.js","abpetkov-closest-num/index.js"),e.alias("vesln-super/lib/super.js","powerange/deps/super/lib/super.js"),e.alias("vesln-super/lib/super.js","powerange/deps/super/index.js"),e.alias("vesln-super/lib/super.js","super/index.js"),e.alias("vesln-super/lib/super.js","vesln-super/index.js"),e.alias("powerange/lib/powerange.js","powerange/index.js"),"object"==typeof exports?module.exports=e("powerange"):"function"==typeof define&&define.amd?define([],function(){return e("powerange")}):this.Powerange=e("powerange")}();
|