diff --git a/dist/react-router.js b/dist/react-router.js index 0ddf702738..33b7dd63d2 100644 --- a/dist/react-router.js +++ b/dist/react-router.js @@ -104,8 +104,8 @@ var ReactRouter = /***/ function(module, exports, __webpack_require__) { var React = __webpack_require__(17); - var classSet = __webpack_require__(34); - var assign = __webpack_require__(35); + var classSet = __webpack_require__(32); + var assign = __webpack_require__(33); var Navigation = __webpack_require__(12); var State = __webpack_require__(13); @@ -442,38 +442,33 @@ var ReactRouter = // Do this BEFORE listening for hashchange. ensureSlash(); - if (_isListening) - return; + if (!_isListening) { + if (window.addEventListener) { + window.addEventListener('hashchange', onHashChange, false); + } else { + window.attachEvent('onhashchange', onHashChange); + } - if (window.addEventListener) { - window.addEventListener('hashchange', onHashChange, false); - } else { - window.attachEvent('onhashchange', onHashChange); + _isListening = true; } - - _isListening = true; }, removeChangeListener: function(listener) { - for (var i = 0, l = _changeListeners.length; i < l; i ++) { - if (_changeListeners[i] === listener) { - _changeListeners.splice(i, 1); - break; - } - } + _changeListeners = _changeListeners.filter(function (l) { + return l !== listener; + }); - if (window.removeEventListener) { - window.removeEventListener('hashchange', onHashChange, false); - } else { - window.removeEvent('onhashchange', onHashChange); - } + if (_changeListeners.length === 0) { + if (window.removeEventListener) { + window.removeEventListener('hashchange', onHashChange, false); + } else { + window.removeEvent('onhashchange', onHashChange); + } - if (_changeListeners.length === 0) _isListening = false; + } }, - - push: function (path) { _actionType = LocationActions.PUSH; window.location.hash = Path.encode(path); @@ -481,7 +476,7 @@ var ReactRouter = replace: function (path) { _actionType = LocationActions.REPLACE; - window.location.replace(window.location.pathname + '#' + Path.encode(path)); + window.location.replace(window.location.pathname + window.location.search + '#' + Path.encode(path)); }, pop: function () { @@ -544,38 +539,33 @@ var ReactRouter = addChangeListener: function (listener) { _changeListeners.push(listener); - if (_isListening) - return; + if (!_isListening) { + if (window.addEventListener) { + window.addEventListener('popstate', onPopState, false); + } else { + window.attachEvent('popstate', onPopState); + } - if (window.addEventListener) { - window.addEventListener('popstate', onPopState, false); - } else { - window.attachEvent('popstate', onPopState); + _isListening = true; } - - _isListening = true; }, removeChangeListener: function(listener) { - for (var i = 0, l = _changeListeners.length; i < l; i ++) { - if (_changeListeners[i] === listener) { - _changeListeners.splice(i, 1); - break; - } - } + _changeListeners = _changeListeners.filter(function (l) { + return l !== listener; + }); - if (window.addEventListener) { - window.removeEventListener('popstate', onPopState); - } else { - window.removeEvent('popstate', onPopState); - } + if (_changeListeners.length === 0) { + if (window.addEventListener) { + window.removeEventListener('popstate', onPopState); + } else { + window.removeEvent('popstate', onPopState); + } - if (_changeListeners.length === 0) _isListening = false; + } }, - - push: function (path) { window.history.pushState({ path: path }, '', Path.encode(path)); History.length += 1; @@ -855,9 +845,9 @@ var ReactRouter = /* jshint -W058 */ var React = __webpack_require__(17); - var warning = __webpack_require__(36); - var invariant = __webpack_require__(37); - var canUseDOM = __webpack_require__(38).canUseDOM; + var warning = __webpack_require__(34); + var invariant = __webpack_require__(35); + var canUseDOM = __webpack_require__(36).canUseDOM; var ImitateBrowserBehavior = __webpack_require__(10); var RouteHandler = __webpack_require__(6); var LocationActions = __webpack_require__(30); @@ -1012,6 +1002,14 @@ var ReactRouter = var state = {}; var nextState = {}; var pendingTransition = null; + var changeListener = null; + + function cancelPendingTransition() { + if (pendingTransition) { + pendingTransition.abort(new Cancellation); + pendingTransition = null; + } + } function updateState() { state = nextState; @@ -1047,6 +1045,7 @@ var ReactRouter = defaultRoute: null, notFoundRoute: null, + isRunning: false, /** * Adds routes to this router from the given children object (see ReactChildren). @@ -1168,14 +1167,11 @@ var ReactRouter = * all route handlers we're transitioning to. * * Both willTransitionFrom and willTransitionTo hooks may either abort or redirect the - * transition. To resolve asynchronously, they may use transition.wait(promise). If no + * transition. To resolve asynchronously, they may use the callback argument. If no * hooks wait, the transition is fully synchronous. */ dispatch: function (path, action, callback) { - if (pendingTransition) { - pendingTransition.abort(new Cancellation); - pendingTransition = null; - } + cancelPendingTransition(); var prevPath = state.path; if (prevPath === path) @@ -1223,7 +1219,9 @@ var ReactRouter = var transition = new Transition(path, this.replaceWith.bind(this, path)); pendingTransition = transition; - transition.from(fromRoutes, components, function (error) { + var fromComponents = components.slice(prevRoutes.length - fromRoutes.length); + + transition.from(fromRoutes, fromComponents, function (error) { if (error || transition.isAborted) return callback.call(router, error, transition); @@ -1251,6 +1249,11 @@ var ReactRouter = * Router.*Location objects (e.g. Router.HashLocation or Router.HistoryLocation). */ run: function (callback) { + invariant( + !this.isRunning, + 'Router is already running' + ); + var dispatchHandler = function (error, transition) { pendingTransition = null; @@ -1267,7 +1270,7 @@ var ReactRouter = router.dispatch(location, null, dispatchHandler); } else { // Listen for changes to the location. - var changeListener = function (change) { + changeListener = function (change) { router.dispatch(change.path, change.type, dispatchHandler); }; @@ -1276,11 +1279,20 @@ var ReactRouter = // Bootstrap using the current path. router.dispatch(location.getCurrentPath(), null, dispatchHandler); + + this.isRunning = true; } }, - teardown: function() { - location.removeChangeListener(this.changeListener); + stop: function () { + cancelPendingTransition(); + + if (location.removeChangeListener && changeListener) { + location.removeChangeListener(changeListener); + changeListener = null; + } + + this.isRunning = false; } }, @@ -1316,8 +1328,8 @@ var ReactRouter = this.setState(state); }, - componentWillUnmount: function() { - router.teardown(); + componentWillUnmount: function () { + router.stop(); }, render: function () { @@ -1407,8 +1419,8 @@ var ReactRouter = /* 16 */ /***/ function(module, exports, __webpack_require__) { - var invariant = __webpack_require__(37); - var canUseDOM = __webpack_require__(38).canUseDOM; + var invariant = __webpack_require__(35); + var canUseDOM = __webpack_require__(36).canUseDOM; var History = { @@ -1448,7 +1460,7 @@ var ReactRouter = /* 18 */ /***/ function(module, exports, __webpack_require__) { - var invariant = __webpack_require__(37); + var invariant = __webpack_require__(35); var FakeNode = { @@ -1535,9 +1547,9 @@ var ReactRouter = /* 21 */ /***/ function(module, exports, __webpack_require__) { - var invariant = __webpack_require__(37); - var merge = __webpack_require__(40).merge; - var qs = __webpack_require__(39); + var invariant = __webpack_require__(35); + var merge = __webpack_require__(38).merge; + var qs = __webpack_require__(37); var paramCompileMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g; var paramInjectMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g; @@ -1754,7 +1766,7 @@ var ReactRouter = /***/ function(module, exports, __webpack_require__) { var React = __webpack_require__(17); - var assign = __webpack_require__(35); + var assign = __webpack_require__(33); var Path = __webpack_require__(21); function routeIsActive(activeRoutes, routeName) { @@ -1860,8 +1872,8 @@ var ReactRouter = /* 24 */ /***/ function(module, exports, __webpack_require__) { - var invariant = __webpack_require__(37); - var canUseDOM = __webpack_require__(38).canUseDOM; + var invariant = __webpack_require__(35); + var canUseDOM = __webpack_require__(36).canUseDOM; var getWindowScrollPosition = __webpack_require__(31); function shouldUpdateScroll(state, prevState) { @@ -1951,8 +1963,8 @@ var ReactRouter = /* jshint -W084 */ var React = __webpack_require__(17); - var warning = __webpack_require__(36); - var invariant = __webpack_require__(37); + var warning = __webpack_require__(34); + var invariant = __webpack_require__(35); var DefaultRoute = __webpack_require__(1); var NotFoundRoute = __webpack_require__(3); var Redirect = __webpack_require__(4); @@ -2144,40 +2156,8 @@ var ReactRouter = /* 27 */ /***/ function(module, exports, __webpack_require__) { - var assign = __webpack_require__(35); - var reversedArray = __webpack_require__(32); + var assign = __webpack_require__(33); var Redirect = __webpack_require__(28); - var Promise = __webpack_require__(33); - - /** - * Runs all hook functions serially and calls callback(error) when finished. - * A hook may return a promise if it needs to execute asynchronously. - */ - function runHooks(hooks, callback) { - var promise; - try { - promise = hooks.reduce(function (promise, hook) { - // The first hook to use transition.wait makes the rest - // of the transition async from that point forward. - return promise ? promise.then(hook) : hook(); - }, null); - } catch (error) { - return callback(error); // Sync error. - } - - if (promise) { - // Use setTimeout to break the promise chain. - promise.then(function () { - setTimeout(callback); - }, function (error) { - setTimeout(function () { - callback(error); - }); - }); - } else { - callback(); - } - } /** * Calls the willTransitionFrom hook of all handlers in the given matches @@ -2186,23 +2166,27 @@ var ReactRouter = * Calls callback(error) when finished. */ function runTransitionFromHooks(transition, routes, components, callback) { - components = reversedArray(components); - - var hooks = reversedArray(routes).map(function (route, index) { - return function () { - var handler = route.handler; - - if (!transition.isAborted && handler.willTransitionFrom) - return handler.willTransitionFrom(transition, components[index]); - - var promise = transition._promise; - transition._promise = null; - - return promise; + var runHooks = routes.reduce(function (callback, route, index) { + return function (error) { + if (error || transition.isAborted) { + callback(error); + } else if (route.handler.willTransitionFrom) { + try { + route.handler.willTransitionFrom(transition, components[index], callback); + + // If there is no callback in the argument list, call it automatically. + if (route.handler.willTransitionFrom.length < 3) + callback(); + } catch (e) { + callback(e); + } + } else { + callback(); + } }; - }); + }, callback); - runHooks(hooks, callback); + runHooks(); } /** @@ -2211,21 +2195,27 @@ var ReactRouter = * handler. Calls callback(error) when finished. */ function runTransitionToHooks(transition, routes, params, query, callback) { - var hooks = routes.map(function (route) { - return function () { - var handler = route.handler; - - if (!transition.isAborted && handler.willTransitionTo) - handler.willTransitionTo(transition, params, query); - - var promise = transition._promise; - transition._promise = null; - - return promise; + var runHooks = routes.reduceRight(function (callback, route) { + return function (error) { + if (error || transition.isAborted) { + callback(error); + } else if (route.handler.willTransitionTo) { + try { + route.handler.willTransitionTo(transition, params, query, callback); + + // If there is no callback in the argument list, call it automatically. + if (route.handler.willTransitionTo.length < 4) + callback(); + } catch (e) { + callback(e); + } + } else { + callback(); + } }; - }); + }, callback); - runHooks(hooks, callback); + runHooks(); } /** @@ -2239,7 +2229,6 @@ var ReactRouter = this.abortReason = null; this.isAborted = false; this.retry = retry.bind(this); - this._promise = null; } assign(Transition.prototype, { @@ -2258,10 +2247,6 @@ var ReactRouter = this.abort(new Redirect(to, params, query)); }, - wait: function (value) { - this._promise = Promise.resolve(value); - }, - from: function (routes, components, callback) { return runTransitionFromHooks(this, routes, components, callback); }, @@ -2337,8 +2322,8 @@ var ReactRouter = /* 31 */ /***/ function(module, exports, __webpack_require__) { - var invariant = __webpack_require__(37); - var canUseDOM = __webpack_require__(38).canUseDOM; + var invariant = __webpack_require__(35); + var canUseDOM = __webpack_require__(36).canUseDOM; /** * Returns the current scroll position of the window as { x, y }. @@ -2360,29 +2345,6 @@ var ReactRouter = /***/ }, /* 32 */ -/***/ function(module, exports, __webpack_require__) { - - function reversedArray(array) { - return array.slice(0).reverse(); - } - - module.exports = reversedArray; - - -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { - - var Promise = __webpack_require__(43); - - // TODO: Use process.env.NODE_ENV check + envify to enable - // when's promise monitor here when in dev. - - module.exports = Promise; - - -/***/ }, -/* 34 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2425,7 +2387,7 @@ var ReactRouter = /***/ }, -/* 35 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2476,7 +2438,7 @@ var ReactRouter = /***/ }, -/* 36 */ +/* 34 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2492,7 +2454,7 @@ var ReactRouter = "use strict"; - var emptyFunction = __webpack_require__(41); + var emptyFunction = __webpack_require__(39); /** * Similar to invariant but only logs a warning if the condition is not met. @@ -2523,7 +2485,7 @@ var ReactRouter = /***/ }, -/* 37 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2582,7 +2544,7 @@ var ReactRouter = /***/ }, -/* 38 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2631,14 +2593,14 @@ var ReactRouter = /***/ }, -/* 39 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { - module.exports = __webpack_require__(42); + module.exports = __webpack_require__(40); /***/ }, -/* 40 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { // Load modules @@ -2669,29 +2631,26 @@ var ReactRouter = return target; } - if (Array.isArray(source)) { - for (var i = 0, il = source.length; i < il; ++i) { - if (typeof source[i] !== 'undefined') { - if (typeof target[i] === 'object') { - target[i] = exports.merge(target[i], source[i]); - } - else { - target[i] = source[i]; - } - } + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } + else { + target[source] = true; } return target; } - if (Array.isArray(target)) { - if (typeof source !== 'object') { - target.push(source); - return target; - } - else { - target = exports.arrayToObject(target); - } + if (typeof target !== 'object') { + target = [target].concat(source); + return target; + } + + if (Array.isArray(target) && + !Array.isArray(source)) { + + target = exports.arrayToObject(target); } var keys = Object.keys(source); @@ -2699,18 +2658,11 @@ var ReactRouter = var key = keys[k]; var value = source[key]; - if (value && - typeof value === 'object') { - - if (!target[key]) { - target[key] = value; - } - else { - target[key] = exports.merge(target[key], value); - } + if (!target[key]) { + target[key] = value; } else { - target[key] = value; + target[key] = exports.merge(target[key], value); } } @@ -2747,7 +2699,7 @@ var ReactRouter = if (Array.isArray(obj)) { var compacted = []; - for (var i = 0, l = obj.length; i < l; ++i) { + for (var i = 0, il = obj.length; i < il; ++i) { if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } @@ -2757,7 +2709,7 @@ var ReactRouter = } var keys = Object.keys(obj); - for (var i = 0, il = keys.length; i < il; ++i) { + for (i = 0, il = keys.length; i < il; ++i) { var key = keys[i]; obj[key] = exports.compact(obj[key], refs); } @@ -2773,17 +2725,20 @@ var ReactRouter = exports.isBuffer = function (obj) { - if (typeof Buffer !== 'undefined') { - return Buffer.isBuffer(obj); - } - else { + if (obj === null || + typeof obj === 'undefined') { + return false; } + + return !!(obj.constructor && + obj.constructor.isBuffer && + obj.constructor.isBuffer(obj)); }; /***/ }, -/* 41 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { /** @@ -2821,13 +2776,13 @@ var ReactRouter = /***/ }, -/* 42 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { // Load modules - var Stringify = __webpack_require__(44); - var Parse = __webpack_require__(45); + var Stringify = __webpack_require__(41); + var Parse = __webpack_require__(42); // Declare internals @@ -2842,45 +2797,23 @@ var ReactRouter = /***/ }, -/* 43 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;/** @license MIT License (c) copyright 2010-2014 original author or authors */ - /** @author Brian Cavalier */ - /** @author John Hann */ - - (function(define) { 'use strict'; - !(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) { - - var makePromise = __webpack_require__(46); - var Scheduler = __webpack_require__(47); - var async = __webpack_require__(48); - - return makePromise({ - scheduler: new Scheduler(async) - }); - - }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - })(__webpack_require__(50)); - - -/***/ }, -/* 44 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { // Load modules - var Utils = __webpack_require__(40); + var Utils = __webpack_require__(38); // Declare internals var internals = { - delimiter: '&' + delimiter: '&', + indices: true }; - internals.stringify = function (obj, prefix) { + internals.stringify = function (obj, prefix, options) { if (Utils.isBuffer(obj)) { obj = obj.toString(); @@ -2901,9 +2834,20 @@ var ReactRouter = var values = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']')); + if (typeof obj === 'undefined') { + return values; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + if (!options.indices && + Array.isArray(obj)) { + + values = values.concat(internals.stringify(obj[key], prefix, options)); + } + else { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', options)); } } @@ -2915,13 +2859,20 @@ var ReactRouter = options = options || {}; var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; + options.indices = typeof options.indices === 'boolean' ? options.indices : internals.indices; var keys = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - keys = keys.concat(internals.stringify(obj[key], key)); - } + if (typeof obj !== 'object' || + obj === null) { + + return ''; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + keys = keys.concat(internals.stringify(obj[key], key, options)); } return keys.join(delimiter); @@ -2929,12 +2880,12 @@ var ReactRouter = /***/ }, -/* 45 */ +/* 42 */ /***/ function(module, exports, __webpack_require__) { // Load modules - var Utils = __webpack_require__(40); + var Utils = __webpack_require__(38); // Declare internals @@ -2963,7 +2914,7 @@ var ReactRouter = var key = Utils.decode(part.slice(0, pos)); var val = Utils.decode(part.slice(pos + 1)); - if (!obj[key]) { + if (!obj.hasOwnProperty(key)) { obj[key] = val; } else { @@ -2992,8 +2943,11 @@ var ReactRouter = else { var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; var index = parseInt(cleanRoot, 10); + var indexString = '' + index; if (!isNaN(index) && root !== cleanRoot && + indexString === cleanRoot && + index >= 0 && index <= options.arrayLimit) { obj = []; @@ -3088,1154 +3042,5 @@ var ReactRouter = }; -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;/** @license MIT License (c) copyright 2010-2014 original author or authors */ - /** @author Brian Cavalier */ - /** @author John Hann */ - - (function(define) { 'use strict'; - !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { - - return function makePromise(environment) { - - var tasks = environment.scheduler; - - var objectCreate = Object.create || - function(proto) { - function Child() {} - Child.prototype = proto; - return new Child(); - }; - - /** - * Create a promise whose fate is determined by resolver - * @constructor - * @returns {Promise} promise - * @name Promise - */ - function Promise(resolver, handler) { - this._handler = resolver === Handler ? handler : init(resolver); - } - - /** - * Run the supplied resolver - * @param resolver - * @returns {Pending} - */ - function init(resolver) { - var handler = new Pending(); - - try { - resolver(promiseResolve, promiseReject, promiseNotify); - } catch (e) { - promiseReject(e); - } - - return handler; - - /** - * Transition from pre-resolution state to post-resolution state, notifying - * all listeners of the ultimate fulfillment or rejection - * @param {*} x resolution value - */ - function promiseResolve (x) { - handler.resolve(x); - } - /** - * Reject this promise with reason, which will be used verbatim - * @param {Error|*} reason rejection reason, strongly suggested - * to be an Error type - */ - function promiseReject (reason) { - handler.reject(reason); - } - - /** - * Issue a progress event, notifying all progress listeners - * @param {*} x progress event payload to pass to all listeners - */ - function promiseNotify (x) { - handler.notify(x); - } - } - - // Creation - - Promise.resolve = resolve; - Promise.reject = reject; - Promise.never = never; - - Promise._defer = defer; - Promise._handler = getHandler; - - /** - * Returns a trusted promise. If x is already a trusted promise, it is - * returned, otherwise returns a new trusted Promise which follows x. - * @param {*} x - * @return {Promise} promise - */ - function resolve(x) { - return isPromise(x) ? x - : new Promise(Handler, new Async(getHandler(x))); - } - - /** - * Return a reject promise with x as its reason (x is used verbatim) - * @param {*} x - * @returns {Promise} rejected promise - */ - function reject(x) { - return new Promise(Handler, new Async(new Rejected(x))); - } - - /** - * Return a promise that remains pending forever - * @returns {Promise} forever-pending promise. - */ - function never() { - return foreverPendingPromise; // Should be frozen - } - - /** - * Creates an internal {promise, resolver} pair - * @private - * @returns {Promise} - */ - function defer() { - return new Promise(Handler, new Pending()); - } - - // Transformation and flow control - - /** - * Transform this promise's fulfillment value, returning a new Promise - * for the transformed result. If the promise cannot be fulfilled, onRejected - * is called with the reason. onProgress *may* be called with updates toward - * this promise's fulfillment. - * @param {function=} onFulfilled fulfillment handler - * @param {function=} onRejected rejection handler - * @deprecated @param {function=} onProgress progress handler - * @return {Promise} new promise - */ - Promise.prototype.then = function(onFulfilled, onRejected) { - var parent = this._handler; - var state = parent.join().state(); - - if ((typeof onFulfilled !== 'function' && state > 0) || - (typeof onRejected !== 'function' && state < 0)) { - // Short circuit: value will not change, simply share handler - return new this.constructor(Handler, parent); - } - - var p = this._beget(); - var child = p._handler; - - parent.chain(child, parent.receiver, onFulfilled, onRejected, - arguments.length > 2 ? arguments[2] : void 0); - - return p; - }; - - /** - * If this promise cannot be fulfilled due to an error, call onRejected to - * handle the error. Shortcut for .then(undefined, onRejected) - * @param {function?} onRejected - * @return {Promise} - */ - Promise.prototype['catch'] = function(onRejected) { - return this.then(void 0, onRejected); - }; - - /** - * Creates a new, pending promise of the same type as this promise - * @private - * @returns {Promise} - */ - Promise.prototype._beget = function() { - var parent = this._handler; - var child = new Pending(parent.receiver, parent.join().context); - return new this.constructor(Handler, child); - }; - - // Array combinators - - Promise.all = all; - Promise.race = race; - - /** - * Return a promise that will fulfill when all promises in the - * input array have fulfilled, or will reject when one of the - * promises rejects. - * @param {array} promises array of promises - * @returns {Promise} promise for array of fulfillment values - */ - function all(promises) { - /*jshint maxcomplexity:8*/ - var resolver = new Pending(); - var pending = promises.length >>> 0; - var results = new Array(pending); - - var i, h, x, s; - for (i = 0; i < promises.length; ++i) { - x = promises[i]; - - if (x === void 0 && !(i in promises)) { - --pending; - continue; - } - - if (maybeThenable(x)) { - h = getHandlerMaybeThenable(x); - - s = h.state(); - if (s === 0) { - h.fold(settleAt, i, results, resolver); - } else if (s > 0) { - results[i] = h.value; - --pending; - } else { - unreportRemaining(promises, i+1, h); - resolver.become(h); - break; - } - - } else { - results[i] = x; - --pending; - } - } - - if(pending === 0) { - resolver.become(new Fulfilled(results)); - } - - return new Promise(Handler, resolver); - - function settleAt(i, x, resolver) { - /*jshint validthis:true*/ - this[i] = x; - if(--pending === 0) { - resolver.become(new Fulfilled(this)); - } - } - } - - function unreportRemaining(promises, start, rejectedHandler) { - var i, h, x; - for(i=start; i 0) { - queue.shift().run(); - } - } - - return Scheduler; - - }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }(__webpack_require__(50))); - - -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;var require;/* WEBPACK VAR INJECTION */(function(process) {/** @license MIT License (c) copyright 2010-2014 original author or authors */ - /** @author Brian Cavalier */ - /** @author John Hann */ - - (function(define) { 'use strict'; - !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require) { - - // Sniff "best" async scheduling option - // Prefer process.nextTick or MutationObserver, then check for - // vertx and finally fall back to setTimeout - - /*jshint maxcomplexity:6*/ - /*global process,document,setTimeout,MutationObserver,WebKitMutationObserver*/ - var nextTick, MutationObs; - - if (typeof process !== 'undefined' && process !== null && - typeof process.nextTick === 'function') { - nextTick = function(f) { - process.nextTick(f); - }; - - } else if (MutationObs = - (typeof MutationObserver === 'function' && MutationObserver) || - (typeof WebKitMutationObserver === 'function' && WebKitMutationObserver)) { - nextTick = (function (document, MutationObserver) { - var scheduled; - var el = document.createElement('div'); - var o = new MutationObserver(run); - o.observe(el, { attributes: true }); - - function run() { - var f = scheduled; - scheduled = void 0; - f(); - } - - return function (f) { - scheduled = f; - el.setAttribute('class', 'x'); - }; - }(document, MutationObs)); - - } else { - nextTick = (function(cjsRequire) { - var vertx; - try { - // vert.x 1.x || 2.x - vertx = __webpack_require__(49); - } catch (ignore) {} - - if (vertx) { - if (typeof vertx.runOnLoop === 'function') { - return vertx.runOnLoop; - } - if (typeof vertx.runOnContext === 'function') { - return vertx.runOnContext; - } - } - - // capture setTimeout to avoid being caught by fake timers - // used in time based tests - var capturedSetTimeout = setTimeout; - return function (t) { - capturedSetTimeout(t, 0); - }; - }(require)); - } - - return nextTick; - }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - }(__webpack_require__(50))); - - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(52))) - -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { - - /* (ignored) */ - -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { - - module.exports = function() { throw new Error("define cannot be used indirect"); }; - - -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;/** @license MIT License (c) copyright 2010-2014 original author or authors */ - /** @author Brian Cavalier */ - /** @author John Hann */ - - (function(define) { 'use strict'; - !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { - /** - * Circular queue - * @param {number} capacityPow2 power of 2 to which this queue's capacity - * will be set initially. eg when capacityPow2 == 3, queue capacity - * will be 8. - * @constructor - */ - function Queue(capacityPow2) { - this.head = this.tail = this.length = 0; - this.buffer = new Array(1 << capacityPow2); - } - - Queue.prototype.push = function(x) { - if(this.length === this.buffer.length) { - this._ensureCapacity(this.length * 2); - } - - this.buffer[this.tail] = x; - this.tail = (this.tail + 1) & (this.buffer.length - 1); - ++this.length; - return this.length; - }; - - Queue.prototype.shift = function() { - var x = this.buffer[this.head]; - this.buffer[this.head] = void 0; - this.head = (this.head + 1) & (this.buffer.length - 1); - --this.length; - return x; - }; - - Queue.prototype._ensureCapacity = function(capacity) { - var head = this.head; - var buffer = this.buffer; - var newBuffer = new Array(capacity); - var i = 0; - var len; - - if(head === 0) { - len = this.length; - for(; i 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; - })(); - - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - // TODO(shtylman) - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - - /***/ } /******/ ]) \ No newline at end of file diff --git a/dist/react-router.min.js b/dist/react-router.min.js index 9f50570d75..939ff9d931 100644 --- a/dist/react-router.min.js +++ b/dist/react-router.min.js @@ -1,11 +1,6 @@ -var ReactRouter=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){e.DefaultRoute=n(1),e.Link=n(2),e.NotFoundRoute=n(3),e.Redirect=n(4),e.Route=n(5),e.RouteHandler=n(6),e.HashLocation=n(7),e.HistoryLocation=n(8),e.RefreshLocation=n(9),e.ImitateBrowserBehavior=n(10),e.ScrollToTopBehavior=n(11),e.Navigation=n(12),e.State=n(13),e.create=n(14),e.run=n(15),e.History=n(16)},function(t,e,n){var r=n(17),o=n(18),i=n(19),u=r.createClass({displayName:"DefaultRoute",mixins:[o],propTypes:{name:r.PropTypes.string,path:i.falsy,handler:r.PropTypes.func.isRequired}});t.exports=u},function(t,e,n){function r(t){return 0===t.button}function o(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var i=n(17),u=n(34),s=n(35),a=n(12),c=n(13),p=i.createClass({displayName:"Link",mixins:[a,c],propTypes:{activeClassName:i.PropTypes.string.isRequired,to:i.PropTypes.string.isRequired,params:i.PropTypes.object,query:i.PropTypes.object,onClick:i.PropTypes.func},getDefaultProps:function(){return{activeClassName:"active"}},handleClick:function(t){var e,n=!0;this.props.onClick&&(e=this.props.onClick(t)),!o(t)&&r(t)&&((e===!1||t.defaultPrevented===!0)&&(n=!1),t.preventDefault(),n&&this.transitionTo(this.props.to,this.props.params,this.props.query))},getHref:function(){return this.makeHref(this.props.to,this.props.params,this.props.query)},getClassName:function(){var t={};return this.props.className&&(t[this.props.className]=!0),this.isActive(this.props.to,this.props.params,this.props.query)&&(t[this.props.activeClassName]=!0),u(t)},render:function(){var t=s({},this.props,{href:this.getHref(),className:this.getClassName(),onClick:this.handleClick});return i.DOM.a(t,this.props.children)}});t.exports=p},function(t,e,n){var r=n(17),o=n(18),i=n(19),u=r.createClass({displayName:"NotFoundRoute",mixins:[o],propTypes:{name:r.PropTypes.string,path:i.falsy,handler:r.PropTypes.func.isRequired}});t.exports=u},function(t,e,n){var r=n(17),o=n(18),i=n(19),u=r.createClass({displayName:"Redirect",mixins:[o],propTypes:{path:r.PropTypes.string,from:r.PropTypes.string,to:r.PropTypes.string,handler:i.falsy}});t.exports=u},function(t,e,n){var r=n(17),o=n(18),i=r.createClass({displayName:"Route",mixins:[o],propTypes:{name:r.PropTypes.string,path:r.PropTypes.string,handler:r.PropTypes.func.isRequired,ignoreScrollBehavior:r.PropTypes.bool}});t.exports=i},function(t,e,n){var r=n(17),o=n(20),i=r.createClass({displayName:"RouteHandler",mixins:[o],getDefaultProps:function(){return{ref:"__routeHandler__"}},render:function(){return this.getRouteHandler()}});t.exports=i},function(t,e,n){function r(){return p.decode(window.location.href.split("#")[1]||"")}function o(){var t=r();return"/"===t.charAt(0)?!0:(l.replace("/"+t),!1)}function i(t){t===a.PUSH&&(c.length+=1);var e={path:r(),type:t};f.forEach(function(t){t(e)})}function u(){o()&&(i(s||a.POP),s=null)}var s,a=n(30),c=n(16),p=n(21),f=[],h=!1,l={addChangeListener:function(t){f.push(t),o(),h||(window.addEventListener?window.addEventListener("hashchange",u,!1):window.attachEvent("onhashchange",u),h=!0)},removeChangeListener:function(t){for(var e=0,n=f.length;n>e;e++)if(f[e]===t){f.splice(e,1);break}window.removeEventListener?window.removeEventListener("hashchange",u,!1):window.removeEvent("onhashchange",u),0===f.length&&(h=!1)},push:function(t){s=a.PUSH,window.location.hash=p.encode(t)},replace:function(t){s=a.REPLACE,window.location.replace(window.location.pathname+"#"+p.encode(t))},pop:function(){s=a.POP,c.back()},getCurrentPath:r,toString:function(){return""}};t.exports=l},function(t,e,n){function r(){return a.decode(window.location.pathname+window.location.search)}function o(t){var e={path:r(),type:t};c.forEach(function(t){t(e)})}function i(){o(u.POP)}var u=n(30),s=n(16),a=n(21),c=[],p=!1,f={addChangeListener:function(t){c.push(t),p||(window.addEventListener?window.addEventListener("popstate",i,!1):window.attachEvent("popstate",i),p=!0)},removeChangeListener:function(t){for(var e=0,n=c.length;n>e;e++)if(c[e]===t){c.splice(e,1);break}window.addEventListener?window.removeEventListener("popstate",i):window.removeEvent("popstate",i),0===c.length&&(p=!1)},push:function(t){window.history.pushState({path:t},"",a.encode(t)),s.length+=1,o(u.PUSH)},replace:function(t){window.history.replaceState({path:t},"",a.encode(t)),o(u.REPLACE)},pop:s.back,getCurrentPath:r,toString:function(){return""}};t.exports=f},function(t,e,n){var r=n(8),o=n(16),i=n(21),u={push:function(t){window.location=i.encode(t)},replace:function(t){window.location.replace(i.encode(t))},pop:o.back,getCurrentPath:r.getCurrentPath,toString:function(){return""}};t.exports=u},function(t,e,n){var r=n(30),o={updateScrollPosition:function(t,e){switch(e){case r.PUSH:case r.REPLACE:window.scrollTo(0,0);break;case r.POP:t?window.scrollTo(t.x,t.y):window.scrollTo(0,0)}}};t.exports=o},function(t){var e={updateScrollPosition:function(){window.scrollTo(0,0)}};t.exports=e},function(t,e,n){var r=n(17),o={contextTypes:{makePath:r.PropTypes.func.isRequired,makeHref:r.PropTypes.func.isRequired,transitionTo:r.PropTypes.func.isRequired,replaceWith:r.PropTypes.func.isRequired,goBack:r.PropTypes.func.isRequired},makePath:function(t,e,n){return this.context.makePath(t,e,n)},makeHref:function(t,e,n){return this.context.makeHref(t,e,n)},transitionTo:function(t,e,n){this.context.transitionTo(t,e,n)},replaceWith:function(t,e,n){this.context.replaceWith(t,e,n)},goBack:function(){this.context.goBack()}};t.exports=o},function(t,e,n){var r=n(17),o={contextTypes:{getCurrentPath:r.PropTypes.func.isRequired,getCurrentRoutes:r.PropTypes.func.isRequired,getCurrentPathname:r.PropTypes.func.isRequired,getCurrentParams:r.PropTypes.func.isRequired,getCurrentQuery:r.PropTypes.func.isRequired,isActive:r.PropTypes.func.isRequired},getPath:function(){return this.context.getCurrentPath()},getRoutes:function(){return this.context.getCurrentRoutes()},getPathname:function(){return this.context.getCurrentPathname()},getParams:function(){return this.context.getCurrentParams()},getQuery:function(){return this.context.getCurrentQuery()},isActive:function(t,e,n){return this.context.isActive(t,e,n)}};t.exports=o},function(t,e,n){function r(t){throw t}function o(t,e){if("string"==typeof e)throw new Error("Unhandled aborted transition! Reason: "+t);t instanceof A||(t instanceof j?e.replace(this.makePath(t.to,t.params,t.query)):e.pop())}function i(t,e,n,r){for(var o,s,a,c=0,p=e.length;p>c;++c){if(s=e[c],o=i(t,s.childRoutes,s.defaultRoute,s.notFoundRoute),null!=o)return o.routes.unshift(s),o;if(a=k.extractParams(s.path,t))return u(s,a)}return n&&(a=k.extractParams(n.path,t))?u(n,a):r&&(a=k.extractParams(r.path,t))?u(r,a):o}function u(t,e){return{routes:[t],params:e}}function s(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function a(t,e,n,r,o,i){return t.some(function(t){if(t!==e)return!1;for(var u,a=e.paramNames,c=0,p=a.length;p>c;++c)if(u=a[c],r[u]!==n[u])return!1;return s(o,i)&&s(i,o)})}function c(t){function e(){H=S,S={}}t=t||{},"function"==typeof t?t={routes:t}:Array.isArray(t)&&(t={routes:t});var n=[],u={},s=[],c=t.location||E,d=t.scrollBehavior||q,j=t.onError||r,L=t.onAbort||o,H={},S={},N=null;"string"==typeof c?f(!l||!1,"You should not use a static location in a DOM environment because the router will not be kept in sync with the current URL"):h(l,"You cannot use %s without a DOM",c),c!==g||C()||(c=w);var D=p.createClass({displayName:"Router",mixins:[x,P,R],statics:{defaultRoute:null,notFoundRoute:null,addRoutes:function(t){n.push.apply(n,b(t,this,u))},makePath:function(t,e,n){var r;if(k.isAbsolute(t))r=k.normalize(t);else{var o=u[t];h(o,'Unable to find ',t),r=o.path}return k.withQuery(k.injectParams(r,e),n)},makeHref:function(t,e,n){var r=this.makePath(t,e,n);return c===m?"#"+r:r},transitionTo:function(t,e,n){h("string"!=typeof c,"You cannot use transitionTo with a static location");var r=this.makePath(t,e,n);N?c.replace(r):c.push(r)},replaceWith:function(t,e,n){h("string"!=typeof c,"You cannot use replaceWith with a static location"),c.replace(this.makePath(t,e,n))},goBack:function(){return h("string"!=typeof c,"You cannot use goBack with a static location"),O.length>1||c===w?(c.pop(),!0):(f(!1,"goBack() was ignored because there is no router history"),!1)},match:function(t){return i(t,n,this.defaultRoute,this.notFoundRoute)||null},dispatch:function(t,e,n){N&&(N.abort(new A),N=null);var r=H.path;if(r!==t){r&&e!==v.REPLACE&&this.recordScrollPosition(r);var o=k.withoutQuery(t),i=this.match(o);f(null!=i,'No route matches path "%s". Make sure you have somewhere in your routes',t,t),null==i&&(i={});var u,c,p=H.routes||[],h=H.params||{},l=H.query||{},d=i.routes||[],y=i.params||{},m=k.extractQuery(t)||{};p.length?(u=p.filter(function(t){return!a(d,t,h,y,l,m)}),c=d.filter(function(t){return!a(p,t,h,y,l,m)})):(u=[],c=d);var g=new T(t,this.replaceWith.bind(this,t));N=g,g.from(u,s,function(r){return r||g.isAborted?n.call(D,r,g):void g.to(c,y,m,function(r){return r||g.isAborted?n.call(D,r,g):(S.path=t,S.action=e,S.pathname=o,S.routes=d,S.params=y,S.query=m,void n.call(D,null,g))})})}},run:function(t){var e=function(e,n){N=null,e?j.call(D,e):n.isAborted?L.call(D,n.abortReason,c):t.call(D,D,S)};if("string"==typeof c)D.dispatch(c,null,e);else{var n=function(t){D.dispatch(t.path,t.type,e)};c.addChangeListener&&c.addChangeListener(n),D.dispatch(c.getCurrentPath(),null,e)}},teardown:function(){c.removeChangeListener(this.changeListener)}},propTypes:{children:_.falsy},getLocation:function(){return c},getScrollBehavior:function(){return d},getRouteAtDepth:function(t){var e=this.state.routes;return e&&e[t]},getRouteComponents:function(){return s},getInitialState:function(){return e(),H},componentWillReceiveProps:function(){e(),this.setState(H)},componentWillUnmount:function(){D.teardown()},render:function(){return this.getRouteAtDepth(0)?p.createElement(y,this.props):null},childContextTypes:{getRouteAtDepth:p.PropTypes.func.isRequired,getRouteComponents:p.PropTypes.func.isRequired,routeHandlers:p.PropTypes.array.isRequired},getChildContext:function(){return{getRouteComponents:this.getRouteComponents,getRouteAtDepth:this.getRouteAtDepth,routeHandlers:[this]}}});return t.routes&&D.addRoutes(t.routes),D}var p=n(17),f=n(36),h=n(37),l=n(38).canUseDOM,d=n(10),y=n(6),v=n(30),m=n(7),g=n(8),w=n(9),x=n(22),P=n(23),R=n(24),b=n(25),C=n(26),T=n(27),_=n(19),j=n(28),O=n(16),A=n(29),k=n(21),E=l?m:"/",q=l?d:null;t.exports=c},function(t,e,n){function r(t,e,n){"function"==typeof e&&(n=e,e=null);var r=o({routes:t,location:e});return r.run(n),r}var o=n(14);t.exports=r},function(t,e,n){var r=n(37),o=n(38).canUseDOM,i={back:function(){r(o,"Cannot use History.back without a DOM"),i.length-=1,window.history.back()},length:1};t.exports=i},function(t){t.exports=React},function(t,e,n){var r=n(37),o={render:function(){r(!1,"%s elements should not be rendered",this.constructor.displayName)}};t.exports=o},function(t){var e={falsy:function(t,e,n){return t[e]?new Error("<"+n+'> may not have a "'+e+'" prop'):void 0}};t.exports=e},function(t,e,n){var r=n(17);t.exports={contextTypes:{getRouteAtDepth:r.PropTypes.func.isRequired,getRouteComponents:r.PropTypes.func.isRequired,routeHandlers:r.PropTypes.array.isRequired},childContextTypes:{routeHandlers:r.PropTypes.array.isRequired},getChildContext:function(){return{routeHandlers:this.context.routeHandlers.concat([this])}},getRouteDepth:function(){return this.context.routeHandlers.length-1},componentDidMount:function(){this._updateRouteComponent()},componentDidUpdate:function(){this._updateRouteComponent()},_updateRouteComponent:function(){var t=this.getRouteDepth(),e=this.context.getRouteComponents();e[t]=this.refs[this.props.ref||"__routeHandler__"]},getRouteHandler:function(t){var e=this.context.getRouteAtDepth(this.getRouteDepth());return e?r.createElement(e.handler,t||this.props):null}}},function(t,e,n){function r(t){if(!(t in f)){var e=[],n=t.replace(s,function(t,n){return n?(e.push(n),"([^/?#]+)"):"*"===t?(e.push("splat"),"(.*?)"):"\\"+t});f[t]={matcher:new RegExp("^"+n+"$","i"),paramNames:e}}return f[t]}var o=n(37),i=n(40).merge,u=n(39),s=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g,a=/:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g,c=/\/\/\?|\/\?/g,p=/\?(.+)/,f={},h={decode:function(t){return decodeURI(t.replace(/\+/g," "))},encode:function(t){return encodeURI(t).replace(/%20/g,"+")},extractParamNames:function(t){return r(t).paramNames},extractParams:function(t,e){var n=r(t),o=e.match(n.matcher);if(!o)return null;var i={};return n.paramNames.forEach(function(t,e){i[t]=o[e+1]}),i},injectParams:function(t,e){e=e||{};var n=0;return t.replace(a,function(r,i){if(i=i||"splat","?"!==i.slice(-1))o(null!=e[i],'Missing "'+i+'" parameter for path "'+t+'"');else if(i=i.slice(0,-1),null==e[i])return"";var u;return"splat"===i&&Array.isArray(e[i])?(u=e[i][n++],o(null!=u,"Missing splat # "+n+' for path "'+t+'"')):u=e[i],u}).replace(c,"/")},extractQuery:function(t){var e=t.match(p);return e&&u.parse(e[1])},withoutQuery:function(t){return t.replace(p,"")},withQuery:function(t,e){var n=h.extractQuery(t);n&&(e=e?i(n,e):n);var r=e&&u.stringify(e);return r?h.withoutQuery(t)+"?"+r:t},isAbsolute:function(t){return"/"===t.charAt(0)},normalize:function(t){return t.replace(/^\/*/,"/")},join:function(t,e){return t.replace(/\/*$/,"/")+e}};t.exports=h},function(t,e,n){var r=n(17),o={childContextTypes:{makePath:r.PropTypes.func.isRequired,makeHref:r.PropTypes.func.isRequired,transitionTo:r.PropTypes.func.isRequired,replaceWith:r.PropTypes.func.isRequired,goBack:r.PropTypes.func.isRequired},getChildContext:function(){return{makePath:this.constructor.makePath,makeHref:this.constructor.makeHref,transitionTo:this.constructor.transitionTo,replaceWith:this.constructor.replaceWith,goBack:this.constructor.goBack}}};t.exports=o},function(t,e,n){function r(t,e){return t.some(function(t){return t.name===e})}function o(t,e){for(var n in e)if(String(t[n])!==String(e[n]))return!1;return!0}function i(t,e){for(var n in e)if(String(t[n])!==String(e[n]))return!1;return!0}var u=n(17),s=n(35),a=n(21),c={getCurrentPath:function(){return this.state.path},getCurrentRoutes:function(){return this.state.routes.slice(0)},getCurrentPathname:function(){return this.state.pathname},getCurrentParams:function(){return s({},this.state.params)},getCurrentQuery:function(){return s({},this.state.query)},isActive:function(t,e,n){return a.isAbsolute(t)?t===this.state.path:r(this.state.routes,t)&&o(this.state.params,e)&&(null==n||i(this.state.query,n))},childContextTypes:{getCurrentPath:u.PropTypes.func.isRequired,getCurrentRoutes:u.PropTypes.func.isRequired,getCurrentPathname:u.PropTypes.func.isRequired,getCurrentParams:u.PropTypes.func.isRequired,getCurrentQuery:u.PropTypes.func.isRequired,isActive:u.PropTypes.func.isRequired},getChildContext:function(){return{getCurrentPath:this.getCurrentPath,getCurrentRoutes:this.getCurrentRoutes,getCurrentPathname:this.getCurrentPathname,getCurrentParams:this.getCurrentParams,getCurrentQuery:this.getCurrentQuery,isActive:this.isActive}}};t.exports=c},function(t,e,n){function r(t,e){if(!e)return!0;if(t.pathname===e.pathname)return!1;var n=t.routes,r=e.routes,o=n.filter(function(t){return-1!==r.indexOf(t)});return!o.some(function(t){return t.ignoreScrollBehavior})}var o=n(37),i=n(38).canUseDOM,u=n(31),s={statics:{recordScrollPosition:function(t){this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]=u()},getScrollPosition:function(t){return this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]||null}},componentWillMount:function(){o(null==this.getScrollBehavior()||i,"Cannot use scroll behavior without a DOM")},componentDidMount:function(){this._updateScroll()},componentDidUpdate:function(t,e){this._updateScroll(e)},_updateScroll:function(t){if(r(this.state,t)){var e=this.getScrollBehavior();e&&e.updateScrollPosition(this.constructor.getScrollPosition(this.state.path),this.state.action)}}};t.exports=s},function(t,e,n){function r(t,e,n){return s.createClass({statics:{willTransitionTo:function(r,o,i){r.redirect(t,e||o,n||i)}},render:function(){return null}})}function o(t,e,n){for(var r in e)if(e.hasOwnProperty(r)){var o=e[r](n,r,t);o instanceof Error&&a(!1,o.message)}}function i(t,e,n){var i=t.type,s=t.props,a=i&&i.displayName||"UnknownComponent";c(-1!==y.indexOf(i),'Unrecognized route configuration element "<%s>"',a),i.propTypes&&o(a,i.propTypes,s);var l={name:s.name};s.ignoreScrollBehavior&&(l.ignoreScrollBehavior=!0),i===h.type?(l.handler=r(s.to,s.params,s.query),s.path=s.path||s.from||"*"):l.handler=s.handler;var v=e&&e.path||"/";if((s.path||s.name)&&i!==p.type&&i!==f.type){var m=s.path||s.name;d.isAbsolute(m)||(m=d.join(v,m)),l.path=d.normalize(m)}else l.path=v,i===f.type&&(l.path+="*");return l.paramNames=d.extractParamNames(l.path),e&&Array.isArray(e.paramNames)&&e.paramNames.forEach(function(t){c(-1!==l.paramNames.indexOf(t),'The nested route path "%s" is missing the "%s" parameter of its parent path "%s"',l.path,t,e.path)}),s.name&&(c(null==n[s.name],'You cannot use the name "%s" for more than one route',s.name),n[s.name]=l),i===f.type?(c(e," must have a parent "),c(null==e.notFoundRoute,"You may not have more than one per "),e.notFoundRoute=l,null):i===p.type?(c(e," must have a parent "),c(null==e.defaultRoute,"You may not have more than one per "),e.defaultRoute=l,null):(l.childRoutes=u(s.children,l,n),l)}function u(t,e,n){var r=[];return s.Children.forEach(t,function(t){(t=i(t,e,n))&&r.push(t)}),r}var s=n(17),a=n(36),c=n(37),p=n(1),f=n(3),h=n(4),l=n(5),d=n(21),y=[p.type,f.type,h.type,l.type];t.exports=u},function(t){function e(){/*! taken from modernizr +var ReactRouter=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){e.DefaultRoute=n(1),e.Link=n(2),e.NotFoundRoute=n(3),e.Redirect=n(4),e.Route=n(5),e.RouteHandler=n(6),e.HashLocation=n(7),e.HistoryLocation=n(8),e.RefreshLocation=n(9),e.ImitateBrowserBehavior=n(10),e.ScrollToTopBehavior=n(11),e.Navigation=n(12),e.State=n(13),e.create=n(14),e.run=n(15),e.History=n(16)},function(t,e,n){var r=n(17),o=n(18),i=n(19),a=r.createClass({displayName:"DefaultRoute",mixins:[o],propTypes:{name:r.PropTypes.string,path:i.falsy,handler:r.PropTypes.func.isRequired}});t.exports=a},function(t,e,n){function r(t){return 0===t.button}function o(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var i=n(17),a=n(32),s=n(33),u=n(12),c=n(13),p=i.createClass({displayName:"Link",mixins:[u,c],propTypes:{activeClassName:i.PropTypes.string.isRequired,to:i.PropTypes.string.isRequired,params:i.PropTypes.object,query:i.PropTypes.object,onClick:i.PropTypes.func},getDefaultProps:function(){return{activeClassName:"active"}},handleClick:function(t){var e,n=!0;this.props.onClick&&(e=this.props.onClick(t)),!o(t)&&r(t)&&((e===!1||t.defaultPrevented===!0)&&(n=!1),t.preventDefault(),n&&this.transitionTo(this.props.to,this.props.params,this.props.query))},getHref:function(){return this.makeHref(this.props.to,this.props.params,this.props.query)},getClassName:function(){var t={};return this.props.className&&(t[this.props.className]=!0),this.isActive(this.props.to,this.props.params,this.props.query)&&(t[this.props.activeClassName]=!0),a(t)},render:function(){var t=s({},this.props,{href:this.getHref(),className:this.getClassName(),onClick:this.handleClick});return i.DOM.a(t,this.props.children)}});t.exports=p},function(t,e,n){var r=n(17),o=n(18),i=n(19),a=r.createClass({displayName:"NotFoundRoute",mixins:[o],propTypes:{name:r.PropTypes.string,path:i.falsy,handler:r.PropTypes.func.isRequired}});t.exports=a},function(t,e,n){var r=n(17),o=n(18),i=n(19),a=r.createClass({displayName:"Redirect",mixins:[o],propTypes:{path:r.PropTypes.string,from:r.PropTypes.string,to:r.PropTypes.string,handler:i.falsy}});t.exports=a},function(t,e,n){var r=n(17),o=n(18),i=r.createClass({displayName:"Route",mixins:[o],propTypes:{name:r.PropTypes.string,path:r.PropTypes.string,handler:r.PropTypes.func.isRequired,ignoreScrollBehavior:r.PropTypes.bool}});t.exports=i},function(t,e,n){var r=n(17),o=n(20),i=r.createClass({displayName:"RouteHandler",mixins:[o],getDefaultProps:function(){return{ref:"__routeHandler__"}},render:function(){return this.getRouteHandler()}});t.exports=i},function(t,e,n){function r(){return p.decode(window.location.href.split("#")[1]||"")}function o(){var t=r();return"/"===t.charAt(0)?!0:(h.replace("/"+t),!1)}function i(t){t===u.PUSH&&(c.length+=1);var e={path:r(),type:t};f.forEach(function(t){t(e)})}function a(){o()&&(i(s||u.POP),s=null)}var s,u=n(30),c=n(16),p=n(21),f=[],l=!1,h={addChangeListener:function(t){f.push(t),o(),l||(window.addEventListener?window.addEventListener("hashchange",a,!1):window.attachEvent("onhashchange",a),l=!0)},removeChangeListener:function(t){f=f.filter(function(e){return e!==t}),0===f.length&&(window.removeEventListener?window.removeEventListener("hashchange",a,!1):window.removeEvent("onhashchange",a),l=!1)},push:function(t){s=u.PUSH,window.location.hash=p.encode(t)},replace:function(t){s=u.REPLACE,window.location.replace(window.location.pathname+window.location.search+"#"+p.encode(t))},pop:function(){s=u.POP,c.back()},getCurrentPath:r,toString:function(){return""}};t.exports=h},function(t,e,n){function r(){return u.decode(window.location.pathname+window.location.search)}function o(t){var e={path:r(),type:t};c.forEach(function(t){t(e)})}function i(){o(a.POP)}var a=n(30),s=n(16),u=n(21),c=[],p=!1,f={addChangeListener:function(t){c.push(t),p||(window.addEventListener?window.addEventListener("popstate",i,!1):window.attachEvent("popstate",i),p=!0)},removeChangeListener:function(t){c=c.filter(function(e){return e!==t}),0===c.length&&(window.addEventListener?window.removeEventListener("popstate",i):window.removeEvent("popstate",i),p=!1)},push:function(t){window.history.pushState({path:t},"",u.encode(t)),s.length+=1,o(a.PUSH)},replace:function(t){window.history.replaceState({path:t},"",u.encode(t)),o(a.REPLACE)},pop:s.back,getCurrentPath:r,toString:function(){return""}};t.exports=f},function(t,e,n){var r=n(8),o=n(16),i=n(21),a={push:function(t){window.location=i.encode(t)},replace:function(t){window.location.replace(i.encode(t))},pop:o.back,getCurrentPath:r.getCurrentPath,toString:function(){return""}};t.exports=a},function(t,e,n){var r=n(30),o={updateScrollPosition:function(t,e){switch(e){case r.PUSH:case r.REPLACE:window.scrollTo(0,0);break;case r.POP:t?window.scrollTo(t.x,t.y):window.scrollTo(0,0)}}};t.exports=o},function(t){var e={updateScrollPosition:function(){window.scrollTo(0,0)}};t.exports=e},function(t,e,n){var r=n(17),o={contextTypes:{makePath:r.PropTypes.func.isRequired,makeHref:r.PropTypes.func.isRequired,transitionTo:r.PropTypes.func.isRequired,replaceWith:r.PropTypes.func.isRequired,goBack:r.PropTypes.func.isRequired},makePath:function(t,e,n){return this.context.makePath(t,e,n)},makeHref:function(t,e,n){return this.context.makeHref(t,e,n)},transitionTo:function(t,e,n){this.context.transitionTo(t,e,n)},replaceWith:function(t,e,n){this.context.replaceWith(t,e,n)},goBack:function(){this.context.goBack()}};t.exports=o},function(t,e,n){var r=n(17),o={contextTypes:{getCurrentPath:r.PropTypes.func.isRequired,getCurrentRoutes:r.PropTypes.func.isRequired,getCurrentPathname:r.PropTypes.func.isRequired,getCurrentParams:r.PropTypes.func.isRequired,getCurrentQuery:r.PropTypes.func.isRequired,isActive:r.PropTypes.func.isRequired},getPath:function(){return this.context.getCurrentPath()},getRoutes:function(){return this.context.getCurrentRoutes()},getPathname:function(){return this.context.getCurrentPathname()},getParams:function(){return this.context.getCurrentParams()},getQuery:function(){return this.context.getCurrentQuery()},isActive:function(t,e,n){return this.context.isActive(t,e,n)}};t.exports=o},function(t,e,n){function r(t){throw t}function o(t,e){if("string"==typeof e)throw new Error("Unhandled aborted transition! Reason: "+t);t instanceof L||(t instanceof O?e.replace(this.makePath(t.to,t.params,t.query)):e.pop())}function i(t,e,n,r){for(var o,s,u,c=0,p=e.length;p>c;++c){if(s=e[c],o=i(t,s.childRoutes,s.defaultRoute,s.notFoundRoute),null!=o)return o.routes.unshift(s),o;if(u=E.extractParams(s.path,t))return a(s,u)}return n&&(u=E.extractParams(n.path,t))?a(n,u):r&&(u=E.extractParams(r.path,t))?a(r,u):o}function a(t,e){return{routes:[t],params:e}}function s(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function u(t,e,n,r,o,i){return t.some(function(t){if(t!==e)return!1;for(var a,u=e.paramNames,c=0,p=u.length;p>c;++c)if(a=u[c],r[a]!==n[a])return!1;return s(o,i)&&s(i,o)})}function c(t){function e(){U&&(U.abort(new L),U=null)}function n(){j=D,D={}}t=t||{},"function"==typeof t?t={routes:t}:Array.isArray(t)&&(t={routes:t});var a=[],s={},c=[],d=t.location||q,O=t.scrollBehavior||S,H=t.onError||r,N=t.onAbort||o,j={},D={},U=null,B=null;"string"==typeof d?f(!h||!1,"You should not use a static location in a DOM environment because the router will not be kept in sync with the current URL"):l(h,"You cannot use %s without a DOM",d),d!==v||T()||(d=R);var M=p.createClass({displayName:"Router",mixins:[P,w,x],statics:{defaultRoute:null,notFoundRoute:null,isRunning:!1,addRoutes:function(t){a.push.apply(a,C(t,this,s))},makePath:function(t,e,n){var r;if(E.isAbsolute(t))r=E.normalize(t);else{var o=s[t];l(o,'Unable to find ',t),r=o.path}return E.withQuery(E.injectParams(r,e),n)},makeHref:function(t,e,n){var r=this.makePath(t,e,n);return d===g?"#"+r:r},transitionTo:function(t,e,n){l("string"!=typeof d,"You cannot use transitionTo with a static location");var r=this.makePath(t,e,n);U?d.replace(r):d.push(r)},replaceWith:function(t,e,n){l("string"!=typeof d,"You cannot use replaceWith with a static location"),d.replace(this.makePath(t,e,n))},goBack:function(){return l("string"!=typeof d,"You cannot use goBack with a static location"),k.length>1||d===R?(d.pop(),!0):(f(!1,"goBack() was ignored because there is no router history"),!1)},match:function(t){return i(t,a,this.defaultRoute,this.notFoundRoute)||null},dispatch:function(t,n,r){e();var o=j.path;if(o!==t){o&&n!==y.REPLACE&&this.recordScrollPosition(o);var i=E.withoutQuery(t),a=this.match(i);f(null!=a,'No route matches path "%s". Make sure you have somewhere in your routes',t,t),null==a&&(a={});var s,p,l=j.routes||[],h=j.params||{},d=j.query||{},m=a.routes||[],g=a.params||{},v=E.extractQuery(t)||{};l.length?(s=l.filter(function(t){return!u(m,t,h,g,d,v)}),p=m.filter(function(t){return!u(l,t,h,g,d,v)})):(s=[],p=m);var R=new b(t,this.replaceWith.bind(this,t));U=R;var P=c.slice(l.length-s.length);R.from(s,P,function(e){return e||R.isAborted?r.call(M,e,R):void R.to(p,g,v,function(e){return e||R.isAborted?r.call(M,e,R):(D.path=t,D.action=n,D.pathname=i,D.routes=m,D.params=g,D.query=v,void r.call(M,null,R))})})}},run:function(t){l(!this.isRunning,"Router is already running");var e=function(e,n){U=null,e?H.call(M,e):n.isAborted?N.call(M,n.abortReason,d):t.call(M,M,D)};"string"==typeof d?M.dispatch(d,null,e):(B=function(t){M.dispatch(t.path,t.type,e)},d.addChangeListener&&d.addChangeListener(B),M.dispatch(d.getCurrentPath(),null,e),this.isRunning=!0)},stop:function(){e(),d.removeChangeListener&&B&&(d.removeChangeListener(B),B=null),this.isRunning=!1}},propTypes:{children:A.falsy},getLocation:function(){return d},getScrollBehavior:function(){return O},getRouteAtDepth:function(t){var e=this.state.routes;return e&&e[t]},getRouteComponents:function(){return c},getInitialState:function(){return n(),j},componentWillReceiveProps:function(){n(),this.setState(j)},componentWillUnmount:function(){M.stop()},render:function(){return this.getRouteAtDepth(0)?p.createElement(m,this.props):null},childContextTypes:{getRouteAtDepth:p.PropTypes.func.isRequired,getRouteComponents:p.PropTypes.func.isRequired,routeHandlers:p.PropTypes.array.isRequired},getChildContext:function(){return{getRouteComponents:this.getRouteComponents,getRouteAtDepth:this.getRouteAtDepth,routeHandlers:[this]}}});return t.routes&&M.addRoutes(t.routes),M}var p=n(17),f=n(34),l=n(35),h=n(36).canUseDOM,d=n(10),m=n(6),y=n(30),g=n(7),v=n(8),R=n(9),P=n(22),w=n(23),x=n(24),C=n(25),T=n(26),b=n(27),A=n(19),O=n(28),k=n(16),L=n(29),E=n(21),q=h?g:"/",S=h?d:null;t.exports=c},function(t,e,n){function r(t,e,n){"function"==typeof e&&(n=e,e=null);var r=o({routes:t,location:e});return r.run(n),r}var o=n(14);t.exports=r},function(t,e,n){var r=n(35),o=n(36).canUseDOM,i={back:function(){r(o,"Cannot use History.back without a DOM"),i.length-=1,window.history.back()},length:1};t.exports=i},function(t){t.exports=React},function(t,e,n){var r=n(35),o={render:function(){r(!1,"%s elements should not be rendered",this.constructor.displayName)}};t.exports=o},function(t){var e={falsy:function(t,e,n){return t[e]?new Error("<"+n+'> may not have a "'+e+'" prop'):void 0}};t.exports=e},function(t,e,n){var r=n(17);t.exports={contextTypes:{getRouteAtDepth:r.PropTypes.func.isRequired,getRouteComponents:r.PropTypes.func.isRequired,routeHandlers:r.PropTypes.array.isRequired},childContextTypes:{routeHandlers:r.PropTypes.array.isRequired},getChildContext:function(){return{routeHandlers:this.context.routeHandlers.concat([this])}},getRouteDepth:function(){return this.context.routeHandlers.length-1},componentDidMount:function(){this._updateRouteComponent()},componentDidUpdate:function(){this._updateRouteComponent()},_updateRouteComponent:function(){var t=this.getRouteDepth(),e=this.context.getRouteComponents();e[t]=this.refs[this.props.ref||"__routeHandler__"]},getRouteHandler:function(t){var e=this.context.getRouteAtDepth(this.getRouteDepth());return e?r.createElement(e.handler,t||this.props):null}}},function(t,e,n){function r(t){if(!(t in f)){var e=[],n=t.replace(s,function(t,n){return n?(e.push(n),"([^/?#]+)"):"*"===t?(e.push("splat"),"(.*?)"):"\\"+t});f[t]={matcher:new RegExp("^"+n+"$","i"),paramNames:e}}return f[t]}var o=n(35),i=n(38).merge,a=n(37),s=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g,u=/:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g,c=/\/\/\?|\/\?/g,p=/\?(.+)/,f={},l={decode:function(t){return decodeURI(t.replace(/\+/g," "))},encode:function(t){return encodeURI(t).replace(/%20/g,"+")},extractParamNames:function(t){return r(t).paramNames},extractParams:function(t,e){var n=r(t),o=e.match(n.matcher);if(!o)return null;var i={};return n.paramNames.forEach(function(t,e){i[t]=o[e+1]}),i},injectParams:function(t,e){e=e||{};var n=0;return t.replace(u,function(r,i){if(i=i||"splat","?"!==i.slice(-1))o(null!=e[i],'Missing "'+i+'" parameter for path "'+t+'"');else if(i=i.slice(0,-1),null==e[i])return"";var a;return"splat"===i&&Array.isArray(e[i])?(a=e[i][n++],o(null!=a,"Missing splat # "+n+' for path "'+t+'"')):a=e[i],a}).replace(c,"/")},extractQuery:function(t){var e=t.match(p);return e&&a.parse(e[1])},withoutQuery:function(t){return t.replace(p,"")},withQuery:function(t,e){var n=l.extractQuery(t);n&&(e=e?i(n,e):n);var r=e&&a.stringify(e);return r?l.withoutQuery(t)+"?"+r:t},isAbsolute:function(t){return"/"===t.charAt(0)},normalize:function(t){return t.replace(/^\/*/,"/")},join:function(t,e){return t.replace(/\/*$/,"/")+e}};t.exports=l},function(t,e,n){var r=n(17),o={childContextTypes:{makePath:r.PropTypes.func.isRequired,makeHref:r.PropTypes.func.isRequired,transitionTo:r.PropTypes.func.isRequired,replaceWith:r.PropTypes.func.isRequired,goBack:r.PropTypes.func.isRequired},getChildContext:function(){return{makePath:this.constructor.makePath,makeHref:this.constructor.makeHref,transitionTo:this.constructor.transitionTo,replaceWith:this.constructor.replaceWith,goBack:this.constructor.goBack}}};t.exports=o},function(t,e,n){function r(t,e){return t.some(function(t){return t.name===e})}function o(t,e){for(var n in e)if(String(t[n])!==String(e[n]))return!1;return!0}function i(t,e){for(var n in e)if(String(t[n])!==String(e[n]))return!1;return!0}var a=n(17),s=n(33),u=n(21),c={getCurrentPath:function(){return this.state.path},getCurrentRoutes:function(){return this.state.routes.slice(0)},getCurrentPathname:function(){return this.state.pathname},getCurrentParams:function(){return s({},this.state.params)},getCurrentQuery:function(){return s({},this.state.query)},isActive:function(t,e,n){return u.isAbsolute(t)?t===this.state.path:r(this.state.routes,t)&&o(this.state.params,e)&&(null==n||i(this.state.query,n))},childContextTypes:{getCurrentPath:a.PropTypes.func.isRequired,getCurrentRoutes:a.PropTypes.func.isRequired,getCurrentPathname:a.PropTypes.func.isRequired,getCurrentParams:a.PropTypes.func.isRequired,getCurrentQuery:a.PropTypes.func.isRequired,isActive:a.PropTypes.func.isRequired},getChildContext:function(){return{getCurrentPath:this.getCurrentPath,getCurrentRoutes:this.getCurrentRoutes,getCurrentPathname:this.getCurrentPathname,getCurrentParams:this.getCurrentParams,getCurrentQuery:this.getCurrentQuery,isActive:this.isActive}}};t.exports=c},function(t,e,n){function r(t,e){if(!e)return!0;if(t.pathname===e.pathname)return!1;var n=t.routes,r=e.routes,o=n.filter(function(t){return-1!==r.indexOf(t)});return!o.some(function(t){return t.ignoreScrollBehavior})}var o=n(35),i=n(36).canUseDOM,a=n(31),s={statics:{recordScrollPosition:function(t){this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]=a()},getScrollPosition:function(t){return this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[t]||null}},componentWillMount:function(){o(null==this.getScrollBehavior()||i,"Cannot use scroll behavior without a DOM")},componentDidMount:function(){this._updateScroll()},componentDidUpdate:function(t,e){this._updateScroll(e)},_updateScroll:function(t){if(r(this.state,t)){var e=this.getScrollBehavior();e&&e.updateScrollPosition(this.constructor.getScrollPosition(this.state.path),this.state.action)}}};t.exports=s},function(t,e,n){function r(t,e,n){return s.createClass({statics:{willTransitionTo:function(r,o,i){r.redirect(t,e||o,n||i)}},render:function(){return null}})}function o(t,e,n){for(var r in e)if(e.hasOwnProperty(r)){var o=e[r](n,r,t);o instanceof Error&&u(!1,o.message)}}function i(t,e,n){var i=t.type,s=t.props,u=i&&i.displayName||"UnknownComponent";c(-1!==m.indexOf(i),'Unrecognized route configuration element "<%s>"',u),i.propTypes&&o(u,i.propTypes,s);var h={name:s.name};s.ignoreScrollBehavior&&(h.ignoreScrollBehavior=!0),i===l.type?(h.handler=r(s.to,s.params,s.query),s.path=s.path||s.from||"*"):h.handler=s.handler;var y=e&&e.path||"/";if((s.path||s.name)&&i!==p.type&&i!==f.type){var g=s.path||s.name;d.isAbsolute(g)||(g=d.join(y,g)),h.path=d.normalize(g)}else h.path=y,i===f.type&&(h.path+="*");return h.paramNames=d.extractParamNames(h.path),e&&Array.isArray(e.paramNames)&&e.paramNames.forEach(function(t){c(-1!==h.paramNames.indexOf(t),'The nested route path "%s" is missing the "%s" parameter of its parent path "%s"',h.path,t,e.path)}),s.name&&(c(null==n[s.name],'You cannot use the name "%s" for more than one route',s.name),n[s.name]=h),i===f.type?(c(e," must have a parent "),c(null==e.notFoundRoute,"You may not have more than one per "),e.notFoundRoute=h,null):i===p.type?(c(e," must have a parent "),c(null==e.defaultRoute,"You may not have more than one per "),e.defaultRoute=h,null):(h.childRoutes=a(s.children,h,n),h)}function a(t,e,n){var r=[];return s.Children.forEach(t,function(t){(t=i(t,e,n))&&r.push(t)}),r}var s=n(17),u=n(34),c=n(35),p=n(1),f=n(3),l=n(4),h=n(5),d=n(21),m=[p.type,f.type,l.type,h.type];t.exports=a},function(t){function e(){/*! taken from modernizr * https://github.com/Modernizr/Modernizr/blob/master/LICENSE * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js * changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586 */ -var t=navigator.userAgent;return-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}t.exports=e},function(t,e,n){function r(t,e){var n;try{n=t.reduce(function(t,e){return t?t.then(e):e()},null)}catch(r){return e(r)}n?n.then(function(){setTimeout(e)},function(t){setTimeout(function(){e(t)})}):e()}function o(t,e,n,o){n=a(n);var i=a(e).map(function(e,r){return function(){var o=e.handler;if(!t.isAborted&&o.willTransitionFrom)return o.willTransitionFrom(t,n[r]);var i=t._promise;return t._promise=null,i}});r(i,o)}function i(t,e,n,o,i){var u=e.map(function(e){return function(){var r=e.handler;!t.isAborted&&r.willTransitionTo&&r.willTransitionTo(t,n,o);var i=t._promise;return t._promise=null,i}});r(u,i)}function u(t,e){this.path=t,this.abortReason=null,this.isAborted=!1,this.retry=e.bind(this),this._promise=null}var s=n(35),a=n(32),c=n(28),p=n(33);s(u.prototype,{abort:function(t){this.isAborted||(this.abortReason=t,this.isAborted=!0)},redirect:function(t,e,n){this.abort(new c(t,e,n))},wait:function(t){this._promise=p.resolve(t)},from:function(t,e,n){return o(this,t,e,n)},to:function(t,e,n,r){return i(this,t,e,n,r)}}),t.exports=u},function(t){function e(t,e,n){this.to=t,this.params=e,this.query=n}t.exports=e},function(t){function e(){}t.exports=e},function(t){var e={PUSH:"push",REPLACE:"replace",POP:"pop"};t.exports=e},function(t,e,n){function r(){return o(i,"Cannot get current scroll position without a DOM"),{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}}var o=n(37),i=n(38).canUseDOM;t.exports=r},function(t){function e(t){return t.slice(0).reverse()}t.exports=e},function(t,e,n){var r=n(43);t.exports=r},function(t){function e(t){return"object"==typeof t?Object.keys(t).filter(function(e){return t[e]}).join(" "):Array.prototype.join.call(arguments," ")}t.exports=e},function(t){function e(t){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(t),n=Object.prototype.hasOwnProperty,r=1;rn;++n)"undefined"!=typeof t[n]&&(e[n]=t[n]);return e},e.merge=function(t,n){if(!n)return t;if(Array.isArray(n)){for(var r=0,o=n.length;o>r;++r)"undefined"!=typeof n[r]&&(t[r]="object"==typeof t[r]?e.merge(t[r],n[r]):n[r]);return t}if(Array.isArray(t)){if("object"!=typeof n)return t.push(n),t;t=e.arrayToObject(t)}for(var i=Object.keys(n),u=0,s=i.length;s>u;++u){var a=i[u],c=n[a];t[a]=c&&"object"==typeof c&&t[a]?e.merge(t[a],c):c}return t},e.decode=function(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}},e.compact=function(t,n){if("object"!=typeof t||null===t)return t;n=n||[];var r=n.indexOf(t);if(-1!==r)return n[r];if(n.push(t),Array.isArray(t)){for(var o=[],i=0,u=t.length;u>i;++i)"undefined"!=typeof t[i]&&o.push(t[i]);return o}for(var s=Object.keys(t),i=0,a=s.length;a>i;++i){var c=s[i];t[c]=e.compact(t[c],n)}return t},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.isBuffer=function(t){return"undefined"!=typeof Buffer?Buffer.isBuffer(t):!1}},function(t){function e(t){return function(){return t}}function n(){}n.thatReturns=e,n.thatReturnsFalse=e(!1),n.thatReturnsTrue=e(!0),n.thatReturnsNull=e(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(t){return t},t.exports=n},function(t,e,n){var r=n(44),o=n(45);t.exports={stringify:r,parse:o}},function(t,e,n){var r;/** @license MIT License (c) copyright 2010-2014 original author or authors */ -!function(){"use strict";r=function(){var t=n(46),e=n(47),r=n(48);return t({scheduler:new e(r)})}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))}(n(51))},function(t,e,n){var r=n(40),o={delimiter:"&"};o.stringify=function(t,e){if(r.isBuffer(t)?t=t.toString():t instanceof Date?t=t.toISOString():null===t&&(t=""),"string"==typeof t||"number"==typeof t||"boolean"==typeof t)return[encodeURIComponent(e)+"="+encodeURIComponent(t)];var n=[];for(var i in t)t.hasOwnProperty(i)&&(n=n.concat(o.stringify(t[i],e+"["+i+"]")));return n},t.exports=function(t,e){e=e||{};var n="undefined"==typeof e.delimiter?o.delimiter:e.delimiter,r=[];for(var i in t)t.hasOwnProperty(i)&&(r=r.concat(o.stringify(t[i],i)));return r.join(n)}},function(t,e,n){var r=n(40),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};o.parseValues=function(t,e){for(var n={},o=t.split(e.delimiter,1/0===e.parameterLimit?void 0:e.parameterLimit),i=0,u=o.length;u>i;++i){var s=o[i],a=-1===s.indexOf("]=")?s.indexOf("="):s.indexOf("]=")+1;if(-1===a)n[r.decode(s)]="";else{var c=r.decode(s.slice(0,a)),p=r.decode(s.slice(a+1));n[c]=n[c]?[].concat(n[c]).concat(p):p}}return n},o.parseObject=function(t,e,n){if(!t.length)return e;var r=t.shift(),i={};if("[]"===r)i=[],i=i.concat(o.parseObject(t,e,n));else{var u="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,s=parseInt(u,10);!isNaN(s)&&r!==u&&s<=n.arrayLimit?(i=[],i[s]=o.parseObject(t,e,n)):i[u]=o.parseObject(t,e,n)}return i},o.parseKeys=function(t,e,n){if(t){var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,u=r.exec(t);if(!Object.prototype.hasOwnProperty(u[1])){var s=[];u[1]&&s.push(u[1]);for(var a=0;null!==(u=i.exec(t))&&as;++s){var c=u[s],p=o.parseKeys(c,n[c],e);i=r.merge(i,p)}return r.compact(i)}},function(t,e,n){var r;/** @license MIT License (c) copyright 2010-2014 original author or authors */ -!function(){"use strict";r=function(){return function(t){function e(t,e){this._handler=t===l?e:n(t)}function n(t){function e(t){o.resolve(t)}function n(t){o.reject(t)}function r(t){o.notify(t)}var o=new y;try{t(e,n,r)}catch(i){n(i)}return o}function r(t){return j(t)?t:new e(l,new v(p(t)))}function o(t){return new e(l,new v(new w(t)))}function i(){return W}function u(){return new e(l,new y)}function s(t){function n(t,e,n){this[t]=e,0===--c&&n.become(new g(this))}var r,o,i,u,s=new y,c=t.length>>>0,p=new Array(c);for(r=0;r0)){a(t,r+1,o),s.become(o);break}p[r]=o.value,--c}else p[r]=i,--c;else--c;return 0===c&&s.become(new g(p)),new e(l,s)}function a(t,e,n){var r,o,i;for(r=e;r0||"function"!=typeof e&&0>r)return new this.constructor(l,n);var o=this._beget(),i=o._handler;return n.chain(i,n.receiver,t,e,arguments.length>2?arguments[2]:void 0),o},e.prototype["catch"]=function(t){return this.then(void 0,t)},e.prototype._beget=function(){var t=this._handler,e=new y(t.receiver,t.join().context);return new this.constructor(l,e)},e.all=s,e.race=c,l.prototype.when=l.prototype.become=l.prototype.notify=l.prototype.fail=l.prototype._unreport=l.prototype._report=N,l.prototype._state=0,l.prototype.state=function(){return this._state},l.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},l.prototype.chain=function(t,e,n,r,o){this.when({resolver:t,receiver:e,fulfilled:n,rejected:r,progress:o})},l.prototype.visit=function(t,e,n,r){this.chain(M,t,e,n,r)},l.prototype.fold=function(t,e,n,r){this.visit(r,function(r){t.call(n,e,r,this)},r.reject,r.notify)},S(l,d),d.prototype.become=function(t){t.fail()};var M=new d;S(l,y),y.prototype._state=0,y.prototype.resolve=function(t){this.become(p(t))},y.prototype.reject=function(t){this.resolved||this.become(new w(t))},y.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=R();return t},y.prototype.run=function(){var t=this.consumers,e=this.join();this.consumers=void 0;for(var n=0;n0;)t.shift().run()}var r=n(50);return t.prototype.enqueue=function(t){this._add(this._queue,t)},t.prototype.afterQueue=function(t){this._add(this._afterQueue,t)},t.prototype._drain=function(){e(this._queue),this._running=!1,e(this._afterQueue)},t.prototype._add=function(t,e){t.push(e),this._running||(this._running=!0,this._async(this.drain))},t}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))}(n(51))},function(t,e,n){var r;(function(o){/** @license MIT License (c) copyright 2010-2014 original author or authors */ -!function(){"use strict";r=function(t){var e,r;return e="undefined"!=typeof o&&null!==o&&"function"==typeof o.nextTick?function(t){o.nextTick(t)}:(r="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)?function(t,e){function n(){var t=r;r=void 0,t()}var r,o=t.createElement("div"),i=new e(n);return i.observe(o,{attributes:!0}),function(t){r=t,o.setAttribute("class","x")}}(document,r):function(){var t;try{t=n(49)}catch(e){}if(t){if("function"==typeof t.runOnLoop)return t.runOnLoop;if("function"==typeof t.runOnContext)return t.runOnContext}var r=setTimeout;return function(t){r(t,0)}}(t)}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))}(n(51))}).call(e,n(52))},function(){},function(t,e,n){var r;/** @license MIT License (c) copyright 2010-2014 original author or authors */ -!function(){"use strict";r=function(){function t(t){this.head=this.tail=this.length=0,this.buffer=new Array(1<i;++i)o[i]=r[i];else{for(t=r.length,e=this.tail;t>n;++i,++n)o[i]=r[n];for(n=0;e>n;++i,++n)o[i]=r[n]}this.buffer=o,this.head=0,this.tail=this.length},t}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))}(n(51))},function(t){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t){function e(){}var n=t.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var o=document.createElement("div"),i=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return i.observe(o,{attributes:!0}),function(t){r.length||o.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=e,n.addListener=e,n.once=e,n.off=e,n.removeListener=e,n.removeAllListeners=e,n.emit=e,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}}]); \ No newline at end of file +var t=navigator.userAgent;return-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}t.exports=e},function(t,e,n){function r(t,e,n,r){var o=e.reduce(function(e,r,o){return function(i){if(i||t.isAborted)e(i);else if(r.handler.willTransitionFrom)try{r.handler.willTransitionFrom(t,n[o],e),r.handler.willTransitionFrom.length<3&&e()}catch(a){e(a)}else e()}},r);o()}function o(t,e,n,r,o){var i=e.reduceRight(function(e,o){return function(i){if(i||t.isAborted)e(i);else if(o.handler.willTransitionTo)try{o.handler.willTransitionTo(t,n,r,e),o.handler.willTransitionTo.length<4&&e()}catch(a){e(a)}else e()}},o);i()}function i(t,e){this.path=t,this.abortReason=null,this.isAborted=!1,this.retry=e.bind(this)}var a=n(33),s=n(28);a(i.prototype,{abort:function(t){this.isAborted||(this.abortReason=t,this.isAborted=!0)},redirect:function(t,e,n){this.abort(new s(t,e,n))},from:function(t,e,n){return r(this,t,e,n)},to:function(t,e,n,r){return o(this,t,e,n,r)}}),t.exports=i},function(t){function e(t,e,n){this.to=t,this.params=e,this.query=n}t.exports=e},function(t){function e(){}t.exports=e},function(t){var e={PUSH:"push",REPLACE:"replace",POP:"pop"};t.exports=e},function(t,e,n){function r(){return o(i,"Cannot get current scroll position without a DOM"),{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}}var o=n(35),i=n(36).canUseDOM;t.exports=r},function(t){function e(t){return"object"==typeof t?Object.keys(t).filter(function(e){return t[e]}).join(" "):Array.prototype.join.call(arguments," ")}t.exports=e},function(t){function e(t){if(null==t)throw new TypeError("Object.assign target cannot be null or undefined");for(var e=Object(t),n=Object.prototype.hasOwnProperty,r=1;rn;++n)"undefined"!=typeof t[n]&&(e[n]=t[n]);return e},e.merge=function(t,n){if(!n)return t;if("object"!=typeof n)return Array.isArray(t)?t.push(n):t[n]=!0,t;if("object"!=typeof t)return t=[t].concat(n);Array.isArray(t)&&!Array.isArray(n)&&(t=e.arrayToObject(t));for(var r=Object.keys(n),o=0,i=r.length;i>o;++o){var a=r[o],s=n[a];t[a]=t[a]?e.merge(t[a],s):s}return t},e.decode=function(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}},e.compact=function(t,n){if("object"!=typeof t||null===t)return t;n=n||[];var r=n.indexOf(t);if(-1!==r)return n[r];if(n.push(t),Array.isArray(t)){for(var o=[],i=0,a=t.length;a>i;++i)"undefined"!=typeof t[i]&&o.push(t[i]);return o}var s=Object.keys(t);for(i=0,a=s.length;a>i;++i){var u=s[i];t[u]=e.compact(t[u],n)}return t},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.isBuffer=function(t){return null===t||"undefined"==typeof t?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}},function(t){function e(t){return function(){return t}}function n(){}n.thatReturns=e,n.thatReturnsFalse=e(!1),n.thatReturnsTrue=e(!0),n.thatReturnsNull=e(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(t){return t},t.exports=n},function(t,e,n){var r=n(41),o=n(42);t.exports={stringify:r,parse:o}},function(t,e,n){var r=n(38),o={delimiter:"&",indices:!0};o.stringify=function(t,e,n){if(r.isBuffer(t)?t=t.toString():t instanceof Date?t=t.toISOString():null===t&&(t=""),"string"==typeof t||"number"==typeof t||"boolean"==typeof t)return[encodeURIComponent(e)+"="+encodeURIComponent(t)];var i=[];if("undefined"==typeof t)return i;for(var a=Object.keys(t),s=0,u=a.length;u>s;++s){var c=a[s];i=i.concat(!n.indices&&Array.isArray(t)?o.stringify(t[c],e,n):o.stringify(t[c],e+"["+c+"]",n))}return i},t.exports=function(t,e){e=e||{};var n="undefined"==typeof e.delimiter?o.delimiter:e.delimiter;e.indices="boolean"==typeof e.indices?e.indices:o.indices;var r=[];if("object"!=typeof t||null===t)return"";for(var i=Object.keys(t),a=0,s=i.length;s>a;++a){var u=i[a];r=r.concat(o.stringify(t[u],u,e))}return r.join(n)}},function(t,e,n){var r=n(38),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};o.parseValues=function(t,e){for(var n={},o=t.split(e.delimiter,1/0===e.parameterLimit?void 0:e.parameterLimit),i=0,a=o.length;a>i;++i){var s=o[i],u=-1===s.indexOf("]=")?s.indexOf("="):s.indexOf("]=")+1;if(-1===u)n[r.decode(s)]="";else{var c=r.decode(s.slice(0,u)),p=r.decode(s.slice(u+1));n[c]=n.hasOwnProperty(c)?[].concat(n[c]).concat(p):p}}return n},o.parseObject=function(t,e,n){if(!t.length)return e;var r=t.shift(),i={};if("[]"===r)i=[],i=i.concat(o.parseObject(t,e,n));else{var a="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,s=parseInt(a,10),u=""+s;!isNaN(s)&&r!==a&&u===a&&s>=0&&s<=n.arrayLimit?(i=[],i[s]=o.parseObject(t,e,n)):i[a]=o.parseObject(t,e,n)}return i},o.parseKeys=function(t,e,n){if(t){var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=r.exec(t);if(!Object.prototype.hasOwnProperty(a[1])){var s=[];a[1]&&s.push(a[1]);for(var u=0;null!==(a=i.exec(t))&&us;++s){var c=a[s],p=o.parseKeys(c,n[c],e);i=r.merge(i,p)}return r.compact(i)}}]); \ No newline at end of file