diff --git a/dev/carousel.css b/dev/carousel.css index 721f64ea..28c29bd8 100644 --- a/dev/carousel.css +++ b/dev/carousel.css @@ -251,23 +251,17 @@ button { list-style: none; overflow: hidden; white-space: nowrap; } + .carousel .slider.swiping { + -webkit-transition: none 0 ease-in; + -moz-transition: none 0 ease-in; + -ms-transition: none 0 ease-in; + -o-transition: none 0 ease-in; + transition: none 0 ease-in; } .carousel .slide { - -webkit-transition: border 0.25s ease-in; - -moz-transition: border 0.25s ease-in; - -ms-transition: border 0.25s ease-in; - -o-transition: border 0.25s ease-in; - transition: border 0.25s ease-in; display: inline-block; width: 260px; margin: 0px; white-space: nowrap; } - @media (min-width: 768px) { - .carousel .slide { - -webkit-transition: border 0.15s ease-in; - -moz-transition: border 0.15s ease-in; - -ms-transition: border 0.15s ease-in; - -o-transition: border 0.15s ease-in; - transition: border 0.15s ease-in; } } .carousel .slide img { vertical-align: top; } .carousel .control-dots { diff --git a/dev/carousel.html b/dev/carousel.html new file mode 100644 index 00000000..1d2f443a --- /dev/null +++ b/dev/carousel.html @@ -0,0 +1,22 @@ + + + + + + + + + + + +
+

React Responsive Carousel (WIP)

+
+

Slider with controls

+
+
+
+ + + + \ No newline at end of file diff --git a/dev/main.js b/dev/main.js index c48fa9f9..14119f15 100644 --- a/dev/main.js +++ b/dev/main.js @@ -78,531 +78,12 @@ var DemoCarousel = React.createClass({displayName: "DemoCarousel", } }); -React.render(React.createElement(DemoGallery, null), document.querySelector('.demo-gallery')); +// React.render(, document.querySelector('.demo-gallery')); React.render(React.createElement(DemoSliderControls, null), document.querySelector('.demo-slider-controls')); -React.render(React.createElement(DemoCarousel, null), document.querySelector('.demo-carousel')); +// React.render(, document.querySelector('.demo-carousel')); -},{"./components/Carousel":"/home/leandro/Documents/dev/react-responsive-carousel/src/components/Carousel.js","./components/ImageGallery":"/home/leandro/Documents/dev/react-responsive-carousel/src/components/ImageGallery.js","react":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/react.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/index.js":[function(require,module,exports){ -var RequestFrame = require('raf') -var Dimensions = require('ainojs-dimensions') -var EventMixin = require('ainojs-events') - -// shortcuts -var document = window.document -var abs = Math.abs - -// short event bindings -var bind = function(elem, type, handler) { - elem.addEventListener(type, handler, false) -} -var unbind = function(elem, type, handler) { - elem.removeEventListener(type, handler, false) -} - -// track velocity -var tracker = [] - -var Finger = function(elem, options) { - - if ( !(this instanceof Finger) ) - return new Finger(elem, options) - - // test for basic js support - if ( - !document.addEventListener || - !Array.prototype.forEach || - !('contains' in document.body) || - !Function.prototype.bind || - !document.body.children - ) return - - // default options - this.config = { - start: 0, - duration: 600, // will decrease on smaller screens - dbltap: true, // set to false for faster tap event if doubletap is not needed - easing: function(x,t,b,c,d) { - return -c * ((t=t/d-1)*t*t*t - 1) + b // easeOutQuart - }, - bounceEasing: function (x, t, b, c, d, s) { - if (s == undefined) s = 2.0158; - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; - } - } - - this.inner = elem.children[0] - - if ( !this.inner ) - return - - // extend options - if ( options ) { - for(var key in options) { - this.config[key] = options[key] - } - } - - this.container = elem - this.to = this.pos = 0 - this.touching = false - this.start = {} - this.index = this.projection = this.config.start - this.anim = 0 - this.tap = 0 - this.clearTap = function() { - if ( this.tap ) { - window.clearTimeout(this.tap.timer) - this.tap = 0 - } - }.bind(this) - - // bind events - bind(elem, 'touchstart', this.ontouchstart.bind(this)) - bind(window, 'resize', this.setup.bind(this)) - bind(window, 'orientationchange', this.setup.bind(this)) - bind(document, 'touchmove', this.ontouchmove.bind(this)) - bind(document, 'touchend', this.ontouchend.bind(this)) - - // mixin events - EventMixin.call(this) - - this.setup() -} - -Finger.prototype.setup = function() { - this.width = Dimensions( this.container ).width - this.length = Math.ceil( Dimensions( this.inner ).width / this.width ) - if ( this.index !== 0 ) { - this.index = this.validateIndex( this.index ) - this.pos = this.to = -this.width*this.index - } - this.loop() -} - -Finger.prototype.destroy = function() { - unbind(this.container, 'touchstart', this.ontouchstart) - unbind(window, 'resize', this.setup) - unbind(window, 'orientationchange', this.setup) - unbind(document, 'touchmove', this.ontouchmove) - unbind(document, 'touchend', this.ontouchend) -} - -Finger.prototype.validateIndex = function(index) { - return Math.min(this.length-1, Math.max(0, index)) -} - -Finger.prototype.ontouchstart = function(e) { - - var touch = e.touches - - this.start = { - pageX: touch[0].pageX, - pageY: touch[0].pageY, - time: +new Date(), - pos: this.pos || 0, - prevent: function() { e.preventDefault() }, - distance: 0, - target: e.target - } - - this.isScrolling = null - this.touching = true - this.deltaX = 0 - this.offset = 0 - - if ( this.anim ) { - this.to = this.pos - this.offset = (this.pos + (this.width*this.index)) - this.anim = 0 - } - - this.loop() -} - -Finger.prototype.ontouchmove = function(e) { - - if ( !this.touching ) - return - - // don’t swipe if zoomed - if ( document.documentElement && Dimensions(document.documentElement).width / window.innerWidth > 1 ) - return - - var touch = e.touches - - // ensure swiping with one touch and not pinching - if( touch && touch.length > 1 || e.scale && e.scale !== 1 ) return - - this.deltaX = touch[0].pageX - this.start.pageX + this.offset - - var dx = abs(touch[0].pageX - this.start.pageX) - var dy = abs(touch[0].pageY - this.start.pageY) - - // determine if scrolling test has run - one time test - if ( this.isScrolling === null ) { - this.isScrolling = !!( - this.isScrolling || dx < dy - ) - } - - // save distance for tap event - this.start.distance = Math.max( dx, dy ) - - // clear old taps on move - if ( this.start.distance > 2 ) { - this.clearTap() - } - - // if user is not trying to scroll vertically - if (!this.isScrolling) { - - // prevent native scrolling - e.preventDefault() - this.start.prevent() - - // increase resistance if first or last slide - this.deltaX /= ( (!this.index && this.deltaX > 0 || this.index == this.length - 1 && this.deltaX < 0 ) ? - ( abs(this.deltaX) / this.width + 1.8 ) : 1 ) - this.to = this.deltaX - this.index * this.width - - // track the valocity - var touch = e.touches - - tracker.push({ - pageX: touch[0].pageX - this.start.pageX, - time: +new Date() - this.start.time - }) - - tracker = tracker.slice(-5) - } - - e.stopPropagation() -} - -Finger.prototype.ontouchend = function(e) { - - if ( !this.touching ) - return - - this.touching = false - - // detect taps - if ( this.start.distance < 2 && this.inner.contains( this.start.target ) ) { - if ( !this.tap ) { - if ( this.config.dbltap ) { - this.tap = { - time: +new Date(), - pageX: this.start.pageX, - pageY: this.start.pageY, - timer: window.setTimeout(function() { - this.trigger('tap', { target: this.start.target }) - this.tap = 0 - }.bind(this), 300) - } - } else { - this.trigger('tap', { target: this.start.target }) - } - } else { - var tapDistance = Math.max( - abs(this.tap.pageX - this.start.pageX), - abs(this.tap.pageY - this.start.pageY) - ) - if ( tapDistance < 100 ) - this.trigger('dbltap', { target: this.start.target }) - this.clearTap() - } - } else - this.clearTap() - - // determine if slide attempt triggers next/prev slide - var isValidSlide = +new Date() - this.start.time < 250 && - abs(this.deltaX) > 40 || - abs(this.deltaX) > this.width/2, - - isPastBounds = !this.index && this.deltaX > 0 || - this.index == this.length - 1 && this.deltaX < 0 - - // if not scrolling vertically - if ( !this.isScrolling ) { - this.projection += ( isValidSlide && !isPastBounds ? - ((this.deltaX-this.offset) < 0 ? 1 : -1) : 0 ) - this.animateTo( this.projection ) - } else if ( this.offset ) - this.animateTo( this.index ) -} - -Finger.prototype.animateTo = function( index ) { - index = this.validateIndex(index) - this.to = -( index*this.width ) - this.index = this.projection = index - this.loop() -}, - -Finger.prototype.jumpTo = function( index ) { - index = this.validateIndex( index ) - if ( index !== this.index ) - this.trigger('complete', { index: index }, this) - this.to = this.pos = -( index*this.width ) - this.index = this.projection = index - this.loop() -}, - -Finger.prototype.loop = function() { - - var distance = this.to - this.pos - - // if distance is short or the user is touching, do a 1-1 animation - if ( this.touching || abs(distance) <= 1 ) { - this.pos = this.to - if ( this.anim ) { - this.index = this.projection = abs(Math.round(this.pos/this.width)) - this.trigger('complete', {index: this.index }, this) - } - this.anim = 0 - } else { - - if ( !this.anim ) { - - // save animation parameters - // extract velocity first - var velocity = 0.6 - var travel = this.width - if ( tracker.length ) { - var last = tracker[tracker.length-1] - travel = (last.pageX - tracker[0].pageX) - velocity = travel / (last.time - tracker[0].time) - tracker = [] - } - - // detect bounce - var isEdge = abs(this.start.pos) == abs(this.index*this.width) - var bounce = !isEdge && abs(velocity) > 2.5 && abs(travel) / this.width > 0.35 - var duration = this.config.duration - if ( !isEdge ) - duration *= Math.min(1.2, Math.max(0.6, abs(distance/768))) // factorize 768 - - this.anim = { - position: this.pos, - distance: distance, - time: +new Date(), - duration: duration, - easing: bounce ? this.config.bounceEasing : this.config.easing - } - } - // apply easing - this.pos = this.anim.easing(null, +new Date() - this.anim.time, this.anim.position, this.anim.distance, this.anim.duration) - } - - this.trigger('frame', { - value: -this.pos/this.width, - position: this.pos - }, this) - - if ( this.touching || this.anim ) - RequestFrame(this.loop.bind(this)) -} - -module.exports = Finger -},{"ainojs-dimensions":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/ainojs-dimensions/index.js","ainojs-events":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/ainojs-events/index.js","raf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/raf/index.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/ainojs-dimensions/index.js":[function(require,module,exports){ -var comp = window.getComputedStyle - -var getValue = function(elem, what) { - var low = what.toLowerCase() - var val = Math.ceil( ("getBoundingClientRect" in elem) ? - elem.getBoundingClientRect()[ low ] : - elem[ 'offset'+what ] - ) - - if ( (typeof val == 'undefined' || isNaN(val)) && comp ) - val = comp(elem, null)[ low ].replace('px','') - - return parseInt(val, 10) -} - -module.exports = function(elem) { - return { - width: getValue(elem, 'Width'), - height: getValue(elem, 'Height') - } -} -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/ainojs-events/index.js":[function(require,module,exports){ -var Events = function() { - - var handlers = [] - - this.on = function( type, handler ) { - handlers.push({ - type: type, - handler: handler - }) - return this - } - - this.off = function( type, handler ) { - var i = handlers.length - var ev - while ( i-- ) { - ev = handlers[i] - if ( ev === undefined || ( ev.type == type && ( !handler || handler == ev.handler ) ) ) - handlers.splice(i, 1) - } - return this - } - - this.once = function( type, handler ) { - var fn = function() { - handler.call( this ) - this.off( type, fn ) - }.bind(this) - return this.on( type, fn ) - } - - this.trigger = function( type, params, context ) { - context = context || this - var i = 0 - var len = handlers.length - var ev - var obj = { type: type } - if ( typeof params == 'object' ) { - for( var prop in params ) - obj[prop] = params[prop] - } - for ( ; i < len; i++ ) { - ev = handlers[i] - if ( ev && ev.type == type ) - ev.handler.call(context, obj) - } - return this - } - return this -} - -module.exports = Events -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/raf/index.js":[function(require,module,exports){ -var now = require('performance-now') - , global = typeof window === 'undefined' ? {} : window - , vendors = ['moz', 'webkit'] - , suffix = 'AnimationFrame' - , raf = global['request' + suffix] - , caf = global['cancel' + suffix] || global['cancelRequest' + suffix] - , isNative = true - -for(var i = 0; i < vendors.length && !raf; i++) { - raf = global[vendors[i] + 'Request' + suffix] - caf = global[vendors[i] + 'Cancel' + suffix] - || global[vendors[i] + 'CancelRequest' + suffix] -} - -// Some versions of FF have rAF but not cAF -if(!raf || !caf) { - isNative = false - - var last = 0 - , id = 0 - , queue = [] - , frameDuration = 1000 / 60 - - raf = function(callback) { - if(queue.length === 0) { - var _now = now() - , next = Math.max(0, frameDuration - (_now - last)) - last = next + _now - setTimeout(function() { - var cp = queue.slice(0) - // Clear queue here to prevent - // callbacks from appending listeners - // to the current frame's queue - queue.length = 0 - for(var i = 0; i < cp.length; i++) { - if(!cp[i].cancelled) { - try{ - cp[i].callback(last) - } catch(e) { - setTimeout(function() { throw e }, 0) - } - } - } - }, Math.round(next)) - } - queue.push({ - handle: ++id, - callback: callback, - cancelled: false - }) - return id - } - - caf = function(handle) { - for(var i = 0; i < queue.length; i++) { - if(queue[i].handle === handle) { - queue[i].cancelled = true - } - } - } -} - -module.exports = function(fn) { - // Wrap in a new function to prevent - // `cancel` potentially being assigned - // to the native rAF function - if(!isNative) { - return raf.call(global, fn) - } - return raf.call(global, function() { - try{ - fn.apply(this, arguments) - } catch(e) { - setTimeout(function() { throw e }, 0) - } - }) -} -module.exports.cancel = function() { - caf.apply(global, arguments) -} - -},{"performance-now":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/raf/node_modules/performance-now/lib/performance-now.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/node_modules/raf/node_modules/performance-now/lib/performance-now.js":[function(require,module,exports){ -(function (process){ -// Generated by CoffeeScript 1.6.3 -(function() { - var getNanoSeconds, hrtime, loadTime; - - if ((typeof performance !== "undefined" && performance !== null) && performance.now) { - module.exports = function() { - return performance.now(); - }; - } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { - module.exports = function() { - return (getNanoSeconds() - loadTime) / 1e6; - }; - hrtime = process.hrtime; - getNanoSeconds = function() { - var hr; - hr = hrtime(); - return hr[0] * 1e9 + hr[1]; - }; - loadTime = getNanoSeconds(); - } else if (Date.now) { - module.exports = function() { - return Date.now() - loadTime; - }; - loadTime = Date.now(); - } else { - module.exports = function() { - return new Date().getTime() - loadTime; - }; - loadTime = new Date().getTime(); - } - -}).call(this); - -/* -//@ sourceMappingURL=performance-now.map -*/ - -}).call(this,require('_process')) - -},{"_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js":[function(require,module,exports){ +},{"./components/Carousel":"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/components/Carousel.js","./components/ImageGallery":"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/components/ImageGallery.js","react":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/react.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js":[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -690,10 +171,2475 @@ process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/addons.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/hammerjs/hammer.js":[function(require,module,exports){ +/*! Hammer.JS - v2.0.4 - 2014-09-28 + * http://hammerjs.github.io/ + * + * Copyright (c) 2014 Jorik Tangelder; + * Licensed under the MIT license */ +(function(window, document, exportName, undefined) { + 'use strict'; + +var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o']; +var TEST_ELEMENT = document.createElement('div'); + +var TYPE_FUNCTION = 'function'; + +var round = Math.round; +var abs = Math.abs; +var now = Date.now; + +/** + * set a timeout with a given scope + * @param {Function} fn + * @param {Number} timeout + * @param {Object} context + * @returns {number} + */ +function setTimeoutContext(fn, timeout, context) { + return setTimeout(bindFn(fn, context), timeout); +} + +/** + * if the argument is an array, we want to execute the fn on each entry + * if it aint an array we don't want to do a thing. + * this is used by all the methods that accept a single and array argument. + * @param {*|Array} arg + * @param {String} fn + * @param {Object} [context] + * @returns {Boolean} + */ +function invokeArrayArg(arg, fn, context) { + if (Array.isArray(arg)) { + each(arg, context[fn], context); + return true; + } + return false; +} + +/** + * walk objects and arrays + * @param {Object} obj + * @param {Function} iterator + * @param {Object} context + */ +function each(obj, iterator, context) { + var i; + + if (!obj) { + return; + } + + if (obj.forEach) { + obj.forEach(iterator, context); + } else if (obj.length !== undefined) { + i = 0; + while (i < obj.length) { + iterator.call(context, obj[i], i, obj); + i++; + } + } else { + for (i in obj) { + obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj); + } + } +} + +/** + * extend object. + * means that properties in dest will be overwritten by the ones in src. + * @param {Object} dest + * @param {Object} src + * @param {Boolean} [merge] + * @returns {Object} dest + */ +function extend(dest, src, merge) { + var keys = Object.keys(src); + var i = 0; + while (i < keys.length) { + if (!merge || (merge && dest[keys[i]] === undefined)) { + dest[keys[i]] = src[keys[i]]; + } + i++; + } + return dest; +} + +/** + * merge the values from src in the dest. + * means that properties that exist in dest will not be overwritten by src + * @param {Object} dest + * @param {Object} src + * @returns {Object} dest + */ +function merge(dest, src) { + return extend(dest, src, true); +} + +/** + * simple class inheritance + * @param {Function} child + * @param {Function} base + * @param {Object} [properties] + */ +function inherit(child, base, properties) { + var baseP = base.prototype, + childP; + + childP = child.prototype = Object.create(baseP); + childP.constructor = child; + childP._super = baseP; + + if (properties) { + extend(childP, properties); + } +} + +/** + * simple function bind + * @param {Function} fn + * @param {Object} context + * @returns {Function} + */ +function bindFn(fn, context) { + return function boundFn() { + return fn.apply(context, arguments); + }; +} + +/** + * let a boolean value also be a function that must return a boolean + * this first item in args will be used as the context + * @param {Boolean|Function} val + * @param {Array} [args] + * @returns {Boolean} + */ +function boolOrFn(val, args) { + if (typeof val == TYPE_FUNCTION) { + return val.apply(args ? args[0] || undefined : undefined, args); + } + return val; +} + +/** + * use the val2 when val1 is undefined + * @param {*} val1 + * @param {*} val2 + * @returns {*} + */ +function ifUndefined(val1, val2) { + return (val1 === undefined) ? val2 : val1; +} + +/** + * addEventListener with multiple events at once + * @param {EventTarget} target + * @param {String} types + * @param {Function} handler + */ +function addEventListeners(target, types, handler) { + each(splitStr(types), function(type) { + target.addEventListener(type, handler, false); + }); +} + +/** + * removeEventListener with multiple events at once + * @param {EventTarget} target + * @param {String} types + * @param {Function} handler + */ +function removeEventListeners(target, types, handler) { + each(splitStr(types), function(type) { + target.removeEventListener(type, handler, false); + }); +} + +/** + * find if a node is in the given parent + * @method hasParent + * @param {HTMLElement} node + * @param {HTMLElement} parent + * @return {Boolean} found + */ +function hasParent(node, parent) { + while (node) { + if (node == parent) { + return true; + } + node = node.parentNode; + } + return false; +} + +/** + * small indexOf wrapper + * @param {String} str + * @param {String} find + * @returns {Boolean} found + */ +function inStr(str, find) { + return str.indexOf(find) > -1; +} + +/** + * split string on whitespace + * @param {String} str + * @returns {Array} words + */ +function splitStr(str) { + return str.trim().split(/\s+/g); +} + +/** + * find if a array contains the object using indexOf or a simple polyFill + * @param {Array} src + * @param {String} find + * @param {String} [findByKey] + * @return {Boolean|Number} false when not found, or the index + */ +function inArray(src, find, findByKey) { + if (src.indexOf && !findByKey) { + return src.indexOf(find); + } else { + var i = 0; + while (i < src.length) { + if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) { + return i; + } + i++; + } + return -1; + } +} + +/** + * convert array-like objects to real arrays + * @param {Object} obj + * @returns {Array} + */ +function toArray(obj) { + return Array.prototype.slice.call(obj, 0); +} + +/** + * unique array with objects based on a key (like 'id') or just by the array's value + * @param {Array} src [{id:1},{id:2},{id:1}] + * @param {String} [key] + * @param {Boolean} [sort=False] + * @returns {Array} [{id:1},{id:2}] + */ +function uniqueArray(src, key, sort) { + var results = []; + var values = []; + var i = 0; + + while (i < src.length) { + var val = key ? src[i][key] : src[i]; + if (inArray(values, val) < 0) { + results.push(src[i]); + } + values[i] = val; + i++; + } + + if (sort) { + if (!key) { + results = results.sort(); + } else { + results = results.sort(function sortUniqueArray(a, b) { + return a[key] > b[key]; + }); + } + } + + return results; +} + +/** + * get the prefixed property + * @param {Object} obj + * @param {String} property + * @returns {String|Undefined} prefixed + */ +function prefixed(obj, property) { + var prefix, prop; + var camelProp = property[0].toUpperCase() + property.slice(1); + + var i = 0; + while (i < VENDOR_PREFIXES.length) { + prefix = VENDOR_PREFIXES[i]; + prop = (prefix) ? prefix + camelProp : property; + + if (prop in obj) { + return prop; + } + i++; + } + return undefined; +} + +/** + * get a unique id + * @returns {number} uniqueId + */ +var _uniqueId = 1; +function uniqueId() { + return _uniqueId++; +} + +/** + * get the window object of an element + * @param {HTMLElement} element + * @returns {DocumentView|Window} + */ +function getWindowForElement(element) { + var doc = element.ownerDocument; + return (doc.defaultView || doc.parentWindow); +} + +var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i; + +var SUPPORT_TOUCH = ('ontouchstart' in window); +var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined; +var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent); + +var INPUT_TYPE_TOUCH = 'touch'; +var INPUT_TYPE_PEN = 'pen'; +var INPUT_TYPE_MOUSE = 'mouse'; +var INPUT_TYPE_KINECT = 'kinect'; + +var COMPUTE_INTERVAL = 25; + +var INPUT_START = 1; +var INPUT_MOVE = 2; +var INPUT_END = 4; +var INPUT_CANCEL = 8; + +var DIRECTION_NONE = 1; +var DIRECTION_LEFT = 2; +var DIRECTION_RIGHT = 4; +var DIRECTION_UP = 8; +var DIRECTION_DOWN = 16; + +var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT; +var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN; +var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL; + +var PROPS_XY = ['x', 'y']; +var PROPS_CLIENT_XY = ['clientX', 'clientY']; + +/** + * create new input type manager + * @param {Manager} manager + * @param {Function} callback + * @returns {Input} + * @constructor + */ +function Input(manager, callback) { + var self = this; + this.manager = manager; + this.callback = callback; + this.element = manager.element; + this.target = manager.options.inputTarget; + + // smaller wrapper around the handler, for the scope and the enabled state of the manager, + // so when disabled the input events are completely bypassed. + this.domHandler = function(ev) { + if (boolOrFn(manager.options.enable, [manager])) { + self.handler(ev); + } + }; + + this.init(); + +} + +Input.prototype = { + /** + * should handle the inputEvent data and trigger the callback + * @virtual + */ + handler: function() { }, + + /** + * bind the events + */ + init: function() { + this.evEl && addEventListeners(this.element, this.evEl, this.domHandler); + this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler); + this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler); + }, + + /** + * unbind the events + */ + destroy: function() { + this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler); + this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler); + this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler); + } +}; + +/** + * create new input type manager + * called by the Manager constructor + * @param {Hammer} manager + * @returns {Input} + */ +function createInputInstance(manager) { + var Type; + var inputClass = manager.options.inputClass; + + if (inputClass) { + Type = inputClass; + } else if (SUPPORT_POINTER_EVENTS) { + Type = PointerEventInput; + } else if (SUPPORT_ONLY_TOUCH) { + Type = TouchInput; + } else if (!SUPPORT_TOUCH) { + Type = MouseInput; + } else { + Type = TouchMouseInput; + } + return new (Type)(manager, inputHandler); +} + +/** + * handle input events + * @param {Manager} manager + * @param {String} eventType + * @param {Object} input + */ +function inputHandler(manager, eventType, input) { + var pointersLen = input.pointers.length; + var changedPointersLen = input.changedPointers.length; + var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0)); + var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0)); + + input.isFirst = !!isFirst; + input.isFinal = !!isFinal; + + if (isFirst) { + manager.session = {}; + } + + // source event is the normalized value of the domEvents + // like 'touchstart, mouseup, pointerdown' + input.eventType = eventType; + + // compute scale, rotation etc + computeInputData(manager, input); + + // emit secret event + manager.emit('hammer.input', input); + + manager.recognize(input); + manager.session.prevInput = input; +} + +/** + * extend the data with some usable properties like scale, rotate, velocity etc + * @param {Object} manager + * @param {Object} input + */ +function computeInputData(manager, input) { + var session = manager.session; + var pointers = input.pointers; + var pointersLength = pointers.length; + + // store the first input to calculate the distance and direction + if (!session.firstInput) { + session.firstInput = simpleCloneInputData(input); + } + + // to compute scale and rotation we need to store the multiple touches + if (pointersLength > 1 && !session.firstMultiple) { + session.firstMultiple = simpleCloneInputData(input); + } else if (pointersLength === 1) { + session.firstMultiple = false; + } + + var firstInput = session.firstInput; + var firstMultiple = session.firstMultiple; + var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center; + + var center = input.center = getCenter(pointers); + input.timeStamp = now(); + input.deltaTime = input.timeStamp - firstInput.timeStamp; + + input.angle = getAngle(offsetCenter, center); + input.distance = getDistance(offsetCenter, center); + + computeDeltaXY(session, input); + input.offsetDirection = getDirection(input.deltaX, input.deltaY); + + input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1; + input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0; + + computeIntervalInputData(session, input); + + // find the correct target + var target = manager.element; + if (hasParent(input.srcEvent.target, target)) { + target = input.srcEvent.target; + } + input.target = target; +} + +function computeDeltaXY(session, input) { + var center = input.center; + var offset = session.offsetDelta || {}; + var prevDelta = session.prevDelta || {}; + var prevInput = session.prevInput || {}; + + if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) { + prevDelta = session.prevDelta = { + x: prevInput.deltaX || 0, + y: prevInput.deltaY || 0 + }; + + offset = session.offsetDelta = { + x: center.x, + y: center.y + }; + } + + input.deltaX = prevDelta.x + (center.x - offset.x); + input.deltaY = prevDelta.y + (center.y - offset.y); +} + +/** + * velocity is calculated every x ms + * @param {Object} session + * @param {Object} input + */ +function computeIntervalInputData(session, input) { + var last = session.lastInterval || input, + deltaTime = input.timeStamp - last.timeStamp, + velocity, velocityX, velocityY, direction; + + if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) { + var deltaX = last.deltaX - input.deltaX; + var deltaY = last.deltaY - input.deltaY; + + var v = getVelocity(deltaTime, deltaX, deltaY); + velocityX = v.x; + velocityY = v.y; + velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y; + direction = getDirection(deltaX, deltaY); + + session.lastInterval = input; + } else { + // use latest velocity info if it doesn't overtake a minimum period + velocity = last.velocity; + velocityX = last.velocityX; + velocityY = last.velocityY; + direction = last.direction; + } + + input.velocity = velocity; + input.velocityX = velocityX; + input.velocityY = velocityY; + input.direction = direction; +} + +/** + * create a simple clone from the input used for storage of firstInput and firstMultiple + * @param {Object} input + * @returns {Object} clonedInputData + */ +function simpleCloneInputData(input) { + // make a simple copy of the pointers because we will get a reference if we don't + // we only need clientXY for the calculations + var pointers = []; + var i = 0; + while (i < input.pointers.length) { + pointers[i] = { + clientX: round(input.pointers[i].clientX), + clientY: round(input.pointers[i].clientY) + }; + i++; + } + + return { + timeStamp: now(), + pointers: pointers, + center: getCenter(pointers), + deltaX: input.deltaX, + deltaY: input.deltaY + }; +} + +/** + * get the center of all the pointers + * @param {Array} pointers + * @return {Object} center contains `x` and `y` properties + */ +function getCenter(pointers) { + var pointersLength = pointers.length; + + // no need to loop when only one touch + if (pointersLength === 1) { + return { + x: round(pointers[0].clientX), + y: round(pointers[0].clientY) + }; + } + + var x = 0, y = 0, i = 0; + while (i < pointersLength) { + x += pointers[i].clientX; + y += pointers[i].clientY; + i++; + } + + return { + x: round(x / pointersLength), + y: round(y / pointersLength) + }; +} + +/** + * calculate the velocity between two points. unit is in px per ms. + * @param {Number} deltaTime + * @param {Number} x + * @param {Number} y + * @return {Object} velocity `x` and `y` + */ +function getVelocity(deltaTime, x, y) { + return { + x: x / deltaTime || 0, + y: y / deltaTime || 0 + }; +} + +/** + * get the direction between two points + * @param {Number} x + * @param {Number} y + * @return {Number} direction + */ +function getDirection(x, y) { + if (x === y) { + return DIRECTION_NONE; + } + + if (abs(x) >= abs(y)) { + return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; + } + return y > 0 ? DIRECTION_UP : DIRECTION_DOWN; +} + +/** + * calculate the absolute distance between two points + * @param {Object} p1 {x, y} + * @param {Object} p2 {x, y} + * @param {Array} [props] containing x and y keys + * @return {Number} distance + */ +function getDistance(p1, p2, props) { + if (!props) { + props = PROPS_XY; + } + var x = p2[props[0]] - p1[props[0]], + y = p2[props[1]] - p1[props[1]]; + + return Math.sqrt((x * x) + (y * y)); +} + +/** + * calculate the angle between two coordinates + * @param {Object} p1 + * @param {Object} p2 + * @param {Array} [props] containing x and y keys + * @return {Number} angle + */ +function getAngle(p1, p2, props) { + if (!props) { + props = PROPS_XY; + } + var x = p2[props[0]] - p1[props[0]], + y = p2[props[1]] - p1[props[1]]; + return Math.atan2(y, x) * 180 / Math.PI; +} + +/** + * calculate the rotation degrees between two pointersets + * @param {Array} start array of pointers + * @param {Array} end array of pointers + * @return {Number} rotation + */ +function getRotation(start, end) { + return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY); +} + +/** + * calculate the scale factor between two pointersets + * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out + * @param {Array} start array of pointers + * @param {Array} end array of pointers + * @return {Number} scale + */ +function getScale(start, end) { + return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY); +} + +var MOUSE_INPUT_MAP = { + mousedown: INPUT_START, + mousemove: INPUT_MOVE, + mouseup: INPUT_END +}; + +var MOUSE_ELEMENT_EVENTS = 'mousedown'; +var MOUSE_WINDOW_EVENTS = 'mousemove mouseup'; + +/** + * Mouse events input + * @constructor + * @extends Input + */ +function MouseInput() { + this.evEl = MOUSE_ELEMENT_EVENTS; + this.evWin = MOUSE_WINDOW_EVENTS; + + this.allow = true; // used by Input.TouchMouse to disable mouse events + this.pressed = false; // mousedown state + + Input.apply(this, arguments); +} + +inherit(MouseInput, Input, { + /** + * handle mouse events + * @param {Object} ev + */ + handler: function MEhandler(ev) { + var eventType = MOUSE_INPUT_MAP[ev.type]; + + // on start we want to have the left mouse button down + if (eventType & INPUT_START && ev.button === 0) { + this.pressed = true; + } + + if (eventType & INPUT_MOVE && ev.which !== 1) { + eventType = INPUT_END; + } + + // mouse must be down, and mouse events are allowed (see the TouchMouse input) + if (!this.pressed || !this.allow) { + return; + } + + if (eventType & INPUT_END) { + this.pressed = false; + } + + this.callback(this.manager, eventType, { + pointers: [ev], + changedPointers: [ev], + pointerType: INPUT_TYPE_MOUSE, + srcEvent: ev + }); + } +}); + +var POINTER_INPUT_MAP = { + pointerdown: INPUT_START, + pointermove: INPUT_MOVE, + pointerup: INPUT_END, + pointercancel: INPUT_CANCEL, + pointerout: INPUT_CANCEL +}; + +// in IE10 the pointer types is defined as an enum +var IE10_POINTER_TYPE_ENUM = { + 2: INPUT_TYPE_TOUCH, + 3: INPUT_TYPE_PEN, + 4: INPUT_TYPE_MOUSE, + 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816 +}; + +var POINTER_ELEMENT_EVENTS = 'pointerdown'; +var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; + +// IE10 has prefixed support, and case-sensitive +if (window.MSPointerEvent) { + POINTER_ELEMENT_EVENTS = 'MSPointerDown'; + POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel'; +} + +/** + * Pointer events input + * @constructor + * @extends Input + */ +function PointerEventInput() { + this.evEl = POINTER_ELEMENT_EVENTS; + this.evWin = POINTER_WINDOW_EVENTS; + + Input.apply(this, arguments); + + this.store = (this.manager.session.pointerEvents = []); +} + +inherit(PointerEventInput, Input, { + /** + * handle mouse events + * @param {Object} ev + */ + handler: function PEhandler(ev) { + var store = this.store; + var removePointer = false; + + var eventTypeNormalized = ev.type.toLowerCase().replace('ms', ''); + var eventType = POINTER_INPUT_MAP[eventTypeNormalized]; + var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType; + + var isTouch = (pointerType == INPUT_TYPE_TOUCH); + + // get index of the event in the store + var storeIndex = inArray(store, ev.pointerId, 'pointerId'); + + // start and mouse must be down + if (eventType & INPUT_START && (ev.button === 0 || isTouch)) { + if (storeIndex < 0) { + store.push(ev); + storeIndex = store.length - 1; + } + } else if (eventType & (INPUT_END | INPUT_CANCEL)) { + removePointer = true; + } + + // it not found, so the pointer hasn't been down (so it's probably a hover) + if (storeIndex < 0) { + return; + } + + // update the event in the store + store[storeIndex] = ev; + + this.callback(this.manager, eventType, { + pointers: store, + changedPointers: [ev], + pointerType: pointerType, + srcEvent: ev + }); + + if (removePointer) { + // remove from the store + store.splice(storeIndex, 1); + } + } +}); + +var SINGLE_TOUCH_INPUT_MAP = { + touchstart: INPUT_START, + touchmove: INPUT_MOVE, + touchend: INPUT_END, + touchcancel: INPUT_CANCEL +}; + +var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart'; +var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel'; + +/** + * Touch events input + * @constructor + * @extends Input + */ +function SingleTouchInput() { + this.evTarget = SINGLE_TOUCH_TARGET_EVENTS; + this.evWin = SINGLE_TOUCH_WINDOW_EVENTS; + this.started = false; + + Input.apply(this, arguments); +} + +inherit(SingleTouchInput, Input, { + handler: function TEhandler(ev) { + var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; + + // should we handle the touch events? + if (type === INPUT_START) { + this.started = true; + } + + if (!this.started) { + return; + } + + var touches = normalizeSingleTouches.call(this, ev, type); + + // when done, reset the started state + if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) { + this.started = false; + } + + this.callback(this.manager, type, { + pointers: touches[0], + changedPointers: touches[1], + pointerType: INPUT_TYPE_TOUCH, + srcEvent: ev + }); + } +}); + +/** + * @this {TouchInput} + * @param {Object} ev + * @param {Number} type flag + * @returns {undefined|Array} [all, changed] + */ +function normalizeSingleTouches(ev, type) { + var all = toArray(ev.touches); + var changed = toArray(ev.changedTouches); + + if (type & (INPUT_END | INPUT_CANCEL)) { + all = uniqueArray(all.concat(changed), 'identifier', true); + } + + return [all, changed]; +} + +var TOUCH_INPUT_MAP = { + touchstart: INPUT_START, + touchmove: INPUT_MOVE, + touchend: INPUT_END, + touchcancel: INPUT_CANCEL +}; + +var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel'; + +/** + * Multi-user touch events input + * @constructor + * @extends Input + */ +function TouchInput() { + this.evTarget = TOUCH_TARGET_EVENTS; + this.targetIds = {}; + + Input.apply(this, arguments); +} + +inherit(TouchInput, Input, { + handler: function MTEhandler(ev) { + var type = TOUCH_INPUT_MAP[ev.type]; + var touches = getTouches.call(this, ev, type); + if (!touches) { + return; + } + + this.callback(this.manager, type, { + pointers: touches[0], + changedPointers: touches[1], + pointerType: INPUT_TYPE_TOUCH, + srcEvent: ev + }); + } +}); + +/** + * @this {TouchInput} + * @param {Object} ev + * @param {Number} type flag + * @returns {undefined|Array} [all, changed] + */ +function getTouches(ev, type) { + var allTouches = toArray(ev.touches); + var targetIds = this.targetIds; + + // when there is only one touch, the process can be simplified + if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) { + targetIds[allTouches[0].identifier] = true; + return [allTouches, allTouches]; + } + + var i, + targetTouches, + changedTouches = toArray(ev.changedTouches), + changedTargetTouches = [], + target = this.target; + + // get target touches from touches + targetTouches = allTouches.filter(function(touch) { + return hasParent(touch.target, target); + }); + + // collect touches + if (type === INPUT_START) { + i = 0; + while (i < targetTouches.length) { + targetIds[targetTouches[i].identifier] = true; + i++; + } + } + + // filter changed touches to only contain touches that exist in the collected target ids + i = 0; + while (i < changedTouches.length) { + if (targetIds[changedTouches[i].identifier]) { + changedTargetTouches.push(changedTouches[i]); + } + + // cleanup removed touches + if (type & (INPUT_END | INPUT_CANCEL)) { + delete targetIds[changedTouches[i].identifier]; + } + i++; + } + + if (!changedTargetTouches.length) { + return; + } + + return [ + // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel' + uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), + changedTargetTouches + ]; +} + +/** + * Combined touch and mouse input + * + * Touch has a higher priority then mouse, and while touching no mouse events are allowed. + * This because touch devices also emit mouse events while doing a touch. + * + * @constructor + * @extends Input + */ +function TouchMouseInput() { + Input.apply(this, arguments); + + var handler = bindFn(this.handler, this); + this.touch = new TouchInput(this.manager, handler); + this.mouse = new MouseInput(this.manager, handler); +} + +inherit(TouchMouseInput, Input, { + /** + * handle mouse and touch events + * @param {Hammer} manager + * @param {String} inputEvent + * @param {Object} inputData + */ + handler: function TMEhandler(manager, inputEvent, inputData) { + var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH), + isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE); + + // when we're in a touch event, so block all upcoming mouse events + // most mobile browser also emit mouseevents, right after touchstart + if (isTouch) { + this.mouse.allow = false; + } else if (isMouse && !this.mouse.allow) { + return; + } + + // reset the allowMouse when we're done + if (inputEvent & (INPUT_END | INPUT_CANCEL)) { + this.mouse.allow = true; + } + + this.callback(manager, inputEvent, inputData); + }, + + /** + * remove the event listeners + */ + destroy: function destroy() { + this.touch.destroy(); + this.mouse.destroy(); + } +}); + +var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction'); +var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined; + +// magical touchAction value +var TOUCH_ACTION_COMPUTE = 'compute'; +var TOUCH_ACTION_AUTO = 'auto'; +var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented +var TOUCH_ACTION_NONE = 'none'; +var TOUCH_ACTION_PAN_X = 'pan-x'; +var TOUCH_ACTION_PAN_Y = 'pan-y'; + +/** + * Touch Action + * sets the touchAction property or uses the js alternative + * @param {Manager} manager + * @param {String} value + * @constructor + */ +function TouchAction(manager, value) { + this.manager = manager; + this.set(value); +} + +TouchAction.prototype = { + /** + * set the touchAction value on the element or enable the polyfill + * @param {String} value + */ + set: function(value) { + // find out the touch-action by the event handlers + if (value == TOUCH_ACTION_COMPUTE) { + value = this.compute(); + } + + if (NATIVE_TOUCH_ACTION) { + this.manager.element.style[PREFIXED_TOUCH_ACTION] = value; + } + this.actions = value.toLowerCase().trim(); + }, + + /** + * just re-set the touchAction value + */ + update: function() { + this.set(this.manager.options.touchAction); + }, + + /** + * compute the value for the touchAction property based on the recognizer's settings + * @returns {String} value + */ + compute: function() { + var actions = []; + each(this.manager.recognizers, function(recognizer) { + if (boolOrFn(recognizer.options.enable, [recognizer])) { + actions = actions.concat(recognizer.getTouchAction()); + } + }); + return cleanTouchActions(actions.join(' ')); + }, + + /** + * this method is called on each input cycle and provides the preventing of the browser behavior + * @param {Object} input + */ + preventDefaults: function(input) { + // not needed with native support for the touchAction property + if (NATIVE_TOUCH_ACTION) { + return; + } + + var srcEvent = input.srcEvent; + var direction = input.offsetDirection; + + // if the touch action did prevented once this session + if (this.manager.session.prevented) { + srcEvent.preventDefault(); + return; + } + + var actions = this.actions; + var hasNone = inStr(actions, TOUCH_ACTION_NONE); + var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); + var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); + + if (hasNone || + (hasPanY && direction & DIRECTION_HORIZONTAL) || + (hasPanX && direction & DIRECTION_VERTICAL)) { + return this.preventSrc(srcEvent); + } + }, + + /** + * call preventDefault to prevent the browser's default behavior (scrolling in most cases) + * @param {Object} srcEvent + */ + preventSrc: function(srcEvent) { + this.manager.session.prevented = true; + srcEvent.preventDefault(); + } +}; + +/** + * when the touchActions are collected they are not a valid value, so we need to clean things up. * + * @param {String} actions + * @returns {*} + */ +function cleanTouchActions(actions) { + // none + if (inStr(actions, TOUCH_ACTION_NONE)) { + return TOUCH_ACTION_NONE; + } + + var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); + var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); + + // pan-x and pan-y can be combined + if (hasPanX && hasPanY) { + return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y; + } + + // pan-x OR pan-y + if (hasPanX || hasPanY) { + return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y; + } + + // manipulation + if (inStr(actions, TOUCH_ACTION_MANIPULATION)) { + return TOUCH_ACTION_MANIPULATION; + } + + return TOUCH_ACTION_AUTO; +} + +/** + * Recognizer flow explained; * + * All recognizers have the initial state of POSSIBLE when a input session starts. + * The definition of a input session is from the first input until the last input, with all it's movement in it. * + * Example session for mouse-input: mousedown -> mousemove -> mouseup + * + * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed + * which determines with state it should be. + * + * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to + * POSSIBLE to give it another change on the next cycle. + * + * Possible + * | + * +-----+---------------+ + * | | + * +-----+-----+ | + * | | | + * Failed Cancelled | + * +-------+------+ + * | | + * Recognized Began + * | + * Changed + * | + * Ended/Recognized + */ +var STATE_POSSIBLE = 1; +var STATE_BEGAN = 2; +var STATE_CHANGED = 4; +var STATE_ENDED = 8; +var STATE_RECOGNIZED = STATE_ENDED; +var STATE_CANCELLED = 16; +var STATE_FAILED = 32; + +/** + * Recognizer + * Every recognizer needs to extend from this class. + * @constructor + * @param {Object} options + */ +function Recognizer(options) { + this.id = uniqueId(); + + this.manager = null; + this.options = merge(options || {}, this.defaults); + + // default is enable true + this.options.enable = ifUndefined(this.options.enable, true); + + this.state = STATE_POSSIBLE; + + this.simultaneous = {}; + this.requireFail = []; +} + +Recognizer.prototype = { + /** + * @virtual + * @type {Object} + */ + defaults: {}, + + /** + * set options + * @param {Object} options + * @return {Recognizer} + */ + set: function(options) { + extend(this.options, options); + + // also update the touchAction, in case something changed about the directions/enabled state + this.manager && this.manager.touchAction.update(); + return this; + }, + + /** + * recognize simultaneous with an other recognizer. + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + recognizeWith: function(otherRecognizer) { + if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) { + return this; + } + + var simultaneous = this.simultaneous; + otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); + if (!simultaneous[otherRecognizer.id]) { + simultaneous[otherRecognizer.id] = otherRecognizer; + otherRecognizer.recognizeWith(this); + } + return this; + }, + + /** + * drop the simultaneous link. it doesnt remove the link on the other recognizer. + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + dropRecognizeWith: function(otherRecognizer) { + if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) { + return this; + } + + otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); + delete this.simultaneous[otherRecognizer.id]; + return this; + }, + + /** + * recognizer can only run when an other is failing + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + requireFailure: function(otherRecognizer) { + if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) { + return this; + } + + var requireFail = this.requireFail; + otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); + if (inArray(requireFail, otherRecognizer) === -1) { + requireFail.push(otherRecognizer); + otherRecognizer.requireFailure(this); + } + return this; + }, + + /** + * drop the requireFailure link. it does not remove the link on the other recognizer. + * @param {Recognizer} otherRecognizer + * @returns {Recognizer} this + */ + dropRequireFailure: function(otherRecognizer) { + if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) { + return this; + } + + otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); + var index = inArray(this.requireFail, otherRecognizer); + if (index > -1) { + this.requireFail.splice(index, 1); + } + return this; + }, + + /** + * has require failures boolean + * @returns {boolean} + */ + hasRequireFailures: function() { + return this.requireFail.length > 0; + }, + + /** + * if the recognizer can recognize simultaneous with an other recognizer + * @param {Recognizer} otherRecognizer + * @returns {Boolean} + */ + canRecognizeWith: function(otherRecognizer) { + return !!this.simultaneous[otherRecognizer.id]; + }, + + /** + * You should use `tryEmit` instead of `emit` directly to check + * that all the needed recognizers has failed before emitting. + * @param {Object} input + */ + emit: function(input) { + var self = this; + var state = this.state; + + function emit(withState) { + self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input); + } + + // 'panstart' and 'panmove' + if (state < STATE_ENDED) { + emit(true); + } + + emit(); // simple 'eventName' events + + // panend and pancancel + if (state >= STATE_ENDED) { + emit(true); + } + }, + + /** + * Check that all the require failure recognizers has failed, + * if true, it emits a gesture event, + * otherwise, setup the state to FAILED. + * @param {Object} input + */ + tryEmit: function(input) { + if (this.canEmit()) { + return this.emit(input); + } + // it's failing anyway + this.state = STATE_FAILED; + }, + + /** + * can we emit? + * @returns {boolean} + */ + canEmit: function() { + var i = 0; + while (i < this.requireFail.length) { + if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) { + return false; + } + i++; + } + return true; + }, + + /** + * update the recognizer + * @param {Object} inputData + */ + recognize: function(inputData) { + // make a new copy of the inputData + // so we can change the inputData without messing up the other recognizers + var inputDataClone = extend({}, inputData); + + // is is enabled and allow recognizing? + if (!boolOrFn(this.options.enable, [this, inputDataClone])) { + this.reset(); + this.state = STATE_FAILED; + return; + } + + // reset when we've reached the end + if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) { + this.state = STATE_POSSIBLE; + } + + this.state = this.process(inputDataClone); + + // the recognizer has recognized a gesture + // so trigger an event + if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) { + this.tryEmit(inputDataClone); + } + }, + + /** + * return the state of the recognizer + * the actual recognizing happens in this method + * @virtual + * @param {Object} inputData + * @returns {Const} STATE + */ + process: function(inputData) { }, // jshint ignore:line + + /** + * return the preferred touch-action + * @virtual + * @returns {Array} + */ + getTouchAction: function() { }, + + /** + * called when the gesture isn't allowed to recognize + * like when another is being recognized or it is disabled + * @virtual + */ + reset: function() { } +}; + +/** + * get a usable string, used as event postfix + * @param {Const} state + * @returns {String} state + */ +function stateStr(state) { + if (state & STATE_CANCELLED) { + return 'cancel'; + } else if (state & STATE_ENDED) { + return 'end'; + } else if (state & STATE_CHANGED) { + return 'move'; + } else if (state & STATE_BEGAN) { + return 'start'; + } + return ''; +} + +/** + * direction cons to string + * @param {Const} direction + * @returns {String} + */ +function directionStr(direction) { + if (direction == DIRECTION_DOWN) { + return 'down'; + } else if (direction == DIRECTION_UP) { + return 'up'; + } else if (direction == DIRECTION_LEFT) { + return 'left'; + } else if (direction == DIRECTION_RIGHT) { + return 'right'; + } + return ''; +} + +/** + * get a recognizer by name if it is bound to a manager + * @param {Recognizer|String} otherRecognizer + * @param {Recognizer} recognizer + * @returns {Recognizer} + */ +function getRecognizerByNameIfManager(otherRecognizer, recognizer) { + var manager = recognizer.manager; + if (manager) { + return manager.get(otherRecognizer); + } + return otherRecognizer; +} + +/** + * This recognizer is just used as a base for the simple attribute recognizers. + * @constructor + * @extends Recognizer + */ +function AttrRecognizer() { + Recognizer.apply(this, arguments); +} + +inherit(AttrRecognizer, Recognizer, { + /** + * @namespace + * @memberof AttrRecognizer + */ + defaults: { + /** + * @type {Number} + * @default 1 + */ + pointers: 1 + }, + + /** + * Used to check if it the recognizer receives valid input, like input.distance > 10. + * @memberof AttrRecognizer + * @param {Object} input + * @returns {Boolean} recognized + */ + attrTest: function(input) { + var optionPointers = this.options.pointers; + return optionPointers === 0 || input.pointers.length === optionPointers; + }, + + /** + * Process the input and return the state for the recognizer + * @memberof AttrRecognizer + * @param {Object} input + * @returns {*} State + */ + process: function(input) { + var state = this.state; + var eventType = input.eventType; + + var isRecognized = state & (STATE_BEGAN | STATE_CHANGED); + var isValid = this.attrTest(input); + + // on cancel input and we've recognized before, return STATE_CANCELLED + if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) { + return state | STATE_CANCELLED; + } else if (isRecognized || isValid) { + if (eventType & INPUT_END) { + return state | STATE_ENDED; + } else if (!(state & STATE_BEGAN)) { + return STATE_BEGAN; + } + return state | STATE_CHANGED; + } + return STATE_FAILED; + } +}); + +/** + * Pan + * Recognized when the pointer is down and moved in the allowed direction. + * @constructor + * @extends AttrRecognizer + */ +function PanRecognizer() { + AttrRecognizer.apply(this, arguments); + + this.pX = null; + this.pY = null; +} + +inherit(PanRecognizer, AttrRecognizer, { + /** + * @namespace + * @memberof PanRecognizer + */ + defaults: { + event: 'pan', + threshold: 10, + pointers: 1, + direction: DIRECTION_ALL + }, + + getTouchAction: function() { + var direction = this.options.direction; + var actions = []; + if (direction & DIRECTION_HORIZONTAL) { + actions.push(TOUCH_ACTION_PAN_Y); + } + if (direction & DIRECTION_VERTICAL) { + actions.push(TOUCH_ACTION_PAN_X); + } + return actions; + }, + + directionTest: function(input) { + var options = this.options; + var hasMoved = true; + var distance = input.distance; + var direction = input.direction; + var x = input.deltaX; + var y = input.deltaY; + + // lock to axis? + if (!(direction & options.direction)) { + if (options.direction & DIRECTION_HORIZONTAL) { + direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT; + hasMoved = x != this.pX; + distance = Math.abs(input.deltaX); + } else { + direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN; + hasMoved = y != this.pY; + distance = Math.abs(input.deltaY); + } + } + input.direction = direction; + return hasMoved && distance > options.threshold && direction & options.direction; + }, + + attrTest: function(input) { + return AttrRecognizer.prototype.attrTest.call(this, input) && + (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input))); + }, + + emit: function(input) { + this.pX = input.deltaX; + this.pY = input.deltaY; + + var direction = directionStr(input.direction); + if (direction) { + this.manager.emit(this.options.event + direction, input); + } + + this._super.emit.call(this, input); + } +}); + +/** + * Pinch + * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out). + * @constructor + * @extends AttrRecognizer + */ +function PinchRecognizer() { + AttrRecognizer.apply(this, arguments); +} + +inherit(PinchRecognizer, AttrRecognizer, { + /** + * @namespace + * @memberof PinchRecognizer + */ + defaults: { + event: 'pinch', + threshold: 0, + pointers: 2 + }, + + getTouchAction: function() { + return [TOUCH_ACTION_NONE]; + }, + + attrTest: function(input) { + return this._super.attrTest.call(this, input) && + (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN); + }, + + emit: function(input) { + this._super.emit.call(this, input); + if (input.scale !== 1) { + var inOut = input.scale < 1 ? 'in' : 'out'; + this.manager.emit(this.options.event + inOut, input); + } + } +}); + +/** + * Press + * Recognized when the pointer is down for x ms without any movement. + * @constructor + * @extends Recognizer + */ +function PressRecognizer() { + Recognizer.apply(this, arguments); + + this._timer = null; + this._input = null; +} + +inherit(PressRecognizer, Recognizer, { + /** + * @namespace + * @memberof PressRecognizer + */ + defaults: { + event: 'press', + pointers: 1, + time: 500, // minimal time of the pointer to be pressed + threshold: 5 // a minimal movement is ok, but keep it low + }, + + getTouchAction: function() { + return [TOUCH_ACTION_AUTO]; + }, + + process: function(input) { + var options = this.options; + var validPointers = input.pointers.length === options.pointers; + var validMovement = input.distance < options.threshold; + var validTime = input.deltaTime > options.time; + + this._input = input; + + // we only allow little movement + // and we've reached an end event, so a tap is possible + if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) { + this.reset(); + } else if (input.eventType & INPUT_START) { + this.reset(); + this._timer = setTimeoutContext(function() { + this.state = STATE_RECOGNIZED; + this.tryEmit(); + }, options.time, this); + } else if (input.eventType & INPUT_END) { + return STATE_RECOGNIZED; + } + return STATE_FAILED; + }, + + reset: function() { + clearTimeout(this._timer); + }, + + emit: function(input) { + if (this.state !== STATE_RECOGNIZED) { + return; + } + + if (input && (input.eventType & INPUT_END)) { + this.manager.emit(this.options.event + 'up', input); + } else { + this._input.timeStamp = now(); + this.manager.emit(this.options.event, this._input); + } + } +}); + +/** + * Rotate + * Recognized when two or more pointer are moving in a circular motion. + * @constructor + * @extends AttrRecognizer + */ +function RotateRecognizer() { + AttrRecognizer.apply(this, arguments); +} + +inherit(RotateRecognizer, AttrRecognizer, { + /** + * @namespace + * @memberof RotateRecognizer + */ + defaults: { + event: 'rotate', + threshold: 0, + pointers: 2 + }, + + getTouchAction: function() { + return [TOUCH_ACTION_NONE]; + }, + + attrTest: function(input) { + return this._super.attrTest.call(this, input) && + (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN); + } +}); + +/** + * Swipe + * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction. + * @constructor + * @extends AttrRecognizer + */ +function SwipeRecognizer() { + AttrRecognizer.apply(this, arguments); +} + +inherit(SwipeRecognizer, AttrRecognizer, { + /** + * @namespace + * @memberof SwipeRecognizer + */ + defaults: { + event: 'swipe', + threshold: 10, + velocity: 0.65, + direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL, + pointers: 1 + }, + + getTouchAction: function() { + return PanRecognizer.prototype.getTouchAction.call(this); + }, + + attrTest: function(input) { + var direction = this.options.direction; + var velocity; + + if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) { + velocity = input.velocity; + } else if (direction & DIRECTION_HORIZONTAL) { + velocity = input.velocityX; + } else if (direction & DIRECTION_VERTICAL) { + velocity = input.velocityY; + } + + return this._super.attrTest.call(this, input) && + direction & input.direction && + input.distance > this.options.threshold && + abs(velocity) > this.options.velocity && input.eventType & INPUT_END; + }, + + emit: function(input) { + var direction = directionStr(input.direction); + if (direction) { + this.manager.emit(this.options.event + direction, input); + } + + this.manager.emit(this.options.event, input); + } +}); + +/** + * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur + * between the given interval and position. The delay option can be used to recognize multi-taps without firing + * a single tap. + * + * The eventData from the emitted event contains the property `tapCount`, which contains the amount of + * multi-taps being recognized. + * @constructor + * @extends Recognizer + */ +function TapRecognizer() { + Recognizer.apply(this, arguments); + + // previous time and center, + // used for tap counting + this.pTime = false; + this.pCenter = false; + + this._timer = null; + this._input = null; + this.count = 0; +} + +inherit(TapRecognizer, Recognizer, { + /** + * @namespace + * @memberof PinchRecognizer + */ + defaults: { + event: 'tap', + pointers: 1, + taps: 1, + interval: 300, // max time between the multi-tap taps + time: 250, // max time of the pointer to be down (like finger on the screen) + threshold: 2, // a minimal movement is ok, but keep it low + posThreshold: 10 // a multi-tap can be a bit off the initial position + }, + + getTouchAction: function() { + return [TOUCH_ACTION_MANIPULATION]; + }, + + process: function(input) { + var options = this.options; + + var validPointers = input.pointers.length === options.pointers; + var validMovement = input.distance < options.threshold; + var validTouchTime = input.deltaTime < options.time; + + this.reset(); + + if ((input.eventType & INPUT_START) && (this.count === 0)) { + return this.failTimeout(); + } + + // we only allow little movement + // and we've reached an end event, so a tap is possible + if (validMovement && validTouchTime && validPointers) { + if (input.eventType != INPUT_END) { + return this.failTimeout(); + } + + var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true; + var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold; + + this.pTime = input.timeStamp; + this.pCenter = input.center; + + if (!validMultiTap || !validInterval) { + this.count = 1; + } else { + this.count += 1; + } + + this._input = input; + + // if tap count matches we have recognized it, + // else it has began recognizing... + var tapCount = this.count % options.taps; + if (tapCount === 0) { + // no failing requirements, immediately trigger the tap event + // or wait as long as the multitap interval to trigger + if (!this.hasRequireFailures()) { + return STATE_RECOGNIZED; + } else { + this._timer = setTimeoutContext(function() { + this.state = STATE_RECOGNIZED; + this.tryEmit(); + }, options.interval, this); + return STATE_BEGAN; + } + } + } + return STATE_FAILED; + }, + + failTimeout: function() { + this._timer = setTimeoutContext(function() { + this.state = STATE_FAILED; + }, this.options.interval, this); + return STATE_FAILED; + }, + + reset: function() { + clearTimeout(this._timer); + }, + + emit: function() { + if (this.state == STATE_RECOGNIZED ) { + this._input.tapCount = this.count; + this.manager.emit(this.options.event, this._input); + } + } +}); + +/** + * Simple way to create an manager with a default set of recognizers. + * @param {HTMLElement} element + * @param {Object} [options] + * @constructor + */ +function Hammer(element, options) { + options = options || {}; + options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset); + return new Manager(element, options); +} + +/** + * @const {string} + */ +Hammer.VERSION = '2.0.4'; + +/** + * default settings + * @namespace + */ +Hammer.defaults = { + /** + * set if DOM events are being triggered. + * But this is slower and unused by simple implementations, so disabled by default. + * @type {Boolean} + * @default false + */ + domEvents: false, + + /** + * The value for the touchAction property/fallback. + * When set to `compute` it will magically set the correct value based on the added recognizers. + * @type {String} + * @default compute + */ + touchAction: TOUCH_ACTION_COMPUTE, + + /** + * @type {Boolean} + * @default true + */ + enable: true, + + /** + * EXPERIMENTAL FEATURE -- can be removed/changed + * Change the parent input target element. + * If Null, then it is being set the to main element. + * @type {Null|EventTarget} + * @default null + */ + inputTarget: null, + + /** + * force an input class + * @type {Null|Function} + * @default null + */ + inputClass: null, + + /** + * Default recognizer setup when calling `Hammer()` + * When creating a new Manager these will be skipped. + * @type {Array} + */ + preset: [ + // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...] + [RotateRecognizer, { enable: false }], + [PinchRecognizer, { enable: false }, ['rotate']], + [SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }], + [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']], + [TapRecognizer], + [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']], + [PressRecognizer] + ], + + /** + * Some CSS properties can be used to improve the working of Hammer. + * Add them to this method and they will be set when creating a new Manager. + * @namespace + */ + cssProps: { + /** + * Disables text selection to improve the dragging gesture. Mainly for desktop browsers. + * @type {String} + * @default 'none' + */ + userSelect: 'none', + + /** + * Disable the Windows Phone grippers when pressing an element. + * @type {String} + * @default 'none' + */ + touchSelect: 'none', + + /** + * Disables the default callout shown when you touch and hold a touch target. + * On iOS, when you touch and hold a touch target such as a link, Safari displays + * a callout containing information about the link. This property allows you to disable that callout. + * @type {String} + * @default 'none' + */ + touchCallout: 'none', + + /** + * Specifies whether zooming is enabled. Used by IE10> + * @type {String} + * @default 'none' + */ + contentZooming: 'none', + + /** + * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers. + * @type {String} + * @default 'none' + */ + userDrag: 'none', + + /** + * Overrides the highlight color shown when the user taps a link or a JavaScript + * clickable element in iOS. This property obeys the alpha value, if specified. + * @type {String} + * @default 'rgba(0,0,0,0)' + */ + tapHighlightColor: 'rgba(0,0,0,0)' + } +}; + +var STOP = 1; +var FORCED_STOP = 2; + +/** + * Manager + * @param {HTMLElement} element + * @param {Object} [options] + * @constructor + */ +function Manager(element, options) { + options = options || {}; + + this.options = merge(options, Hammer.defaults); + this.options.inputTarget = this.options.inputTarget || element; + + this.handlers = {}; + this.session = {}; + this.recognizers = []; + + this.element = element; + this.input = createInputInstance(this); + this.touchAction = new TouchAction(this, this.options.touchAction); + + toggleCssProps(this, true); + + each(options.recognizers, function(item) { + var recognizer = this.add(new (item[0])(item[1])); + item[2] && recognizer.recognizeWith(item[2]); + item[3] && recognizer.requireFailure(item[3]); + }, this); +} + +Manager.prototype = { + /** + * set options + * @param {Object} options + * @returns {Manager} + */ + set: function(options) { + extend(this.options, options); + + // Options that need a little more setup + if (options.touchAction) { + this.touchAction.update(); + } + if (options.inputTarget) { + // Clean up existing event listeners and reinitialize + this.input.destroy(); + this.input.target = options.inputTarget; + this.input.init(); + } + return this; + }, + + /** + * stop recognizing for this session. + * This session will be discarded, when a new [input]start event is fired. + * When forced, the recognizer cycle is stopped immediately. + * @param {Boolean} [force] + */ + stop: function(force) { + this.session.stopped = force ? FORCED_STOP : STOP; + }, + + /** + * run the recognizers! + * called by the inputHandler function on every movement of the pointers (touches) + * it walks through all the recognizers and tries to detect the gesture that is being made + * @param {Object} inputData + */ + recognize: function(inputData) { + var session = this.session; + if (session.stopped) { + return; + } + + // run the touch-action polyfill + this.touchAction.preventDefaults(inputData); + + var recognizer; + var recognizers = this.recognizers; + + // this holds the recognizer that is being recognized. + // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED + // if no recognizer is detecting a thing, it is set to `null` + var curRecognizer = session.curRecognizer; + + // reset when the last recognizer is recognized + // or when we're in a new session + if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) { + curRecognizer = session.curRecognizer = null; + } + + var i = 0; + while (i < recognizers.length) { + recognizer = recognizers[i]; + + // find out if we are allowed try to recognize the input for this one. + // 1. allow if the session is NOT forced stopped (see the .stop() method) + // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one + // that is being recognized. + // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer. + // this can be setup with the `recognizeWith()` method on the recognizer. + if (session.stopped !== FORCED_STOP && ( // 1 + !curRecognizer || recognizer == curRecognizer || // 2 + recognizer.canRecognizeWith(curRecognizer))) { // 3 + recognizer.recognize(inputData); + } else { + recognizer.reset(); + } + + // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the + // current active recognizer. but only if we don't already have an active recognizer + if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) { + curRecognizer = session.curRecognizer = recognizer; + } + i++; + } + }, + + /** + * get a recognizer by its event name. + * @param {Recognizer|String} recognizer + * @returns {Recognizer|Null} + */ + get: function(recognizer) { + if (recognizer instanceof Recognizer) { + return recognizer; + } + + var recognizers = this.recognizers; + for (var i = 0; i < recognizers.length; i++) { + if (recognizers[i].options.event == recognizer) { + return recognizers[i]; + } + } + return null; + }, + + /** + * add a recognizer to the manager + * existing recognizers with the same event name will be removed + * @param {Recognizer} recognizer + * @returns {Recognizer|Manager} + */ + add: function(recognizer) { + if (invokeArrayArg(recognizer, 'add', this)) { + return this; + } + + // remove existing + var existing = this.get(recognizer.options.event); + if (existing) { + this.remove(existing); + } + + this.recognizers.push(recognizer); + recognizer.manager = this; + + this.touchAction.update(); + return recognizer; + }, + + /** + * remove a recognizer by name or instance + * @param {Recognizer|String} recognizer + * @returns {Manager} + */ + remove: function(recognizer) { + if (invokeArrayArg(recognizer, 'remove', this)) { + return this; + } + + var recognizers = this.recognizers; + recognizer = this.get(recognizer); + recognizers.splice(inArray(recognizers, recognizer), 1); + + this.touchAction.update(); + return this; + }, + + /** + * bind event + * @param {String} events + * @param {Function} handler + * @returns {EventEmitter} this + */ + on: function(events, handler) { + var handlers = this.handlers; + each(splitStr(events), function(event) { + handlers[event] = handlers[event] || []; + handlers[event].push(handler); + }); + return this; + }, + + /** + * unbind event, leave emit blank to remove all handlers + * @param {String} events + * @param {Function} [handler] + * @returns {EventEmitter} this + */ + off: function(events, handler) { + var handlers = this.handlers; + each(splitStr(events), function(event) { + if (!handler) { + delete handlers[event]; + } else { + handlers[event].splice(inArray(handlers[event], handler), 1); + } + }); + return this; + }, + + /** + * emit event to the listeners + * @param {String} event + * @param {Object} data + */ + emit: function(event, data) { + // we also want to trigger dom events + if (this.options.domEvents) { + triggerDomEvent(event, data); + } + + // no handlers, so skip it all + var handlers = this.handlers[event] && this.handlers[event].slice(); + if (!handlers || !handlers.length) { + return; + } + + data.type = event; + data.preventDefault = function() { + data.srcEvent.preventDefault(); + }; + + var i = 0; + while (i < handlers.length) { + handlers[i](data); + i++; + } + }, + + /** + * destroy the manager and unbinds all events + * it doesn't unbind dom events, that is the user own responsibility + */ + destroy: function() { + this.element && toggleCssProps(this, false); + + this.handlers = {}; + this.session = {}; + this.input.destroy(); + this.element = null; + } +}; + +/** + * add/remove the css properties as defined in manager.options.cssProps + * @param {Manager} manager + * @param {Boolean} add + */ +function toggleCssProps(manager, add) { + var element = manager.element; + each(manager.options.cssProps, function(value, name) { + element.style[prefixed(element.style, name)] = add ? value : ''; + }); +} + +/** + * trigger dom event + * @param {String} event + * @param {Object} data + */ +function triggerDomEvent(event, data) { + var gestureEvent = document.createEvent('Event'); + gestureEvent.initEvent(event, true, true); + gestureEvent.gesture = data; + data.target.dispatchEvent(gestureEvent); +} + +extend(Hammer, { + INPUT_START: INPUT_START, + INPUT_MOVE: INPUT_MOVE, + INPUT_END: INPUT_END, + INPUT_CANCEL: INPUT_CANCEL, + + STATE_POSSIBLE: STATE_POSSIBLE, + STATE_BEGAN: STATE_BEGAN, + STATE_CHANGED: STATE_CHANGED, + STATE_ENDED: STATE_ENDED, + STATE_RECOGNIZED: STATE_RECOGNIZED, + STATE_CANCELLED: STATE_CANCELLED, + STATE_FAILED: STATE_FAILED, + + DIRECTION_NONE: DIRECTION_NONE, + DIRECTION_LEFT: DIRECTION_LEFT, + DIRECTION_RIGHT: DIRECTION_RIGHT, + DIRECTION_UP: DIRECTION_UP, + DIRECTION_DOWN: DIRECTION_DOWN, + DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL, + DIRECTION_VERTICAL: DIRECTION_VERTICAL, + DIRECTION_ALL: DIRECTION_ALL, + + Manager: Manager, + Input: Input, + TouchAction: TouchAction, + + TouchInput: TouchInput, + MouseInput: MouseInput, + PointerEventInput: PointerEventInput, + TouchMouseInput: TouchMouseInput, + SingleTouchInput: SingleTouchInput, + + Recognizer: Recognizer, + AttrRecognizer: AttrRecognizer, + Tap: TapRecognizer, + Pan: PanRecognizer, + Swipe: SwipeRecognizer, + Pinch: PinchRecognizer, + Rotate: RotateRecognizer, + Press: PressRecognizer, + + on: addEventListeners, + off: removeEventListeners, + each: each, + merge: merge, + extend: extend, + inherit: inherit, + bindFn: bindFn, + prefixed: prefixed +}); + +if (typeof define == TYPE_FUNCTION && define.amd) { + define(function() { + return Hammer; + }); +} else if (typeof module != 'undefined' && module.exports) { + module.exports = Hammer; +} else { + window[exportName] = Hammer; +} + +})(window, document, 'Hammer'); + +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/addons.js":[function(require,module,exports){ module.exports = require('./lib/ReactWithAddons'); -},{"./lib/ReactWithAddons":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactWithAddons.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js":[function(require,module,exports){ +},{"./lib/ReactWithAddons":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactWithAddons.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -720,7 +2666,7 @@ var AutoFocusMixin = { module.exports = AutoFocusMixin; -},{"./focusNode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/focusNode.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/BeforeInputEventPlugin.js":[function(require,module,exports){ +},{"./focusNode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/focusNode.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/BeforeInputEventPlugin.js":[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * All rights reserved. @@ -942,7 +2888,7 @@ var BeforeInputEventPlugin = { module.exports = BeforeInputEventPlugin; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./SyntheticInputEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticInputEvent.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSCore.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./SyntheticInputEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticInputEvent.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSCore.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -1055,7 +3001,7 @@ module.exports = CSSCore; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSProperty.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSProperty.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -1174,7 +3120,7 @@ var CSSProperty = { module.exports = CSSProperty; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSPropertyOperations.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSPropertyOperations.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -1310,7 +3256,7 @@ module.exports = CSSPropertyOperations; }).call(this,require('_process')) -},{"./CSSProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSProperty.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./camelizeStyleName":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelizeStyleName.js","./dangerousStyleValue":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/dangerousStyleValue.js","./hyphenateStyleName":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenateStyleName.js","./memoizeStringOnly":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/memoizeStringOnly.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js":[function(require,module,exports){ +},{"./CSSProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSProperty.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./camelizeStyleName":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelizeStyleName.js","./dangerousStyleValue":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/dangerousStyleValue.js","./hyphenateStyleName":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenateStyleName.js","./memoizeStringOnly":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/memoizeStringOnly.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -1411,7 +3357,7 @@ module.exports = CallbackQueue; }).call(this,require('_process')) -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ChangeEventPlugin.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ChangeEventPlugin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -1793,7 +3739,7 @@ var ChangeEventPlugin = { module.exports = ChangeEventPlugin; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./isEventSupported":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js","./isTextInputElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextInputElement.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ClientReactRootIndex.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./isEventSupported":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js","./isTextInputElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextInputElement.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ClientReactRootIndex.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -1818,7 +3764,7 @@ var ClientReactRootIndex = { module.exports = ClientReactRootIndex; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CompositionEventPlugin.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CompositionEventPlugin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -2077,7 +4023,7 @@ var CompositionEventPlugin = { module.exports = CompositionEventPlugin; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./ReactInputSelection":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js","./SyntheticCompositionEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticCompositionEvent.js","./getTextContentAccessor":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMChildrenOperations.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./ReactInputSelection":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js","./SyntheticCompositionEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticCompositionEvent.js","./getTextContentAccessor":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMChildrenOperations.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -2253,7 +4199,7 @@ module.exports = DOMChildrenOperations; }).call(this,require('_process')) -},{"./Danger":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Danger.js","./ReactMultiChildUpdateTypes":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./getTextContentAccessor":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js":[function(require,module,exports){ +},{"./Danger":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Danger.js","./ReactMultiChildUpdateTypes":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./getTextContentAccessor":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -2553,7 +4499,7 @@ module.exports = DOMProperty; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -2751,7 +4697,7 @@ module.exports = DOMPropertyOperations; }).call(this,require('_process')) -},{"./DOMProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./escapeTextForBrowser":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js","./memoizeStringOnly":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/memoizeStringOnly.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Danger.js":[function(require,module,exports){ +},{"./DOMProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./escapeTextForBrowser":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js","./memoizeStringOnly":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/memoizeStringOnly.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Danger.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -2938,7 +4884,7 @@ module.exports = Danger; }).call(this,require('_process')) -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./createNodesFromMarkup":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/createNodesFromMarkup.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","./getMarkupWrap":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getMarkupWrap.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DefaultEventPluginOrder.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./createNodesFromMarkup":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/createNodesFromMarkup.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","./getMarkupWrap":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getMarkupWrap.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DefaultEventPluginOrder.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -2978,7 +4924,7 @@ var DefaultEventPluginOrder = [ module.exports = DefaultEventPluginOrder; -},{"./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EnterLeaveEventPlugin.js":[function(require,module,exports){ +},{"./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EnterLeaveEventPlugin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -3118,7 +5064,7 @@ var EnterLeaveEventPlugin = { module.exports = EnterLeaveEventPlugin; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./SyntheticMouseEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./SyntheticMouseEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -3190,7 +5136,7 @@ var EventConstants = { module.exports = EventConstants; -},{"./keyMirror":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventListener.js":[function(require,module,exports){ +},{"./keyMirror":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventListener.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014 Facebook, Inc. @@ -3281,7 +5227,7 @@ module.exports = EventListener; }).call(this,require('_process')) -},{"./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js":[function(require,module,exports){ +},{"./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -3558,7 +5504,7 @@ module.exports = EventPluginHub; }).call(this,require('_process')) -},{"./EventPluginRegistry":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginRegistry.js","./EventPluginUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js","./accumulateInto":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginRegistry.js":[function(require,module,exports){ +},{"./EventPluginRegistry":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginRegistry.js","./EventPluginUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js","./accumulateInto":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginRegistry.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -3839,7 +5785,7 @@ module.exports = EventPluginRegistry; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -4061,7 +6007,7 @@ module.exports = EventPluginUtils; }).call(this,require('_process')) -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -4204,7 +6150,7 @@ module.exports = EventPropagators; }).call(this,require('_process')) -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./accumulateInto":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./accumulateInto":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -4249,7 +6195,7 @@ var ExecutionEnvironment = { module.exports = ExecutionEnvironment; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/HTMLDOMPropertyConfig.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/HTMLDOMPropertyConfig.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -4441,7 +6387,7 @@ var HTMLDOMPropertyConfig = { module.exports = HTMLDOMPropertyConfig; -},{"./DOMProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedStateMixin.js":[function(require,module,exports){ +},{"./DOMProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedStateMixin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -4482,7 +6428,7 @@ var LinkedStateMixin = { module.exports = LinkedStateMixin; -},{"./ReactLink":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLink.js","./ReactStateSetters":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactStateSetters.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js":[function(require,module,exports){ +},{"./ReactLink":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLink.js","./ReactStateSetters":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactStateSetters.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -4639,7 +6585,7 @@ module.exports = LinkedValueUtils; }).call(this,require('_process')) -},{"./ReactPropTypes":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypes.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LocalEventTrapMixin.js":[function(require,module,exports){ +},{"./ReactPropTypes":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypes.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LocalEventTrapMixin.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -4690,7 +6636,7 @@ module.exports = LocalEventTrapMixin; }).call(this,require('_process')) -},{"./ReactBrowserEventEmitter":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./accumulateInto":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/MobileSafariClickEventPlugin.js":[function(require,module,exports){ +},{"./ReactBrowserEventEmitter":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./accumulateInto":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/MobileSafariClickEventPlugin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -4748,7 +6694,7 @@ var MobileSafariClickEventPlugin = { module.exports = MobileSafariClickEventPlugin; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js":[function(require,module,exports){ /** * Copyright 2014, Facebook, Inc. * All rights reserved. @@ -4795,7 +6741,7 @@ function assign(target, sources) { module.exports = assign; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -4912,7 +6858,7 @@ module.exports = PooledClass; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -5101,7 +7047,7 @@ module.exports = React; }).call(this,require('_process')) -},{"./DOMPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./EventPluginUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactChildren":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactChildren.js","./ReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactContext":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactDOMComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMComponent.js","./ReactDefaultInjection":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultInjection.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js","./ReactInstanceHandles":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactLegacyElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactPropTypes":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypes.js","./ReactServerRendering":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRendering.js","./ReactTextComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js","./deprecated":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js","./onlyChild":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/onlyChild.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js":[function(require,module,exports){ +},{"./DOMPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./EventPluginUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactChildren":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactChildren.js","./ReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactContext":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactDOMComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMComponent.js","./ReactDefaultInjection":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultInjection.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js","./ReactInstanceHandles":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactLegacyElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactPropTypes":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypes.js","./ReactServerRendering":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRendering.js","./ReactTextComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js","./deprecated":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js","./onlyChild":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/onlyChild.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -5145,7 +7091,7 @@ module.exports = ReactBrowserComponentMixin; }).call(this,require('_process')) -},{"./ReactEmptyComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js":[function(require,module,exports){ +},{"./ReactEmptyComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -5500,7 +7446,7 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { module.exports = ReactBrowserEventEmitter; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./EventPluginRegistry":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginRegistry.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactEventEmitterMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventEmitterMixin.js","./ViewportMetrics":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ViewportMetrics.js","./isEventSupported":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroup.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./EventPluginRegistry":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginRegistry.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactEventEmitterMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventEmitterMixin.js","./ViewportMetrics":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ViewportMetrics.js","./isEventSupported":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroup.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -5567,7 +7513,7 @@ var ReactCSSTransitionGroup = React.createClass({ module.exports = ReactCSSTransitionGroup; -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./React":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactCSSTransitionGroupChild":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroupChild.js","./ReactTransitionGroup":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionGroup.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroupChild.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./React":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactCSSTransitionGroupChild":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroupChild.js","./ReactTransitionGroup":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionGroup.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroupChild.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -5703,7 +7649,7 @@ module.exports = ReactCSSTransitionGroupChild; }).call(this,require('_process')) -},{"./CSSCore":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSCore.js","./React":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactTransitionEvents":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionEvents.js","./onlyChild":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/onlyChild.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactChildren.js":[function(require,module,exports){ +},{"./CSSCore":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSCore.js","./React":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactTransitionEvents":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionEvents.js","./onlyChild":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/onlyChild.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactChildren.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -5854,7 +7800,7 @@ module.exports = ReactChildren; }).call(this,require('_process')) -},{"./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./traverseAllChildren":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/traverseAllChildren.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js":[function(require,module,exports){ +},{"./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./traverseAllChildren":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/traverseAllChildren.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -6298,7 +8244,7 @@ module.exports = ReactComponent; }).call(this,require('_process')) -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactOwner.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyMirror":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentBrowserEnvironment.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactOwner.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyMirror":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentBrowserEnvironment.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -6421,7 +8367,7 @@ module.exports = ReactComponentBrowserEnvironment; }).call(this,require('_process')) -},{"./ReactDOMIDOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMarkupChecksum":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMarkupChecksum.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactReconcileTransaction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactReconcileTransaction.js","./getReactRootElementInContainer":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getReactRootElementInContainer.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./setInnerHTML":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/setInnerHTML.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentWithPureRenderMixin.js":[function(require,module,exports){ +},{"./ReactDOMIDOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMarkupChecksum":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMarkupChecksum.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactReconcileTransaction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactReconcileTransaction.js","./getReactRootElementInContainer":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getReactRootElementInContainer.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./setInnerHTML":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/setInnerHTML.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentWithPureRenderMixin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -6470,7 +8416,7 @@ var ReactComponentWithPureRenderMixin = { module.exports = ReactComponentWithPureRenderMixin; -},{"./shallowEqual":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/shallowEqual.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js":[function(require,module,exports){ +},{"./shallowEqual":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/shallowEqual.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -7911,7 +9857,7 @@ module.exports = ReactCompositeComponent; }).call(this,require('_process')) -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactContext":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js","./ReactEmptyComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactErrorUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactErrorUtils.js","./ReactLegacyElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactOwner.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactPropTransferer":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTransferer.js","./ReactPropTypeLocationNames":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocations.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./instantiateReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyMirror":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./mapObject":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/mapObject.js","./monitorCodeUse":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","./shouldUpdateReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactContext":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js","./ReactEmptyComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactErrorUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactErrorUtils.js","./ReactLegacyElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactOwner.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactPropTransferer":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTransferer.js","./ReactPropTypeLocationNames":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocations.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./instantiateReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyMirror":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./mapObject":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/mapObject.js","./monitorCodeUse":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","./shouldUpdateReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -7973,7 +9919,7 @@ var ReactContext = { module.exports = ReactContext; -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -8007,7 +9953,7 @@ var ReactCurrentOwner = { module.exports = ReactCurrentOwner; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -8191,7 +10137,7 @@ module.exports = ReactDOM; }).call(this,require('_process')) -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js","./ReactLegacyElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./mapObject":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/mapObject.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMButton.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js","./ReactLegacyElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./mapObject":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/mapObject.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMButton.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -8256,7 +10202,7 @@ var ReactDOMButton = ReactCompositeComponent.createClass({ module.exports = ReactDOMButton; -},{"./AutoFocusMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./keyMirror":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMComponent.js":[function(require,module,exports){ +},{"./AutoFocusMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./keyMirror":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMComponent.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -8744,7 +10690,7 @@ module.exports = ReactDOMComponent; }).call(this,require('_process')) -},{"./CSSPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSPropertyOperations.js","./DOMProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./DOMPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactBrowserEventEmitter":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./escapeTextForBrowser":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./isEventSupported":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./monitorCodeUse":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMForm.js":[function(require,module,exports){ +},{"./CSSPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSPropertyOperations.js","./DOMProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./DOMPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactBrowserEventEmitter":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./escapeTextForBrowser":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./isEventSupported":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./monitorCodeUse":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMForm.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -8794,7 +10740,7 @@ var ReactDOMForm = ReactCompositeComponent.createClass({ module.exports = ReactDOMForm; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMIDOperations.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMIDOperations.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -8981,7 +10927,7 @@ module.exports = ReactDOMIDOperations; }).call(this,require('_process')) -},{"./CSSPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSPropertyOperations.js","./DOMChildrenOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./setInnerHTML":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/setInnerHTML.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMImg.js":[function(require,module,exports){ +},{"./CSSPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSPropertyOperations.js","./DOMChildrenOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./setInnerHTML":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/setInnerHTML.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMImg.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -9029,7 +10975,7 @@ var ReactDOMImg = ReactCompositeComponent.createClass({ module.exports = ReactDOMImg; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMInput.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMInput.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -9208,7 +11154,7 @@ module.exports = ReactDOMInput; }).call(this,require('_process')) -},{"./AutoFocusMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMOption.js":[function(require,module,exports){ +},{"./AutoFocusMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMOption.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -9262,7 +11208,7 @@ module.exports = ReactDOMOption; }).call(this,require('_process')) -},{"./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelect.js":[function(require,module,exports){ +},{"./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelect.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -9446,7 +11392,7 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({ module.exports = ReactDOMSelect; -},{"./AutoFocusMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./LinkedValueUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelection.js":[function(require,module,exports){ +},{"./AutoFocusMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./LinkedValueUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelection.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -9655,7 +11601,7 @@ var ReactDOMSelection = { module.exports = ReactDOMSelection; -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./getNodeForCharacterOffset":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getNodeForCharacterOffset.js","./getTextContentAccessor":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMTextarea.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./getNodeForCharacterOffset":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getNodeForCharacterOffset.js","./getTextContentAccessor":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMTextarea.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -9797,7 +11743,7 @@ module.exports = ReactDOMTextarea; }).call(this,require('_process')) -},{"./AutoFocusMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultBatchingStrategy.js":[function(require,module,exports){ +},{"./AutoFocusMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactDOM":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOM.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultBatchingStrategy.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -9870,7 +11816,7 @@ var ReactDefaultBatchingStrategy = { module.exports = ReactDefaultBatchingStrategy; -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./Transaction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultInjection.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./Transaction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultInjection.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -10000,7 +11946,7 @@ module.exports = { }).call(this,require('_process')) -},{"./BeforeInputEventPlugin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/BeforeInputEventPlugin.js","./ChangeEventPlugin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ChangeEventPlugin.js","./ClientReactRootIndex":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ClientReactRootIndex.js","./CompositionEventPlugin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CompositionEventPlugin.js","./DefaultEventPluginOrder":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DefaultEventPluginOrder.js","./EnterLeaveEventPlugin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EnterLeaveEventPlugin.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./HTMLDOMPropertyConfig":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/HTMLDOMPropertyConfig.js","./MobileSafariClickEventPlugin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/MobileSafariClickEventPlugin.js","./ReactBrowserComponentMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactComponentBrowserEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMButton":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMButton.js","./ReactDOMComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMComponent.js","./ReactDOMForm":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMForm.js","./ReactDOMImg":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMImg.js","./ReactDOMInput":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMInput.js","./ReactDOMOption":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMOption.js","./ReactDOMSelect":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelect.js","./ReactDOMTextarea":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMTextarea.js","./ReactDefaultBatchingStrategy":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactDefaultPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerf.js","./ReactEventListener":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventListener.js","./ReactInjection":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInjection.js","./ReactInstanceHandles":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./SVGDOMPropertyConfig":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SVGDOMPropertyConfig.js","./SelectEventPlugin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SelectEventPlugin.js","./ServerReactRootIndex":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ServerReactRootIndex.js","./SimpleEventPlugin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SimpleEventPlugin.js","./createFullPageComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/createFullPageComponent.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerf.js":[function(require,module,exports){ +},{"./BeforeInputEventPlugin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/BeforeInputEventPlugin.js","./ChangeEventPlugin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ChangeEventPlugin.js","./ClientReactRootIndex":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ClientReactRootIndex.js","./CompositionEventPlugin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CompositionEventPlugin.js","./DefaultEventPluginOrder":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DefaultEventPluginOrder.js","./EnterLeaveEventPlugin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EnterLeaveEventPlugin.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./HTMLDOMPropertyConfig":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/HTMLDOMPropertyConfig.js","./MobileSafariClickEventPlugin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/MobileSafariClickEventPlugin.js","./ReactBrowserComponentMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactComponentBrowserEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMButton":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMButton.js","./ReactDOMComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMComponent.js","./ReactDOMForm":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMForm.js","./ReactDOMImg":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMImg.js","./ReactDOMInput":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMInput.js","./ReactDOMOption":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMOption.js","./ReactDOMSelect":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelect.js","./ReactDOMTextarea":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMTextarea.js","./ReactDefaultBatchingStrategy":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactDefaultPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerf.js","./ReactEventListener":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventListener.js","./ReactInjection":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInjection.js","./ReactInstanceHandles":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./SVGDOMPropertyConfig":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SVGDOMPropertyConfig.js","./SelectEventPlugin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SelectEventPlugin.js","./ServerReactRootIndex":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ServerReactRootIndex.js","./SimpleEventPlugin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SimpleEventPlugin.js","./createFullPageComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/createFullPageComponent.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerf.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -10260,7 +12206,7 @@ var ReactDefaultPerf = { module.exports = ReactDefaultPerf; -},{"./DOMProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./ReactDefaultPerfAnalysis":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerfAnalysis.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./performanceNow":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/performanceNow.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerfAnalysis.js":[function(require,module,exports){ +},{"./DOMProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./ReactDefaultPerfAnalysis":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerfAnalysis.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./performanceNow":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/performanceNow.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerfAnalysis.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -10466,7 +12412,7 @@ var ReactDefaultPerfAnalysis = { module.exports = ReactDefaultPerfAnalysis; -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -10713,7 +12659,7 @@ module.exports = ReactElement; }).call(this,require('_process')) -},{"./ReactContext":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js":[function(require,module,exports){ +},{"./ReactContext":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElementValidator.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -10996,7 +12942,7 @@ module.exports = ReactElementValidator; }).call(this,require('_process')) -},{"./ReactCurrentOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocations.js","./monitorCodeUse":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js":[function(require,module,exports){ +},{"./ReactCurrentOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocations.js","./monitorCodeUse":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -11074,7 +13020,7 @@ module.exports = ReactEmptyComponent; }).call(this,require('_process')) -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactErrorUtils.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactErrorUtils.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -11106,7 +13052,7 @@ var ReactErrorUtils = { module.exports = ReactErrorUtils; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventEmitterMixin.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventEmitterMixin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -11156,7 +13102,7 @@ var ReactEventEmitterMixin = { module.exports = ReactEventEmitterMixin; -},{"./EventPluginHub":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventListener.js":[function(require,module,exports){ +},{"./EventPluginHub":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEventListener.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -11340,7 +13286,7 @@ var ReactEventListener = { module.exports = ReactEventListener; -},{"./EventListener":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventListener.js","./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactInstanceHandles":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./getEventTarget":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js","./getUnboundedScrollPosition":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getUnboundedScrollPosition.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInjection.js":[function(require,module,exports){ +},{"./EventListener":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventListener.js","./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactInstanceHandles":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./getEventTarget":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js","./getUnboundedScrollPosition":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getUnboundedScrollPosition.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInjection.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -11380,7 +13326,7 @@ var ReactInjection = { module.exports = ReactInjection; -},{"./DOMProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./EventPluginHub":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./ReactBrowserEventEmitter":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactEmptyComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactRootIndex":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactRootIndex.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js":[function(require,module,exports){ +},{"./DOMProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./EventPluginHub":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./ReactBrowserEventEmitter":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactEmptyComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./ReactRootIndex":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactRootIndex.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -11516,7 +13462,7 @@ var ReactInputSelection = { module.exports = ReactInputSelection; -},{"./ReactDOMSelection":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelection.js","./containsNode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/containsNode.js","./focusNode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/focusNode.js","./getActiveElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getActiveElement.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js":[function(require,module,exports){ +},{"./ReactDOMSelection":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDOMSelection.js","./containsNode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/containsNode.js","./focusNode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/focusNode.js","./getActiveElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getActiveElement.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -11852,7 +13798,7 @@ module.exports = ReactInstanceHandles; }).call(this,require('_process')) -},{"./ReactRootIndex":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactRootIndex.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js":[function(require,module,exports){ +},{"./ReactRootIndex":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactRootIndex.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -12100,7 +14046,7 @@ module.exports = ReactLegacyElementFactory; }).call(this,require('_process')) -},{"./ReactCurrentOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./monitorCodeUse":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLink.js":[function(require,module,exports){ +},{"./ReactCurrentOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./monitorCodeUse":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLink.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -12173,7 +14119,7 @@ ReactLink.PropTypes = { module.exports = ReactLink; -},{"./React":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMarkupChecksum.js":[function(require,module,exports){ +},{"./React":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMarkupChecksum.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -12221,7 +14167,7 @@ var ReactMarkupChecksum = { module.exports = ReactMarkupChecksum; -},{"./adler32":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/adler32.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js":[function(require,module,exports){ +},{"./adler32":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/adler32.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -12920,7 +14866,7 @@ module.exports = ReactMount; }).call(this,require('_process')) -},{"./DOMProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./ReactBrowserEventEmitter":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactCurrentOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactLegacyElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./containsNode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/containsNode.js","./deprecated":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js","./getReactRootElementInContainer":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getReactRootElementInContainer.js","./instantiateReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./shouldUpdateReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChild.js":[function(require,module,exports){ +},{"./DOMProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js","./ReactBrowserEventEmitter":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactCurrentOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactLegacyElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./containsNode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/containsNode.js","./deprecated":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js","./getReactRootElementInContainer":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getReactRootElementInContainer.js","./instantiateReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./shouldUpdateReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChild.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -13348,7 +15294,7 @@ var ReactMultiChild = { module.exports = ReactMultiChild; -},{"./ReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactMultiChildUpdateTypes":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./flattenChildren":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/flattenChildren.js","./instantiateReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./shouldUpdateReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChildUpdateTypes.js":[function(require,module,exports){ +},{"./ReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactMultiChildUpdateTypes":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./flattenChildren":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/flattenChildren.js","./instantiateReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./shouldUpdateReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMultiChildUpdateTypes.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -13381,7 +15327,7 @@ var ReactMultiChildUpdateTypes = keyMirror({ module.exports = ReactMultiChildUpdateTypes; -},{"./keyMirror":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactNativeComponent.js":[function(require,module,exports){ +},{"./keyMirror":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactNativeComponent.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -13455,7 +15401,7 @@ module.exports = ReactNativeComponent; }).call(this,require('_process')) -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactOwner.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactOwner.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -13612,7 +15558,7 @@ module.exports = ReactOwner; }).call(this,require('_process')) -},{"./emptyObject":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyObject.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js":[function(require,module,exports){ +},{"./emptyObject":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyObject.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -13697,7 +15643,7 @@ module.exports = ReactPerf; }).call(this,require('_process')) -},{"_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTransferer.js":[function(require,module,exports){ +},{"_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTransferer.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -13865,7 +15811,7 @@ module.exports = ReactPropTransferer; }).call(this,require('_process')) -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./joinClasses":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/joinClasses.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocationNames.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./joinClasses":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/joinClasses.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocationNames.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -13894,7 +15840,7 @@ module.exports = ReactPropTypeLocationNames; }).call(this,require('_process')) -},{"_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocations.js":[function(require,module,exports){ +},{"_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocations.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -13918,7 +15864,7 @@ var ReactPropTypeLocations = keyMirror({ module.exports = ReactPropTypeLocations; -},{"./keyMirror":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypes.js":[function(require,module,exports){ +},{"./keyMirror":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypes.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -14272,7 +16218,7 @@ function getPreciseType(propValue) { module.exports = ReactPropTypes; -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocationNames":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocationNames.js","./deprecated":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPutListenerQueue.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactPropTypeLocationNames":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTypeLocationNames.js","./deprecated":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPutListenerQueue.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -14328,7 +16274,7 @@ PooledClass.addPoolingTo(ReactPutListenerQueue); module.exports = ReactPutListenerQueue; -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactReconcileTransaction.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactReconcileTransaction.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -14504,7 +16450,7 @@ PooledClass.addPoolingTo(ReactReconcileTransaction); module.exports = ReactReconcileTransaction; -},{"./CallbackQueue":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactInputSelection":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js","./ReactPutListenerQueue":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactRootIndex.js":[function(require,module,exports){ +},{"./CallbackQueue":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactInputSelection":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js","./ReactPutListenerQueue":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactRootIndex.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -14535,7 +16481,7 @@ var ReactRootIndex = { module.exports = ReactRootIndex; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRendering.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRendering.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -14616,7 +16562,7 @@ module.exports = { }).call(this,require('_process')) -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactMarkupChecksum":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMarkupChecksum.js","./ReactServerRenderingTransaction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRenderingTransaction.js","./instantiateReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRenderingTransaction.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./ReactMarkupChecksum":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMarkupChecksum.js","./ReactServerRenderingTransaction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRenderingTransaction.js","./instantiateReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactServerRenderingTransaction.js":[function(require,module,exports){ /** * Copyright 2014, Facebook, Inc. * All rights reserved. @@ -14729,7 +16675,7 @@ PooledClass.addPoolingTo(ReactServerRenderingTransaction); module.exports = ReactServerRenderingTransaction; -},{"./CallbackQueue":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactPutListenerQueue":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactStateSetters.js":[function(require,module,exports){ +},{"./CallbackQueue":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactPutListenerQueue":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactStateSetters.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -14835,7 +16781,7 @@ ReactStateSetters.Mixin = { module.exports = ReactStateSetters; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTestUtils.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTestUtils.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -15247,7 +17193,7 @@ for (eventType in topLevelTypes) { module.exports = ReactTestUtils; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./React":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactBrowserEventEmitter":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactMount":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactTextComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./React":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactBrowserEventEmitter":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactMount":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactMount.js","./ReactTextComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -15353,7 +17299,7 @@ ReactTextComponentFactory.type = ReactTextComponent; module.exports = ReactTextComponentFactory; -},{"./DOMPropertyOperations":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./escapeTextForBrowser":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionChildMapping.js":[function(require,module,exports){ +},{"./DOMPropertyOperations":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./ReactComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponent.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./escapeTextForBrowser":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionChildMapping.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -15454,7 +17400,7 @@ var ReactTransitionChildMapping = { module.exports = ReactTransitionChildMapping; -},{"./ReactChildren":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactChildren.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionEvents.js":[function(require,module,exports){ +},{"./ReactChildren":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactChildren.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionEvents.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -15565,7 +17511,7 @@ var ReactTransitionEvents = { module.exports = ReactTransitionEvents; -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionGroup.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionGroup.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -15754,7 +17700,7 @@ var ReactTransitionGroup = React.createClass({ module.exports = ReactTransitionGroup; -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./React":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactTransitionChildMapping":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionChildMapping.js","./cloneWithProps":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/cloneWithProps.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./React":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactTransitionChildMapping":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionChildMapping.js","./cloneWithProps":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/cloneWithProps.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -16045,7 +17991,7 @@ module.exports = ReactUpdates; }).call(this,require('_process')) -},{"./CallbackQueue":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactCurrentOwner":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./Transaction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactWithAddons.js":[function(require,module,exports){ +},{"./CallbackQueue":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./ReactCurrentOwner":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCurrentOwner.js","./ReactPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPerf.js","./Transaction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactWithAddons.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -16100,7 +18046,7 @@ module.exports = React; }).call(this,require('_process')) -},{"./LinkedStateMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedStateMixin.js","./React":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactCSSTransitionGroup":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroup.js","./ReactComponentWithPureRenderMixin":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentWithPureRenderMixin.js","./ReactDefaultPerf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerf.js","./ReactTestUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTestUtils.js","./ReactTransitionGroup":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionGroup.js","./ReactUpdates":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./cloneWithProps":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/cloneWithProps.js","./cx":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/cx.js","./update":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/update.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SVGDOMPropertyConfig.js":[function(require,module,exports){ +},{"./LinkedStateMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/LinkedStateMixin.js","./React":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js","./ReactCSSTransitionGroup":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCSSTransitionGroup.js","./ReactComponentWithPureRenderMixin":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactComponentWithPureRenderMixin.js","./ReactDefaultPerf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactDefaultPerf.js","./ReactTestUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTestUtils.js","./ReactTransitionGroup":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTransitionGroup.js","./ReactUpdates":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactUpdates.js","./cloneWithProps":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/cloneWithProps.js","./cx":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/cx.js","./update":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/update.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SVGDOMPropertyConfig.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -16192,7 +18138,7 @@ var SVGDOMPropertyConfig = { module.exports = SVGDOMPropertyConfig; -},{"./DOMProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SelectEventPlugin.js":[function(require,module,exports){ +},{"./DOMProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/DOMProperty.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SelectEventPlugin.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -16387,7 +18333,7 @@ var SelectEventPlugin = { module.exports = SelectEventPlugin; -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ReactInputSelection":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js","./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./getActiveElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getActiveElement.js","./isTextInputElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextInputElement.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./shallowEqual":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/shallowEqual.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ServerReactRootIndex.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPropagators":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./ReactInputSelection":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInputSelection.js","./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./getActiveElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getActiveElement.js","./isTextInputElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextInputElement.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./shallowEqual":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/shallowEqual.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ServerReactRootIndex.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -16418,7 +18364,7 @@ var ServerReactRootIndex = { module.exports = ServerReactRootIndex; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SimpleEventPlugin.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SimpleEventPlugin.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -16847,7 +18793,7 @@ module.exports = SimpleEventPlugin; }).call(this,require('_process')) -},{"./EventConstants":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginUtils":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js","./EventPropagators":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./SyntheticClipboardEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticClipboardEvent.js","./SyntheticDragEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticDragEvent.js","./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./SyntheticFocusEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticFocusEvent.js","./SyntheticKeyboardEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticKeyboardEvent.js","./SyntheticMouseEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js","./SyntheticTouchEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticTouchEvent.js","./SyntheticUIEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./SyntheticWheelEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticWheelEvent.js","./getEventCharCode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticClipboardEvent.js":[function(require,module,exports){ +},{"./EventConstants":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventConstants.js","./EventPluginUtils":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPluginUtils.js","./EventPropagators":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/EventPropagators.js","./SyntheticClipboardEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticClipboardEvent.js","./SyntheticDragEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticDragEvent.js","./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./SyntheticFocusEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticFocusEvent.js","./SyntheticKeyboardEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticKeyboardEvent.js","./SyntheticMouseEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js","./SyntheticTouchEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticTouchEvent.js","./SyntheticUIEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./SyntheticWheelEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticWheelEvent.js","./getEventCharCode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticClipboardEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -16893,7 +18839,7 @@ SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); module.exports = SyntheticClipboardEvent; -},{"./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticCompositionEvent.js":[function(require,module,exports){ +},{"./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticCompositionEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -16939,7 +18885,7 @@ SyntheticEvent.augmentClass( module.exports = SyntheticCompositionEvent; -},{"./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticDragEvent.js":[function(require,module,exports){ +},{"./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticDragEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -16978,7 +18924,7 @@ SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); module.exports = SyntheticDragEvent; -},{"./SyntheticMouseEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js":[function(require,module,exports){ +},{"./SyntheticMouseEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17136,7 +19082,7 @@ PooledClass.addPoolingTo(SyntheticEvent, PooledClass.threeArgumentPooler); module.exports = SyntheticEvent; -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","./getEventTarget":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticFocusEvent.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./PooledClass":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/PooledClass.js","./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","./getEventTarget":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticFocusEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17175,7 +19121,7 @@ SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); module.exports = SyntheticFocusEvent; -},{"./SyntheticUIEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticInputEvent.js":[function(require,module,exports){ +},{"./SyntheticUIEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticInputEvent.js":[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * All rights reserved. @@ -17222,7 +19168,7 @@ SyntheticEvent.augmentClass( module.exports = SyntheticInputEvent; -},{"./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticKeyboardEvent.js":[function(require,module,exports){ +},{"./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticKeyboardEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17309,7 +19255,7 @@ SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); module.exports = SyntheticKeyboardEvent; -},{"./SyntheticUIEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./getEventCharCode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js","./getEventKey":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventKey.js","./getEventModifierState":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js":[function(require,module,exports){ +},{"./SyntheticUIEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./getEventCharCode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js","./getEventKey":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventKey.js","./getEventModifierState":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17392,7 +19338,7 @@ SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; -},{"./SyntheticUIEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./ViewportMetrics":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ViewportMetrics.js","./getEventModifierState":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticTouchEvent.js":[function(require,module,exports){ +},{"./SyntheticUIEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./ViewportMetrics":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ViewportMetrics.js","./getEventModifierState":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticTouchEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17440,7 +19386,7 @@ SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); module.exports = SyntheticTouchEvent; -},{"./SyntheticUIEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./getEventModifierState":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js":[function(require,module,exports){ +},{"./SyntheticUIEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js","./getEventModifierState":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticUIEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17502,7 +19448,7 @@ SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; -},{"./SyntheticEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticWheelEvent.js":[function(require,module,exports){ +},{"./SyntheticEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticWheelEvent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17563,7 +19509,7 @@ SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); module.exports = SyntheticWheelEvent; -},{"./SyntheticMouseEvent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js":[function(require,module,exports){ +},{"./SyntheticMouseEvent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/SyntheticMouseEvent.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Transaction.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -17805,7 +19751,7 @@ module.exports = Transaction; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ViewportMetrics.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ViewportMetrics.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17837,7 +19783,7 @@ var ViewportMetrics = { module.exports = ViewportMetrics; -},{"./getUnboundedScrollPosition":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getUnboundedScrollPosition.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js":[function(require,module,exports){ +},{"./getUnboundedScrollPosition":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getUnboundedScrollPosition.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/accumulateInto.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -17904,7 +19850,7 @@ module.exports = accumulateInto; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/adler32.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/adler32.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17938,7 +19884,7 @@ function adler32(data) { module.exports = adler32; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelize.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelize.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -17970,7 +19916,7 @@ function camelize(string) { module.exports = camelize; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelizeStyleName.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelizeStyleName.js":[function(require,module,exports){ /** * Copyright 2014, Facebook, Inc. * All rights reserved. @@ -18012,7 +19958,7 @@ function camelizeStyleName(string) { module.exports = camelizeStyleName; -},{"./camelize":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelize.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/cloneWithProps.js":[function(require,module,exports){ +},{"./camelize":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/camelize.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/cloneWithProps.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -18072,7 +20018,7 @@ module.exports = cloneWithProps; }).call(this,require('_process')) -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactPropTransferer":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTransferer.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/containsNode.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactPropTransferer":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactPropTransferer.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/containsNode.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18116,7 +20062,7 @@ function containsNode(outerNode, innerNode) { module.exports = containsNode; -},{"./isTextNode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextNode.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/createArrayFrom.js":[function(require,module,exports){ +},{"./isTextNode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextNode.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/createArrayFrom.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18202,7 +20148,7 @@ function createArrayFrom(obj) { module.exports = createArrayFrom; -},{"./toArray":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/toArray.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/createFullPageComponent.js":[function(require,module,exports){ +},{"./toArray":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/toArray.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/createFullPageComponent.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -18264,7 +20210,7 @@ module.exports = createFullPageComponent; }).call(this,require('_process')) -},{"./ReactCompositeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/createNodesFromMarkup.js":[function(require,module,exports){ +},{"./ReactCompositeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactCompositeComponent.js","./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/createNodesFromMarkup.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -18355,7 +20301,7 @@ module.exports = createNodesFromMarkup; }).call(this,require('_process')) -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./createArrayFrom":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/createArrayFrom.js","./getMarkupWrap":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getMarkupWrap.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/cx.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./createArrayFrom":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/createArrayFrom.js","./getMarkupWrap":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getMarkupWrap.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/cx.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18394,7 +20340,7 @@ function cx(classNames) { module.exports = cx; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/dangerousStyleValue.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/dangerousStyleValue.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18452,7 +20398,7 @@ function dangerousStyleValue(name, value) { module.exports = dangerousStyleValue; -},{"./CSSProperty":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSProperty.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js":[function(require,module,exports){ +},{"./CSSProperty":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/CSSProperty.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/deprecated.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -18504,7 +20450,7 @@ module.exports = deprecated; }).call(this,require('_process')) -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18538,7 +20484,7 @@ emptyFunction.thatReturnsArgument = function(arg) { return arg; }; module.exports = emptyFunction; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyObject.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyObject.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -18563,7 +20509,7 @@ module.exports = emptyObject; }).call(this,require('_process')) -},{"_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js":[function(require,module,exports){ +},{"_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/escapeTextForBrowser.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18604,7 +20550,7 @@ function escapeTextForBrowser(text) { module.exports = escapeTextForBrowser; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/flattenChildren.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/flattenChildren.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -18674,7 +20620,7 @@ module.exports = flattenChildren; }).call(this,require('_process')) -},{"./ReactTextComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js","./traverseAllChildren":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/traverseAllChildren.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/focusNode.js":[function(require,module,exports){ +},{"./ReactTextComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactTextComponent.js","./traverseAllChildren":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/traverseAllChildren.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/focusNode.js":[function(require,module,exports){ /** * Copyright 2014, Facebook, Inc. * All rights reserved. @@ -18703,7 +20649,7 @@ function focusNode(node) { module.exports = focusNode; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/forEachAccumulated.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18734,7 +20680,7 @@ var forEachAccumulated = function(arr, cb, scope) { module.exports = forEachAccumulated; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getActiveElement.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getActiveElement.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18763,7 +20709,7 @@ function getActiveElement() /*?DOMElement*/ { module.exports = getActiveElement; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18815,7 +20761,7 @@ function getEventCharCode(nativeEvent) { module.exports = getEventCharCode; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventKey.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventKey.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18920,7 +20866,7 @@ function getEventKey(nativeEvent) { module.exports = getEventKey; -},{"./getEventCharCode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js":[function(require,module,exports){ +},{"./getEventCharCode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventCharCode.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventModifierState.js":[function(require,module,exports){ /** * Copyright 2013 Facebook, Inc. * All rights reserved. @@ -18967,7 +20913,7 @@ function getEventModifierState(nativeEvent) { module.exports = getEventModifierState; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getEventTarget.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -18998,7 +20944,7 @@ function getEventTarget(nativeEvent) { module.exports = getEventTarget; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getMarkupWrap.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getMarkupWrap.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -19116,7 +21062,7 @@ module.exports = getMarkupWrap; }).call(this,require('_process')) -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getNodeForCharacterOffset.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getNodeForCharacterOffset.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19191,7 +21137,7 @@ function getNodeForCharacterOffset(root, offset) { module.exports = getNodeForCharacterOffset; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getReactRootElementInContainer.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getReactRootElementInContainer.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19226,7 +21172,7 @@ function getReactRootElementInContainer(container) { module.exports = getReactRootElementInContainer; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getTextContentAccessor.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19263,7 +21209,7 @@ function getTextContentAccessor() { module.exports = getTextContentAccessor; -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/getUnboundedScrollPosition.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/getUnboundedScrollPosition.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19303,7 +21249,7 @@ function getUnboundedScrollPosition(scrollable) { module.exports = getUnboundedScrollPosition; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenate.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenate.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19336,7 +21282,7 @@ function hyphenate(string) { module.exports = hyphenate; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenateStyleName.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenateStyleName.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19377,7 +21323,7 @@ function hyphenateStyleName(string) { module.exports = hyphenateStyleName; -},{"./hyphenate":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenate.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js":[function(require,module,exports){ +},{"./hyphenate":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/hyphenate.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/instantiateReactComponent.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -19492,7 +21438,7 @@ module.exports = instantiateReactComponent; }).call(this,require('_process')) -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactEmptyComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactLegacyElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactNativeComponent":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactNativeComponent.js","./warning":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactEmptyComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactEmptyComponent.js","./ReactLegacyElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactLegacyElement.js","./ReactNativeComponent":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactNativeComponent.js","./warning":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -19550,7 +21496,7 @@ module.exports = invariant; }).call(this,require('_process')) -},{"_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js":[function(require,module,exports){ +},{"_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isEventSupported.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19615,7 +21561,7 @@ function isEventSupported(eventNameSuffix, capture) { module.exports = isEventSupported; -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isNode.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isNode.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19643,7 +21589,7 @@ function isNode(object) { module.exports = isNode; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextInputElement.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextInputElement.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19687,7 +21633,7 @@ function isTextInputElement(elem) { module.exports = isTextInputElement; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextNode.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isTextNode.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19712,7 +21658,7 @@ function isTextNode(object) { module.exports = isTextNode; -},{"./isNode":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/isNode.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/joinClasses.js":[function(require,module,exports){ +},{"./isNode":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/isNode.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/joinClasses.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19753,7 +21699,7 @@ function joinClasses(className/*, ... */) { module.exports = joinClasses; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyMirror.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -19809,7 +21755,7 @@ module.exports = keyMirror; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19845,7 +21791,7 @@ var keyOf = function(oneKeyObj) { module.exports = keyOf; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/mapObject.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/mapObject.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19898,7 +21844,7 @@ function mapObject(object, callback, context) { module.exports = mapObject; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/memoizeStringOnly.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/memoizeStringOnly.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -19932,7 +21878,7 @@ function memoizeStringOnly(callback) { module.exports = memoizeStringOnly; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/monitorCodeUse.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -19967,7 +21913,7 @@ module.exports = monitorCodeUse; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/onlyChild.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/onlyChild.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -20008,7 +21954,7 @@ module.exports = onlyChild; }).call(this,require('_process')) -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/performance.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/performance.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -20036,7 +21982,7 @@ if (ExecutionEnvironment.canUseDOM) { module.exports = performance || {}; -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/performanceNow.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/performanceNow.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -20064,7 +22010,7 @@ var performanceNow = performance.now.bind(performance); module.exports = performanceNow; -},{"./performance":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/performance.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/setInnerHTML.js":[function(require,module,exports){ +},{"./performance":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/performance.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/setInnerHTML.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -20142,7 +22088,7 @@ if (ExecutionEnvironment.canUseDOM) { module.exports = setInnerHTML; -},{"./ExecutionEnvironment":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/shallowEqual.js":[function(require,module,exports){ +},{"./ExecutionEnvironment":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ExecutionEnvironment.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/shallowEqual.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -20186,7 +22132,7 @@ function shallowEqual(objA, objB) { module.exports = shallowEqual; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/shouldUpdateReactComponent.js":[function(require,module,exports){ /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. @@ -20224,7 +22170,7 @@ function shouldUpdateReactComponent(prevElement, nextElement) { module.exports = shouldUpdateReactComponent; -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/toArray.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/toArray.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -20297,7 +22243,7 @@ module.exports = toArray; }).call(this,require('_process')) -},{"./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/traverseAllChildren.js":[function(require,module,exports){ +},{"./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/traverseAllChildren.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -20481,7 +22427,7 @@ module.exports = traverseAllChildren; }).call(this,require('_process')) -},{"./ReactElement":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/update.js":[function(require,module,exports){ +},{"./ReactElement":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/ReactInstanceHandles.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/update.js":[function(require,module,exports){ (function (process){ /** * Copyright 2013-2014, Facebook, Inc. @@ -20650,7 +22596,7 @@ module.exports = update; }).call(this,require('_process')) -},{"./Object.assign":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./invariant":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyOf":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js":[function(require,module,exports){ +},{"./Object.assign":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/Object.assign.js","./invariant":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/invariant.js","./keyOf":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/keyOf.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/warning.js":[function(require,module,exports){ (function (process){ /** * Copyright 2014, Facebook, Inc. @@ -20696,21 +22642,39 @@ module.exports = warning; }).call(this,require('_process')) -},{"./emptyFunction":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","_process":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/react.js":[function(require,module,exports){ +},{"./emptyFunction":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/emptyFunction.js","_process":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/browserify/node_modules/process/browser.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/react.js":[function(require,module,exports){ module.exports = require('./lib/React'); -},{"./lib/React":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/src/components/Carousel.js":[function(require,module,exports){ +},{"./lib/React":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/lib/React.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/components/Carousel.js":[function(require,module,exports){ /** @jsx React.DOM */ var React = require('react/addons'); var klass = require('../cssClasses'); var outerWidth = require('../dimensions').outerWidth; var has3d = require('../has3d')(); -// helper lib to do the swipe work -var Finger = require('ainojs-finger'); +var addClass = function(el, className) { + if (el.classList) + el.classList.add(className); + else + el.className += ' ' + className; +} + +var removeClass = function(el, className) { + if (el.classList) + el.classList.remove(className); + else + el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); +} + +// touch / swipe lib +var Hammer = require('hammerjs'); module.exports = React.createClass({displayName: "exports", - + + currentPosition: 0, + position: null, + touchStart: null, + propsTypes: { items: React.PropTypes.array.isRequired }, @@ -20741,14 +22705,6 @@ module.exports = React.createClass({displayName: "exports", componentWillUnmount:function() { window.removeEventListener("resize", this.updateDimensions); - - // unbinding swipe component - if (this.isSlider) { - this.finger.off('frame', this.onSwipeMove); - this.finger.off('complete', this.onSwipeEnd); - this.finger.destroy(); - } - }, componentWillReceiveProps:function (props, state) { @@ -20775,19 +22731,49 @@ module.exports = React.createClass({displayName: "exports", // the container size to adjust the responsive behaviour this.updateDimensions(); - // swipe is only applied to slider because the of the current lib - // TODO: implement the swipe behaviour for the carousel too. - if (this.isSlider) { - var finger = new Finger(this.refs.itemsWrapper.getDOMNode()); + var el = this.refs.itemList.getDOMNode(); + + var self = this; + + var handleStart = function(e) { + console.log(e.touches[0]); + self.touchStart = e.touches[0].pageX; + addClass(el, 'swiping'); + } + + var handleMove = function(e) { + var delta = e.touches[0].pageX - self.touchStart; + var position = this.currentPosition + delta; + + console.log(this.currentPosition, delta); + - // this was breaking the tests, some weird behaviour of jest - if ('on' in finger) { - finger.on('frame', this.onSwipeMove); - finger.on('complete', this.onSwipeEnd); + self.position = delta; + + this.onSwipeMove({ + position: position + }) + }.bind(this) + + var handleEnd = function(e) { + var position = self.position; + + console.log('touchend', position) + // left + if (position < 0) { + this.slideLeft(); + } else { + this.slideRight(); } - this.finger = finger; - } + self.position = null; + self.touchStart = null; + removeClass(el, 'swiping'); + }.bind(this) + + el.addEventListener('touchstart', handleStart); + el.addEventListener('touchmove', handleMove); + el.addEventListener('touchend', handleEnd); }, updateDimensions:function () { @@ -20880,6 +22866,7 @@ module.exports = React.createClass({displayName: "exports", // if it's not a slider, we don't need to set position here selectedItem: this.isSlider ? position : this.state.selectedItem }); + this.triggerOnChange(position); }, @@ -20979,6 +22966,8 @@ module.exports = React.createClass({displayName: "exports", } } + this.currentPosition = this.getNextPosition(); + itemListStyles.width = this.itemSize * total; var itemListProps = { @@ -21007,7 +22996,7 @@ module.exports = React.createClass({displayName: "exports", }); -},{"../cssClasses":"/home/leandro/Documents/dev/react-responsive-carousel/src/cssClasses.js","../dimensions":"/home/leandro/Documents/dev/react-responsive-carousel/src/dimensions.js","../has3d":"/home/leandro/Documents/dev/react-responsive-carousel/src/has3d.js","ainojs-finger":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/ainojs-finger/index.js","react/addons":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/addons.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/src/components/ImageGallery.js":[function(require,module,exports){ +},{"../cssClasses":"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/cssClasses.js","../dimensions":"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/dimensions.js","../has3d":"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/has3d.js","hammerjs":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/hammerjs/hammer.js","react/addons":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/addons.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/components/ImageGallery.js":[function(require,module,exports){ /** @jsx React.DOM */ var React = require('react/addons'); var Carousel = require('./Carousel'); @@ -21045,7 +23034,7 @@ module.exports = React.createClass({displayName: "exports", }); -},{"./Carousel":"/home/leandro/Documents/dev/react-responsive-carousel/src/components/Carousel.js","react/addons":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/addons.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/src/cssClasses.js":[function(require,module,exports){ +},{"./Carousel":"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/components/Carousel.js","react/addons":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/addons.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/cssClasses.js":[function(require,module,exports){ var React = require('react/addons'); var classSet = React.addons.classSet; @@ -21100,7 +23089,7 @@ module.exports = { }) } } -},{"react/addons":"/home/leandro/Documents/dev/react-responsive-carousel/node_modules/react/addons.js"}],"/home/leandro/Documents/dev/react-responsive-carousel/src/dimensions.js":[function(require,module,exports){ +},{"react/addons":"/Users/leandrowd/Documents/dev/react-responsive-carousel/node_modules/react/addons.js"}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/dimensions.js":[function(require,module,exports){ module.exports = { outerWidth: function(el) { var width = el.offsetWidth; @@ -21110,7 +23099,7 @@ module.exports = { return width; } } -},{}],"/home/leandro/Documents/dev/react-responsive-carousel/src/has3d.js":[function(require,module,exports){ +},{}],"/Users/leandrowd/Documents/dev/react-responsive-carousel/src/has3d.js":[function(require,module,exports){ module.exports = function has3d() { if (!window.getComputedStyle) { return false; @@ -21141,4 +23130,4 @@ module.exports = function has3d() { return (has3d !== undefined && has3d.length > 0 && has3d !== "none"); } },{}]},{},["./src/main.js"]) -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvbWFpbi5qcyIsIm5vZGVfbW9kdWxlcy9haW5vanMtZmluZ2VyL2luZGV4LmpzIiwibm9kZV9tb2R1bGVzL2Fpbm9qcy1maW5nZXIvbm9kZV9tb2R1bGVzL2Fpbm9qcy1kaW1lbnNpb25zL2luZGV4LmpzIiwibm9kZV9tb2R1bGVzL2Fpbm9qcy1maW5nZXIvbm9kZV9tb2R1bGVzL2Fpbm9qcy1ldmVudHMvaW5kZXguanMiLCJub2RlX21vZHVsZXMvYWlub2p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50cy9JbWFnZUdhbGxlcnknKTtcbnZhciBDYXJvdXNlbCA9IHJlcXVpcmUoJy4vY29tcG9uZW50cy9DYXJvdXNlbCcpO1xuXG52YXIgZ2FsbGVyeUltYWdlcyA9IFtcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vNzAwLzI1MC9zcG9ydHMvMVwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vNzAwLzI1MC9zcG9ydHMvMlwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vNzAwLzI1MC9zcG9ydHMvM1wifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vNzAwLzI1MC9zcG9ydHMvNFwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vNzAwLzI1MC9zcG9ydHMvNVwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vNzAwLzI1MC9zcG9ydHMvNlwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vNzAwLzI1MC9zcG9ydHMvN1wifVxuXTtcblxudmFyIHNsaWRlckltYWdlcyA9IFtcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vOTYwLzQwMC9uYXR1cmUvMVwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vOTYwLzQwMC9uYXR1cmUvMlwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vOTYwLzQwMC9uYXR1cmUvM1wifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vOTYwLzQwMC9uYXR1cmUvNFwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vOTYwLzQwMC9uYXR1cmUvNVwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1waXhlbC5jb20vOTYwLzQwMC9uYXR1cmUvNlwifSxcblx0e3VybDogXCJodHRwOi8vbG9yZW1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ICAgICB2YXIgaGlkZGVuRGl2ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChcImRpdlwiKTtcbiAgICAgICAgdmFyIG9ic2VydmVyID0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHF1ZXVlTGlzdCA9IHF1ZXVlLnNsaWNlKCk7XG4gICAgICAgICAgICBxdWV1ZS5sZW5ndGggPSAwO1xuICAgICAgICAgICAgcXVldWVMaXN0LmZvckVhY2goZnVuY3Rpb24gKGZuKSB7XG4gICAgICAgICAgICAgICAgZm4oKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICBvYnNlcnZlci5vYnNlcnZlKGhpZGRlbkRpdiwgeyBhdHRyaWJ1dGVzOiB0cnVlIH0pO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiBuZXh0VGljayhmbikge1xuICAgICAgICAgICAgaWYgKCFxdWV1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBoaWRkZW5EaXYuc2V0QXR0cmlidXRlKCd5ZXMnLCAnbm8nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHF1ZXVlLnB1c2goZm4pO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIGlmIChjYW5Qb3N0KSB7XG4gICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdtZXNzYWdlJywgZnVuY3Rpb24gKGV2KSB7XG4gICAgICAgICAgICB2YXIgc291cmNlID0gZXYuc291cmNlO1xuICAgICAgICAgICAgaWYgKChzb3VyY2UgPT09IHdpbmRvdyB8fCBzb3VyY2UgPT09IG51bGwpICYmIGV2LmRhdGEgPT09ICdwcm9jZXNzLXRpY2snKSB7XG4gICAgICAgICAgICAgICAgZXYuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAg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B0aGV5IHdhbnRcbiAqICAgIHRvIGV4dHJhY3QgYW55IHN5bnRoZXRpYyBldmVudHMuXG4gKlxuICogIC0gVGhlIGBFdmVudFBsdWdpbkh1YmAgd2lsbCB0aGVuIHByb2Nlc3MgZWFjaCBldmVudCBieSBhbm5vdGF0aW5nIHRoZW0gd2l0aFxuICogICAgXCJkaXNwYXRjaGVzXCIsIGEgc2VxdWVuY2Ugb2YgbGlzdGVuZXJzIGFuZCBJRHMgdGhhdCBjYXJlIGFib3V0IHRoYXQgZXZlbnQuXG4gKlxuICogIC0gVGhlIGBFdmVudFBsdWdpbkh1YmAgdGhlbiBkaXNwYXRjaGVzIHRoZSBldmVudHMuXG4gKlxuICogT3ZlcnZpZXcgb2YgUmVhY3QgYW5kIHRoZSBldmVudCBzeXN0ZW06XG4gKlxuICogKy0tLS0tLS0tLS0tLSsgICAgLlxuICogfCAgICBET00gICAgIHwgICAgLlxuICogKy0tLS0tLS0tLS0tLSsgICAgLlxuICogICAgICAgfCAgICAgICAgICAgLlxuICogICAgICAgdiAgICAgICAgICAgLlxuICogKy0tLS0tLS0tLS0tLSsgICAgLlxuICogfCBSZWFjdEV2ZW50IHwgICAgLlxuICogfCAgTGlzdGVuZXIgIHwgICAgLlxuICogKy0tLS0tLS0tLS0tLSsgICAgLiAgICAgICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0rXG4gKiAgICAgICB8ICAgICAgICAgICAuICAgICAgICAgICAgICAgKy0tLS0tLS0tK3xTaW1wbGVFdmVudHxcbiAqICAgICAgIHwgICAgICAgICAgIC4gICAgICAgICAgICAgICB8ICAgICAgICAgfFBsdWdpbiAgICAgfFxuICogKy0tLS0tfC0tLS0tLSsgICAgLiAgICAgICAgICAgICAgIHYgICAgICAgICArLS0tLS0tLS0tLS0rXG4gKiB8ICAgICB8ICAgICAgfCAgICAuICAgICstLS0tLS0tLS0tLS0tLSsgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0rXG4gKiB8ICAgICArLS0tLS0tLS0tLS0uLS0tPnxFdmVudFBsdWdpbkh1YnwgICAgICAgICAgICAgICAgICAgIHwgICAgRXZlbnQgICB8XG4gKiB8ICAgICAgICAgICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgICstLS0tLS0tLS0tLSsgIHwgUHJvcGFnYXRvcnN8XG4gKiB8IFJlYWN0RXZlbnQgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgIHxUYXBFdmVudCAgIHwgIHwtLS0tLS0tLS0tLS18XG4gKiB8ICBFbWl0dGVyICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHw8LS0tK3xQbHVnaW4gICAgIHwgIHxvdGhlciBwbHVnaW58XG4gKiB8ICAgICAgICAgICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgICstLS0tLS0tLS0tLSsgIHwgIHV0aWxpdGllcyB8XG4gKiB8ICAgICArLS0tLS0tLS0tLS0uLS0tPnwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0rXG4gKiB8ICAgICB8ICAgICAgfCAgICAuICAgICstLS0tLS0tLS0tLS0tLStcbiAqICstLS0tLXwtLS0tLS0rICAgIC4gICAgICAgICAgICAgICAgXiAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogICAgICAgfCAgICAgICAgICAgLiAgICAgICAgICAgICAgICB8ICAgICAgICB8RW50ZXIvTGVhdmV8XG4gKiAgICAgICArICAgICAgICAgICAuICAgICAgICAgICAgICAgICstLS0tLS0tK3xQbHVnaW4gICAgIHxcbiAqICstLS0tLS0tLS0tLS0tKyAgIC4gICAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogfCBhcHBsaWNhdGlvbiB8ICAgLlxuICogfC0tLS0tLS0tLS0tLS18ICAgLlxuICogfCAgICAgICAgICAgICB8ICAgLlxuICogfCAgICAgICAgICAgICB8ICAgLlxuICogKy0tLS0tLS0tLS0tLS0rICAgLlxuICogICAg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0gZGVwZW5kZW5jaWVzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgdmFyIGRlcGVuZGVuY3kgPSBkZXBlbmRlbmNpZXNbaV07XG4gICAgICBpZiAoIShcbiAgICAgICAgICAgIGlzTGlzdGVuaW5nLmhhc093blByb3BlcnR5KGRlcGVuZGVuY3kpICYmXG4gICAgICAgICAgICBpc0xpc3RlbmluZ1tkZXBlbmRlbmN5XVxuICAgICAgICAgICkpIHtcbiAgICAgICAgaWYgKGRlcGVuZGVuY3kgPT09IHRvcExldmVsVHlwZXMudG9wV2hlZWwpIHtcbiAgICAgICAgICBpZiAoaXNFdmVudFN1cHBvcnRlZCgnd2hlZWwnKSkge1xuICAgICAgICAgICAgUmVhY3RCcm93c2VyRXZlbnRFbWl0dGVyLlJlYWN0RXZlbnRMaXN0ZW5lci50cmFwQnViYmxlZEV2ZW50KFxuICAgICAgICAgICAgICB0b3BMZXZlbFR5cGVzLnRvcFdoZWVsLFxuICAgICAgICAgICAgICAnd2hlZWwnLFxuICAgICAgICAgICAgICBtb3VudEF0XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0gZWxzZSBpZiAoaXNFdmVudFN1cHBvcnRlZCgnbW91c2V3aGVlbCcpKSB7XG4gICAgICAgICAgICBSZWFjdEJyb3dzZXJFdmVudEVtaXR0ZXIuUmVhY3RFdmVudExpc3RlbmVyLnRyYXBCdWJibGVkRXZlbnQoXG4gICAgICAgICAgICAgIHRvcExldmVsVHlwZXMudG9wV2hlZWwsXG4gICAgICAgICAgICAgICdtb3VzZXdoZWVsJyxcbiAgICAgICAgICAgICAgbW91bnRBdFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gRmlyZWZveCBuZWVkcyB0byBjYXB0dXJlIGEgZGlmZmVyZW50IG1vdXNlIHNjcm9sbCBldmVudC5cbiAgICAgICAgICAgIC8vIEBzZWUgaHR0cDovL3d3dy5xdWlya3Ntb2RlLm9yZy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AgICAgICAgUmVhY3RPd25lci5hZGRDb21wb25lbnRBc1JlZlRvKFxuICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgIG5leHRFbGVtZW50LnJlZixcbiAgICAgICAgICAgIG5leHRFbGVtZW50Ll9vd25lclxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogTW91bnRzIHRoaXMgY29tcG9uZW50IGFuZCBpbnNlcnRzIGl0IGludG8gdGhlIERPTS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSByb290SUQgRE9NIElEIG9mIHRoZSByb290IG5vZGUuXG4gICAgICogQHBhcmFtIHtET01FbGVtZW50fSBjb250YWluZXIgRE9NIGVsZW1lbnQgdG8gbW91bnQgaW50by5cbiAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IHNob3VsZFJldXNlTWFya3VwIElmIHRydWUsIGRvIG5vdCBpbnNlcnQgbWFya3VwXG4gICAgICogQGZpbmFsXG4gICAgICogQGludGVybmFsXG4gICAgICogQHNlZSB7UmVhY3RNb3VudC5yZW5kZXJ9XG4gICAgICovXG4gICAgbW91bnRDb21wb25lbnRJbnRvTm9kZTogZnVuY3Rpb24ocm9vdElELCBjb250YWluZXIsIHNob3VsZFJldXNlTWFya3VwKSB7XG4gICAgICB2YXIgdHJhbnNhY3Rpb24gPSBSZWFjdFVwZGF0ZXMuUmVhY3RSZWNvbmNpbGVUcmFuc2FjdGlvbi5nZXRQb29sZWQoKTtcbiAgICAgIHRyYW5zYWN0aW9uLnBlcmZvcm0oXG4gICAgICAgIHRoaXMuX21vdW50Q29tcG9uZW50SW50b05vZGUsXG4gICAgICAgIHRoaXMsXG4gICAgICAgIHJvb3RJRCxcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICB0cmFuc2FjdGlvbixcbiAgICAgICAgc2hvdWxkUmV1c2VNYXJrdXBcbiAgICAgICk7XG4gICAgICBSZWFjdFVwZGF0ZX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1JlYWN0Q29tcG9uZW50QnJvd3NlckVudmlyb25tZW50JyxcbiAgICAnbW91bnRJbWFnZUludG9Ob2RlJyxcbiAgICBmdW5jdGlvbihtYXJrdXAsIGNvbnRhaW5lciwgc2hvdWxkUmV1c2VNYXJrdXApIHtcbiAgICAgIChcInByb2R1Y3Rpb25cIiAhPT0gcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPyBpbnZhcmlhbnQoXG4gICAgICAgIGNvbnRhaW5lciAmJiAoXG4gICAgICAgICAgY29udGFpbmVyLm5vZGVUeXBlID09PSBFTEVNRU5UX05PREVfVFlQRSB8fFxuICAgICAgICAgICAgY29udGFpbmVyLm5vZGVUeXBlID09PSBET0NfTk9ERV9UWVBFXG4gICAgICAgICksXG4gICAgICAgICdtb3VudENvbXBvbmVudEludG9Ob2RlKC4uLik6IFRhcmdldCBjb250YWluZXIgaXMgbm90IHZhbGlkLidcbiAgICAgICkgOiBpbnZhcmlhbnQoY29udGFpbmVyICYmIChcbiAgICAgICAgY29udGFpbmVyLm5vZGVUeXBlID09PSBFTEVNRU5UX05PREVfVFlQRSB8fFxuICAgICAgICAgIGNvbnRhaW5lci5ub2RlVHlwZSA9PT0gRE9DX05PREVfVFlQRVxuICAgICAgKSkpO1xuXG4gICAgICBpZiAoc2hvdWxkUmV1c2VNYXJrdXApIHtcbiAgICAgICAgaWYgKFJlYWN0TWFya3VwQ2hlY2tzdW0uY2FuUmV1c2VNYXJrdXAoXG4gICAgICAgICAgbWFya3VwLFxuICAgICAgICAgIGdldFJlYWN0Um9vdEVsZW1lbnRJbkNvbnRhaW5lcihjb250YWluZXIpKSkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAoXCJwcm9kdWN0aW9uXCIgIT09IHByb2Nlc3MuZW52Lk5PREVfRU5WID8gaW52YXJpYW50KFxuICAgICAgICAgICAgY29udGFpbmVyLm5vZGVUeXBlICE9PSBET0NfTk9ERV9UWVBFLFxuICAgIC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ICAgcHJvdG8uX19yZWFjdEF1dG9CaW5kTWFwID0ge307XG4gICAgICAgIH1cbiAgICAgICAgcHJvdG8uX19yZWFjdEF1dG9CaW5kTWFwW25hbWVdID0gcHJvcGVydHk7XG4gICAgICAgIHByb3RvW25hbWVdID0gcHJvcGVydHk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoaXNBbHJlYWR5RGVmaW5lZCkge1xuICAgICAgICAgIHZhciBzcGVjUG9saWN5ID0gUmVhY3RDb21wb3NpdGVDb21wb25lbnRJbnRlcmZhY2VbbmFtZV07XG5cbiAgICAgICAgICAvLyBUaGVzZSBjYXNlcyBzaG91bGQgYWxyZWFkeSBiZSBjYXVnaHQgYnkgdmFsaWRhdGVNZXRob2RPdmVycmlkZVxuICAgICAgICAgIChcInByb2R1Y3Rpb25cIiAhPT0gcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPyBpbnZhcmlhbnQoXG4gICAgICAgICAgICBpc0NvbXBvc2l0ZUNvbXBvbmVudE1ldGhvZCAmJiAoXG4gICAgICAgICAgICAgIHNwZWNQb2xpY3kgPT09IFNwZWNQb2xpY3kuREVGSU5FX01BTllfTUVSR0VEIHx8XG4gICAgICAgICAgICAgIHNwZWNQb2xpY3kgPT09IFNwZWNQb2xpY3kuREVGSU5FX01BTllcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICAnUmVhY3RDb21wb3NpdGVDb21wb25lbnQ6IFVuZXhwZWN0ZWQgc3BlYyBwb2xpY3kgJXMgZm9yIGtleSAlcyAnICtcbiAgICAgICAgICAgICd3aGVuIG1peGluZyBpbiBjb21wb25lbnQgc3BlY3MuJyxcbiAgICAgICAgICAgIHNwZWNQb2xpY3ksXG4gICAgICAgICAgICBuYW1lXG4gICAgICAgICAgKSA6IGludmFyaWFudChpc0NvbXBvc2l0ZUNvbXBvbmVudE1ldGhvZCAmJiAoXG4gICAgICAgICAgICBzcGVjUG9saWN5ID09PSBTcGVjUG9saWN5LkRFRklORV9NQU5ZX01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ZXM7XG4gICAgaWYgKGNvbnRleHRUeXBlcykge1xuICAgICAgbWFza2VkQ29udGV4dCA9IHt9O1xuICAgICAgZm9yICh2YXIgY29udGV4dE5hbWUgaW4gY29udGV4dFR5cGVzKSB7XG4gICAgICAgIG1hc2tlZENvbnRleHRbY29udGV4dE5hbWVdID0gY29udGV4dFtjb250ZXh0TmFtZV07XG4gICAgICB9XG4gICAgICBpZiAoXCJwcm9kdWN0aW9uXCIgIT09IHByb2Nlc3MuZW52Lk5PREVfRU5WKSB7XG4gICAgICAgIHRoaXMuX2NoZWNrUHJvcFR5cGVzKFxuICAgICAgICAgIGNvbnRleHRUeXBlcyxcbiAgICAgICAgICBtYXNrZWRDb250ZXh0LFxuICAgICAgICAgIFJlYWN0UHJvcFR5cGVMb2NhdGlvbnMuY29udGV4dFxuICAgICAgICApO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gbWFza2VkQ29udGV4dDtcbiAgfSxcblxuICAvKipcbiAgICogQHBhcmFtIHtvYmplY3R9IGN1cnJlbnRDb250ZXh0XG4gICAqIEByZXR1cm4ge29iamVjdH1cbiAgICogQHByaXZhdGVcbiAgICovXG4gIF9wcm9jZXNzQ2hpbGRDb250ZXh0OiBmdW5jdGlvbihjdXJyZW50Q29udGV4dCkge1xuICAgIHZhciBjaGlsZENvbnRleHQgPSB0aGlzLmdldENoaWxkQ29udGV4dCAmJiB0aGlzLmdldENoaWxkQ29udGV4dCgpO1xuICAgIHZhciBkaXNwbGF5TmFtZSA9IHRoaXMuY29uc3RydWN0b3IuZGlzcGxheU5hbWUgfHwgJ1JlYWN0Q29tcG9zaXRlQ29tcG9uZW50JztcbiAgICBpZiAoY2hpbGRDb250ZXh0KSB7XG4gICAgICAoXCJwcm9kdWN0aW9uXCIgIT09IHByb2Nlc3MuZW52Lk5PREVfRU5WID8gaW52YXJpYW50KFxuICAgICAgICB0eXBlb2YgdGhpcy5jb25zdHJ1Y3Rvci5jaGlsZENvbnRleHRUeXBlcyA9PT0gJ29iamVjdCcsXG4gICAgICAgICclcy5nZXRDaGlsZENvbnRleHQoKTogY2hpbGRDb250ZXh0VHlwZXMgbXVzdCBiZSBkZWZpbmVkIGluIG9yZGVyIHRvICcgK1xuICAgICAgICAndXNlIGdldENoaWxkQ29udGV4dCgpLicsXG4gICAgICAgIGRpc3BsYXlOYW1lXG4gICAgICApIDogaW52YXJpYW50KHR5cGVvZiB0aGlzLmNvbnN0cnVjdG9yLmNoaWxkQ29udGV4dFR5cGVzID09PSAnb2JqZWN0JykpO1xuICAgICAgaWYgKFwicHJvZHVjdGlvblwiICE9PSBwcm9jZXNzLmVudi5OT0RFX0VOVikge1xuICAgICAgICB0aGlzLl9jaGVja1Byb3BUeXBlcyhcbiAgICAgICAgICB0aGlzLmNvbnN0cnVjdG9yLmNoaWxkQ29udGV4dFR5cGVzLFxuICAgICAgICAgIGNoaWxkQ29udGV4dCxcbiAgICAgICAgICBSZWFjdFByb3BUeXBlTG9jYXRpb25zLmNoaWxkQ29udGV4dFxuICAgICAgICApO1xuICAgICAgfVxuICAgICAgZm9yICh2YXIgbmFtZSBpbiBjaGlsZENvbnRleHQpIHtcbiAgICAgICAgKFwicHJvZHVjdGlvblwiICE9PSBwcm9jZXNzLmVudi5OT0RFX0VOViA/IGludmFyaWFudChcbiAgICAgICAgICBuYW1lIGluIHRoaXMuY29uc3RydWN0b3IuY2hpbGRDb250ZXh0VHlwZXMsXG4gICAgICAgICAgJyVzLmdldENoaWxkQ29udGV4dCgpOiBrZXkgXCIlc1wiIGlzIG5vdCBkZWZpbmVkIGluIGNoaWxkQ29udGV4dFR5cGVzLicsXG4gICAgICAgICAgZGlzcGxheU5hbWUsXG4gICAgICAgICAgbmFtZVxuICAgICAgICApIDogaW52YXJpYW50KG5hbWUgaW4gdGhpcy5jb25zdHJ1Y3Rvci5jaGlsZENvbnRleHRUeXBlcykpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGFzc2lnbih7fSwgY3VycmVudENvbnRleHQsIGNoaWx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cmV2Q29tcG9uZW50SW5zdGFuY2UuX2N1cnJlbnRFbGVtZW50O1xuICAgICAgdmFyIG5leHRFbGVtZW50ID0gdGhpcy5fcmVuZGVyVmFsaWRhdGVkQ29tcG9uZW50KCk7XG4gICAgICBpZiAoc2hvdWxkVXBkYXRlUmVhY3RDb21wb25lbnQocHJldkVsZW1lbnQsIG5leHRFbGVtZW50KSkge1xuICAgICAgICBwcmV2Q29tcG9uZW50SW5zdGFuY2UucmVjZWl2ZUNvbXBvbmVudChuZXh0RWxlbWVudCwgdHJhbnNhY3Rpb24pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gVGhlc2UgdHdvIElEcyBhcmUgYWN0dWFsbHkgdGhlIHNhbWUhIEJ1dCBub3RoaW5nIHNob3VsZCByZWx5IG9uIHRoYXQuXG4gICAgICAgIHZhciB0aGlzSUQgPSB0aGlzLl9yb290Tm9kZUlEO1xuICAgICAgICB2YXIgcHJldkNvbXBvbmVudElEID0gcHJldkNvbXBvbmVudEluc3RhbmNlLl9yb290Tm9kZUlEO1xuICAgICAgICBwcmV2Q29tcG9uZW50SW5zdGFuY2UudW5tb3VudENvbXBvbmVudCgpO1xuICAgICAgICB0aGlzLl9yZW5kZXJlZENvbXBvbmVudCA9IGluc3RhbnRpYXRlUmVhY3RDb21wb25lbnQoXG4gICAgICAgICAgbmV4dEVsZW1lbnQsXG4gICAgICAgICAgdGhpcy5fY3VycmVudEVsZW1lbnQudHlwZVxuICAgICAgICApO1xuICAgICAgICB2YXIgbmV4dE1hcmt1cCA9IHRoaXMuX3JlbmRlcmVkQ29tcG9uZW50Lm1vdW50Q29tcG9uZW50KFxuICAgICAgICAgIHRoaXNJRCxcbiAgICAgICAgICB0cmFuc2FjdGlvbixcbiAgICAgICAgICB0aGlzLl9tb3VudERlcHRoICsgMVxuICAgICAgICApO1xuICAgICAgICBSZWFjdENvbXBvbmVudC5CYWNrZW5kSURPcGVyYXRpb25zLmRhbmdlcm91c2x5UmVwbGFjZU5v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YXN0U3R5bGUuaGFzT3duUHJvcGVydHkoc3R5bGVOYW1lKSkge1xuICAgICAgICAgICAgc3R5bGVVcGRhdGVzID0gc3R5bGVVcGRhdGVzIHx8IHt9O1xuICAgICAgICAgICAgc3R5bGVVcGRhdGVzW3N0eWxlTmFtZV0gPSAnJztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAocmVnaXN0cmF0aW9uTmFtZU1vZHVsZXMuaGFzT3duUHJvcGVydHkocHJvcEtleSkpIHtcbiAgICAgICAgZGVsZXRlTGlzdGVuZXIodGhpcy5fcm9vdE5vZGVJRCwgcHJvcEtleSk7XG4gICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAgIERPTVByb3BlcnR5LmlzU3RhbmRhcmROYW1lW3Byb3BLZXldIHx8XG4gICAgICAgICAgRE9NUHJvcGVydHkuaXNDdXN0b21BdHRyaWJ1dGUocHJvcEtleSkpIHtcbiAgICAgICAgUmVhY3RDb21wb25lbnQuQmFja2VuZElET3BlcmF0aW9ucy5kZWxldGVQcm9wZXJ0eUJ5SUQoXG4gICAgICAgICAgdGhpcy5fcm9vdE5vZGVJRCxcbiAgICAgICAgICBwcm9wS2V5XG4gICAgICAgICk7XG4gICAgICB9XG4gICAgfVxuICAgIGZvciAocHJvcEtleSBpbiBuZXh0UHJvcHMpIHtcbiAgICAgIHZhciBuZXh0UHJvcCA9IG5leHRQcm9wc1twcm9wS2V5XTtcbiAgICAgIHZhciBsYXN0UHJvcCA9IGxhc3RQcm9wc1twcm9wS2V5XTtcbiAgICAgIGlmICghbmV4dFByb3BzLmhhc093blByb3BlcnR5KHByb3BLZXkpIHx8IG5leHRQcm9wID09PSBsYXN0UHJvcCkge1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cbiAgICAgIGlmIChwcm9wS2V5ID09PSBTVFlMRSkge1xuICAgICAgICBpZiAobmV4dFByb3ApIHtcbiAgICAgICAgICBuZXh0UHJvcCA9IG5leHRQcm9wcy5z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GNvdW50czoge30sXG4gICAgICAgICAgd3JpdGVzOiB7fSxcbiAgICAgICAgICBkaXNwbGF5TmFtZXM6IHt9LFxuICAgICAgICAgIHRvdGFsVGltZTogMFxuICAgICAgICB9KTtcbiAgICAgICAgc3RhcnQgPSBwZXJmb3JtYW5jZU5vdygpO1xuICAgICAgICBydiA9IGZ1bmMuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgIFJlYWN0RGVmYXVsdFBlcmYuX2FsbE1lYXN1cmVtZW50c1tcbiAgICAgICAgICBSZWFjdERlZmF1bHRQZXJmLl9hbGxNZWFzdXJlbWVudHMubGVuZ3RoIC0gMVxuICAgICAgICBdLnRvdGFsVGltZSA9IHBlcmZvcm1hbmNlTm93KCkgLSBzdGFydDtcbiAgICAgICAgcmV0dXJuIHJ2O1xuICAgICAgfSBlbHNlIGlmIChtb2R1bGVOYW1lID09PSAnUmVhY3RET01JRE9wZXJhdGlvbnMnIHx8XG4gICAgICAgIG1vZHVsZU5hbWUgPT09ICdSZWFjdENvbXBvbmVudEJyb3dzZXJFbnZpcm9ubWVudCcpIHtcbiAgICAgICAgc3RhcnQgPSBwZXJmb3JtYW5jZU5vdygpO1xuICAgICAgICBydiA9IGZ1bmMuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgIHRvdGFsVGltZSA9IHBlcmZvcm1hbmNlTm93KCkgLSBzdGFydDtcblxuICAgICAgICBpZiAoZm5OYW1lID09PSAnbW91bnRJbWFnZUludG9Ob2RlJykge1xuICAgICAgICAgIHZhciBtb3VudElEID0gUmVhY3RNb3VudC5nZXRJRChhcmdzWzFdKTtcbiAgICAgICAgICBSZWFjdERlZmF1bHRQZXJmLl9yZWNvcmRXcml0ZShtb3VudElELCBmbk5hbWUsIHRvdGFsVGltZSwgYXJnc1swXSk7XG4gICAgICAgIH0gZWxzZSBpZiAoZm5OYW1lID09PSAnZGFuZ2Vyb3VzbHlQcm9jZXNzQ2hpbGRyZW5VcGRhdGVzJykge1xuICAgICAgICAgIC8vIHNwZWNpYWwgZm9ybWF0XG4gICAgICAgICAgYXJnc1swXS5mb3JFYWNoKGZ1bmN0aW9uKHVwZGF0ZSkge1xuICAgICAgICAgICAgdmFyIHdyaXRlQXJncyA9IHt9O1xuICAgICAgICAgICAgaWYgKHVwZGF0ZS5mcm9tSW5kZXggIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgd3JpdGVBcmdzLmZyb21JbmRleCA9IHVwZGF0ZS5mcm9tSW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodXBkYXRlLnRvSW5kZXggIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgd3JpdGVBcmdzLnRvSW5kZXggPSB1cGRhdGUudG9JbmRleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh1cGRhdGUudGV4dENvbnRlbnQgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgd3JpdGVBcmdzLnRleHRDb250ZW50ID0gdXBkYXRlLnRleHRDb250ZW50O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHVwZGF0ZS5tYXJrdXBJbmRleCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICB3cml0ZUFyZ3MubWFya3VwID0gYXJnc1sxXVt1cGRhdGUubWFya3VwSW5kZXhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgUmVhY3REZWZhdWx0UGVyZi5fcmVjb3JkV3JpdGUoXG4gICAgICAgICAgICAgIHVwZGF0ZS5wYXJlbnRJRCxcbiAgICAgICAgICAgICAgdXBkYXRlLnR5cGUsXG4gICAgICAgICAgICAgIHRvdGFsVGltZSxcbiAgICAgICAgICAgICAgd3JpdGVBcmdzXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGJhc2ljIGZvcm1hdFxuICAgICAgICAgIFJlYWN0RGVmYXVsdFBlcmYuX3JlY29yZFdyaXRlKFxuICAgICAgICAgICAgYXJnc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GFpbmVyIGNvbnRhaW5lciB0byByZW5kZXIgaW50b1xuICAgKiBAcGFyYW0gez9mdW5jdGlvbn0gY2FsbGJhY2sgZnVuY3Rpb24gdHJpZ2dlcmVkIG9uIGNvbXBsZXRpb25cbiAgICovXG4gIF91cGRhdGVSb290Q29tcG9uZW50OiBmdW5jdGlvbihcbiAgICAgIHByZXZDb21wb25lbnQsXG4gICAgICBuZXh0Q29tcG9uZW50LFxuICAgICAgY29udGFpbmVyLFxuICAgICAgY2FsbGJhY2spIHtcbiAgICB2YXIgbmV4dFByb3BzID0gbmV4dENvbXBvbmVudC5wcm9wcztcbiAgICBSZWFjdE1vdW50LnNjcm9sbE1vbml0b3IoY29udGFpbmVyLCBmdW5jdGlvbigpIHtcbiAgICAgIHByZXZDb21wb25lbnQucmVwbGFjZVByb3BzKG5leHRQcm9wcywgY2FsbGJhY2spO1xuICAgIH0pO1xuXG4gICAgaWYgKFwicHJvZHVjdGlvblwiICE9PSBwcm9jZXNzLmVudi5OT0RFX0VOVikge1xuICAgICAgLy8gUmVjb3JkIHRoZSByb290IGVsZW1lbnQgaW4gY2FzZSBpdCBsYXRlciBnZXRzIHRyYW5zcGxhbnRlZC5cbiAgICAgIHJvb3RFbGVtZW50c0J5UmVhY3RSb290SURbZ2V0UmVhY3RSb290SUQoY29udGFpbmVyKV0gPVxuICAgICAgICBnZXRSZWFjdFJvb3RFbGVtZW50SW5Db250YWluZXIoY29udGFpbmVyKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcHJldkNvbXBvbmVudDtcbiAgfSxcblxuICAvKipcbiAgICogUmVnaXN0ZXIgYSBjb21wb25lbnQgaW50byB0aGUgaW5zdGFuY2UgbWFwIGFuZCBzdGFydHMgc2Nyb2xsIHZhbHVlXG4gICAqIG1vbml0b3JpbmdcbiAgICogQHBhcmFtIHtSZWFjdENvbXBvbmVudH0gbmV4dENvbXBvbmVudCBjb21wb25lbnQgaW5zdGFuY2UgdG8gcmVuZGVyXG4gICAqIEBwYXJh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Bwcm9wcyBhbmQgc3RhdGU7IHRyaWdnZXJpbmcgbmVzdGVkIGNvbXBvbmVudCB1cGRhdGVzIGZyb20gJyArXG4gICAgICAgICdyZW5kZXIgaXMgbm90IGFsbG93ZWQuIElmIG5lY2Vzc2FyeSwgdHJpZ2dlciBuZXN0ZWQgdXBkYXRlcyBpbiAnICtcbiAgICAgICAgJ2NvbXBvbmVudERpZFVwZGF0ZS4nXG4gICAgICApIDogbnVsbCk7XG5cbiAgICAgIHZhciBjb21wb25lbnRJbnN0YW5jZSA9IGluc3RhbnRpYXRlUmVhY3RDb21wb25lbnQobmV4dENvbXBvbmVudCwgbnVsbCk7XG4gICAgICB2YXIgcmVhY3RSb290SUQgPSBSZWFjdE1vdW50Ll9yZWdpc3RlckNvbXBvbmVudChcbiAgICAgICAgY29tcG9uZW50SW5zdGFuY2UsXG4gICAgICAgIGNvbnRhaW5lclxuICAgICAgKTtcbiAgICAgIGNvbXBvbmVudEluc3RhbmNlLm1vdW50Q29tcG9uZW50SW50b05vZGUoXG4gICAgICAgIHJlYWN0Um9vdElELFxuICAgICAgICBjb250YWluZXIsXG4gICAgICAgIHNob3VsZFJldXNlTWFya3VwXG4gICAgICApO1xuXG4gICAgICBpZiAoXCJwcm9kdWN0aW9uXCIgIT09IHByb2Nlc3MuZW52Lk5PREVfRU5WKSB7XG4gICAgICAgIC8vIFJlY29yZCB0aGUgcm9vdCBlbGVtZW50IGluIGNhc2UgaXQgbGF0ZXIgZ2V0cyB0cmFuc3BsYW50ZWQuXG4gICAgICAgIHJvb3RFbGVtZW50c0J5UmVhY3RSb290SURbcmVhY3RSb290SURdID1cbiAgICAgICAgICBnZXRSZWFjdFJvb3RFbGVtZW50SW5Db250YWluZXIoY29udGFpbmVyKTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGNvbXBvbmVudEluc3RhbmNlO1xuICAgIH1cbiAgKSxcblxuICAvKipcbiAgICogUmVuZGVycyBhIFJlYWN0IGNvbXBvbmVudCBpbnRvIH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m4gUmVhY3RNb3VudC5fdXBkYXRlUm9vdENvbXBvbmVudChcbiAgICAgICAgICBwcmV2Q29tcG9uZW50LFxuICAgICAgICAgIG5leHRFbGVtZW50LFxuICAgICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgICBjYWxsYmFja1xuICAgICAgICApO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgUmVhY3RNb3VudC51bm1vdW50Q29tcG9uZW50QXROb2RlKGNvbnRhaW5lcik7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIHJlYWN0Um9vdEVsZW1lbnQgPSBnZXRSZWFjdFJvb3RFbGVtZW50SW5Db250YWluZXIoY29udGFpbmVyKTtcbiAgICB2YXIgY29udGFpbmVySGFzUmVhY3RNYXJrdXAgPVxuICAgICAgcmVhY3RSb290RWxlbWVudCAmJiBSZWFjdE1vdW50LmlzUmVuZGVyZWRCeVJlYWN0KHJlYWN0Um9vdEVsZW1lbnQpO1xuXG4gICAgdmFyIHNob3VsZFJldXNlTWFya3VwID0gY29udGFpbmVySGFzUmVhY3RNYXJrdXAgJiYgIXByZXZDb21wb25lbnQ7XG5cbiAgICB2YXIgY29tcG9uZW50ID0gUmVhY3RNb3VudC5fcmVuZGVyTmV3Um9vdENvbXBvbmVudChcbiAgICAgIG5leHRFbGVtZW50LFxuICAgICAgY29udGFpbmVyLFxuICAgICAgc2hvdWxkUmV1c2VNYXJrdXBcbiAgICApO1xuICAgIGNhbGxiYWNrICYmIGNhbGxiYWNrLmNhbGwoY29tcG9uZW50KTtcbiAgICByZXR1cm4gY29tcG9uZW50O1xuICB9LFxuXG4gIC8qKlxuICAgKiBDb25zdHJ1Y3RzIGEgY29tcG9uZW50IGluc3RhbmNlIG9mIGBjb25zdHJ1Y3RvcmAgd2l0aCBgaW5pdGlhbFByb3BzYCBhbmRcbiAgICogcmVuZGVycyBpdCBpbnRvIHRoZSBzdXBwbGllZCBgY29udGFpbmVyYC5cbiAgICpcbiAgICogQHBhcmFtIHtmdW5jd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AgICAgICAgICAgIHJvb3RJRCxcbiAgICAgICAgICAgIHRyYW5zYWN0aW9uLFxuICAgICAgICAgICAgdGhpcy5fbW91bnREZXB0aCArIDFcbiAgICAgICAgICApO1xuICAgICAgICAgIGNoaWxkSW5zdGFuY2UuX21vdW50SW5kZXggPSBpbmRleDtcbiAgICAgICAgICBtb3VudEltYWdlcy5wdXNoKG1vdW50SW1hZ2UpO1xuICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBtb3VudEltYWdlcztcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogUmVwbGFjZXMgYW55IHJlbmRlcmVkIGNoaWxkcmVuIHdpdGggYSB0ZXh0IGNvbnRlbnQgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG5leHRDb250ZW50IFN0cmluZyBvZiBjb250ZW50LlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIHVwZGF0ZVRleHRDb250ZW50OiBmdW5jdGlvbihuZXh0Q29udGVudCkge1xuICAgICAgdXBkYXRlRGVwdGgrKztcbiAgICAgIHZhciBlcnJvclRocm93biA9IHRydWU7XG4gICAgICB0cnkge1xuICAgICAgICB2YXIgcHJldkNoaWxkcmVuID0gdGhpcy5fcmVuZGVyZWRDaGlsZHJlbjtcbiAgICAgICAgLy8gUmVtb3ZlIGFueSByZW5kZXJlZCBjaGlsZHJlbi5cbiAgICAgICAgZm9yICh2YXIgbmFtZSBpbiBwcmV2Q2hpbGRyZW4pIHtcbiAgICAgICAgICBpZiAocHJldkNoaWxkcmVuLmhhc093blByb3BlcnR5KG5hbWUpKSB7XG4gICAgICAgICAgICB0aGlzLl91bm1vdW50Q2hpbGRCeU5hbWUocHJldkNoaWxkcmVuW25hbWVdLCBuYW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gU2V0IG5ldyB0ZXh0IGNvbnRlbnQuXG4gICAgICAg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bGYgd2lsbCBzdXBwbHkgb25lIGFkZGl0aW9uYWxcbiAqIGF1dG9tYXRpYyBpbnZhcmlhbnQgZm9yIHlvdSAtIHRoZSBpbnZhcmlhbnQgdGhhdCBhbnkgdHJhbnNhY3Rpb24gaW5zdGFuY2VcbiAqIHNob3VsZCBub3QgYmUgcnVuIHdoaWxlIGl0IGlzIGFscmVhZHkgYmVpbmcgcnVuLiBZb3Ugd291bGQgdHlwaWNhbGx5IGNyZWF0ZSBhXG4gKiBzaW5nbGUgaW5zdGFuY2Ugb2YgYSBgVHJhbnNhY3Rpb25gIGZvciByZXVzZSBtdWx0aXBsZSB0aW1lcywgdGhhdCBwb3RlbnRpYWxseVxuICogaXMgdXNlZCB0byB3cmFwIHNldmVyYWwgZGlmZmVyZW50IG1ldGhvZHMuIFdyYXBwZXJzIGFyZSBleHRyZW1lbHkgc2ltcGxlIC1cbiAqIHRoZXkgb25seSByZXF1aXJlIGltcGxlbWVudGluZyB0d28gbWV0aG9kcy5cbiAqXG4gKiA8cHJlPlxuICogICAgICAgICAgICAgICAgICAgICAgIHdyYXBwZXJzIChpbmplY3RlZCBhdCBjcmVhdGlvbiB0aW1lKVxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgICAgICAgICtcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tLS0tLS0tfC0tLS0tLS0tfC0tLS0tLS0tLS0tLS0tK1xuICogICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgIHYgICAgICAgIHwgICAgICAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgICAgKy0tLS0tLS0tLS0tLS0tLSsgICB8ICAgICAgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgICstLXwgICAgd3JhcHBlcjEgICB8LS0tfC0tLS0rICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICArLS0tLS0tLS0tLS0tLS0tKyAgIHYgICAgfCAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgICAgICAgICArLS0tLS0tLS0tLS0tLSsgIHwgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgICstLS0tfCAgIHdyYXBwZXIyICB8LS0tLS0tLS0rICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICB8ICAgICstLS0tLS0tLS0tLS0tKyAgfCAgICAgfCAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgICAgfCAgICAgICAgICAgICAgICAgICAgIHwgICAgIHwgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHYgICAgIHYgICAgICAgICAgICAgICAgICAgICB2ICAgICB2ICAgfCB3cmFwcGVyXG4gKiAgICAgICAgICAgICAgICAgICAgfCArLS0tKyArLS0tKyAgICstLS0tLS0tLS0rICAgKy0tLSsgKy0tLSsgfCBpbnZhcmlhbnRzXG4gKiBwZXJmb3JtKGFueU1ldGhvZCkgfCB8ICAgfCB8ICAgfCAgIHwgICAgICAgICB8ICAgfCAgIHwgfCAgIHwgfCBtYWludGFpbmVkXG4gKiArLS0tLS0tLS0tLS0tLS0tLS0+fC18LS0tfC18LS0tfC0tPnxhbnlNZXRob2R8LS0tfC0tLXwtfC0tLXwtfC0tLS0tLS0tPlxuICogICAgICAgICAgICAgICAgICAgIHwgfCAgIHwgfCAgIHwgICB8ICAgICAgICAgfCAgIHwgICB8IHwgICB8IHxcbiAqICAgICAgICAgICAgICAgICAgICB8IHwgICB8IHwgICB8ICAgfCAgICAgICAgIHwgICB8ICAgfCB8ICAgfCB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCB8ICAgfCB8ICAgfCAgIHwgICAgICAgICB8ICAgfCAgIHwgfCAgIHwgfFxuICogICAgICAgICAgICAgICAgICAgIHwgKy0tLSsgKy0tLSsgICArLS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UgPT09ICdvYmplY3QnKSB7XG4gICAgICAgIChcInByb2R1Y3Rpb25cIiAhPT0gcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPyBpbnZhcmlhbnQoXG4gICAgICAgICAgIWNoaWxkcmVuIHx8IGNoaWxkcmVuLm5vZGVUeXBlICE9PSAxLFxuICAgICAgICAgICd0cmF2ZXJzZUFsbENoaWxkcmVuKC4uLik6IEVuY291bnRlcmVkIGFuIGludmFsaWQgY2hpbGQ7IERPTSAnICtcbiAgICAgICAgICAnZWxlbWVudHMgYXJlIG5vdCB2YWxpZCBjaGlsZHJlbiBvZiBSZWFjdCBjb21wb25lbnRzLidcbiAgICAgICAgKSA6IGludmFyaWFudCghY2hpbGRyZW4gfHwgY2hpbGRyZW4ubm9kZVR5cGUgIT09IDEpKTtcbiAgICAgICAgZm9yICh2YXIga2V5IGluIGNoaWxkcmVuKSB7XG4gICAgICAgICAgaWYgKGNoaWxkcmVuLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgIG5leHROYW1lID0gKFxuICAgICAgICAgICAgICBuYW1lU29GYXIgKyAobmFtZVNvRmFyID8gU1VCU0VQQVJBVE9SIDogU0VQQVJBVE9SKSArXG4gICAgICAgICAgICAgIHdyYXBVc2VyUHJvdmlkZWRLZXkoa2V5KSArIFNVQlNFUEFSQVRPUiArXG4gICAgICAgICAgICAgIGdldENvbXBvbmVudEtleShjaGlsZHJlbltrZXldLCAwKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIG5leHRJbmRleCA9IGluZGV4U29GYXIgKyBzdWJ0cmVlQ291bnQ7XG4gICAgICAgICAgICBzdWJ0cmVlQ291bnQgKz0gdHJhdmVyc2VBbGxDaGlsZHJlbkltcGwoXG4gICAgICAgICAgICAgIGNoaWxkcmVuW2tleV0sXG4gICAgICAgICAgICAgIG5leHROYW1lLFxuICAgICAgICAgICAgICBuZXh0SW5kZXgsXG4gICAgICAgICAgICAgIGNhbGxiYWNrLFxuICAgICAgICA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ICAgICAgICBxdWV1ZS5sZW5ndGggPSAwO1xuICAgICAgICAgICAgcXVldWVMaXN0LmZvckVhY2goZnVuY3Rpb24gKGZuKSB7XG4gICAgICAgICAgICAgICAgZm4oKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICBvYnNlcnZlci5vYnNlcnZlKGhpZGRlbkRpdiwgeyBhdHRyaWJ1dGVzOiB0cnVlIH0pO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiBuZXh0VGljayhmbikge1xuICAgICAgICAgICAgaWYgKCFxdWV1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBoaWRkZW5EaXYuc2V0QXR0cmlidXRlKCd5ZXMnLCAnbm8nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHF1ZXVlLnB1c2goZm4pO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIGlmIChjYW5Qb3N0KSB7XG4gICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdtZXNzYWdlJywgZnVuY3Rpb24gKGV2KSB7XG4gICAgICAgICAgICB2YXIgc291cmNlID0gZXYuc291cmNlO1xuICAgICAgICAgICAgaWYgKChzb3VyY2UgPT09IHdpbmRvdyB8fCBzb3VyY2UgPT09IG51bGwpICYmIGV2LmRhdGEgPT09ICdwcm9jZXNzLXRpY2snKSB7XG4gICAgICAgICAgICAgICAgZXYuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZuID0gcXVldWUuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICAgICAgZm4oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHRydWUpO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiBuZXh0VGljayhmbikge1xuICAgICAgICAgICAgcXVldWUucHVzaChmbik7XG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tcclxuICAgICAgICAgICAgICAgIHN0b3JlLnB1c2goZXYpO1xyXG4gICAgICAgICAgICAgICAgc3RvcmVJbmRleCA9IHN0b3JlLmxlbmd0aCAtIDE7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9IGVsc2UgaWYgKGV2ZW50VHlwZSAmIChJTlBVVF9FTkQgfCBJTlBVVF9DQU5DRUwpKSB7XHJcbiAgICAgICAgICAgIHJlbW92ZVBvaW50ZXIgPSB0cnVlO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgLy8gaXQgbm90IGZvdW5kLCBzbyB0aGUgcG9pbnRlciBoYXNuJ3QgYmVlbiBkb3duIChzbyBpdCdzIHByb2JhYmx5IGEgaG92ZXIpXHJcbiAgICAgICAgaWYgKHN0b3JlSW5kZXggPCAwKSB7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8vIHVwZGF0ZSB0aGUgZXZlbnQgaW4gdGhlIHN0b3JlXHJcbiAgICAgICAgc3RvcmVbc3RvcmVJbmRleF0gPSBldjtcclxuXHJcbiAgICAgICAgdGhpcy5jYWxsYmFjayh0aGlzLm1hbmFnZXIsIGV2ZW50VHlwZSwge1xyXG4gICAgICAgICAgICBwb2ludGVyczogc3RvcmUsXHJcbiAgICAgICAgICAgIGNoYW5nZWRQb2ludGVyczogW2V2XSxcclxuICAgICAgICAgICAgcG9pbnRlclR5cGU6IHBvaW50ZXJUeXBlLFxyXG4gICAgICAgICAgICBzcmNFdmVudDogZXZcclxuICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgaWYgKHJlbW92ZVBvaW50ZXIpIHtcclxuICAgICAgICAgICAgLy8gcmVtb3ZlIGZyb20gdGhlIHN0b3JlXHJcbiAgICAgICAgICAgIHN0b3JlLnNwbGljZShzdG9yZUluZGV4LCAxKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0pO1xyXG5cclxudmFyIFNJTkdMRV9UT1VDSF9JTlBV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AgICAgICAgICAgICAgfFxyXG4gKiAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICB8XHJcbiAqICAgRmFpbGVkICAgICAgQ2FuY2VsbGVkICAgICAgICAgIHxcclxuICogICAgICAgICAgICAgICAgICAgICAgICAgICstLS0tLS0tKy0tLS0tLStcclxuICogICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgIHxcclxuICogICAgICAgICAgICAgICAgICAgICAgUmVjb2duaXplZCAgICAgICBCZWdhblxyXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxyXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhbmdlZFxyXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxyXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbmRlZC9SZWNvZ25pemVkXHJcbiAqL1xyXG52YXIgU1RBVEVfUE9TU0lCTEUgPSAxO1xyXG52YXIgU1RBVEVfQkVHQU4gPSAyO1xyXG52YXIgU1RBVEVfQ0hBTkdFRCA9IDQ7XHJcbnZhciBTVEFURV9FTkRFRCA9IDg7XHJcbnZhciBTVEFURV9SRUNPR05JWkVEID0gU1RBVEVfRU5ERUQ7XHJcbnZhciBTVEFURV9DQU5DRUxMRUQgPSAxNjtcclxudmFyIFNUQVRFX0ZBSUxFRCA9IDMyO1xyXG5cclxuLyoqXHJcbiAqIFJlY29nbml6ZXJcclxuICogRXZlcnkgcmVjb2duaXplciBuZWVkcyB0byBleHRlbmQgZnJvbSB0aGlzIGNsYXNzLlxyXG4gKiBAY29uc3RydWN0b3JcclxuICogQHBhcmFtIHtPYmplY3R9IG9wdGlvbnNcclxuICovXHJcbmZ1bmN0aW9uIFJlY29nbml6ZXIob3B0aW9ucykge1xyXG4gICAgdGhpcy5pZCA9IHVuaXF1ZUlkKCk7XHJcblxyXG4gICAgdGhpcy5tYW5hZ2VyID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HNpbXVsdGFuZW91cyB3aXRoIGFuIG90aGVyIHJlY29nbml6ZXIuXHJcbiAgICAgKiBAcGFyYW0ge1JlY29nbml6ZXJ9IG90aGVyUmVjb2duaXplclxyXG4gICAgICogQHJldHVybnMge1JlY29nbml6ZXJ9IHRoaXNcclxuICAgICAqL1xyXG4gICAgcmVjb2duaXplV2l0aDogZnVuY3Rpb24ob3RoZXJSZWNvZ25pemVyKSB7XHJcbiAgICAgICAgaWYgKGludm9rZUFycmF5QXJnKG90aGVyUmVjb2duaXplciwgJ3JlY29nbml6ZVdpdGgnLCB0aGlzKSkge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHZhciBzaW11bHRhbmVvdXMgPSB0aGlzLnNpbXVsdGFuZW91cztcclxuICAgICAgICBvdGhlclJlY29nbml6ZXIgPSBnZXRSZWNvZ25pemVyQnlOYW1lSWZNYW5hZ2VyKG90aGVyUmVjb2duaXplciwgdGhpcyk7XHJcbiAgICAgICAgaWYgKCFzaW11bHRhbmVvdXNbb3RoZXJSZWNvZ25pemVyLmlkXSkge1xyXG4gICAgICAgICAgICBzaW11bHRhbmVvdXNbb3RoZXJSZWNvZ25pemVyLmlkXSA9IG90aGVyUmVjb2duaXplcjtcclxuICAgICAgICAgICAgb3RoZXJSZWNvZ25pemVyLnJlY29nbml6ZVdpdGgodGhpcyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzO1xyXG4gICAgfSxcclxuXHJcbiAgICAvKipcclxuICAgICAqIGRyb3AgdGhlIHNpbXVsdGFuZW91cyBsaW5rLiBpdCBkb2VzbnQgcmVtb3ZlIHRoZSBsaW5rIG9uIHRoZSBvdGhlciByZWNvZ25pemVyLlxyXG4gICAgICogQHBhcmFtIHtSZWNvZ25pemVyfSBvdGhlclJlY29nbml6ZXJcclxuICAgICAqIEByZXR1cm5zIHtSZWNvZ25pemVyfSB0aGlzXHJcbiAgICAgKi9cclxuICAgIGRyb3BSZWNvZ25pemVXaXRoOiBmdW5jdGlvbihvdGhlclJlY29nbml6ZXIpIHtcclxuICAgICAgICBpZiAoaW52b2tlQXJyYXlBcmcob3RoZXJSZWNvZ25pemVyLCAnZHJvcFJlY29nbml6ZVdpdGgnLCB0aGlzKSkge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIG90aGVyUmVjb2duaXplciA9IGdldFJlY29nbml6ZXJCeU5hbWVJZk1hbmFnZXIob3RoZXJSZWNvZ25pemVyLCB0aGlzKTtcclxuICAgICAgICBkZWxldGUgdGhpcy5zaW11bHRhbmVvdXNbb3RoZXJSZWNvZ25pemVyLmlkXTtcclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH0sXHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiByZWNvZ25pemVyIGNhbiBvbmx5IHJ1biB3aGVuIGFuIG90aGVyIGlzIGZhaWxpbmdcclxuICAgICAqIEBwYXJhbSB7UmVjb2duaXplcn0gb3RoZXJSZWNvZ25pemVyXHJcbiAgICAgKiBAcmV0dXJucyB7UmVjb2duaXplcn0gdGhpc1xyXG4gICAgICovXHJcbiAgICByZXF1aXJlRmFpbHVyZTogZnVuY3Rpb24ob3RoZXJSZWNvZ25pemVyKSB7XHJcbiAgICAgICAgaWYgKGludm9rZUFycmF5QXJnKG90aGVyUmVjb2duaXplciwgJ3JlcXVpcmVGYWlsdXJlJywgdGhpcykpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICB2YXIgcmVxdWlyZUZhaWwgPSB0aGlzLnJlcXVpcmVGYWlsO1xyXG4gICAgICAgIG90aGVyUmVjb2duaXplciA9IGdldFJlY29nbml6ZXJCeU5hbWVJZk1hbmFnZXIob3RoZXJSZWNvZ25pemVyLCB0aGlzKTtcclxuICAgICAgICBpZiAoaW5BcnJheShyZXF1aXJlRmFpbCwgb3RoZXJSZWNvZ25pemVyKSA9PT0gLTEpIHtcclxuICAgICAgICAgICAgcmVxdWlyZUZhaWwucHVzaChvdGhlclJlY29nbml6ZXIpO1xyXG4gICAgICAgICAgICBvdGhlclJlY29nbml6ZXIucmVxdWlyZUZhaWx1cmUodGhpcyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzO1xyXG4gICAgfSxcclxuXHJcbiAgICAvKipcclxuICAgICAqIGRyb3AgdGhlIHJlcXVpcmVGYWlsdXJlIGxpbmsuIGl0IGRvZXMgbm90IHJlbW92ZSB0aGUgbGluayBvbiB0aGUgb3RoZXIgcmVjb2duaXplci5cclxuICAgICAqIEBwYXJhbSB7UmVjb2duaXplcn0gb3RoZXJSZWNvZ25pemVyXHJcbiAgICAgKiBAcmV0dXJucyB7UmVjb2duaXplcn0gdGhpc1xyXG4gICAgICovXHJcbiAgICBkcm9wUmVxdWlyZUZhaWx1cmU6IGZ1bmN0aW9uKG90aGVyUmVjb2duaXplcikge1xyXG4gICAgICAgIGlmIChpbnZva2VBcnJheUFyZyhvdGhlclJlY29nbml6ZXIsICdkcm9wUmVxdWlyZUZhaWx1cmUnLCB0aGlzKSkge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIG90aGVyUmVjb2duaXplciA9IGdldFJlY29nbml6ZXJCeU5hbWVJZk1hbmFnZXIob3RoZXJSZWNvZ25pemVyLCB0aGlzKTtcclxuICAgICAgICB2YXIgaW5kZXggPSBpbkFycmF5KHRoaXMucmVxdWlyZUZhaWwsIG90aGVyUmVjb2duaXplcik7XHJcbiAgICAgICAgaWYgKGluZGV4ID4gLTEpIHtcclxuICAgICAgICAgICAgdGhpcy5yZXF1aXJlRmFpbC5zcGxpY2UoaW5kZXgsIDEpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH0sXHJcblxyXG4gICAgLyoqXHJcbiAgICAgKi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bjogZnVuY3Rpb24oKSB7XHJcbiAgICAgICAgdmFyIGRpcmVjdGlvbiA9IHRoaXMub3B0aW9ucy5kaXJlY3Rpb247XHJcbiAgICAgICAgdmFyIGFjdGlvbnMgPSBbXTtcclxuICAgICAgICBpZiAoZGlyZWN0aW9uICYgRElSRUNUSU9OX0hPUklaT05UQUwpIHtcclxuICAgICAgICAgICAgYWN0aW9ucy5wdXNoKFRPVUNIX0FDVElPTl9QQU5fWSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChkaXJlY3Rpb24gJiBESVJFQ1RJT05fVkVSVElDQUwpIHtcclxuICAgICAgICAgICAgYWN0aW9ucy5wdXNoKFRPVUNIX0FDVElPTl9QQU5fWCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBhY3Rpb25zO1xyXG4gICAgfSxcclxuXHJcbiAgICBkaXJlY3Rpb25UZXN0OiBmdW5jdGlvbihpbnB1dCkge1xyXG4gICAgICAgIHZhciBvcHRpb25zID0gdGhpcy5vcHRpb25zO1xyXG4gICAgICAgIHZhciBoYXNNb3ZlZCA9IHRydWU7XHJcbiAgICAgICAgdmFyIGRpc3RhbmNlID0gaW5wdXQuZGlzdGFuY2U7XHJcbiAgICAgICAgdmFyIGRpcmVjdGlvbiA9IGlucHV0LmRpcmVjdGlvbjtcclxuICAgICAgICB2YXIgeCA9IGlucHV0LmRlbHRhWDtcclxuICAgICAgICB2YXIgeSA9IGlucHV0LmRlbHRhWTtcclxuXHJcbiAgICAgICAgLy8gbG9jayB0byBheGlzP1xyXG4gICAgICAgIGlmICghKGRpcmVjdGlvbiAmIG9wdGlvbnMuZGlyZWN0aW9uKSkge1xyXG4gICAgICAgICAgICBpZiAob3B0aW9ucy5kaXJlY3Rpb24gJiBESVJFQ1RJT05fSE9SSVpPTlRBTCkge1xyXG4gICAgICAgICAgICAgICAgZGlyZWN0aW9uID0gKHggPT09IDApID8gRElSRUNUSU9OX05PTkUgOiAoeCA8IDApID8gRElSRUN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5jZW50ZXIpIDwgb3B0aW9ucy5wb3NUaHJlc2hvbGQ7XHJcblxyXG4gICAgICAgICAgICB0aGlzLnBUaW1lID0gaW5wdXQudGltZVN0YW1wO1xyXG4gICAgICAgICAgICB0aGlzLnBDZW50ZXIgPSBpbnB1dC5jZW50ZXI7XHJcblxyXG4gICAgICAgICAgICBpZiAoIXZhbGlkTXVsdGlUYXAgfHwgIXZhbGlkSW50ZXJ2YWwpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuY291bnQgPSAxO1xyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jb3VudCArPSAxO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICB0aGlzLl9pbnB1dCA9IGlucHV0O1xyXG5cclxuICAgICAgICAgICAgLy8gaWYgdGFwIGNvdW50IG1hdGNoZXMgd2UgaGF2ZSByZWNvZ25pemVkIGl0LFxyXG4gICAgICAgICAgICAvLyBlbHNlIGl0IGhhcyBiZWdhbiByZWNvZ25pemluZy4uLlxyXG4gICAgICAgICAgICB2YXIgdGFwQ291bnQgPSB0aGlzLmNvdW50ICUgb3B0aW9ucy50YXBzO1xyXG4gICAgICAgICAgICBpZiAodGFwQ291bnQgPT09IDApIHtcclxuICAgICAgICAgICAgICAgIC8vIG5vIGZhaWxpbmcgcmVxdWlyZW1lbnRzLCBpbW1lZGlhdGVseSB0cmlnZ2VyIHRoZSB0YXAgZXZlbnRcclxuICAgICAgICAgICAgICAgIC8vIG9yIHdhaXQgYXMgbG9uZyBhcyB0aGUgbXVsdGl0YXAgaW50ZXJ2YWwgdG8gdHJpZ2dlclxyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLmhhc1JlcXVpcmVGYWlsdXJlcygpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNUQVRFX1JFQ09HTklaRUQ7XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3RpbWVyID0gc2V0VGltZW91dENvbnRleHQoZnVuY3Rpb24oKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc3RhdGUgPSBTVEFURV9SRUNPR05JWkVEO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRyeUVtaXQoKTtcclxuICAgICAgICAgICAgICAgICAgICB9LCBvcHRpb25zLmludGVydmFsLCB0aGlzKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1RBVEVfQkVHQU47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIFNUQVRFX0ZBSUxFRDtcclxuICAgIH0sXHJcblxyXG4gICAgZmFpbFRpbWVvdXQ6IGZ1bmN0aW9uKCkge1xyXG4gICAgICAgIHRoaXMuX3RpbWVyID0gc2V0VGltZW91dENvbnRleHQoZnVuY3Rpb24oKSB7XHJcbiAgICAgICAgICAgIHRoaXMuc3RhdGUgPSBTVEFURV9GQUlMRUQ7XHJcbiAgICAgICAgfSwgdGhpcy5vcHRpb25zLmludGVydmFsLCB0aGlzKTtcclxuICAgICAgICByZXR1cm4gU1RBVEVfRkFJTEVEO1xyXG4gICAgfSxcclxuXHJcbiAgICByZXNldDogZnVuY3Rpb24oKSB7XHJcbiAgICAgICAgY2xlYXJUaW1lb3V0KHRoaXMuX3RpbWVyKTtcclxuICAgIH0sXHJcblxyXG4gICAgZW1pdDogZnVuY3Rpb24oKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuc3RhdGUgPT0gU1RBVEVfUkVDT0dOSVpFRCApIHtcclxuICAgICAgICAgICAgdGhpcy5faW5wdXQudGFwQ291bnQgPSB0aGlzLmNvdW50O1xyXG4gICAgICAgICAgICB0aGlzLm1hbmFnZXIuZW1pdCh0aGlzLm9wdGlvbnMuZXZlbnQsIHRoaXMuX2lucHV0KTtcclxuICAgICAgICB9XHJcbiAg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yXG4gICAgICAgICAqIERpc2FibGVzIHRleHQgc2VsZWN0aW9uIHRvIGltcHJvdmUgdGhlIGRyYWdnaW5nIGdlc3R1cmUuIE1haW5seSBmb3IgZGVza3RvcCBicm93c2Vycy5cclxuICAgICAgICAgKiBAdHlwZSB7U3RyaW5nfVxyXG4gICAgICAgICAqIEBkZWZhdWx0ICdub25lJ1xyXG4gICAgICAgICAqL1xyXG4gICAgICAgIHVzZXJTZWxlY3Q6ICdub25lJyxcclxuXHJcbiAgICAgICAgLyoqXHJcbiAgICAgICAgICogRGlzYWJsZSB0aGUgV2luZG93cyBQaG9uZSBncmlwcGVycyB3aGVuIHByZXNzaW5nIGFuIGVsZW1lbnQuXHJcbiAgICAgICAgICogQHR5cGUge1N0cmluZ31cclxuICAgICAgICAgKiBAZGVmYXVsdCAnbm9uZSdcclxuICAgICAgICAgKi9cclxuICAgICAgICB0b3VjaFNlbGVjdDogJ25vbmUnLFxyXG5cclxuICAgICAgICAvKipcclxuICAgICAgICAgKiBEaXNhYmxlcyB0aGUgZGVmYXVsdCBjYWxsb3V0IHNob3duIHdoZW4geW91IHRvdWNoIGFuZCBob2xkIGEgdG91Y2ggdGFyZ2V0LlxyXG4gICAgICAgICAqIE9uIGlPUywgd2hlbiB5b3UgdG91Y2ggYW5kIGhvbGQgYSB0b3VjaCB0YXJnZXQgc3VjaCBhcyBhIGxpbmssIFNhZmFyaSBkaXNwbGF5c1xyXG4gICAgICAgICAqIGEgY2FsbG91dCBjb250YWluaW5nIGluZm9ybWF0aW9uIGFib3V0IHRoZSBsaW5rLiBUaGlzIHByb3BlcnR5IGFsbG93cyB5b3UgdG8gZGlzYWJsZSB0aGF0IGNhbGxvdXQuXHJcbiAgICAgICAgICogQHR5cGUge1N0cmluZ31cclxuICAgICAgICAgKiBAZGVmYXVsdCAnbm9uZSdcclxuICAgICAgICAgKi9cclxuICAgICAgICB0b3VjaENhbGxvdXQ6ICdub25lJyxcclxuXHJcbiAgICAgICAgLyoqXHJcbiAg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uJ3QgcmVjb2duaXplZCBhIGdlc3R1cmUgaW4gdGhpcyBzZXNzaW9uLCBvciB0aGUgdGhpcyByZWNvZ25pemVyIGlzIHRoZSBvbmVcclxuICAgICAgICAgICAgLy8gICAgICB0aGF0IGlzIGJlaW5nIHJlY29nbml6ZWQuXHJcbiAgICAgICAgICAgIC8vIDMuICAgYWxsb3cgaWYgdGhlIHJlY29nbml6ZXIgaXMgYWxsb3dlZCB0byBydW4gc2ltdWx0YW5lb3VzIHdpdGggdGhlIGN1cnJlbnQgcmVjb2duaXplZCByZWNvZ25pemVyLlxyXG4gICAgICAgICAgICAvLyAgICAgIHRoaXMgY2FuIGJlIHNldHVwIHdpdGggdGhlIGByZWNvZ25pemVXaXRoKClgIG1ldGhvZCBvbiB0aGUgcmVjb2duaXplci5cclxuICAgICAgICAgICAgaWYgKHNlc3Npb24uc3RvcHBlZCAhPT0gRk9SQ0VEX1NUT1AgJiYgKCAvLyAxXHJcbiAgICAgICAgICAgICAgICAgICAgIWN1clJlY29nbml6ZXIgfHwgcmVjb2duaXplciA9PSBjdXJSZWNvZ25pemVyIHx8IC8vIDJcclxuICAgICAgICAgICAgICAgICAgICByZWNvZ25pemVyLmNhblJlY29nbml6ZVdpdGgoY3VyUmVjb2duaXplcikpKSB7IC8vIDNcclxuICAgICAgICAgICAgICAgIHJlY29nbml6ZXIucmVjb2duaXplKGlucHV0RGF0YSk7XHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICByZWNvZ25pemVyLnJlc2V0KCk7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIC8vIGlmIHRoZSByZWNvZ25pemVyIGhhcyBiZWVuIHJlY29nbml6aW5nIHRoZSBpbnB1dCBhcyBhIHZhbGlkIGdlc3R1cmUsIHdlIHdhbnQgdG8gc3RvcmUgdGhpcyBvbmUgYXMgdGhlXHJcbiAgICAgICAgICAgIC8vIGN1cnJlbnQgYWN0aXZlIHJlY29nbml6ZXIuIGJ1dCBvbmx5IGlmIHdlIGRvbid0IGFscmVhZHkgaGF2ZSBhbiBhY3RpdmUgcmVjb2duaXplclxyXG4gICAgICAgICAgICBpZiAoIWN1clJlY29nbml6ZXIgJiYgcmVjb2duaXplci5zdGF0ZSAmIChTVEFURV9CRUdBTiB8IFNUQVRFX0NIQU5HRUQgfCBTVEFURV9FTkRFRCkpIHtcclxuICAgICAgICAgICAgICAgIGN1clJlY29nbml6ZXIgPSBzZXNzaW9uLmN1clJlY29nbml6ZXIgPSByZWNvZ25pemVyO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGkrKztcclxuICAgICAgICB9XHJcbiAgICB9LFxyXG5cclxuICAgIC8qKlxyXG4gICAgICogZ2V0IGEgcmVjb2duaXplciBieSBpdHMgZXZlbnQgbmFtZS5cclxuICAgICAqIEBwYXJhbSB7UmVjb2duaXplcnxTdHJpbmd9IHJlY29nbml6ZXJcclxuICAgICAqIEByZXR1cm5zIHtSZWNvZ25pemVyfE51bGx9XHJcbiAgICAgKi9cclxuICAgIGdldDogZnVuY3Rpb24ocmVjb2duaXplcikge1xyXG4gICAgICAgIGlmIChyZWNvZ25pemVyIGluc3RhbmNlb2YgUmVjb2duaXplcikge1xyXG4gICAgICAgICAgICByZXR1cm4gcmVjb2duaXplcjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHZhciByZWNvZ25pemVycyA9IHRoaXMucmVjb2duaXplcnM7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCByZWNvZ25pemVycy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICBpZiAocmVjb2duaXplcnNbaV0ub3B0aW9ucy5ldmVudCA9PSByZWNvZ25pemVyKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVjb2duaXplcnNbaV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICB9LFxyXG5cclxuIC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1xyXG4gICAgcmVtb3ZlOiBmdW5jdGlvbihyZWNvZ25pemVyKSB7XHJcbiAgICAgICAgaWYgKGludm9rZUFycmF5QXJnKHJlY29nbml6ZXIsICdyZW1vdmUnLCB0aGlzKSkge1xyXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHZhciByZWNvZ25pemVycyA9IHRoaXMucmVjb2duaXplcnM7XHJcbiAgICAgICAgcmVjb2duaXplciA9IHRoaXMuZ2V0KHJlY29nbml6ZXIpO1xyXG4gICAgICAgIHJlY29nbml6ZXJzLnNwbGljZShpbkFycmF5KHJlY29nbml6ZXJzLCByZWNvZ25pemVyKSwgMSk7XHJcblxyXG4gICAgICAgIHRoaXMudG91Y2hBY3Rpb24udXBkYXRlKCk7XHJcbiAgICAgICAgcmV0dXJuIHRoaXM7XHJcbiAgICB9LFxyXG5cclxuICAgIC8qKlxyXG4gICAgICogYmluZCBldmVudFxyXG4gICAgICogQHBhcmFtIHtTdHJpbmd9IGV2ZW50c1xyXG4gICAgICogQHBhcmFtIHtGdW5jdGlvbn0gaGFuZGxlclxyXG4gICAgICogQHJldHVybnMge0V2ZW50RW1pdHRlcn0gdGhpc1xyXG4gICAgICovXHJcbiAgICBvbjogZnVuY3Rpb24oZXZlbnRzLCBoYW5kbGVyKSB7XHJcbiAgICAgICAgdmFyIGhhbmRsZXJzID0gdGhpcy5oYW5kbGVycztcclxuICAgICAgICBlYWNoKHNwbGl0U3RyKGV2ZW50cyksIGZ1bmN0aW9uKGV2ZW50KSB7XHJcbiAgICAgICAgICAgIGhhbmRsZXJzW2V2ZW50XSA9IGhhbmRsZXJzW2V2ZW50XSB8fCBbXTtcclxuICAgICAgICAgICAgaGFuZGxlcnNbZXZlbnRdLnB1c2goaGFuZGxlcik7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgcmV0dXJuIHRoaXM7XHJcbiAgICB9LFxyXG5cclxuICAgIC8qKlxyXG4gICAgICogdW5i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AgICAgICAgICB2ICAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogfCAgICAgfCAgICAgIHwgICAgLiAgICArLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tK1xuICogfCAgICAgKy0tLS0tLS0tLS0tLi0tLT58RXZlbnRQbHVnaW5IdWJ8ICAgICAgICAgICAgICAgICAgICB8ICAgIEV2ZW50ICAgfFxuICogfCAgICAgICAgICAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICArLS0tLS0tLS0tLS0rICB8IFByb3BhZ2F0b3JzfFxuICogfCBSZWFjdEV2ZW50IHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICB8VGFwRXZlbnQgICB8ICB8LS0tLS0tLS0tLS0tfFxuICogfCAgRW1pdHRlciAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8PC0tLSt8UGx1Z2luICAgICB8ICB8b3RoZXIgcGx1Z2lufFxuICogfCAgICAgICAgICAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICArLS0tLS0tLS0tLS0rICB8ICB1dGlsaXRpZXMgfFxuICogfCAgICAgKy0tLS0tLS0tLS0tLi0tLT58ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tK1xuICogfCAgICAgfCAgICAgIHwgICAgLiAgICArLS0tLS0tLS0tLS0tLS0rXG4gKiArLS0tLS18LS0tLS0tKyAgICAuICAgICAgICAgICAgICAgIF4gICAgICAgICstLS0tLS0tLS0tLStcbiAqICAgICAgIHwgICAgICAgICAgIC4gICAgICAgICAgICAgICAgfCAgICAgICAgfEVudGVyL0xlYXZlfFxuICogICAgICAgKyAgICAgICAgICAgLiAgICAgICAgICAgICAgICArLS0tLS0tLSt8UGx1Z2luICAgICB8XG4gKiArLS0tLS0tLS0tLS0tLSsgICAuICAgICAgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLStcbiAqIHwgYXBwbGljY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oXG4gICAgICAgICAgICAgIHRvcExldmVsVHlwZXMudG9wRm9jdXMsXG4gICAgICAgICAgICAgICdmb2N1c2luJyxcbiAgICAgICAgICAgICAgbW91bnRBdFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIFJlYWN0QnJvd3NlckV2ZW50RW1pdHRlci5SZWFjdEV2ZW50TGlzdGVuZXIudHJhcEJ1YmJsZWRFdmVudChcbiAgICAgICAgICAgICAgdG9wTGV2ZWxUeXBlcy50b3BCbHVyLFxuICAgICAgICAgICAgICAnZm9jdXNvdXQnLFxuICAgICAgICAgICAgICBtb3VudEF0XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHRvIG1ha2Ugc3VyZSBibHVyIGFuZCBmb2N1cyBldmVudCBsaXN0ZW5lcnMgYXJlIG9ubHkgYXR0YWNoZWQgb25jZVxuICAgICAgICAgIGlzTGlzdGVuaW5nW3RvcExldmVsVHlwZXMudG9wQmx1cl0gPSB0cnVlO1xuICAgICAgICAgIGlzTGlzdGVuaW5nW3RvcExldmVsVHlwZXMudG9wRm9jdXNdID0gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIGlmICh0b3BFdmVudE1hcHBpbmcuaGFzT3duUHJvcGVydHkoZGVwZW5kZW5jeSkpIHtcbiAgICAgICAgICBSZWFjdEJyb3dzZXJFdmVudEVtaXR0ZXIuUmVhY3RFdmVudExpc3RlbmVyLnRyYXBCdWJibGVkRXZlbnQoXG4gICAgICAgICAgICBkZXBlbmRlbmN5LFxuICAgICAgICAgICAgdG9wRXZlbnRNYXBwaW5nW2RlcGVuZGVuY3ldLFxuICAgICAgICAgICAgbW91bnRBdFxuICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBpc0xpc3RlbmluZ1tkZXBlbmRlbmN5XSA9IHRydWU7XG4gICAgICB9XG4gICAgfVxuICB9LFxuXG4gIHRyYXBCdWJibGVkRXZlbnQ6IGZ1bmN0aW9uKHRvcExldmVsVHlwZ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BldmVudCBsaXN0ZW5lcnMuXG4gICAgICpcbiAgICAgKiBOT1RFOiBUaGlzIGRvZXMgbm90IGluc2VydCBhbnkgbm9kZXMgaW50byB0aGUgRE9NLlxuICAgICAqXG4gICAgICogU3ViY2xhc3NlcyB0aGF0IG92ZXJyaWRlIHRoaXMgbWV0aG9kIHNob3VsZCBtYWtlIHN1cmUgdG8gaW52b2tlXG4gICAgICogYFJlYWN0Q29tcG9uZW50Lk1peGluLm1vdW50Q29tcG9uZW50LmNhbGwodGhpcywgLi4uKWAuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gcm9vdElEIERPTSBJRCBvZiB0aGUgcm9vdCBub2RlLlxuICAgICAqIEBwYXJhbSB7UmVhY3RSZWNvbmNpbGVUcmFuc2FjdGlvbnxSZWFjdFNlcnZlclJlbmRlcmluZ1RyYW5zYWN0aW9ufSB0cmFuc2FjdGlvblxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBtb3VudERlcHRoIG51bWJlciBvZiBjb21wb25lbnRzIGluIHRoZSBvd25lciBoaWVyYXJjaHkuXG4gICAgICogQHJldHVybiB7P3N0cmluZ30gUmVuZGVyZWQgbWFya3VwIHRvIGJlIGluc2VydGVkIGludG8gdGhlIERPTS5cbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICBtb3VudENvbXBvbmVudDogZnVuY3Rpb24ocm9vdElELCB0cmFuc2FjdGlvbiwgbW91bnREZXB0aCkge1xuICAgICAgKFwicHJvZHVjdGlvblwiICE9PSBwcm9jZXNzLmVudi5OT0RFX0VOViA/IGludmFyaWFudChcbiAgICAgICAgIXRoaXMuaXNNb3VudGVkKCksXG4gICAgICAgICdtb3VudENvbXBvbmVudCglcywgLi4uKTogQ2FuIG9ubHkgbW91bnQgYW4gdW5tb3VudGVkIGNvbXBvbmVudC4gJyArXG4gICAgICAgICdNYWtlIHN1cmUgdG8gYXZvaWQgc3RvcmluZyBjb21wb25lbnRzIGJldHdlZW4gcmVuZGVycyBvciByZXVzaW5nIGEgJyArXG4gICAgICAgICdzaW5nbGUgY29tcG9uZW50IGluc3RhbmNlIGluIG11bHRpcGxlIHBsYWNlcy4nLFxuICAgICAgICByb290SURcbiAgICAgICkgOiBpbnZhcmlhbnQoIXRoaXMuaXNNb3VudGVkKCkpKTtcbiAgICAgIHZhciByZWYgPSB0aGlzLl9jdXJyZW50RWxlbWVudC5yZWY7XG4gICAgICBpZiAocmVmICE9IG51bGwpIHtcbiAgICAgICAgdmFyIG93bmVyID0gdGhpcy5fY3VycmVudEVsZW1lbnQuX293bmVyO1xuICAgICAgICBSZWFjdE93bmVyLmFkZENvbXBvbmVudEFzUmVmVG8odGhpcywgcmVmLCBvd25lcik7XG4gICAgICB9XG4gICAgICB0aGlzLl9yb290Tm9kZUlEID0gcm9vdElEO1xuICAgICAgdGhpcy5fbGlmZUN5Y2xlU3RhdGUgPSBDb21wb25lbnRMaWZlQ3ljbGUuTU9VTlRFRDtcbiAgICAgIHRoaXMuX21vdW50RGVwdGggPSBtb3VudERlcHRoO1xuICAgICAgLy8gRWZmZWN0aXZlbHk6IHJldHVybiAnJztcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogUmVsZWFzZXMgYW55IHJlc291cmNlcyBhbGxvY2F0ZWQgYnkgYG1vdW50Q29tcG9uZW50YC5cbiAgICAgKlxuICAgICAqIE5PVEU6IFRoaXMgZG9lcyBub3QgcmVtb3ZlIGFueSBub2RlcyBmcm9tIHRoZSBET00uXG4gICAgICpcbiAgICAgKiBTdWJjbGFzc2VzIHRoYXQgb3ZlcnJpZGUgdGhpcyBtZXRob2Qgc2hvdWxkIG1ha2Ugc3VyZSB0byBpbnZva2VcbiAgICAgKiBgUmVhY3RDb21wb25lbnQuTWl4aW4udW5tb3VudENvbXBvbmVudC5jYWxsKHRoaXMpYC5cbiAgICAgKlxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqL1xuICAgIHVubW91bnRDb21wb25lbnQ6IGZ1bmN0aW9uKCk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AgIGlmIChuZXh0RWxlbWVudC5yZWYgIT0gbnVsbCkge1xuICAgICAgICAgIFJlYWN0T3duZXIuYWRkQ29tcG9uZW50QXNSZWZUbyhcbiAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICBuZXh0RWxlbWVudC5yZWYsXG4gICAgICAgICAgICBuZXh0RWxlbWVudC5fb3duZXJcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIE1vdW50cyB0aGlzIGNvbXBvbmVudCBhbmQgaW5zZXJ0cyBpdCBpbnRvIHRoZSBET00uXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gcm9vdElEIERPTSBJRCBvZiB0aGUgcm9vdCBub2RlLlxuICAgICAqIEBwYXJhbSB7RE9NRWxlbWVudH0gY29udGFpbmVyIERPTSBlbGVtZW50IHRvIG1vdW50IGludG8uXG4gICAgICogQHBhcmFtIHtib29sZWFufSBzaG91bGRSZXVzZU1hcmt1cCBJZiB0cnVlLCBkbyBub3QgaW5zZXJ0IG1hcmt1cFxuICAgICAqIEBmaW5hbFxuICAgICAqIEBpbnRlcm5hbFxuICAgICAqIEBzZWUge1JlYWN0TW91bnQucmVuZGVyfVxuICAgICAqL1xuICAgIG1vdW50Q29tcG9uZW50SW50b05vZGU6IGZ1bmN0aW9uKHJvb3RJRCwgY29udGFpbmVyLCBzaG91bGRSZXVzZU1hcmt1cCkge1xuICAgICAgdmFyIHRyYW5zYWN0aW9uID0gUmVhY3RVcGRhdGVzLlJlYWN0UmVjb25jaWxlVHJhbnNhY3Rpb24uZ2V0UG9vbGVkKCk7XG4gICAgICB0cmFuc2FjdGlvbi5wZXJmb3JtKFxuICAgICAgICB0aGlzLl9tb3VudENvbXBvbmVudEludG9Ob2RlLFxuICAgICAgICB0aGlzLFxuICAgICAgICByb290SUQsXG4gICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgdHJhbnNhY3Rpb24sXG4gICAgICAgIHNob3VsZFJldXNlTWFya3VwXG4gICAgICApO1xuICAgICAgUmVhY3RVcGRhdGVzLlJlYWN0UmVjb25jaWxlVHJhbnNhY3Rpb24ucmVsZWFzZSh0cmFuc2FjdGlvbik7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSByb290SUQgRE9NIElEIG9mIHRoZSByb290IG5vZGUuXG4gICAgICogQHBhcmFtIHtET01FbGVtZW50fSBjb250YWluZXIgRE9NIGVsZW1lbnQgdG8gbW91bnQgaW50by5cbiAgICAgKiBAcGFyYW0ge1JlYWN0UmVjb25jaWxlVHJhbnNhY3Rpb259IHRyYW5zYWN0aW9uXG4gICAgICogQHBhcmFtIHtib29sZWFufSBzaG91bGRSZXVzZU1hcmt1cCBJZiB0cnVlLCBkbyBub3QgaW5zZXJ0IG1hcmt1cFxuICAgICAqIEBmaW5hbFxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgX21vdW50Q29tcG9uZW50SW50b05vZGU6IGZ1bmN0aW9uKFxuICAgICAgICByb290SUQsXG4gICAgICAgIGNvbnRhaW5lcixcbiAgICAgICAgdHJhbnNhY3Rpb24sXG4gICAgICAgIHNob3VsZFJldXNlTWFya3VwKSB7XG4gICAgICB2YXIgbWFya3VwID0gdGhpcy5tb3VudENvbXBvbmVudChyb290SUQsIHRyYW5zYWN0aW9uLCAwKTtcbiAgICAgIG1vdW50SW1hZ2VJbnRvTm9kZShtYXJrdXAsIGNvbnRhaW5lciwgc2hvdWxkUmV1c2VNYXJrdXApO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBDaGVja3MgaWYgdGhpcyBjb21wb25lbnQgaXMgb3duZWQgYnkgdGhlIHN1cHBsaWVkIGBvd25lcmAgY29tcG9uZW50LlxuICAgICAqXG4gICAgICogQHBhcmFtIHtSZWFjdENvbXBvbmVudH0gb3duZXIgQ29tcG9uZW50IHRvIGNoZWNrLlxuICAgICAqIEByZXR1cm4ge2Jvb2xlY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5tZWFzdXJlKFxuICAgICdSZWFjdENvbXBvbmVudEJyb3dzZXJFbnZpcm9ubWVudCcsXG4gICAgJ21vdW50SW1hZ2VJbnRvTm9kZScsXG4gICAgZnVuY3Rpb24obWFya3VwLCBjb250YWluZXIsIHNob3VsZFJldXNlTWFya3VwKSB7XG4gICAgICAoXCJwcm9kdWN0aW9uXCIgIT09IHByb2Nlc3MuZW52Lk5PREVfRU5WID8gaW52YXJpYW50KFxuICAgICAgICBjb250YWluZXIgJiYgKFxuICAgICAgICAgIGNvbnRhaW5lci5ub2RlVHlwZSA9PT0gRUxFTUVOVF9OT0RFX1RZUEUgfHxcbiAgICAgICAgICAgIGNvbnRhaW5lci5ub2RlVHlwZSA9PT0gRE9DX05PREVfVFlQRVxuICAgICAgICApLFxuICAgICAgICAnbW91bnRDb21wb25lbnRJbnRvTm9kZSguLi4pOiBUYXJnZXQgY29udGFpbmVyIGlzIG5vdCB2YWxpZC4nXG4gICAgICApIDogaW52YXJpYW50KGNvbnRhaW5lciAmJiAoXG4gICAgICAgIGNvbnRhaW5lci5ub2RlVHlwZSA9PT0gRUxFTUVOVF9OT0RFX1RZUEUgfHxcbiAgICAgICAgICBjb250YWluZXIubm9kZVR5cGUgPT09IERPQ19OT0RFX1RZUEVcbiAgICAgICkpKTtcblxuICAgICAgaWYgKHNob3VsZFJldXNlTWFya3VwKSB7XG4gICAgICAgIGlmIChSZWFjdE1hcmt1cENoZWNrc3VtLmNhblJldXNlTWFya3VwKFxuICAgICAgICAgIG1hcmt1cCxcbiAgICAgICAgICBnZXRSZWFjdFJvb3RFbGVtZW50SW5Db250YWluZXIoY29udGFpbmVyKSkpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgKFwicHJvZHVjdGlvblwiICE9PSBwcm9jZXNzLmVudi5OT0RFX0VOViA/IGludmFyaWFudChcbiAgICAgICAgICAgIGNvbnRhaW5lci5ub2RlVHlwZSAhPT0gRE9DX05PREVfVFlQRSxcbiAgICAgICAgICAgICdZb3VcXCdyZSB0cnlpbmcgdG8gcmVuZGVyIGEgY29tcG9uZW50IHRvIHRoZSBkb2N1bWVudCB1c2luZyAnICtcbiAgICAgICAgICAgICdzZXJ2ZXIgcmVuZGVyaW5nIGJ1dCB0aGUgY2hlY2tzdW0gd2FzIGludmFsaWQuIFRoaXMgdXN1YWxseSAnICtcbiAgICAgICAgICAgICdtZWFucyB5b3UgcmVuZGVyZWQgYSBkaWZmZXJlbnQgY29tcG9uZW50IHR5cGUgb3IgcHJvcHMgb24gJyArXG4gICAgICAgICAgICAndGhlIGNsaWVudCBmcm9tIHRoZSBvbmUgb24gdGhlIHNlcnZlciwgb3IgeW91ciByZW5kZXIoKSAnICtcbiAgICAgICAgICAgICdtZXRob2RzIGFyZSBpbXB1cmUuIFJlYWN0IGNhbm5vdCBoYW5kbGUgdGhpcyBjYXNlIGR1ZSB0byAnICtcbiAgICAgICAgICAgICdjcm9zcy1icm93c2VyIHF1aXJrcyBieSByZW5kZXJpbmcgYXQgdGhlIGRvY3VtZW50IHJvb3QuIFlvdSAnICtcbiAgICAgICAgICAgICdzaG91bGQgbG9vayBmb3IgZW52aXJvbm1lbnQgZGVwZW5kZW50IGNvZGUgaW4geW91ciBjb21wb25lbnRzICcgK1xuICAgICAgICAgICAgJ2FuZCBlbnN1cmUgdGhlIHByb3BzIGFyZSB0aGUgc2FtZSBjbGllbnQgYW5kIHNlcnZlciBzaWRlLidcbiAgICAgICAgICApIDogaW52YXJpYW50KGNvbnRhaW5lci5ub2RlVHlwZSAhPT0gRE9DX05PREVfVFlQRSkpO1xuXG4gICAgICAgICAgaWYgKFwicHJvZHVjdGlvblwiICE9PSBwcm9jZXNzLmVudi5OT0RFX0VOVikge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKFxuICAgICAgICAgICAgICAnUmVhY3QgYXR0ZW1wdGVkIHRvIHVzZSByZXVzZSBtYXJrdXAgaW4gYSBjb250YWluZXIgYnV0IHRoZSAnIC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RBdXRvQmluZE1hcFtuYW1lXSA9IHByb3BlcnR5O1xuICAgICAgICBwcm90b1tuYW1lXSA9IHByb3BlcnR5O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGlzQWxyZWFkeURlZmluZWQpIHtcbiAgICAgICAgICB2YXIgc3BlY1BvbGljeSA9IFJlYWN0Q29tcG9zaXRlQ29tcG9uZW50SW50ZXJmYWNlW25hbWVdO1xuXG4gICAgICAgICAgLy8gVGhlc2UgY2FzZXMgc2hvdWxkIGFscmVhZHkgYmUgY2F1Z2h0IGJ5IHZhbGlkYXRlTWV0aG9kT3ZlcnJpZGVcbiAgICAgICAgICAoXCJwcm9kdWN0aW9uXCIgIT09IHByb2Nlc3MuZW52Lk5PREVfRU5WID8gaW52YXJpYW50KFxuICAgICAgICAgICAgaXNDb21wb3NpdGVDb21wb25lbnRNZXRob2QgJiYgKFxuICAgICAgICAgICAgICBzcGVjUG9saWN5ID09PSBTcGVjUG9saWN5LkRFRklORV9NQU5ZX01FUkdFRCB8fFxuICAgICAgICAgICAgICBzcGVjUG9saWN5ID09PSBTcGVjUG9saWN5LkRFRklORV9NQU5ZXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgJ1JlYWN0Q29tcG9zaXRlQ29tcG9uZW50OiBVbmV4cGVjdGVkIHNwZWMgcG9saWN5ICVzIGZvciBrZXkgJXMgJyArXG4gICAgICAgICAgICAnd2hlbiBtaXhpbmcgaW4gY29tcG9uZW50IHNwZWNzLicsXG4gICAgICAgICAgICBzcGVjUG9saWN5LFxuICAgICAgICAgICAgbmFtZVxuICAgICAgICAgICkgOiBpbnZhcmlhbnQoaXNDb21wb3NpdGVDb21wb25lbnRNZXRob2QgJiYgKFxuICAgICAgICAgICAgc3BlY1BvbGljeSA9PT0gU3BlY1BvbGljeS5ERUZJTkVfTUFOWV9NRVJHRUQgfHxcbiAgICAgICAgICAgIHNwZWNQb2xpY3kgPT09IFNwZWNQb2xpY3kuREVGSU5FX01BTllcbiAgICA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AgICAgICAgIGlmICh1cGRhdGUuZnJvbUluZGV4ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgIHdyaXRlQXJncy5mcm9tSW5kZXggPSB1cGRhdGUuZnJvbUluZGV4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHVwZGF0ZS50b0luZGV4ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgIHdyaXRlQXJncy50b0luZGV4ID0gdXBkYXRlLnRvSW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodXBkYXRlLnRleHRDb250ZW50ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgIHdyaXRlQXJncy50ZXh0Q29udGVudCA9IHVwZGF0ZS50ZXh0Q29udGVudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh1cGRhdGUubWFya3VwSW5kZXggIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgd3JpdGVBcmdzLm1hcmt1cCA9IGFyZ3NbMV1bdXBkYXRlLm1hcmt1cEluZGV4XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFJlYWN0RGVmYXVsdFBlcmYuX3JlY29yZFdyaXRlKFxuICAgICAgICAgICAgICB1cGRhdGUucGFyZW50SUQsXG4gICAgICAgICAgICAgIHVwZGF0ZS50eXBlLFxuICAgICAgICAgICAgICB0b3RhbFRpbWUsXG4gICAgICAgICAgICAgIHdyaXRlQXJnc1xuICAgICAgICAgICAgKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBiYXNpYyBmb3JtYXRcbiAgICAgICAgICBSZWFjdERlZmF1bHRQZXJmLl9yZWNvcmRXcml0ZShcbiAgICAgICAgICAgIGFyZ3NbMF0sXG4gICAgICAgICAgICBmbk5hbWUsXG4gICAgICAgICAgICB0b3RhbFRpbWUsXG4gICAgICAgICAgICBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmdzLCAxKVxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJ2O1xuICAgICAgfSBlbHNlIGlmIChtb2R1bGVOYW1lID09PSAnUmVhY3RDb21wb3NpdGVDb21wb25lbnQnICYmIChcbiAgICAgICAgZm5OYW1lID09PSAnbW91bnRDb21wb25lbnQnIHx8XG4gICAgICAgIGZuTmFtZSA9PT0gJ3VwZGF0ZUNvbXBvbmVudCcgfHwgLy8gVE9ETzogcmVjZWl2ZUNvbXBvbmVudCgpP1xuICAgICAgICBmbk5hbWUgPT09ICdfcmVuZGVyVmFsaWRhdGVkQ29tcG9uZW50JykpIHtcblxuICAgICAgICB2YXIgcm9vdE5vZGVJRCA9IGZuTmFtZSA9PT0gJ21vdW50Q29tcG9uZW50JyA/XG4gICAgICAgICAgYXJnc1swXSA6XG4gICAgICAgICAgdGhpcy5fcm9vdE5vZGVJRDtcbiAgICAgICAgdmFyIGlzUmVuZGVyID0gZm5OYW1lID09PSAnX3JlbmRlclZhbGlkYXRlZENvbXBvbmVudCc7XG4gICAgICAgIHZhciBpc01vdW50ID0gZm5OYW1lID09PSAnbW91bnRDb21wb25lbnQnO1xuXG4gICAgICAgIHZhciBtb3VudFN0YWNrID0gUmVhY3REZWZhdWx0UGVyZi5fbW91bnRTdGFjaztcbiAgICAgICAgdmFyIGVudHJ5ID0gUmVhY3REZWZhdWx0UGVyZi5fYWxsTWVhc3VyZW1lbnRzW1xuICAgICAgICAgIFJlYWN0RGVmYXVsdFBlcmYuX2FsbE1lYXN1cmVtZW50cy5sZW5ndGggLSAxXG4gICAgICAgIF07XG5cbiAgICAgICAgaWYgKGlzUmVuZGVyKSB7XG4gICAgICAgICAgYWRkVmFsdWUoZW50cnkuY291bnRzLCByb290Tm9kZUlELCAxKTtcbiAgICAgICAgfSBlbHNlIGlmIChpc01vdW50KSB7XG4gICAgICAgICAgbW91bnRTdGFjay5wdXNoKDApO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhcnQgPSBwZXJmb3JtYW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BfcmVnaXN0ZXJDb21wb25lbnQ6IGZ1bmN0aW9uKG5leHRDb21wb25lbnQsIGNvbnRhaW5lcikge1xuICAgIChcInByb2R1Y3Rpb25cIiAhPT0gcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPyBpbnZhcmlhbnQoXG4gICAgICBjb250YWluZXIgJiYgKFxuICAgICAgICBjb250YWluZXIubm9kZVR5cGUgPT09IEVMRU1FTlRfTk9ERV9UWVBFIHx8XG4gICAgICAgIGNvbnRhaW5lci5ub2RlVHlwZSA9PT0gRE9DX05PREVfVFlQRVxuICAgICAgKSxcbiAgICAgICdfcmVnaXN0ZXJDb21wb25lbnQoLi4uKTogVGFyZ2V0IGNvbnRhaW5lciBpcyBub3QgYSBET00gZWxlbWVudC4nXG4gICAgKSA6IGludmFyaWFudChjb250YWluZXIgJiYgKFxuICAgICAgY29udGFpbmVyLm5vZGVUeXBlID09PSBFTEVNRU5UX05PREVfVFlQRSB8fFxuICAgICAgY29udGFpbmVyLm5vZGVUeXBlID09PSBET0NfTk9ERV9UWVBFXG4gICAgKSkpO1xuXG4gICAgUmVhY3RCcm93c2VyRXZlbnRFbWl0dGVyLmVuc3VyZVNjcm9sbFZhbHVlTW9uaXRvcmluZygpO1xuXG4gICAgdmFyIHJlYWN0Um9vdElEID0gUmVhY3RNb3VudC5yZWdpc3RlckNvbnRhaW5lcihjb250YWluZXIpO1xuICAgIGluc3RhbmNlc0J5UmVhY3RSb290SURbcmVhY3RSb290SURdID0gbmV4dENvbXBvbmVudDtcbiAgICByZXR1cm4gcmVhY3RSb290SUQ7XG4gIH0sXG5cbiAgLyoqXG4gICAqIFJlbmRlciBhIG5ldyBjb21wb25lbnQgaW50byB0aGUgRE9NLlxuICAgKiBAcGFyYW0ge1JlYWN0Q29tcG9uZW50fSBuZXh0Q29tcG9uZW50IGNvbXBvbmVudCBpbnN0YW5jZSB0byByZW5kZXJcbiAgICogQHBhcmFtIHtET01FbGVtZW50fSBjb250YWluZXIgY29udGFpbmVyI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NhcnksIHRyaWdnZXIgbmVzdGVkIHVwZGF0ZXMgaW4gJyArXG4gICAgICAgICdjb21wb25lbnREaWRVcGRhdGUuJ1xuICAgICAgKSA6IG51bGwpO1xuXG4gICAgICB2YXIgY29tcG9uZW50SW5zdGFuY2UgPSBpbnN0YW50aWF0ZVJlYWN0Q29tcG9uZW50KG5leHRDb21wb25lbnQsIG51bGwpO1xuICAgICAgdmFyIHJlYWN0Um9vdElEID0gUmVhY3RNb3VudC5fcmVnaXN0ZXJDb21wb25lbnQoXG4gICAgICAgIGNvbXBvbmVudEluc3RhbmNlLFxuICAgICAgICBjb250YWluZXJcbiAgICAgICk7XG4gICAgICBjb21wb25lbnRJbnN0YW5jZS5tb3VudENvbXBvbmVudEludG9Ob2RlKFxuICAgICAgICByZWFjdFJvb3RJRCxcbiAgICAgICAgY29udGFpbmVyLFxuICAgICAgICBzaG91bGRSZXVzZU1hcmt1cFxuICAgICAgKTtcblxuICAgICAgaWYgKFwicHJvZHVjdGlvblwiICE9PSBwcm9jZXNzLmVudi5OT0RFX0VOVikge1xuICAgICAgICAvLyBSZWNvcmQgdGhlIHJvb3QgZWxlbWVudCBpbiBjYXNlIGl0IGxhdGVyIGdldHMgdHJhbnNwbGFudGVkLlxuICAgICAgICByb290RWxlbWVudHNCeVJlYWN0Um9vdElEW3JlYWN0Um9vdElEXSA9XG4gICAgICAgICAgZ2V0UmVhY3RSb290RWxlbWVudEluQ29udGFpbmVyKGNvbnRhaW5lcik7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBjb21wb25lbnRJbnN0YW5jZTtcbiAgICB9XG4gICksXG5cbiAgLyoqXG4gICAqIFJlbmRlcnMgYSBSZWFjdCBjb21wb25lbnQgaW50byB0aGUgRE9NIGluIHRoZSBzdXBwbGllZCBgY29udGFpbmVyYC5cbiAgICpcbiAgICogSWYgdGhlIFJlYWN0IGNvbXBvbmVudCB3YXMgcHJldmlvdXNseSByZW5kZXJlZCBpbnRvIGBjb250YWluZXJgLCB0a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hdGlvbnMuXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgbW91bnRDaGlsZHJlbjogZnVuY3Rpb24obmVzdGVkQ2hpbGRyZW4sIHRyYW5zYWN0aW9uKSB7XG4gICAgICB2YXIgY2hpbGRyZW4gPSBmbGF0dGVuQ2hpbGRyZW4obmVzdGVkQ2hpbGRyZW4pO1xuICAgICAgdmFyIG1vdW50SW1hZ2VzID0gW107XG4gICAgICB2YXIgaW5kZXggPSAwO1xuICAgICAgdGhpcy5fcmVuZGVyZWRDaGlsZHJlbiA9IGNoaWxkcmVuO1xuICAgICAgZm9yICh2YXIgbmFtZSBpbiBjaGlsZHJlbikge1xuICAgICAgICB2YXIgY2hpbGQgPSBjaGlsZHJlbltuYW1lXTtcbiAgICAgICAgaWYgKGNoaWxkcmVuLmhhc093blByb3BlcnR5KG5hbWUpKSB7XG4gICAgICAgICAgLy8gVGhlIHJlbmRlcmVkIGNoaWxkcmVuIG11c3QgYmUgdHVybmVkIGludG8gaW5zdGFuY2VzIGFzIHRoZXkncmVcbiAgICAgICAgICAvLyBtb3VudGVkLlxuICAgICAgICAgIHZhciBjaGlsZEluc3RhbmNlID0gaW5zdGFudGlhdGVSZWFjdENvbXBvbmVudChjaGlsZCwgbnVsbCk7XG4gICAgICAgICAgY2hpbGRyZW5bbmFtZV0gPSBjaGlsZEluc3RhbmNlO1xuICAgICAgICAgIC8vIElubGluZWQgZm9yIHBlcmZvcm1hbmNlLCBzZWUgYFJlYWN0SW5zdGFuY2VIYW5kbGVzLmNyZWF0ZVJlYWN0SURgLlxuICAgICAgICAgIHZhciByb290SUQgPSB0aGlzLl9yb290Tm9kZUlEICsgbmFtZTtcbiAgICAgICAgICB2YXIgbW91bnRJbWFnZSA9IGNoaWxkSW5zdGFuY2UubW91bnRDb21wb25lbnQoXG4gICAgICAgICAgICByb290SUQsXG4gICAgICAgICAgICB0cmFuc2FjdGlvbixcbiAgICAgICAgICAgIHRoaXMuX21vdW50RGVwdGggKyAxXG4gICAgICAgICAgKTtcbiAgICAgICAgICBjaGlsZEluc3RhbmNlLl9tb3VudEluZGV4ID0gaW5kZXg7XG4gICAgICAgICAgbW91bnRJbWFnZXMucHVzaChtb3VudEltYWdlKTtcbiAgICAgICAgICBpbmRleCsrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gbW91bnRJbWFnZXM7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJlcGxhY2VzIGFueSByZW5kZXJlZCBjaGlsZHJlbiB3aXRoIGEgdGV4dCBjb250ZW50IHN0cmluZy5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBuZXh0Q29udGVudCBTdHJpbmcgb2YgY29udGVudC5cbiAgICAgKiBAaW50ZXJuYWxcbiAgICAgKi9cbiAgICB1cGRhdGVUZXh0Q29udGVudDogZnVuY3Rpb24obmV4dENvbnRlbnQpIHtcbiAgICAgIHVwZGF0ZURlcHRoKys7XG4gICAgICB2YXIgZXJyb3JUaHJvd24gPSB0cnVlO1xuICAgICAgdHJ5IHtcbiAgICAgICAgdmFyIHByZXZDaGlsZHJlbiA9IHRoaXMuX3JlbmRlcmVkQ2hpbGRyZW47XG4gICAgICAgIC8vIFJlbW92ZSBhbnkgcmVuZGVyZWQgY2hpbGRyZW4uXG4gICAgICAgIGZvciAodmFyIG5hbWUgaW4gcHJldkNoaWxkcmVuKSB7XG4gICAgICAgICAgaWYgKHByZXZDaGlsZHJlbi5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xuICAgICAgICAgICAgdGhpcy5fdW5tb3VudENoaWxkQnlOYW1lKHByZXZDaGlsZHJlbltuYW1lXSwgbmFtZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFNldCBuZXcgdGV4dCBjb250ZW50LlxuICAgICAgICB0aGlzLnNldFRleHRDb250ZW50KG5leHRDb250ZW50KTtcbiAgICAgICAgZXJyb3JUaHJvd24gPSBmYWxzZTtcbiAgICAgIH0gZm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VJlYWN0Q29tcG9uZW50KFxuICAgICAgICAgICAgbmV4dEVsZW1lbnQsXG4gICAgICAgICAgICBudWxsXG4gICAgICAgICAgKTtcbiAgICAgICAgICB0aGlzLl9tb3VudENoaWxkQnlOYW1lQXRJbmRleChcbiAgICAgICAgICAgIG5leHRDaGlsZEluc3RhbmNlLCBuYW1lLCBuZXh0SW5kZXgsIHRyYW5zYWN0aW9uXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICBuZXh0SW5kZXgrKztcbiAgICAgIH1cbiAgICAgIC8vIFJlbW92ZSBjaGlsZHJlbiB0aGF0IGFyZSBubyBsb25nZXIgcHJlc2VudC5cbiAgICAgIGZvciAobmFtZSBpbiBwcmV2Q2hpbGRyZW4pIHtcbiAgICAgICAgaWYgKHByZXZDaGlsZHJlbi5oYXNPd25Qcm9wZXJ0eShuYW1lKSAmJlxuICAgICAgICAgICAgIShuZXh0Q2hpbGRyZW4gJiYgbmV4dENoaWxkcmVuW25hbWVdKSkge1xuICAgICAgICAgIHRoaXMuX3VubW91bnRDaGlsZEJ5TmFtZShwcmV2Q2hpbGRyZW5bbmFtZV0sIG5hbWUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFVubW91bnRzIGFsbCByZW5kZXJlZCBjaGlsZHJlbi4gVGhpcyBzaG91bGQgYmUgdXNlZCB0byBjbGVhbiB1cCBjaGlsZHJlblxuICAgICAqIHdoZW4gdGhpcyBjb21wb25lbnQgaXMgdW5tb3VudGVkLlxuICAgICAqXG4gICAgICogQGludGVybmFsXG4gICAgICovXG4gICAgdW5tb3VudENoaWxkcmVuOiBmdW5jdGlvbigpIHtcbiAgICAgIHZhciByZW5kZXJlZENoaWxkcmVuID0gdGhpcy5fcmVuZGVyZWRDaGlsZHJlbjtcbiAgICAgIGZvciAodmFyIG5hbWUgaW4gcmVuZGVyZWRDaGlsZHJlbikge1xuICAgICAgICB2YXIgcmVuZGVyZWRDaGlsZ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xhc3RJbmRleCkge1xuICAgICAgICBlbnF1ZXVlTW92ZSh0aGlzLl9yb290Tm9kZUlELCBjaGlsZC5fbW91bnRJbmRleCwgdG9JbmRleCk7XG4gICAgICB9XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgYSBjaGlsZCBjb21wb25lbnQuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge1JlYWN0Q29tcG9uZW50fSBjaGlsZCBDb21wb25lbnQgdG8gY3JlYXRlLlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBtb3VudEltYWdlIE1hcmt1cCB0byBpbnNlcnQuXG4gICAgICogQHByb3RlY3RlZFxuICAgICAqL1xuICAgIGNyZWF0ZUNoaWxkOiBmdW5jdGlvbihjaGlsZCwgbW91bnRJbWFnZSkge1xuICAgICAgZW5xdWV1ZU1hcmt1cCh0aGlzLl9yb290Tm9kZUlELCBtb3VudEltYWdlLCBjaGlsZC5fbW91bnRJbmRleCk7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFJlbW92ZXMgYSBjaGlsZCBjb21wb25lbnQuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge1JlYWN0Q29tcG9uZW50fSBjaGlsZCBDaGlsZCB0byByZW1vdmUuXG4gICAgICogQHByb3RlY3RlZFxuICAgICAqL1xuICAgIHJlbW92ZUNoaWxkOiBmdW5jdGlvbihjaGlsZCkge1xuICAgICAgZW5xdWV1ZVJlbW92ZSh0aGlzLl9yb290Tm9kZUlELCBjaGlsZC5fbW91bnRJbmRleCk7XG4gICAgfSxcblxuICAgIC8qKlxuICAgICAqIFNldHMgdGhpcyB0ZXh0IGNvbnRlbnQgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IHRleHRDb250ZW50IFRleHQgY29udGVudCB0byBzZXQuXG4gICAgICogQHByb3RlY3RlZFxuICAgICAqL1xuICAgIHNldFRleHRDb250ZW50OiBmdW5jdGlvbih0ZXh0Q29udGVudCkge1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mNlIG9mIGEgYFRyYW5zYWN0aW9uYCBmb3IgcmV1c2UgbXVsdGlwbGUgdGltZXMsIHRoYXQgcG90ZW50aWFsbHlcbiAqIGlzIHVzZWQgdG8gd3JhcCBzZXZlcmFsIGRpZmZlcmVudCBtZXRob2RzLiBXcmFwcGVycyBhcmUgZXh0cmVtZWx5IHNpbXBsZSAtXG4gKiB0aGV5IG9ubHkgcmVxdWlyZSBpbXBsZW1lbnRpbmcgdHdvIG1ldGhvZHMuXG4gKlxuICogPHByZT5cbiAqICAgICAgICAgICAgICAgICAgICAgICB3cmFwcGVycyAoaW5qZWN0ZWQgYXQgY3JlYXRpb24gdGltZSlcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICAgICAgICArXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0tLS0tLXwtLS0tLS0tLXwtLS0tLS0tLS0tLS0tLStcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICB2ICAgICAgICB8ICAgICAgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgICAgICstLS0tLS0tLS0tLS0tLS0rICAgfCAgICAgICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICArLS18ICAgIHdyYXBwZXIxICAgfC0tLXwtLS0tKyAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgKy0tLS0tLS0tLS0tLS0tLSsgICB2ICAgIHwgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgICAgICAgKy0tLS0tLS0tLS0tLS0rICB8ICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICArLS0tLXwgICB3cmFwcGVyMiAgfC0tLS0tLS0tKyAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgICAgfCAgICArLS0tLS0tLS0tLS0tLSsgIHwgICAgIHwgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgIHwgICAgICAgICAgICAgICAgICAgICB8ICAgICB8ICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB2ICAgICB2ICAgICAgICAgICAgICAgICAgICAgdiAgICAgdiAgIHwgd3JhcHBlclxuICogICAgICAgICAgICAgICAgICAgIHwgKy0tLSsgKy0tLSsgICArLS0tLS0tLS0tKyAgICstLS0rICstLS0rIHwgaW52YXJpYW50c1xuICogcGVyZm9ybShhbnlNZXRob2QpIHwgfCAgIHwgfCAgIHwgICB8ICAgICAgICAgfCAgIHwgICB8IHwgICB8IHwgbWFpbnRhaW5lZFxuICogKy0tLS0tLS0tLS0tLS0tLS0tPnwtfC0tLXwtfC0tLXwtLT58YW55TWV0aG9kfC0tLXwtLS18LXwtLS18LXwtLS0tLS0tLT5cbiAqICAgICAgICAgICAgICAgICAgICB8IHwgICB8IHwgICB8ICAgfCAgICAgICAgIHwgICB8ICAgfCB8ICAgfCB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCB8ICAgfCB8ICAgfCAgIHwgICAgICAgICB8ICAgfCAgIHwgfCAgIHwgfFxuICogICAgICAgICAgICAgICAgICAgIHwgfCAgIHwgfCAgIHwgICB8ICAgICAgICAgfCAgIHwgICB8IHwgICB8IHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICstLS0rICstLS0rICAgKy0tLS0tLS0tLSsgICArLS0tKyArLS0tKyB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgaW5pdGlhbGl6ZSAgICAgICAgICAgICAgICAgICAgY2xvc2UgICAgfFxuICogICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLStcbiAqIDwvcHJlPlxuICpcbiAqIFVzZSBjYXNlczpcbiAqIC0gUHJlc2VydmluZyB0aGUgaW5wdXQgc2VsZWN0aW9uIHJhbm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dGhlc2UgY2FsbHMgdGhyZXcuXG4gICAgICBlcnJvclRocm93biA9IHRydWU7XG4gICAgICB0aGlzLmluaXRpYWxpemVBbGwoMCk7XG4gICAgICByZXQgPSBtZXRob2QuY2FsbChzY29wZSwgYSwgYiwgYywgZCwgZSwgZik7XG4gICAgICBlcnJvclRocm93biA9IGZhbHNlO1xuICAgIH0gZmluYWxseSB7XG4gICAgICB0cnkge1xuICAgICAgICBpZiAoZXJyb3JUaHJvd24pIHtcbiAgICAgICAgICAvLyBJZiBgbWV0aG9kYCB0aHJvd3MsIHByZWZlciB0byBzaG93IHRoYXQgc3RhY2sgdHJhY2Ugb3ZlciBhbnkgdGhyb3duXG4gICAgICAgICAgLy8gYnkgaW52b2tpbmcgYGNsb3NlQWxsYC5cbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy5jbG9zZUFsbCgwKTtcbiAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gU2luY2UgYG1ldGhvZGAgZGlkbid0IHRocm93LCB3ZSBkb24ndCB3YW50IHRvIHNpbGVuY2UgdGhlIGV4Y2VwdGlvblxuICAgICAgICAgIC8vIGhlcmUuXG4gICAgICAgICAgdGhpcy5jbG9zZUFsbCgwKTtcbiAgICAgICAgfVxuICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgdGhpcy5faXNJblRyYW5zYWN0aW9uID0gZmFsc2U7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXQ7XG4gIH0sXG5cbiAgaW5pdGlhbGl6ZUFsbDogZnVuY3Rpb24oc3RhcnRJbmRleCkge1xuICAgIHZhciB0cmFuc2FjdGlvbldyYXBwZXJzID0gdGhpcy50cmFuc2FjdGlvbldyYXBwZXJzO1xuICAgIGZvciAodmFyIGkgPSBzdGFydEluZGV4OyBpIDwgdHJhbnNhY3Rpb25XcmFwcGVycy5sZW5ndGg7IGkrKykge1xu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aWxkOyBET00gJyArXG4gICAgICAgICAgJ2VsZW1lbnRzIGFyZSBub3QgdmFsaWQgY2hpbGRyZW4gb2YgUmVhY3QgY29tcG9uZW50cy4nXG4gICAgICAgICkgOiBpbnZhcmlhbnQoIWNoaWxkcmVuIHx8IGNoaWxkcmVuLm5vZGVUeXBlICE9PSAxKSk7XG4gICAgICAgIGZvciAodmFyIGtleSBpbiBjaGlsZHJlbikge1xuICAgICAgICAgIGlmIChjaGlsZHJlbi5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICBuZXh0TmFtZSA9IChcbiAgICAgICAgICAgICAgbmFtZVNvRmFyICsgKG5hbWVTb0ZhciA/IFNVQlNFUEFSQVRPUiA6IFNFUEFSQVRPUikgK1xuICAgICAgICAgICAgICB3cmFwVXNlclByb3ZpZGVkS2V5KGtleSkgKyBTVUJTRVBBUkFUT1IgK1xuICAgICAgICAgICAgICBnZXRDb21wb25lbnRLZXkoY2hpbGRyZW5ba2V5XSwgMClcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBuZXh0SW5kZXggPSBpbmRleFNvRmFyICsgc3VidHJlZUNvdW50O1xuICAgICAgICAgICAgc3VidHJlZUNvdW50ICs9IHRyYXZlcnNlQWxsQ2hpbGRyZW5JbXBsKFxuICAgICAgICAgICAgICBjaGlsZHJlbltrZXldLFxuICAgICAgICAgICAgICBuZXh0TmFtZSxcbiAgICAgICAgICAgICAgbmV4dEluZGV4LFxuICAgICAgICAgICAgICBjYWxsYmFjayxcbiAgICAgICAgICAgICAgdHJhdmVyc2VDb250ZXh0XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gc3VidHJlZUNvdW50O1xuICB9O1xuXG4vKipcbiAqIFRyYXZlcnNlcyBjaGlsZHJlbiB0aGF0IGFyZSB0eXBpY2FsbHkgc3BlY2lmaWVkIGFzIGBwcm9wcy5jaGlsZHJlbmAsIG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ZXJ0QmVmb3JlKGVsLCBudWxsKTtcblxuICAgIGZvciAodmFyIHQgaW4gdHJhbnNmb3Jtcykge1xuICAgICAgICBpZiAoZWwuc3R5bGVbdF0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgZWwuc3R5bGVbdF0gPSBcInRyYW5zbGF0ZTNkKDFweCwxcHgsMXB4KVwiO1xuICAgICAgICAgICAgaGFzM2QgPSB3aW5kb3cuZ2V0Q29tcHV0ZWRTdHlsZShlbCkuZ2V0UHJvcGVydHlWYWx1ZSh0cmFuc2Zvcm1zW3RdKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQoZWwpO1xuXG4gICAgcmV0dXJuIChoYXMzZCAhPT0gdW5kZWZpbmVkICYmIGhhczNkLmxlbmd0aCA+IDAgJiYgaGFzM2QgIT09IFwibm9uZVwiKTtcbn0iXX0= diff --git a/src/carousel.scss b/src/carousel.scss index ffed2c64..5c28fa7b 100644 --- a/src/carousel.scss +++ b/src/carousel.scss @@ -1,4 +1,4 @@ -// // basic imports +// basic imports @import "styles/variables"; @import "styles/mixins/gradients"; @import "styles/mixins/breakpoints"; @@ -8,4 +8,4 @@ // buttons, form inputs, etc... @import "styles/elements"; -@import "carousel"; \ No newline at end of file +@import "components/carousel"; \ No newline at end of file diff --git a/src/components/Carousel.js b/src/components/Carousel.js index bff2ba4a..6651b689 100644 --- a/src/components/Carousel.js +++ b/src/components/Carousel.js @@ -4,11 +4,29 @@ var klass = require('../cssClasses'); var outerWidth = require('../dimensions').outerWidth; var has3d = require('../has3d')(); -// helper lib to do the swipe work -var Finger = require('ainojs-finger'); +var addClass = (el, className) => { + if (el.classList) + el.classList.add(className); + else + el.className += ' ' + className; +} + +var removeClass = (el, className) => { + if (el.classList) + el.classList.remove(className); + else + el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); +} + +// touch / swipe lib +var Hammer = require('hammerjs'); module.exports = React.createClass({ - + + currentPosition: 0, + position: null, + touchStart: null, + propsTypes: { items: React.PropTypes.array.isRequired }, @@ -39,14 +57,6 @@ module.exports = React.createClass({ componentWillUnmount() { window.removeEventListener("resize", this.updateDimensions); - - // unbinding swipe component - if (this.isSlider) { - this.finger.off('frame', this.onSwipeMove); - this.finger.off('complete', this.onSwipeEnd); - this.finger.destroy(); - } - }, componentWillReceiveProps (props, state) { @@ -73,19 +83,49 @@ module.exports = React.createClass({ // the container size to adjust the responsive behaviour this.updateDimensions(); - // swipe is only applied to slider because the of the current lib - // TODO: implement the swipe behaviour for the carousel too. - if (this.isSlider) { - var finger = new Finger(this.refs.itemsWrapper.getDOMNode()); + var el = this.refs.itemList.getDOMNode(); + + var self = this; + + var handleStart = (e) => { + console.log(e.touches[0]); + self.touchStart = e.touches[0].pageX; + addClass(el, 'swiping'); + } + + var handleMove = (e) => { + var delta = e.touches[0].pageX - self.touchStart; + var position = this.currentPosition + delta; + + console.log(this.currentPosition, delta); + - // this was breaking the tests, some weird behaviour of jest - if ('on' in finger) { - finger.on('frame', this.onSwipeMove); - finger.on('complete', this.onSwipeEnd); + self.position = delta; + + this.onSwipeMove({ + position: position + }) + } + + var handleEnd = (e) => { + var position = self.position; + + console.log('touchend', position) + // left + if (position < 0) { + this.slideLeft(); + } else { + this.slideRight(); } - this.finger = finger; + self.position = null; + self.touchStart = null; + removeClass(el, 'swiping'); } + + el.addEventListener('touchstart', handleStart); + el.addEventListener('touchmove', handleMove); + el.addEventListener('touchend', handleEnd); }, updateDimensions () { @@ -178,6 +218,7 @@ module.exports = React.createClass({ // if it's not a slider, we don't need to set position here selectedItem: this.isSlider ? position : this.state.selectedItem }); + this.triggerOnChange(position); }, @@ -277,6 +318,8 @@ module.exports = React.createClass({ } } + this.currentPosition = this.getNextPosition(); + itemListStyles.width = this.itemSize * total; var itemListProps = { diff --git a/src/components/_carousel.scss b/src/components/_carousel.scss index 1a7cf2b6..4b7e86ac 100644 --- a/src/components/_carousel.scss +++ b/src/components/_carousel.scss @@ -35,7 +35,7 @@ } .carousel { - + // only applying box sizing inside the plugin so it won't break any style * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; @@ -134,19 +134,18 @@ overflow: hidden; white-space: nowrap; + + &.swiping { + @include transition(none, 0, ease-in); + } } .slide { - @include transition(border, 0.25s, ease-in); display: inline-block; width: 260px; margin: 0px; white-space: nowrap; - @include tablet { - @include transition(border, 0.15s, ease-in); - } - img { vertical-align: top; } diff --git a/src/imageGallery.scss b/src/imageGallery.scss index 914bf23d..74e4e365 100644 --- a/src/imageGallery.scss +++ b/src/imageGallery.scss @@ -6,4 +6,4 @@ @import "styles/mixins/utils"; @import "styles/icons"; -@import "imageGallery"; \ No newline at end of file +@import "components/imageGallery"; \ No newline at end of file diff --git a/src/main.js b/src/main.js index 913dbd39..7cec404f 100644 --- a/src/main.js +++ b/src/main.js @@ -77,7 +77,7 @@ var DemoCarousel = React.createClass({ } }); -React.render(, document.querySelector('.demo-gallery')); +// React.render(, document.querySelector('.demo-gallery')); React.render(, document.querySelector('.demo-slider-controls')); -React.render(, document.querySelector('.demo-carousel')); +// React.render(, document.querySelector('.demo-carousel')); diff --git a/src/styles/mixins/_animation.scss b/src/styles/mixins/_animation.scss index a1813db7..957f2cf5 100644 --- a/src/styles/mixins/_animation.scss +++ b/src/styles/mixins/_animation.scss @@ -50,22 +50,3 @@ @content; } } - -@mixin rotateOnHover($transition-time, $transform-rotate) { - transition: $transition-time cubic-bezier(.5, 1, .75, 1); - - &:hover { - cursor: pointer; - transform: rotate($transform-rotate); - } -} -// Using this mixin looks like this: -// -// @include keyframes(move-the-object) { -// 0% { left: 100px; } -// 100% { left: 200px; } -// } - -// .object-to-animate { -// @include animation('move-the-object .5s 1', 'move-the-object-again .5s 1 .5s'); -// } \ No newline at end of file diff --git a/tasks/css.js b/tasks/css.js index 115a8ccd..98028ccb 100644 --- a/tasks/css.js +++ b/tasks/css.js @@ -17,6 +17,7 @@ module.exports = function (options) { options.environment = "development"; } + var isDevelopment = (options.environment === "development"); var isPackage = (options.environment === "package"); @@ -24,16 +25,11 @@ module.exports = function (options) { if (isPackage) destFolder += '/styles/'; - var start = new Date(); gutil.log('Building CSS bundle'); gulp.src([configs.paths.source + '/**/*.scss']) .pipe(sass({ - includePaths: [ - configs.folders.source + '/components', - configs.folders.source + '/styles' - ], errLogToConsole: true })) // minify only in production