diff --git a/.npmignore b/.npmignore index b40e919..fa37f81 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,7 @@ +.eslintrc .travis.yml +CHANGELOG.md +demo.png examples -LICENSE +README.md test diff --git a/CHANGELOG.md b/CHANGELOG.md index 21ce291..ff5ccd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,67 +1,15 @@ -# React Resolver Changelog +# React Resolver Csp Changelog -### Upcoming... +### v0.0.3 (2015-06-07) -- [Error Handling](https://github.com/ericclemmons/react-resolver/issues/2) -- [React Native](https://github.com/ericclemmons/react-resolver/issues/18) +- renamed js-csp so (hopefully) the whole lot will get published to npm +### v0.0.2 (2015-06-07) -### v1.0.0 - (2015-04-13) +- Includes decorators & exports csp -- Complete rewrite for React v0.13 -- "Higher-order Components" via `Resolver.createContainer` -- Remove all dependencies (!) - + [#9](https://github.com/ericclemmons/react-resolver/issues/9) - + [#14](https://github.com/ericclemmons/react-resolver/issues/14) - + [#15](https://github.com/ericclemmons/react-resolver/issues/15) +### v0.0.1 (2015-06-06) -### v0.2.0 - (2015-02-25) +- Initial version -- Remove [`resolver.handle`][11] - - -### v0.1.2 (2015-02-25) - -- Fix [examples/contacts](https://github.com/ericclemmons/react-resolver/tree/e026a3b1cbf16995c10c825c18d2f20b6277f62f/examples/contacts) - - -### v0.1.1 (2015-02-25) - -- Move `react-router` from `optionalDependencies` to `peerDependencies` - - -### v0.1.0 (2015-02-24) - -- [#7][7] - Add `react` and `react-router` as `peerDependencies`. -- [#8][8] - Support React v0.13 - - -### v0.0.4 (2015-02-24) - -- [#4][4] - NPM package is ES5, not ES6. -- [#5][5] - Clarify use of `Resolver.mixin`. -- [#6][6] - README comparison to Relay. - - -### v0.0.3 (2015-02-19) - -- Public release - - -### v0.0.2 (2015-02-18) - -- Working prototype with context - - -### v0.0.1 (2015-01-29) - -- Initial commit - - -[4]: https://github.com/ericclemmons/react-resolver/pull/4 -[5]: https://github.com/ericclemmons/react-resolver/issues/5 -[6]: https://github.com/ericclemmons/react-resolver/issues/6 -[7]: https://github.com/ericclemmons/react-resolver/issues/7 -[8]: https://github.com/ericclemmons/react-resolver/issues/8 -[11]: https://github.com/ericclemmons/react-resolver/issues/11 diff --git a/LICENSE b/LICENSE index c33bc6b..e8bc73c 100644 --- a/LICENSE +++ b/LICENSE @@ -2,9 +2,10 @@ Internet Systems Consortium license =================================== Copyright (c) 2015 Eric Clemmons +Copyright (c) 2015 Giles Bradshaw Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice +with or without fee is hereby granted, provided that the above copyright notices and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH diff --git a/Original LICENSE b/Original LICENSE new file mode 100644 index 0000000..c33bc6b --- /dev/null +++ b/Original LICENSE @@ -0,0 +1,16 @@ +Internet Systems Consortium license +=================================== + +Copyright (c) 2015 Eric Clemmons + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/README.md b/README.md index 24b3c96..fea36e9 100644 --- a/README.md +++ b/README.md @@ -1,136 +1,85 @@ -# React Resolver ![https://img.shields.io/npm/v/react-resolver.svg](https://img.shields.io/npm/v/react-resolver.svg?style=flat-square) - -> Isomorphic library to lazy-load data for React components - -[![](https://img.shields.io/github/issues-raw/ericclemmons/react-resolver.svg?style=flat-square)](https://github.com/ericclemmons/react-resolver/issues) -[![](https://img.shields.io/travis/ericclemmons/react-resolver/master.svg?style=flat-square)](https://travis-ci.org/ericclemmons/react-resolver) -[![](https://img.shields.io/david/ericclemmons/react-resolver.svg?style=flat-square)](https://david-dm.org/ericclemmons/react-resolver#info=dependencies) -[![](https://img.shields.io/david/dev/ericclemmons/react-resolver.svg?style=flat-square)](https://david-dm.org/ericclemmons/react-resolver#info=devDependencies) - - -## Features - -- **Promise-based** – Define & lazy-load component data dependencies and inject them as `props`. -- **Isomorphic** – Express/Koa/Hapi-friendly server-side rendering & progressive, client-side rendering. -- **Test friendly** – Containers promote separation between data-fetching & rendering. - - -## Demo - -> [![Demo](demo.png)][demo] - -[View Demo][demo] - - -- - - - - -- [Features](#features) -- [Demo](#demo) -- [Requirements](#requirements) -- [Installation](#installation) -- [Usage](#usage) - + [Client](#client) - + [Server](#server) -- [Changelog][changelog] -- [Development](#development) -- [Authors](#authors) -- [License][license] - -- - - - - -## Requirements - -- React `v0.13.x` - -_For browsers that don't nativeuly support promises, use [ES6 Promise](https://github.com/jakearchibald/es6-promise)._ - - -## Installation - -```shell -npm install --save react-resolver -``` - -- - - - -## Usage - -_Example is based on [Stargazers.js](https://github.com/ericclemmons/react-resolver/blob/master/examples/stargazers/components/Stargazers.js) in the [demo][demo]._ - -Suppose you want to display list of users, but that data is loaded -asynchronously via an API. - -Rather than having your component handle data-fetching _and_ rendering, -you can create a "container" that fetches the data and only renders when ready: - -```javascript -import React from "react"; -import { Resolver } from "react-resolver"; - -class Users extends React.Component { - render() { - return ( - - ); - } -} - -Users.defaultProps = { limit: 5 }; -Users.propTypes = { users: React.PropTypes.array.isRequired }; - -// Rather than `export default Users`, create a container: -export default Resolver.createContainer(Users, { - resolve: { - users: function(props) { - return fetch(`/api/users?limit=${props.limit}`); - } - } +# React Resolver Csp + +[![Build Status](https://travis-ci.org/gilesbradshaw/react-resolver-csp.svg?branch=csp)](https://travis-ci.org/gilesbradshaw/react-resolver-csp) + +[![Coverage Status](https://coveralls.io/repos/gilesbradshaw/react-resolver-csp/badge.svg?branch=csp)](https://coveralls.io/r/gilesbradshaw/react-resolver-csp) + +## Isomorphic library to lazy-load data for React components + +Forked and nodified to use CSP channels rather than promises + +I've manually included js-csp so the whole lot gets transpiled to ES5 + +```` +describe("Resolver", function() { + describe(".nested", function() { + it("should render nested elements", function(done) { + @dataDependencies({ + user: ()=> + go(function* (){ + return "Ernie"; + }) + }) + @displayName("TestElement1") + class Element1 extends Component { + render(){ + return {this.props.user}; + } + }; + + @dataDependencies({ + user: ()=> + go(function* (){ + return "Eric"; + }) + }) + @displayName("TestElement") + class Element extends Component { + render(){ + return {this.props.user}; + } + }; + go(function*(){ + const string = yield Resolver.renderToStaticMarkup(); + assert.equal("EricErnie",string.toString()); + done(); + }); + }); + }); }); -``` - - -### Client - -Replace `React.render` with `Resolver.render`, and you're all set! - -```javascript -import React from "react"; -import Resolver from "react-resolver"; - -Resolver.render(, document.getElementById("app")); -``` - - -### Server - -Because data has to be fetched asynchronously, `React.renderToString` -(and `React.renderToStaticMarkup`) won't have the data in time. - -Instead, replace `React` with `Resolver` and you'll receive a promise -that resolves with the rendered output! - -```javascript -import React from "react"; -import Resolver from "react-resolver"; - -Resolver.renderToString().then((string) => { - reply(string); -}).catch((err) { - // An error was thrown while rendering - console.error(err); +describe("Resolver", function() { + describe(".dom", function() { + it("should render a channel into dom", function(done) { + const ch = chan(); + @dataDependencies({ + user: ()=>ch + }) + @displayName("TestElement") + class Element extends Component { + render(){ + return {this.props.user}; + } + }; + const resolver = new Resolver(); + Resolver.render( + + , document.body, resolver); + + go(function* (){ + yield put(ch,"Ernie"); + yield timeout(0); + assert.equal(document.querySelector('span').innerHTML, 'Ernie'); + yield put(ch,"Wise"); + yield timeout(0); + assert.equal(document.querySelector('span').innerHTML, 'Wise'); + done(); + }); + }); + }); }); -``` - -- - - - +```` ## Development If you'd like to contribute to this project, all you need to do is clone @@ -141,22 +90,6 @@ $ npm install $ npm test ``` +## Credits -## Authors - -- [Eric Clemmons](mailto:eric@smarterspam.com>) ([@ericclemmons][twitter]) - - -## [License][license] - - -## Collaboration - -If you have questions or issues, please [open an issue][issue]! - - -[changelog]: https://github.com/ericclemmons/react-resolver/blob/master/CHANGELOG.md -[demo]: https://cdn.rawgit.com/ericclemmons/react-resolver/master/examples/stargazers/public/index.html -[issue]: https://github.com/ericclemmons/react-resolver/issues/new -[license]: https://github.com/ericclemmons/react-resolver/blob/master/LICENSE -[twitter]: https://twitter.com/ericclemmons/ +[Based on ericclemmons/react-resolver](https://github.com/ericclemmons/react-resolver) and [iamdustan/react-resolver](https://github.com/iamdustan/react-resolver) diff --git a/dist/Container.js b/dist/Container.js index dfe19e6..77a73e8 100644 --- a/dist/Container.js +++ b/dist/Container.js @@ -1,29 +1,32 @@ "use strict"; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; +Object.defineProperty(exports, "__esModule", { + value: true +}); var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); -var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; +var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; -var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -Object.defineProperty(exports, "__esModule", { - value: true -}); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } + +var _react = require("react"); -var _React = require("react/addons"); +var _react2 = _interopRequireDefault(_react); -var _React2 = _interopRequireWildcard(_React); +var _reactLibCloneWithProps = require("react/lib/cloneWithProps"); + +var _reactLibCloneWithProps2 = _interopRequireDefault(_reactLibCloneWithProps); var _ResolverError = require("./ResolverError"); -var _ResolverError2 = _interopRequireWildcard(_ResolverError); +var _ResolverError2 = _interopRequireDefault(_ResolverError); -var Children = _React2["default"].Children; -var cloneWithProps = _React2["default"].addons.cloneWithProps; +var Children = _react2["default"].Children; var Container = (function (_React$Component) { function Container(props, context) { @@ -42,15 +45,19 @@ var Container = (function (_React$Component) { _createClass(Container, [{ key: "componentWillMount", value: function componentWillMount() { - var _this = this; + this.resolve(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.getResolver().clearContainerState(this); + } + }, { + key: "componentWillReceiveProps", + value: function componentWillReceiveProps() { + this.getResolver().clearContainerState(this); - if (!this.state.fulfilled) { - this.getResolver().resolve(this, function (state) { - return new Promise(function (resolve) { - _this.setState(state, resolve); - }); - }); - } + this.resolve(); } }, { key: "getId", @@ -75,7 +82,8 @@ var Container = (function (_React$Component) { return { parent: parent, - resolver: resolver }; + resolver: resolver + }; } }, { key: "getResolver", @@ -91,56 +99,88 @@ var Container = (function (_React$Component) { }, { key: "shouldComponentUpdate", value: function shouldComponentUpdate(props, state) { - return state.fulfilled; + return state.fulfilled || state.error || false; } }, { key: "render", value: function render() { + if (this.state.error) { + if (this.props.component && this.props.component.errorRender) { + return this.props.component.errorRender(this.state); + } else { + return false; + } + } if (!this.state.fulfilled) { - return false; + if (this.props.component && this.props.component.waitRender) { + return this.props.component.waitRender(this.state); + } else { + return false; + } } if (this.props.component) { - return _React2["default"].createElement(this.props.component, this.state.values); + return _react2["default"].createElement(this.props.component, this.state.values); } if (this.props.element) { - return cloneWithProps(this.props.element); + return (0, _reactLibCloneWithProps2["default"])(this.props.element); } if (this.props.children) { if (Children.count(this.props.children) === 1) { - return cloneWithProps(Children.only(this.props.children)); + return (0, _reactLibCloneWithProps2["default"])(Children.only(this.props.children)); } - return _React2["default"].createElement( + + return _react2["default"].createElement( "span", null, - Children.map(this.props.children, cloneWithProps) + Children.map(this.props.children, _reactLibCloneWithProps2["default"]) ); } throw new _ResolverError2["default"](" requires one of the following props to render: `element`, `component`, or `children`"); } + }, { + key: "resolve", + value: function resolve() { + var _this = this; + + var nextState = this.getResolver().getContainerState(this); + + this.setState(nextState); + + if (!nextState.fulfilled) { + this.getResolver().resolve(this, function (finalState) { + return new Promise(function (resolve) { + _this.setState(finalState, resolve); + }); + }); + } + } }]); return Container; -})(_React2["default"].Component); +})(_react2["default"].Component); Container.childContextTypes = { - parent: _React2["default"].PropTypes.instanceOf(Container), - resolver: _React2["default"].PropTypes.object.isRequired }; + parent: _react2["default"].PropTypes.instanceOf(Container), + resolver: _react2["default"].PropTypes.object.isRequired +}; Container.contextTypes = { - parent: _React2["default"].PropTypes.instanceOf(Container), - resolver: _React2["default"].PropTypes.object }; + parent: _react2["default"].PropTypes.instanceOf(Container), + resolver: _react2["default"].PropTypes.object +}; Container.displayName = "ResolverContainer"; Container.propTypes = { - component: _React2["default"].PropTypes.any, - element: _React2["default"].PropTypes.element, - resolve: _React2["default"].PropTypes.object, - resolver: _React2["default"].PropTypes.object }; + component: _react2["default"].PropTypes.any, + element: _react2["default"].PropTypes.element, + resolve: _react2["default"].PropTypes.object, + resolver: _react2["default"].PropTypes.object +}; exports["default"] = Container; module.exports = exports["default"]; \ No newline at end of file diff --git a/dist/Context.js b/dist/Context.js deleted file mode 100644 index 53bfdc1..0000000 --- a/dist/Context.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; - -var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -var React = _interopRequire(require("react")); - -var Resolver = _interopRequire(require("./Resolver")); - -var ResolverContext = (function (_React$Component) { - function ResolverContext() { - _classCallCheck(this, ResolverContext); - - if (_React$Component != null) { - _React$Component.apply(this, arguments); - } - } - - _inherits(ResolverContext, _React$Component); - - _createClass(ResolverContext, { - getChildContext: { - value: function getChildContext() { - var resolver = this.props.resolver || this.context.resolver; - - return { resolver: resolver }; - } - }, - render: { - value: function render() { - return React.cloneElement(this.props.element); - } - } - }); - - return ResolverContext; -})(React.Component); - -ResolverContext.childContextTypes = { - resolver: React.PropTypes.any }; - -ResolverContext.contextTypes = { - resolver: React.PropTypes.any }; - -ResolverContext.propTypes = { - resolver: React.PropTypes.any }; - -module.exports = ResolverContext; \ No newline at end of file diff --git a/dist/Resolver.js b/dist/Resolver.js new file mode 100644 index 0000000..4762dea --- /dev/null +++ b/dist/Resolver.js @@ -0,0 +1,495 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _react = require("react"); + +var _react2 = _interopRequireDefault(_react); + +var _Container = require("./Container"); + +var _Container2 = _interopRequireDefault(_Container); + +var _ResolverError = require("./ResolverError"); + +var _ResolverError2 = _interopRequireDefault(_ResolverError); + +var _jsCspSrcCsp = require("./js-csp/src/csp"); + +var _jsCspSrcCsp2 = _interopRequireDefault(_jsCspSrcCsp); + +/*eslint no-unused-vars:0 */ + +var myRenderTo = function myRenderTo(element, renderFunc) { + Resolver.server = true; + var resolver = new Resolver(); /*eslint no-use-before-define:0*/ + var context = _react2["default"].createElement( + _Container2["default"], + { resolver: resolver }, + element + ); + return (0, _jsCspSrcCsp.go)(regeneratorRuntime.mark(function callee$1$0() { + var html; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + context$2$0.next = 2; + return resolver.finish(function () { + return renderFunc(context); + }); + + case 2: + html = context$2$0.sent; + + resolver.freeze(); + return context$2$0.abrupt("return", { + data: resolver.states, + toString: function toString() { + return html; + } + }); + + case 5: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); +}; + +var Resolver = (function () { + function Resolver() { + var states = arguments[0] === undefined ? {} : arguments[0]; + + _classCallCheck(this, Resolver); + + this.channels = []; + this.frozen = false; + this.awaitChan = (0, _jsCspSrcCsp.chan)(); + this.refreshChan = (0, _jsCspSrcCsp.chan)(); + + this.states = states; + } + + _createClass(Resolver, [{ + key: "finish", + + //channel that completes with result of renderer when all channels resolved + value: function finish(renderer) { + return (0, _jsCspSrcCsp.go)(regeneratorRuntime.mark(function process(total) { + var rendered; + return regeneratorRuntime.wrap(function process$(context$3$0) { + while (1) switch (context$3$0.prev = context$3$0.next) { + case 0: + rendered = renderer(); + + if (!(this.channels.length === total)) { + context$3$0.next = 3; + break; + } + + return context$3$0.abrupt("return", rendered); + + case 3: + context$3$0.next = 5; + return this.awaitChan; + + case 5: + context$3$0.next = 7; + return (0, _jsCspSrcCsp.go)(process.bind(this), [this.channels.length]); + + case 7: + return context$3$0.abrupt("return", context$3$0.sent); + + case 8: + case "end": + return context$3$0.stop(); + } + }, process, this); + }).bind(this), [this.channels.length]); + } + }, { + key: "freeze", + value: function freeze() { + this.frozen = true; + } + }, { + key: "fulfillState", + value: function fulfillState(state, callback) { + state.error = undefined; + state.fulfilled = true; + state.rejected = false; + return callback ? callback(state) : state; + } + }, { + key: "getContainerState", + value: function getContainerState(container) { + var id = container.id; + + if (!id) { + throw new ReferenceError("" + container.constructor.displayName + " should have an ID"); + } + + var state = this.states[id] || this.rehydrate(id) || { + fulfilled: false, + rejected: false, + values: {} + }; + + if (!this.states[id]) { + this.states[id] = state; + } + + return state; + } + }, { + key: "clearContainerState", + value: function clearContainerState(container) { + var _this = this; + + var id = container.id; + + Object.keys(this.states).filter(function (key) { + return key.indexOf(id) === 0; + }).forEach(function (key) { + return _this.states[key] = undefined; + }); + var self = this; + (0, _jsCspSrcCsp.go)(regeneratorRuntime.mark(function callee$2$0() { + return regeneratorRuntime.wrap(function callee$2$0$(context$3$0) { + while (1) switch (context$3$0.prev = context$3$0.next) { + case 0: + context$3$0.next = 2; + return self.refreshChan.close(); + + case 2: + case "end": + return context$3$0.stop(); + } + }, callee$2$0, this); + })); + } + }, { + key: "rejectState", + value: function rejectState(error, state, callback) { + state.error = error; + state.fulfilled = false; + state.rejected = true; + + if (callback) { + callback(state); + } + throw new Error("" + this.constructor.displayName + " was rejected: " + error); + } + }, { + key: "rehydrate", + value: function rehydrate(id) { + if (typeof __resolver__ === "undefined") { + return null; + } + return __resolver__[id]; /*eslint no-undef:0*/ + } + }, { + key: "resolve", + value: function resolve(container, callback) { + var self = this; + var asyncProps = container.props.resolve || {}; + var state = this.getContainerState(container); + var asyncKeys = Object.keys(asyncProps) + // Assign existing prop values + .filter(function (asyncProp) { + if (container.props.hasOwnProperty(asyncProp)) { + state.values[asyncProp] = container.props[asyncProp]; + + return false; + } + + return true; + }) + // Filter out pre-loaded values + .filter(function (asyncProp) { + return !state.values.hasOwnProperty(asyncProp); + }); + + if (!asyncKeys.length) { + this.fulfillState(state, callback); + (0, _jsCspSrcCsp.go)(regeneratorRuntime.mark(function callee$2$0() { + return regeneratorRuntime.wrap(function callee$2$0$(context$3$0) { + while (1) switch (context$3$0.prev = context$3$0.next) { + case 0: + context$3$0.next = 2; + return (0, _jsCspSrcCsp.put)(self.awaitChan, []); + + case 2: + case "end": + return context$3$0.stop(); + } + }, callee$2$0, this); + })); + } + + if (this.frozen) { + throw new _ResolverError2["default"](["Resolver is frozen for server rendering.", "" + container.constructor.displayName + " (#" + container.id + ") should have already resolved" //, + //i've only commented this out because it scuppers my sublime text colouring + //`"${asyncKeys.join("\", \"")}". (http://git.io/vvvkr)`, + ].join(" ")); + } + + var channels = asyncKeys.map(function (prop) { + var valueOf = container.props.resolve[prop]; + var value = container.props.hasOwnProperty(prop) ? container.props[prop] : valueOf(container.props.props, container.props.context); + return { prop: prop, value: value }; + }); + var rejectState = this.rejectState; + var fulfillState = this.fulfillState; + + this.channels = this.channels.concat(channels); + (0, _jsCspSrcCsp.go)(regeneratorRuntime.mark(function callee$2$0() { + var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, channel, result; + + return regeneratorRuntime.wrap(function callee$2$0$(context$3$0) { + while (1) switch (context$3$0.prev = context$3$0.next) { + case 0: + context$3$0.prev = 0; + _iteratorNormalCompletion = true; + _didIteratorError = false; + _iteratorError = undefined; + context$3$0.prev = 4; + _iterator = channels[Symbol.iterator](); + + case 6: + if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { + context$3$0.next = 17; + break; + } + + channel = _step.value; + context$3$0.next = 10; + return channel.value; + + case 10: + result = channel.result = context$3$0.sent; + + if (!(Object.prototype.toString.call(result) === "[object Error]")) { + context$3$0.next = 13; + break; + } + + throw result; + + case 13: + state.values[channel.prop] = channel.result; + + case 14: + _iteratorNormalCompletion = true; + context$3$0.next = 6; + break; + + case 17: + context$3$0.next = 23; + break; + + case 19: + context$3$0.prev = 19; + context$3$0.t0 = context$3$0["catch"](4); + _didIteratorError = true; + _iteratorError = context$3$0.t0; + + case 23: + context$3$0.prev = 23; + context$3$0.prev = 24; + + if (!_iteratorNormalCompletion && _iterator["return"]) { + _iterator["return"](); + } + + case 26: + context$3$0.prev = 26; + + if (!_didIteratorError) { + context$3$0.next = 29; + break; + } + + throw _iteratorError; + + case 29: + return context$3$0.finish(26); + + case 30: + return context$3$0.finish(23); + + case 31: + fulfillState.bind(self)(state, callback); + + if (!Resolver.server) { + context$3$0.next = 35; + break; + } + + context$3$0.next = 35; + return (0, _jsCspSrcCsp.put)(self.awaitChan, channels.filter(function (p) { + return p.result; + }).map(function (p) { + return p.result; + })); + + case 35: + context$3$0.next = 40; + break; + + case 37: + context$3$0.prev = 37; + context$3$0.t1 = context$3$0["catch"](0); + + rejectState.bind(self)(context$3$0.t1, state, callback); + + case 40: + if (!Resolver.server) { + //keep getting data from channels until the refreshchan gets closed + (0, _jsCspSrcCsp.go)(regeneratorRuntime.mark(function process(cs) { + var channelResult, channel; + return regeneratorRuntime.wrap(function process$(context$4$0) { + while (1) switch (context$4$0.prev = context$4$0.next) { + case 0: + context$4$0.next = 2; + return (0, _jsCspSrcCsp.alts)(cs); + + case 2: + channelResult = context$4$0.sent; + + if (!(channelResult.channel !== self.refreshChan)) { + context$4$0.next = 13; + break; + } + + if (channelResult.channel.closed) { + context$4$0.next = 11; + break; + } + + channel = channels[channels.map(function (c) { + return c.value; + }).indexOf(channelResult.channel)]; + /*eslint no-loop-func:0*/ + if (channel) { + state.values[channel.prop] = channel.result = channelResult.value; + fulfillState.bind(self)(state, callback); + } + context$4$0.next = 9; + return (0, _jsCspSrcCsp.go)(process, [cs]); + + case 9: + context$4$0.next = 13; + break; + + case 11: + context$4$0.next = 13; + return (0, _jsCspSrcCsp.go)(process, [cs.filter(function (c) { + return c !== channelResult.channel; + })]); + + case 13: + case "end": + return context$4$0.stop(); + } + }, process, this); + }), [channels.map(function (c) { + return c.value; + }).concat([self.refreshChan])]); + } + + case 41: + case "end": + return context$3$0.stop(); + } + }, callee$2$0, this, [[0, 37], [4, 19, 23, 31], [24,, 26, 30]]); + })); + } + }], [{ + key: "createContainer", + value: function createContainer(Component) { + var props = arguments[1] === undefined ? {} : arguments[1]; + + if (!Component.hasOwnProperty("displayName")) { + throw new ReferenceError("Resolver.createContainer requires wrapped component to have `displayName`"); + } + + var ComponentContainer = (function (_React$Component) { + function ComponentContainer() { + _classCallCheck(this, ComponentContainer); + + if (_React$Component != null) { + _React$Component.apply(this, arguments); + } + } + + _inherits(ComponentContainer, _React$Component); + + _createClass(ComponentContainer, [{ + key: "render", + value: function render() { + return _react2["default"].createElement(_Container2["default"], _extends({ + component: Component, + context: this.context, + props: this.props + }, props)); + } + }]); + + return ComponentContainer; + })(_react2["default"].Component); + + ComponentContainer.childContextTypes = props.childContextTypes; + ComponentContainer.contextTypes = props.contextTypes; + ComponentContainer.displayName = "" + Component.displayName + "Container"; + + return ComponentContainer; + } + }, { + key: "render", + value: function render(element, node) { + var instance = arguments[2] === undefined ? new Resolver() : arguments[2]; + + Resolver.server = false; + _react2["default"].render(_react2["default"].createElement( + _Container2["default"], + { resolver: instance }, + element + ), node); + + return instance; + } + }, { + key: "renderToString", + value: function renderToString(element) { + return myRenderTo(element, _react2["default"].renderToString); + } + }, { + key: "renderToStaticMarkup", + value: function renderToStaticMarkup(element) { + return myRenderTo(element, _react2["default"].renderToStaticMarkup); + } + }]); + + return Resolver; +})(); + +exports["default"] = Resolver; +module.exports = exports["default"]; + +//replace with alts + +//if channel is closed remove it from the list of channels we are monitoring \ No newline at end of file diff --git a/dist/ResolverError.js b/dist/ResolverError.js index 3fdb817..2310df3 100644 --- a/dist/ResolverError.js +++ b/dist/ResolverError.js @@ -1,15 +1,15 @@ "use strict"; -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; - Object.defineProperty(exports, "__esModule", { value: true }); +var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } + var ResolverError = (function (_Error) { function ResolverError(message) { _classCallCheck(this, ResolverError); diff --git a/dist/decorators/dataDependencies.js b/dist/decorators/dataDependencies.js new file mode 100644 index 0000000..e33f008 --- /dev/null +++ b/dist/decorators/dataDependencies.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _index = require("../index"); + +exports["default"] = function (resolve) { + return function (target) { + return _index.Resolver.createContainer(target, { resolve: resolve }); + }; +}; + +var errorRender = function errorRender(render) { + return function (target) { + target.errorRender = render; + return target; + }; +}; + +exports.errorRender = errorRender; +var waitRender = function waitRender(render) { + return function (target) { + target.waitRender = render; + return target; + }; +}; +exports.waitRender = waitRender; \ No newline at end of file diff --git a/dist/decorators/displayName.js b/dist/decorators/displayName.js new file mode 100644 index 0000000..3d5a0e9 --- /dev/null +++ b/dist/decorators/displayName.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports["default"] = function (name) { + return function (target) { + target.displayName = name; + return target; + }; +}; + +module.exports = exports["default"]; \ No newline at end of file diff --git a/dist/decorators/index.js b/dist/decorators/index.js new file mode 100644 index 0000000..6fcd1ea --- /dev/null +++ b/dist/decorators/index.js @@ -0,0 +1,14 @@ +"use strict"; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _dataDependencies = require("./dataDependencies"); + +var _dataDependencies2 = _interopRequireDefault(_dataDependencies); + +var _displayName = require("./displayName"); + +var _displayName2 = _interopRequireDefault(_displayName); + +module.exports.dataDependencies = _dataDependencies2["default"]; +module.exports.displayName = _displayName2["default"]; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index e3579de..e3f71ba 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,19 +1,29 @@ "use strict"; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var _Container = require("./Container"); -var _Container2 = _interopRequireWildcard(_Container); +var _Container2 = _interopRequireDefault(_Container); var _Resolver = require("./Resolver"); -var _Resolver2 = _interopRequireWildcard(_Resolver); +var _Resolver2 = _interopRequireDefault(_Resolver); var _ResolverError = require("./ResolverError"); -var _ResolverError2 = _interopRequireWildcard(_ResolverError); +var _ResolverError2 = _interopRequireDefault(_ResolverError); + +var _decoratorsIndex = require("./decorators/index"); + +var _decoratorsIndex2 = _interopRequireDefault(_decoratorsIndex); + +var _jsCsp = require("./js-csp"); + +var _jsCsp2 = _interopRequireDefault(_jsCsp); module.exports.Container = _Container2["default"]; module.exports.Error = _ResolverError2["default"]; -module.exports.Resolver = _Resolver2["default"]; \ No newline at end of file +module.exports.Resolver = _Resolver2["default"]; +module.exports.csp = _jsCsp2["default"]; +module.exports.decorators = _decoratorsIndex2["default"]; \ No newline at end of file diff --git a/dist/js-csp/index.js b/dist/js-csp/index.js new file mode 100644 index 0000000..8ed1063 --- /dev/null +++ b/dist/js-csp/index.js @@ -0,0 +1,5 @@ +"use strict"; + +var csp = require("./src/csp"); + +module.exports = csp; \ No newline at end of file diff --git a/dist/js-csp/src/csp.core.js b/dist/js-csp/src/csp.core.js new file mode 100644 index 0000000..d58a37a --- /dev/null +++ b/dist/js-csp/src/csp.core.js @@ -0,0 +1,70 @@ +"use strict"; + +var buffers = require("./impl/buffers"); +var channels = require("./impl/channels"); +var select = require("./impl/select"); +var process = require("./impl/process"); +var timers = require("./impl/timers"); + +function spawn(gen, creator) { + var ch = channels.chan(buffers.fixed(1)); + new process.Process(gen, function (value) { + if (value === channels.CLOSED) { + ch.close(); + } else { + process.put_then_callback(ch, value, function (ok) { + ch.close(); + }); + } + }, creator).run(); + return ch; +}; + +function go(f, args) { + args = args || []; + + var gen = f.apply(null, args); + return spawn(gen, f); +}; + +function chan(bufferOrNumber, xform, exHandler) { + var buf; + if (bufferOrNumber === 0) { + bufferOrNumber = null; + } + if (typeof bufferOrNumber === "number") { + buf = buffers.fixed(bufferOrNumber); + } else { + buf = bufferOrNumber; + } + return channels.chan(buf, xform, exHandler); +}; + +function promiseChan(xform, exHandler) { + return chan(buffers.promise(), xform, exHandler); +}; + +module.exports = { + buffers: { + fixed: buffers.fixed, + dropping: buffers.dropping, + sliding: buffers.sliding, + promise: buffers.promise + }, + + spawn: spawn, + go: go, + chan: chan, + promiseChan: promiseChan, + DEFAULT: select.DEFAULT, + CLOSED: channels.CLOSED, + + put: process.put, + take: process.take, + sleep: process.sleep, + alts: process.alts, + putAsync: process.put_then_callback, + takeAsync: process.take_then_callback, + + timeout: timers.timeout +}; \ No newline at end of file diff --git a/dist/js-csp/src/csp.js b/dist/js-csp/src/csp.js new file mode 100644 index 0000000..2c3b563 --- /dev/null +++ b/dist/js-csp/src/csp.js @@ -0,0 +1,11 @@ +"use strict"; + +var csp = require("./csp.core"); +var operations = require("./csp.operations"); +var pipeline = require("./csp.pipeline"); + +csp.operations = operations; +csp.operations.pipeline = pipeline.pipeline; +csp.operations.pipelineAsync = pipeline.pipelineAsync; + +module.exports = csp; \ No newline at end of file diff --git a/dist/js-csp/src/csp.operations.js b/dist/js-csp/src/csp.operations.js new file mode 100644 index 0000000..ad6fa23 --- /dev/null +++ b/dist/js-csp/src/csp.operations.js @@ -0,0 +1,1325 @@ +"use strict"; + +var marked0$0 = [mapcat].map(regeneratorRuntime.mark); +var Box = require("./impl/channels").Box; + +var csp = require("./csp.core"), + go = csp.go, + take = csp.take, + put = csp.put, + takeAsync = csp.takeAsync, + putAsync = csp.putAsync, + alts = csp.alts, + chan = csp.chan, + CLOSED = csp.CLOSED; + +function mapFrom(f, ch) { + return { + is_closed: function is_closed() { + return ch.is_closed(); + }, + close: function close() { + ch.close(); + }, + _put: function _put(value, handler) { + return ch._put(value, handler); + }, + _take: function _take(handler) { + var result = ch._take({ + is_active: function is_active() { + return handler.is_active(); + }, + commit: function commit() { + var take_cb = handler.commit(); + return function (value) { + return take_cb(value === CLOSED ? CLOSED : f(value)); + }; + } + }); + if (result) { + var value = result.value; + return new Box(value === CLOSED ? CLOSED : f(value)); + } else { + return null; + } + } + }; +} + +function mapInto(f, ch) { + return { + is_closed: function is_closed() { + return ch.is_closed(); + }, + close: function close() { + ch.close(); + }, + _put: function _put(value, handler) { + return ch._put(f(value), handler); + }, + _take: function _take(handler) { + return ch._take(handler); + } + }; +} + +function filterFrom(p, ch, bufferOrN) { + var out = chan(bufferOrN); + go(regeneratorRuntime.mark(function callee$1$0() { + var value; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 12; + break; + } + + context$2$0.next = 3; + return take(ch); + + case 3: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 7; + break; + } + + out.close(); + return context$2$0.abrupt("break", 12); + + case 7: + if (!p(value)) { + context$2$0.next = 10; + break; + } + + context$2$0.next = 10; + return put(out, value); + + case 10: + context$2$0.next = 0; + break; + + case 12: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return out; +} + +function filterInto(p, ch) { + return { + is_closed: function is_closed() { + return ch.is_closed(); + }, + close: function close() { + ch.close(); + }, + _put: function _put(value, handler) { + if (p(value)) { + return ch._put(value, handler); + } else { + return new Box(!ch.is_closed()); + } + }, + _take: function _take(handler) { + return ch._take(handler); + } + }; +} + +function removeFrom(p, ch) { + return filterFrom(function (value) { + return !p(value); + }, ch); +} + +function removeInto(p, ch) { + return filterInto(function (value) { + return !p(value); + }, ch); +} + +function mapcat(f, src, dst) { + var value, seq, length, i; + return regeneratorRuntime.wrap(function mapcat$(context$1$0) { + while (1) switch (context$1$0.prev = context$1$0.next) { + case 0: + if (!true) { + context$1$0.next = 22; + break; + } + + context$1$0.next = 3; + return take(src); + + case 3: + value = context$1$0.sent; + + if (!(value === CLOSED)) { + context$1$0.next = 9; + break; + } + + dst.close(); + return context$1$0.abrupt("break", 22); + + case 9: + seq = f(value); + length = seq.length; + i = 0; + + case 12: + if (!(i < length)) { + context$1$0.next = 18; + break; + } + + context$1$0.next = 15; + return put(dst, seq[i]); + + case 15: + i++; + context$1$0.next = 12; + break; + + case 18: + if (!dst.is_closed()) { + context$1$0.next = 20; + break; + } + + return context$1$0.abrupt("break", 22); + + case 20: + context$1$0.next = 0; + break; + + case 22: + case "end": + return context$1$0.stop(); + } + }, marked0$0[0], this); +} + +function mapcatFrom(f, ch, bufferOrN) { + var out = chan(bufferOrN); + go(mapcat, [f, ch, out]); + return out; +} + +function mapcatInto(f, ch, bufferOrN) { + var src = chan(bufferOrN); + go(mapcat, [f, src, ch]); + return src; +} + +function pipe(src, dst, keepOpen) { + go(regeneratorRuntime.mark(function callee$1$0() { + var value; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 13; + break; + } + + context$2$0.next = 3; + return take(src); + + case 3: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 7; + break; + } + + if (!keepOpen) { + dst.close(); + } + return context$2$0.abrupt("break", 13); + + case 7: + context$2$0.next = 9; + return put(dst, value); + + case 9: + if (context$2$0.sent) { + context$2$0.next = 11; + break; + } + + return context$2$0.abrupt("break", 13); + + case 11: + context$2$0.next = 0; + break; + + case 13: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return dst; +} + +function split(p, ch, trueBufferOrN, falseBufferOrN) { + var tch = chan(trueBufferOrN); + var fch = chan(falseBufferOrN); + go(regeneratorRuntime.mark(function callee$1$0() { + var value; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 12; + break; + } + + context$2$0.next = 3; + return take(ch); + + case 3: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 8; + break; + } + + tch.close(); + fch.close(); + return context$2$0.abrupt("break", 12); + + case 8: + context$2$0.next = 10; + return put(p(value) ? tch : fch, value); + + case 10: + context$2$0.next = 0; + break; + + case 12: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return [tch, fch]; +} + +function reduce(f, init, ch) { + return go(regeneratorRuntime.mark(function callee$1$0() { + var result, value; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + result = init; + + case 1: + if (!true) { + context$2$0.next = 12; + break; + } + + context$2$0.next = 4; + return take(ch); + + case 4: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 9; + break; + } + + return context$2$0.abrupt("return", result); + + case 9: + result = f(result, value); + + case 10: + context$2$0.next = 1; + break; + + case 12: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + }), [], true); +} + +function onto(ch, coll, keepOpen) { + return go(regeneratorRuntime.mark(function callee$1$0() { + var length, i; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + length = coll.length; + i = 0; + + case 2: + if (!(i < length)) { + context$2$0.next = 8; + break; + } + + context$2$0.next = 5; + return put(ch, coll[i]); + + case 5: + i++; + context$2$0.next = 2; + break; + + case 8: + if (!keepOpen) { + ch.close(); + } + + case 9: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); +} + +// TODO: Bounded? +function fromColl(coll) { + var ch = chan(coll.length); + onto(ch, coll); + return ch; +} + +function map(f, chs, bufferOrN) { + var out = chan(bufferOrN); + var length = chs.length; + // Array holding 1 round of values + var values = new Array(length); + // TODO: Not sure why we need a size-1 buffer here + var dchan = chan(1); + // How many more items this round + var dcount; + // put callbacks for each channel + var dcallbacks = new Array(length); + for (var i = 0; i < length; i++) { + dcallbacks[i] = (function (i) { + return function (value) { + values[i] = value; + dcount--; + if (dcount === 0) { + putAsync(dchan, values.slice(0)); + } + }; + })(i); + } + go(regeneratorRuntime.mark(function callee$1$0() { + var i, values; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 18; + break; + } + + dcount = length; + // We could just launch n goroutines here, but for effciency we + // don't + for (i = 0; i < length; i++) { + try { + takeAsync(chs[i], dcallbacks[i]); + } catch (e) { + // FIX: Hmm why catching here? + dcount--; + } + } + context$2$0.next = 5; + return take(dchan); + + case 5: + values = context$2$0.sent; + i = 0; + + case 7: + if (!(i < length)) { + context$2$0.next = 14; + break; + } + + if (!(values[i] === CLOSED)) { + context$2$0.next = 11; + break; + } + + out.close(); + return context$2$0.abrupt("return"); + + case 11: + i++; + context$2$0.next = 7; + break; + + case 14: + context$2$0.next = 16; + return put(out, f.apply(null, values)); + + case 16: + context$2$0.next = 0; + break; + + case 18: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return out; +} + +function merge(chs, bufferOrN) { + var out = chan(bufferOrN); + var actives = chs.slice(0); + go(regeneratorRuntime.mark(function callee$1$0() { + var r, value, i; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 15; + break; + } + + if (!(actives.length === 0)) { + context$2$0.next = 3; + break; + } + + return context$2$0.abrupt("break", 15); + + case 3: + context$2$0.next = 5; + return alts(actives); + + case 5: + r = context$2$0.sent; + value = r.value; + + if (!(value === CLOSED)) { + context$2$0.next = 11; + break; + } + + i = actives.indexOf(r.channel); + + actives.splice(i, 1); + return context$2$0.abrupt("continue", 0); + + case 11: + context$2$0.next = 13; + return put(out, value); + + case 13: + context$2$0.next = 0; + break; + + case 15: + out.close(); + + case 16: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return out; +} + +function into(coll, ch) { + var result = coll.slice(0); + return reduce(function (result, item) { + result.push(item); + return result; + }, result, ch); +} + +function takeN(n, ch, bufferOrN) { + var out = chan(bufferOrN); + go(regeneratorRuntime.mark(function callee$1$0() { + var i, value; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + i = 0; + + case 1: + if (!(i < n)) { + context$2$0.next = 12; + break; + } + + context$2$0.next = 4; + return take(ch); + + case 4: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 7; + break; + } + + return context$2$0.abrupt("break", 12); + + case 7: + context$2$0.next = 9; + return put(out, value); + + case 9: + i++; + context$2$0.next = 1; + break; + + case 12: + out.close(); + + case 13: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return out; +} + +var NOTHING = {}; + +function unique(ch, bufferOrN) { + var out = chan(bufferOrN); + var last = NOTHING; + go(regeneratorRuntime.mark(function callee$1$0() { + var value; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 13; + break; + } + + context$2$0.next = 3; + return take(ch); + + case 3: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 6; + break; + } + + return context$2$0.abrupt("break", 13); + + case 6: + if (!(value === last)) { + context$2$0.next = 8; + break; + } + + return context$2$0.abrupt("continue", 0); + + case 8: + last = value; + context$2$0.next = 11; + return put(out, value); + + case 11: + context$2$0.next = 0; + break; + + case 13: + out.close(); + + case 14: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return out; +} + +function partitionBy(f, ch, bufferOrN) { + var out = chan(bufferOrN); + var part = []; + var last = NOTHING; + go(regeneratorRuntime.mark(function callee$1$0() { + var value, newItem; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 23; + break; + } + + context$2$0.next = 3; + return take(ch); + + case 3: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 12; + break; + } + + if (!(part.length > 0)) { + context$2$0.next = 8; + break; + } + + context$2$0.next = 8; + return put(out, part); + + case 8: + out.close(); + return context$2$0.abrupt("break", 23); + + case 12: + newItem = f(value); + + if (!(newItem === last || last === NOTHING)) { + context$2$0.next = 17; + break; + } + + part.push(value); + context$2$0.next = 20; + break; + + case 17: + context$2$0.next = 19; + return put(out, part); + + case 19: + part = [value]; + + case 20: + last = newItem; + + case 21: + context$2$0.next = 0; + break; + + case 23: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return out; +} + +function partition(n, ch, bufferOrN) { + var out = chan(bufferOrN); + go(regeneratorRuntime.mark(function callee$1$0() { + var part, i, value; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 21; + break; + } + + part = new Array(n); + i = 0; + + case 3: + if (!(i < n)) { + context$2$0.next = 17; + break; + } + + context$2$0.next = 6; + return take(ch); + + case 6: + value = context$2$0.sent; + + if (!(value === CLOSED)) { + context$2$0.next = 13; + break; + } + + if (!(i > 0)) { + context$2$0.next = 11; + break; + } + + context$2$0.next = 11; + return put(out, part.slice(0, i)); + + case 11: + out.close(); + return context$2$0.abrupt("return"); + + case 13: + part[i] = value; + + case 14: + i++; + context$2$0.next = 3; + break; + + case 17: + context$2$0.next = 19; + return put(out, part); + + case 19: + context$2$0.next = 0; + break; + + case 21: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return out; +} + +// For channel identification +var genId = (function () { + var i = 0; + return function () { + i++; + return "" + i; + }; +})(); + +var ID_ATTR = "__csp_channel_id"; + +// TODO: Do we need to check with hasOwnProperty? +function len(obj) { + var count = 0; + for (var p in obj) { + count++; + } + return count; +} + +function chanId(ch) { + var id = ch[ID_ATTR]; + if (id === undefined) { + id = ch[ID_ATTR] = genId(); + } + return id; +} + +var Mult = function Mult(ch) { + this.taps = {}; + this.ch = ch; +}; + +var Tap = function Tap(channel, keepOpen) { + this.channel = channel; + this.keepOpen = keepOpen; +}; + +Mult.prototype.muxch = function () { + return this.ch; +}; + +Mult.prototype.tap = function (ch, keepOpen) { + var id = chanId(ch); + this.taps[id] = new Tap(ch, keepOpen); +}; + +Mult.prototype.untap = function (ch) { + delete this.taps[chanId(ch)]; +}; + +Mult.prototype.untapAll = function () { + this.taps = {}; +}; + +function mult(ch) { + var m = new Mult(ch); + var dchan = chan(1); + var dcount; + function makeDoneCallback(tap) { + return function (stillOpen) { + dcount--; + if (dcount === 0) { + putAsync(dchan, true); + } + if (!stillOpen) { + m.untap(tap.channel); + } + }; + } + go(regeneratorRuntime.mark(function callee$1$0() { + var value, id, t, taps, initDcount; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 17; + break; + } + + context$2$0.next = 3; + return take(ch); + + case 3: + value = context$2$0.sent; + taps = m.taps; + + if (!(value === CLOSED)) { + context$2$0.next = 9; + break; + } + + for (id in taps) { + t = taps[id]; + if (!t.keepOpen) { + t.channel.close(); + } + } + // TODO: Is this necessary? + m.untapAll(); + return context$2$0.abrupt("break", 17); + + case 9: + dcount = len(taps); + initDcount = dcount; + + // Put value on tapping channels... + for (id in taps) { + t = taps[id]; + putAsync(t.channel, value, makeDoneCallback(t)); + } + + if (!(initDcount > 0)) { + context$2$0.next = 15; + break; + } + + context$2$0.next = 15; + return take(dchan); + + case 15: + context$2$0.next = 0; + break; + + case 17: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return m; +} + +mult.tap = function tap(m, ch, keepOpen) { + m.tap(ch, keepOpen); + return ch; +}; + +mult.untap = function untap(m, ch) { + m.untap(ch); +}; + +mult.untapAll = function untapAll(m) { + m.untapAll(); +}; + +var Mix = function Mix(ch) { + this.ch = ch; + this.stateMap = {}; + this.change = chan(); + this.soloMode = mix.MUTE; +}; + +Mix.prototype._changed = function () { + putAsync(this.change, true); +}; + +Mix.prototype._getAllState = function () { + var allState = {}; + var stateMap = this.stateMap; + var solos = []; + var mutes = []; + var pauses = []; + var reads; + for (var id in stateMap) { + var chanData = stateMap[id]; + var state = chanData.state; + var channel = chanData.channel; + if (state[mix.SOLO]) { + solos.push(channel); + } + // TODO + if (state[mix.MUTE]) { + mutes.push(channel); + } + if (state[mix.PAUSE]) { + pauses.push(channel); + } + } + var i, n; + if (this.soloMode === mix.PAUSE && solos.length > 0) { + n = solos.length; + reads = new Array(n + 1); + for (i = 0; i < n; i++) { + reads[i] = solos[i]; + } + reads[n] = this.change; + } else { + reads = []; + for (id in stateMap) { + chanData = stateMap[id]; + channel = chanData.channel; + if (pauses.indexOf(channel) < 0) { + reads.push(channel); + } + } + reads.push(this.change); + } + + return { + solos: solos, + mutes: mutes, + reads: reads + }; +}; + +Mix.prototype.admix = function (ch) { + this.stateMap[chanId(ch)] = { + channel: ch, + state: {} + }; + this._changed(); +}; + +Mix.prototype.unmix = function (ch) { + delete this.stateMap[chanId(ch)]; + this._changed(); +}; + +Mix.prototype.unmixAll = function () { + this.stateMap = {}; + this._changed(); +}; + +Mix.prototype.toggle = function (updateStateList) { + // [[ch1, {}], [ch2, {solo: true}]]; + var length = updateStateList.length; + for (var i = 0; i < length; i++) { + var ch = updateStateList[i][0]; + var id = chanId(ch); + var updateState = updateStateList[i][1]; + var chanData = this.stateMap[id]; + if (!chanData) { + chanData = this.stateMap[id] = { + channel: ch, + state: {} + }; + } + for (var mode in updateState) { + chanData.state[mode] = updateState[mode]; + } + } + this._changed(); +}; + +Mix.prototype.setSoloMode = function (mode) { + if (VALID_SOLO_MODES.indexOf(mode) < 0) { + throw new Error("Mode must be one of: ", VALID_SOLO_MODES.join(", ")); + } + this.soloMode = mode; + this._changed(); +}; + +function mix(out) { + var m = new Mix(out); + go(regeneratorRuntime.mark(function callee$1$0() { + var state, result, value, channel, solos, stillOpen; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + state = m._getAllState(); + + case 1: + if (!true) { + context$2$0.next = 23; + break; + } + + context$2$0.next = 4; + return alts(state.reads); + + case 4: + result = context$2$0.sent; + value = result.value; + channel = result.channel; + + if (!(value === CLOSED)) { + context$2$0.next = 11; + break; + } + + delete m.stateMap[chanId(channel)]; + state = m._getAllState(); + return context$2$0.abrupt("continue", 1); + + case 11: + if (!(channel === m.change)) { + context$2$0.next = 14; + break; + } + + state = m._getAllState(); + return context$2$0.abrupt("continue", 1); + + case 14: + solos = state.solos; + + if (!(solos.indexOf(channel) > -1 || solos.length === 0 && !(state.mutes.indexOf(channel) > -1))) { + context$2$0.next = 21; + break; + } + + context$2$0.next = 18; + return put(out, value); + + case 18: + stillOpen = context$2$0.sent; + + if (stillOpen) { + context$2$0.next = 21; + break; + } + + return context$2$0.abrupt("break", 23); + + case 21: + context$2$0.next = 1; + break; + + case 23: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return m; +} + +mix.MUTE = "mute"; +mix.PAUSE = "pause"; +mix.SOLO = "solo"; +var VALID_SOLO_MODES = [mix.MUTE, mix.PAUSE]; + +mix.add = function admix(m, ch) { + m.admix(ch); +}; + +mix.remove = function unmix(m, ch) { + m.unmix(ch); +}; + +mix.removeAll = function unmixAll(m) { + m.unmixAll(); +}; + +mix.toggle = function toggle(m, updateStateList) { + m.toggle(updateStateList); +}; + +mix.setSoloMode = function setSoloMode(m, mode) { + m.setSoloMode(mode); +}; + +function constantlyNull() { + return null; +} + +var Pub = function Pub(ch, topicFn, bufferFn) { + this.ch = ch; + this.topicFn = topicFn; + this.bufferFn = bufferFn; + this.mults = {}; +}; + +Pub.prototype._ensureMult = function (topic) { + var m = this.mults[topic]; + var bufferFn = this.bufferFn; + if (!m) { + m = this.mults[topic] = mult(chan(bufferFn(topic))); + } + return m; +}; + +Pub.prototype.sub = function (topic, ch, keepOpen) { + var m = this._ensureMult(topic); + return mult.tap(m, ch, keepOpen); +}; + +Pub.prototype.unsub = function (topic, ch) { + var m = this.mults[topic]; + if (m) { + mult.untap(m, ch); + } +}; + +Pub.prototype.unsubAll = function (topic) { + if (topic === undefined) { + this.mults = {}; + } else { + delete this.mults[topic]; + } +}; + +function pub(ch, topicFn, bufferFn) { + bufferFn = bufferFn || constantlyNull; + var p = new Pub(ch, topicFn, bufferFn); + go(regeneratorRuntime.mark(function callee$1$0() { + var value, mults, topic, m, stillOpen; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 17; + break; + } + + context$2$0.next = 3; + return take(ch); + + case 3: + value = context$2$0.sent; + mults = p.mults; + + if (!(value === CLOSED)) { + context$2$0.next = 8; + break; + } + + for (topic in mults) { + mults[topic].muxch().close(); + } + return context$2$0.abrupt("break", 17); + + case 8: + // TODO: Somehow ensure/document that this must return a string + // (otherwise use proper (hash)maps) + topic = topicFn(value); + m = mults[topic]; + + if (!m) { + context$2$0.next = 15; + break; + } + + context$2$0.next = 13; + return put(m.muxch(), value); + + case 13: + stillOpen = context$2$0.sent; + + if (!stillOpen) { + delete mults[topic]; + } + + case 15: + context$2$0.next = 0; + break; + + case 17: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return p; +} + +pub.sub = function sub(p, topic, ch, keepOpen) { + return p.sub(topic, ch, keepOpen); +}; + +pub.unsub = function unsub(p, topic, ch) { + p.unsub(topic, ch); +}; + +pub.unsubAll = function unsubAll(p, topic) { + p.unsubAll(topic); +}; + +module.exports = { + mapFrom: mapFrom, + mapInto: mapInto, + filterFrom: filterFrom, + filterInto: filterInto, + removeFrom: removeFrom, + removeInto: removeInto, + mapcatFrom: mapcatFrom, + mapcatInto: mapcatInto, + + pipe: pipe, + split: split, + reduce: reduce, + onto: onto, + fromColl: fromColl, + + map: map, + merge: merge, + into: into, + take: takeN, + unique: unique, + partition: partition, + partitionBy: partitionBy, + + mult: mult, + mix: mix, + pub: pub +}; + +// Possible "fluid" interfaces: + +// thread( +// [fromColl, [1, 2, 3, 4]], +// [mapFrom, inc], +// [into, []] +// ) + +// thread( +// [fromColl, [1, 2, 3, 4]], +// [mapFrom, inc, _], +// [into, [], _] +// ) + +// wrap() +// .fromColl([1, 2, 3, 4]) +// .mapFrom(inc) +// .into([]) +// .unwrap(); + +// FIX: Should be a generic looping interface (for...in?) + +// Remove closed channel +// XXX: This is because putAsync can actually call back +// immediately. Fix that +// ... waiting for all puts to complete \ No newline at end of file diff --git a/dist/js-csp/src/csp.pipeline.js b/dist/js-csp/src/csp.pipeline.js new file mode 100644 index 0000000..8764e7f --- /dev/null +++ b/dist/js-csp/src/csp.pipeline.js @@ -0,0 +1,229 @@ +'use strict'; + +var csp = require('./csp.core'); + +function pipelineInternal(n, to, from, close, taskFn) { + if (n <= 0) { + throw new Error('n must be positive'); + } + + var jobs = csp.chan(n); + var results = csp.chan(n); + + for (var _ = 0; _ < n; _++) { + csp.go(regeneratorRuntime.mark(function callee$1$0(taskFn, jobs, results) { + var job; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 9; + break; + } + + context$2$0.next = 3; + return csp.take(jobs); + + case 3: + job = context$2$0.sent; + + if (taskFn(job)) { + context$2$0.next = 7; + break; + } + + results.close(); + return context$2$0.abrupt('break', 9); + + case 7: + context$2$0.next = 0; + break; + + case 9: + case 'end': + return context$2$0.stop(); + } + }, callee$1$0, this); + }), [taskFn, jobs, results]); + } + + csp.go(regeneratorRuntime.mark(function callee$1$0(jobs, from, results) { + var v, p; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 16; + break; + } + + context$2$0.next = 3; + return csp.take(from); + + case 3: + v = context$2$0.sent; + + if (!(v === csp.CLOSED)) { + context$2$0.next = 9; + break; + } + + jobs.close(); + return context$2$0.abrupt('break', 16); + + case 9: + p = csp.chan(1); + context$2$0.next = 12; + return csp.put(jobs, [v, p]); + + case 12: + context$2$0.next = 14; + return csp.put(results, p); + + case 14: + context$2$0.next = 0; + break; + + case 16: + case 'end': + return context$2$0.stop(); + } + }, callee$1$0, this); + }), [jobs, from, results]); + + csp.go(regeneratorRuntime.mark(function callee$1$0(results, close, to) { + var p, res, v; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + if (!true) { + context$2$0.next = 26; + break; + } + + context$2$0.next = 3; + return csp.take(results); + + case 3: + p = context$2$0.sent; + + if (!(p === csp.CLOSED)) { + context$2$0.next = 9; + break; + } + + if (close) { + to.close(); + } + return context$2$0.abrupt('break', 26); + + case 9: + context$2$0.next = 11; + return csp.take(p); + + case 11: + res = context$2$0.sent; + + case 12: + if (!true) { + context$2$0.next = 24; + break; + } + + context$2$0.next = 15; + return csp.take(res); + + case 15: + v = context$2$0.sent; + + if (!(v !== csp.CLOSED)) { + context$2$0.next = 21; + break; + } + + context$2$0.next = 19; + return csp.put(to, v); + + case 19: + context$2$0.next = 22; + break; + + case 21: + return context$2$0.abrupt('break', 24); + + case 22: + context$2$0.next = 12; + break; + + case 24: + context$2$0.next = 0; + break; + + case 26: + case 'end': + return context$2$0.stop(); + } + }, callee$1$0, this); + }), [results, close, to]); + + return to; +} + +function pipeline(to, xf, from, keepOpen, exHandler) { + + function taskFn(job) { + if (job === csp.CLOSED) { + return null; + } else { + var v = job[0]; + var p = job[1]; + var res = csp.chan(1, xf, exHandler); + + csp.go(regeneratorRuntime.mark(function callee$2$0(res, v) { + return regeneratorRuntime.wrap(function callee$2$0$(context$3$0) { + while (1) switch (context$3$0.prev = context$3$0.next) { + case 0: + context$3$0.next = 2; + return csp.put(res, v); + + case 2: + res.close(); + + case 3: + case 'end': + return context$3$0.stop(); + } + }, callee$2$0, this); + }), [res, v]); + + csp.putAsync(p, res); + + return true; + } + } + + return pipelineInternal(1, to, from, !keepOpen, taskFn); +} + +function pipelineAsync(n, to, af, from, keepOpen) { + + function taskFn(job) { + if (job === csp.CLOSED) { + return null; + } else { + var v = job[0]; + var p = job[1]; + var res = csp.chan(1); + af(v, res); + csp.putAsync(p, res); + return true; + } + } + + return pipelineInternal(n, to, from, !keepOpen, taskFn); +} + +module.exports = { + pipeline: pipeline, + pipelineAsync: pipelineAsync +}; \ No newline at end of file diff --git a/dist/js-csp/src/csp.test-helpers.js b/dist/js-csp/src/csp.test-helpers.js new file mode 100644 index 0000000..abca04a --- /dev/null +++ b/dist/js-csp/src/csp.test-helpers.js @@ -0,0 +1,110 @@ +"use strict"; + +var csp = require("./csp"); +var chan = csp.chan; +var go = csp.go; +var put = csp.put; +var take = csp.take; + +var mocha = require("mocha"); +var it = mocha.it; + +function identity_chan(x) { + var ch = chan(1); + go(regeneratorRuntime.mark(function callee$1$0() { + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + context$2$0.next = 2; + return put(ch, x); + + case 2: + ch.close(); + + case 3: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this); + })); + return ch; +} + +function check(f, done) { + return (function () { + try { + f(); + done(); + } catch (e) { + done(e); + } + })(); +} + +// it("", g(function*() { +// })); +function g(f) { + return function (done) { + go(f, [done]); + }; +}; + +function gg(f) { + return g(regeneratorRuntime.mark(function callee$1$0(done) { + var ch; + return regeneratorRuntime.wrap(function callee$1$0$(context$2$0) { + while (1) switch (context$2$0.prev = context$2$0.next) { + case 0: + context$2$0.prev = 0; + ch = go(f, []); + context$2$0.next = 4; + return take(ch); + + case 4: + done(); + context$2$0.next = 10; + break; + + case 7: + context$2$0.prev = 7; + context$2$0.t0 = context$2$0["catch"](0); + + done(context$2$0.t0); + + case 10: + case "end": + return context$2$0.stop(); + } + }, callee$1$0, this, [[0, 7]]); + })); +} + +module.exports = { + identity_chan: identity_chan, + check: check, + goAsync: g, + go: gg, + + // f must be a generator function. For now assertions should be inside f's + // top-level, not functions f may call (that works but a failing test + // may break following tests). + it: function it(desc, f) { + return mocha.it(desc, gg(f)); + }, + + beforeEach: function beforeEach(f) { + return mocha.beforeEach(gg(f)); + }, + + afterEach: function afterEach(f) { + return mocha.afterEach(gg(f)); + }, + + before: function before(f) { + return mocha.before(gg(f)); + }, + + after: function after(f) { + return mocha.after(gg(f)); + } +}; \ No newline at end of file diff --git a/dist/js-csp/src/impl/buffers.js b/dist/js-csp/src/impl/buffers.js new file mode 100644 index 0000000..15f7c73 --- /dev/null +++ b/dist/js-csp/src/impl/buffers.js @@ -0,0 +1,226 @@ +"use strict"; + +// TODO: Consider EmptyError & FullError to avoid redundant bound +// checks, to improve performance (may need benchmarks) + +function acopy(src, src_start, dst, dst_start, length) { + var count = 0; + while (true) { + if (count >= length) { + break; + } + dst[dst_start + count] = src[src_start + count]; + count++; + } +} + +function noop() {}; + +var EMPTY = { + toString: function toString() { + return "[object EMPTY]"; + } +}; + +var RingBuffer = function RingBuffer(head, tail, length, array) { + this.length = length; + this.array = array; + this.head = head; + this.tail = tail; +}; + +// Internal method, callers must do bound check +RingBuffer.prototype._unshift = function (item) { + var array = this.array; + var head = this.head; + array[head] = item; + this.head = (head + 1) % array.length; + this.length++; +}; + +RingBuffer.prototype._resize = function () { + var array = this.array; + var new_length = 2 * array.length; + var new_array = new Array(new_length); + var head = this.head; + var tail = this.tail; + var length = this.length; + if (tail < head) { + acopy(array, tail, new_array, 0, length); + this.tail = 0; + this.head = length; + this.array = new_array; + } else if (tail > head) { + acopy(array, tail, new_array, 0, array.length - tail); + acopy(array, 0, new_array, array.length - tail, head); + this.tail = 0; + this.head = length; + this.array = new_array; + } else if (tail === head) { + this.tail = 0; + this.head = 0; + this.array = new_array; + } +}; + +RingBuffer.prototype.unbounded_unshift = function (item) { + if (this.length + 1 === this.array.length) { + this._resize(); + } + this._unshift(item); +}; + +RingBuffer.prototype.pop = function () { + if (this.length === 0) { + return EMPTY; + } + var array = this.array; + var tail = this.tail; + var item = array[tail]; + array[tail] = null; + this.tail = (tail + 1) % array.length; + this.length--; + return item; +}; + +RingBuffer.prototype.cleanup = function (predicate) { + var length = this.length; + for (var i = 0; i < length; i++) { + var item = this.pop(); + if (predicate(item)) { + this._unshift(item); + } + } +}; + +var FixedBuffer = function FixedBuffer(buf, n) { + this.buf = buf; + this.n = n; +}; + +FixedBuffer.prototype.is_full = function () { + return this.buf.length >= this.n; +}; + +FixedBuffer.prototype.remove = function () { + return this.buf.pop(); +}; + +FixedBuffer.prototype.add = function (item) { + // Note that even though the underlying buffer may grow, "n" is + // fixed so after overflowing the buffer is still considered full. + this.buf.unbounded_unshift(item); +}; + +FixedBuffer.prototype.count = function () { + return this.buf.length; +}; + +FixedBuffer.prototype.close = noop; + +var DroppingBuffer = function DroppingBuffer(buf, n) { + this.buf = buf; + this.n = n; +}; + +DroppingBuffer.prototype.is_full = function () { + return false; +}; + +DroppingBuffer.prototype.remove = function () { + return this.buf.pop(); +}; + +DroppingBuffer.prototype.add = function (item) { + if (this.buf.length < this.n) { + this.buf._unshift(item); + } +}; + +DroppingBuffer.prototype.count = function () { + return this.buf.length; +}; + +DroppingBuffer.prototype.close = noop; + +var SlidingBuffer = function SlidingBuffer(buf, n) { + this.buf = buf; + this.n = n; +}; + +SlidingBuffer.prototype.is_full = function () { + return false; +}; + +SlidingBuffer.prototype.remove = function () { + return this.buf.pop(); +}; + +SlidingBuffer.prototype.add = function (item) { + if (this.buf.length === this.n) { + this.buf.pop(); + } + this.buf._unshift(item); +}; + +SlidingBuffer.prototype.count = function () { + return this.buf.length; +}; + +SlidingBuffer.prototype.close = noop; + +var PromiseBuffer = function PromiseBuffer() { + this.val = EMPTY; +}; + +PromiseBuffer.prototype.count = function () { + return this.val === EMPTY ? 0 : 1; +}; + +PromiseBuffer.prototype.add = function (item) { + if (this.val === EMPTY) { + this.val = item; + } +}; + +PromiseBuffer.prototype.is_full = function () { + return false; +}; + +PromiseBuffer.prototype.remove = function () { + return this.val; +}; + +PromiseBuffer.prototype.close = function () { + this.val = EMPTY; +}; + +var ring = exports.ring = function ring_buffer(n) { + return new RingBuffer(0, 0, 0, new Array(n)); +}; + +/** + * Returns a buffer that is considered "full" when it reaches size n, + * but still accepts additional items, effectively allow overflowing. + * The overflowing behavior is useful for supporting "expanding" + * transducers, where we want to check if a buffer is full before + * running the transduced step function, while still allowing a + * transduced step to expand into multiple "essence" steps. + */ +exports.fixed = function fixed_buffer(n) { + return new FixedBuffer(ring(n), n); +}; + +exports.dropping = function dropping_buffer(n) { + return new DroppingBuffer(ring(n), n); +}; + +exports.sliding = function sliding_buffer(n) { + return new SlidingBuffer(ring(n), n); +}; + +exports.promise = function promise_buffer() { + return new PromiseBuffer(); +}; + +exports.EMPTY = EMPTY; \ No newline at end of file diff --git a/dist/js-csp/src/impl/channels.js b/dist/js-csp/src/impl/channels.js new file mode 100644 index 0000000..67afb64 --- /dev/null +++ b/dist/js-csp/src/impl/channels.js @@ -0,0 +1,324 @@ +"use strict"; + +var buffers = require("./buffers"); +var dispatch = require("./dispatch"); + +var MAX_DIRTY = 64; +var MAX_QUEUE_SIZE = 1024; + +var CLOSED = null; + +var Box = function Box(value) { + this.value = value; +}; + +var PutBox = function PutBox(handler, value) { + this.handler = handler; + this.value = value; +}; + +var Channel = function Channel(takes, puts, buf, xform) { + this.buf = buf; + this.xform = xform; + this.takes = takes; + this.puts = puts; + + this.dirty_takes = 0; + this.dirty_puts = 0; + this.closed = false; +}; + +function isReduced(v) { + return v && v["@@transducer/reduced"]; +} + +function schedule(f, v) { + dispatch.run(function () { + f(v); + }); +} + +Channel.prototype._put = function (value, handler) { + if (value === CLOSED) { + throw new Error("Cannot put CLOSED on a channel."); + } + + // TODO: I'm not sure how this can happen, because the operations + // are registered in 1 tick, and the only way for this to be inactive + // is for a previous operation in the same alt to have returned + // immediately, which would have short-circuited to prevent this to + // be ever register anyway. The same thing goes for the active check + // in "_take". + if (!handler.is_active()) { + return null; + } + + if (this.closed) { + handler.commit(); + return new Box(false); + } + + var taker, callback; + + // Soak the value through the buffer first, even if there is a + // pending taker. This way the step function has a chance to act on the + // value. + if (this.buf && !this.buf.is_full()) { + handler.commit(); + var done = isReduced(this.xform["@@transducer/step"](this.buf, value)); + while (true) { + if (this.buf.count() === 0) { + break; + } + taker = this.takes.pop(); + if (taker === buffers.EMPTY) { + break; + } + if (taker.is_active()) { + value = this.buf.remove(); + callback = taker.commit(); + schedule(callback, value); + } + } + if (done) { + this.close(); + } + return new Box(true); + } + + // Either the buffer is full, in which case there won't be any + // pending takes, or we don't have a buffer, in which case this loop + // fulfills the first of them that is active (note that we don't + // have to worry about transducers here since we require a buffer + // for that). + while (true) { + taker = this.takes.pop(); + if (taker === buffers.EMPTY) { + break; + } + if (taker.is_active()) { + handler.commit(); + callback = taker.commit(); + schedule(callback, value); + return new Box(true); + } + } + + // No buffer, full buffer, no pending takes. Queue this put now. + if (this.dirty_puts > MAX_DIRTY) { + this.puts.cleanup(function (putter) { + return putter.handler.is_active(); + }); + this.dirty_puts = 0; + } else { + this.dirty_puts++; + } + if (this.puts.length >= MAX_QUEUE_SIZE) { + throw new Error("No more than " + MAX_QUEUE_SIZE + " pending puts are allowed on a single channel."); + } + this.puts.unbounded_unshift(new PutBox(handler, value)); + return null; +}; + +Channel.prototype._take = function (handler) { + if (!handler.is_active()) { + return null; + } + + var putter, put_handler, callback, value; + + if (this.buf && this.buf.count() > 0) { + handler.commit(); + value = this.buf.remove(); + // We need to check pending puts here, other wise they won't + // be able to proceed until their number reaches MAX_DIRTY + while (true) { + if (this.buf.is_full()) { + break; + } + putter = this.puts.pop(); + if (putter === buffers.EMPTY) { + break; + } + put_handler = putter.handler; + if (put_handler.is_active()) { + callback = put_handler.commit(); + if (callback) { + schedule(callback, true); + } + if (isReduced(this.xform["@@transducer/step"](this.buf, putter.value))) { + this.close(); + } + } + } + return new Box(value); + } + + // Either the buffer is empty, in which case there won't be any + // pending puts, or we don't have a buffer, in which case this loop + // fulfills the first of them that is active (note that we don't + // have to worry about transducers here since we require a buffer + // for that). + while (true) { + putter = this.puts.pop(); + value = putter.value; + if (putter === buffers.EMPTY) { + break; + } + put_handler = putter.handler; + if (put_handler.is_active()) { + handler.commit(); + callback = put_handler.commit(); + if (callback) { + schedule(callback, true); + } + return new Box(value); + } + } + + if (this.closed) { + handler.commit(); + return new Box(CLOSED); + } + + // No buffer, empty buffer, no pending puts. Queue this take now. + if (this.dirty_takes > MAX_DIRTY) { + this.takes.cleanup(function (handler) { + return handler.is_active(); + }); + this.dirty_takes = 0; + } else { + this.dirty_takes++; + } + if (this.takes.length >= MAX_QUEUE_SIZE) { + throw new Error("No more than " + MAX_QUEUE_SIZE + " pending takes are allowed on a single channel."); + } + this.takes.unbounded_unshift(handler); + return null; +}; + +Channel.prototype.close = function () { + if (this.closed) { + return; + } + this.closed = true; + + // TODO: Duplicate code. Make a "_flush" function or something + if (this.buf) { + this.buf.close(); + this.xform["@@transducer/result"](this.buf); + while (true) { + if (this.buf.count() === 0) { + break; + } + taker = this.takes.pop(); + if (taker === buffers.EMPTY) { + break; + } + if (taker.is_active()) { + callback = taker.commit(); + var value = this.buf.remove(); + schedule(callback, value); + } + } + } + + while (true) { + var taker = this.takes.pop(); + if (taker === buffers.EMPTY) { + break; + } + if (taker.is_active()) { + var callback = taker.commit(); + schedule(callback, CLOSED); + } + } + + while (true) { + var putter = this.puts.pop(); + if (putter === buffers.EMPTY) { + break; + } + if (putter.handler.is_active()) { + var put_callback = putter.handler.commit(); + if (put_callback) { + schedule(put_callback, false); + } + } + } +}; + +Channel.prototype.is_closed = function () { + return this.closed; +}; + +function defaultHandler(e) { + console.log("error in channel transformer", e.stack); + return CLOSED; +} + +function handleEx(buf, exHandler, e) { + var def = (exHandler || defaultHandler)(e); + if (def !== CLOSED) { + buf.add(def); + } + return buf; +} + +// The base transformer object to use with transducers +function AddTransformer() {} + +AddTransformer.prototype["@@transducer/init"] = function () { + throw new Error("init not available"); +}; + +AddTransformer.prototype["@@transducer/result"] = function (v) { + return v; +}; + +AddTransformer.prototype["@@transducer/step"] = function (buffer, input) { + buffer.add(input); + return buffer; +}; + +function handleException(exHandler) { + return function (xform) { + return { + "@@transducer/step": function transducerStep(buffer, input) { + try { + return xform["@@transducer/step"](buffer, input); + } catch (e) { + return handleEx(buffer, exHandler, e); + } + }, + "@@transducer/result": function transducerResult(buffer) { + try { + return xform["@@transducer/result"](buffer); + } catch (e) { + return handleEx(buffer, exHandler, e); + } + } + }; + }; +} + +// XXX: This is inconsistent. We should either call the reducing +// function xform, or call the transducer xform, not both +exports.chan = function (buf, xform, exHandler) { + if (xform) { + if (!buf) { + throw new Error("Only buffered channels can use transducers"); + } + + xform = xform(new AddTransformer()); + } else { + xform = new AddTransformer(); + } + xform = handleException(exHandler)(xform); + + return new Channel(buffers.ring(32), buffers.ring(32), buf, xform); +}; + +exports.Box = Box; +exports.Channel = Channel; +exports.CLOSED = CLOSED; \ No newline at end of file diff --git a/dist/js-csp/src/impl/dispatch.js b/dist/js-csp/src/impl/dispatch.js new file mode 100644 index 0000000..9b72386 --- /dev/null +++ b/dist/js-csp/src/impl/dispatch.js @@ -0,0 +1,82 @@ +"use strict"; + +// TODO: Use process.nextTick if it's available since it's more +// efficient +// http://howtonode.org/understanding-process-next-tick +// Maybe we don't even need to queue ourselves in that case? + +// XXX: But http://blog.nodejs.org/2013/03/11/node-v0-10-0-stable/ +// Looks like it will blow up the stack (or is that just about +// pre-empting IO (but that's already bad enough IMO)?) + +// Looks like +// http://nodejs.org/api/process.html#process_process_nexttick_callback +// is the equivalent of our TASK_BATCH_SIZE + +var buffers = require("./buffers"); + +var TASK_BATCH_SIZE = 1024; + +var tasks = buffers.ring(32); +var running = false; +var queued = false; + +var queue_dispatcher; + +function process_messages() { + running = true; + queued = false; + var count = 0; + while (true) { + var task = tasks.pop(); + if (task === buffers.EMPTY) { + break; + } + // TODO: Don't we need a try/finally here? + task(); + if (count >= TASK_BATCH_SIZE) { + break; + } + count++; + } + running = false; + if (tasks.length > 0) { + queue_dispatcher(); + } +} + +if (typeof MessageChannel !== "undefined") { + var message_channel = new MessageChannel(); + message_channel.port1.onmessage = function (_) { + process_messages(); + }; + queue_dispatcher = function () { + if (!(queued && running)) { + queued = true; + message_channel.port2.postMessage(0); + } + }; +} else if (typeof setImmediate !== "undefined") { + queue_dispatcher = function () { + if (!(queued && running)) { + queued = true; + setImmediate(process_messages); + } + }; +} else { + queue_dispatcher = function () { + if (!(queued && running)) { + queued = true; + setTimeout(process_messages, 0); + } + }; +} + +exports.run = function (f) { + tasks.unbounded_unshift(f); + queue_dispatcher(); +}; + +exports.queue_delay = function (f, delay) { + setTimeout(f, delay); +}; \ No newline at end of file diff --git a/dist/js-csp/src/impl/process.js b/dist/js-csp/src/impl/process.js new file mode 100644 index 0000000..4acedb9 --- /dev/null +++ b/dist/js-csp/src/impl/process.js @@ -0,0 +1,157 @@ +"use strict"; + +var dispatch = require("./dispatch"); +var select = require("./select"); +var Channel = require("./channels").Channel; + +var FnHandler = function FnHandler(f) { + this.f = f; +}; + +FnHandler.prototype.is_active = function () { + return true; +}; + +FnHandler.prototype.commit = function () { + return this.f; +}; + +function put_then_callback(channel, value, callback) { + var result = channel._put(value, new FnHandler(callback)); + if (result && callback) { + callback(result.value); + } +} + +function take_then_callback(channel, callback) { + var result = channel._take(new FnHandler(callback)); + if (result) { + callback(result.value); + } +} + +var Process = function Process(gen, onFinish, creator) { + this.gen = gen; + this.creatorFunc = creator; + this.finished = false; + this.onFinish = onFinish; +}; + +var Instruction = function Instruction(op, data) { + this.op = op; + this.data = data; +}; + +var TAKE = "take"; +var PUT = "put"; +var SLEEP = "sleep"; +var ALTS = "alts"; + +// TODO FIX XXX: This is a (probably) temporary hack to avoid blowing +// up the stack, but it means double queueing when the value is not +// immediately available +Process.prototype._continue = function (response) { + var self = this; + dispatch.run(function () { + self.run(response); + }); +}; + +Process.prototype._done = function (value) { + if (!this.finished) { + this.finished = true; + var onFinish = this.onFinish; + if (typeof onFinish === "function") { + dispatch.run(function () { + onFinish(value); + }); + } + } +}; + +Process.prototype.run = function (response) { + if (this.finished) { + return; + } + + // TODO: Shouldn't we (optionally) stop error propagation here (and + // signal the error through a channel or something)? Otherwise the + // uncaught exception will crash some runtimes (e.g. Node) + var iter = this.gen.next(response); + if (iter.done) { + this._done(iter.value); + return; + } + + var ins = iter.value; + var self = this; + + if (ins instanceof Instruction) { + switch (ins.op) { + case PUT: + var data = ins.data; + put_then_callback(data.channel, data.value, function (ok) { + self._continue(ok); + }); + break; + + case TAKE: + var channel = ins.data; + take_then_callback(channel, function (value) { + self._continue(value); + }); + break; + + case SLEEP: + var msecs = ins.data; + dispatch.queue_delay(function () { + self.run(null); + }, msecs); + break; + + case ALTS: + select.do_alts(ins.data.operations, function (result) { + self._continue(result); + }, ins.data.options); + break; + } + } else if (ins instanceof Channel) { + var channel = ins; + take_then_callback(channel, function (value) { + self._continue(value); + }); + } else { + this._continue(ins); + } +}; + +function take(channel) { + return new Instruction(TAKE, channel); +} + +function put(channel, value) { + return new Instruction(PUT, { + channel: channel, + value: value + }); +} + +function sleep(msecs) { + return new Instruction(SLEEP, msecs); +} + +function alts(operations, options) { + return new Instruction(ALTS, { + operations: operations, + options: options + }); +} + +exports.put_then_callback = put_then_callback; +exports.take_then_callback = take_then_callback; +exports.put = put; +exports.take = take; +exports.sleep = sleep; +exports.alts = alts; +exports.Instruction = Instruction; +exports.Process = Process; \ No newline at end of file diff --git a/dist/js-csp/src/impl/select.js b/dist/js-csp/src/impl/select.js new file mode 100644 index 0000000..9c48349 --- /dev/null +++ b/dist/js-csp/src/impl/select.js @@ -0,0 +1,105 @@ +"use strict"; + +var Box = require("./channels").Box; + +var AltHandler = function AltHandler(flag, f) { + this.f = f; + this.flag = flag; +}; + +AltHandler.prototype.is_active = function () { + return this.flag.value; +}; + +AltHandler.prototype.commit = function () { + this.flag.value = false; + return this.f; +}; + +var AltResult = function AltResult(value, channel) { + this.value = value; + this.channel = channel; +}; + +function rand_int(n) { + return Math.floor(Math.random() * (n + 1)); +} + +function random_array(n) { + var a = new Array(n); + var i; + for (i = 0; i < n; i++) { + a[i] = 0; + } + for (i = 1; i < n; i++) { + var j = rand_int(i); + a[i] = a[j]; + a[j] = i; + } + return a; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var DEFAULT = { + toString: function toString() { + return "[object DEFAULT]"; + } +}; + +// TODO: Accept a priority function or something +exports.do_alts = function (operations, callback, options) { + var length = operations.length; + // XXX Hmm + if (length === 0) { + throw new Error("Empty alt list"); + } + + var priority = options && options.priority ? true : false; + if (!priority) { + var indexes = random_array(length); + } + + var flag = new Box(true); + + for (var i = 0; i < length; i++) { + var operation = operations[priority ? i : indexes[i]]; + var port, result; + // XXX Hmm + if (operation instanceof Array) { + var value = operation[1]; + port = operation[0]; + // We wrap this in a function to capture the value of "port", + // because js' closure captures vars by "references", not + // values. "let port" would have worked, but I don't want to + // raise the runtime requirement yet. TODO: So change this when + // most runtimes are modern enough. + result = port._put(value, (function (port) { + return new AltHandler(flag, function (ok) { + callback(new AltResult(ok, port)); + }); + })(port)); + } else { + port = operation; + result = port._take((function (port) { + return new AltHandler(flag, function (value) { + callback(new AltResult(value, port)); + }); + })(port)); + } + // XXX Hmm + if (result instanceof Box) { + callback(new AltResult(result.value, port)); + break; + } + } + + if (!(result instanceof Box) && options && hasOwnProperty.call(options, "default")) { + if (flag.value) { + flag.value = false; + callback(new AltResult(options["default"], DEFAULT)); + } + } +}; + +exports.DEFAULT = DEFAULT; \ No newline at end of file diff --git a/dist/js-csp/src/impl/timers.js b/dist/js-csp/src/impl/timers.js new file mode 100644 index 0000000..a447ffb --- /dev/null +++ b/dist/js-csp/src/impl/timers.js @@ -0,0 +1,12 @@ +"use strict"; + +var dispatch = require("./dispatch"); +var channels = require("./channels"); + +exports.timeout = function timeout_channel(msecs) { + var chan = channels.chan(); + dispatch.queue_delay(function () { + chan.close(); + }, msecs); + return chan; +}; \ No newline at end of file diff --git a/dist/mixin.js b/dist/mixin.js deleted file mode 100644 index a4ab18f..0000000 --- a/dist/mixin.js +++ /dev/null @@ -1,91 +0,0 @@ -"use strict"; - -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; - -var _ = _interopRequire(require("lodash")); - -var assign = _interopRequire(require("react/lib/Object.assign")); - -var Bluebird = _interopRequire(require("bluebird")); - -var React = _interopRequire(require("react")); - -var utils = _interopRequire(require("./utils")); - -module.exports = { - contextTypes: { - resolver: React.PropTypes.shape({ - promises: React.PropTypes.object.isRequired - }) - }, - - componentWillMount: function componentWillMount() { - var _this = this; - - var id = utils.getElementId(this); - var promise = utils.getElementPromise(this); - var statics = utils.getElementStatics(this); - - if (!statics) { - return false; - } - - if (promise) { - if (promise.isFulfilled()) { - assign(this.props, promise.value()); - - return true; - } else { - throw new Error(id + " should not be re-rendered until Promise is fulfilled! (This is a bug in react-resolver)"); - } - } - - this.renderResolved = this.render.bind(this); - - // Disable rendering until component has props loaded - this.render = function () { - return false; - }; - - var pending = _.mapValues(statics, function (value, key) { - // Existing props shouldn't be replaced - if (_.has(_this.props, key)) { - return Bluebird.resolve(_this.props[key]); - } - - if (_.isFunction(value)) { - // Call Node-style callback when complete - if (value.length) { - return new Bluebird((function (resolve, reject) { - value.call(this, function (err, result) { - err ? reject(err) : resolve(result); - }); - }).bind(_this)); - } - - // Value is a synchronous function call - return Bluebird.resolve(value.call(_this)); - } - }); - - this.context.resolver.promises[id] = Bluebird.props(pending); - }, - - componentDidMount: function componentDidMount() { - var promise = utils.getElementPromise(this); - - if (!promise) { - return false; - } - - if (promise.isPending()) { - return promise.then(this.componentDidMount.bind(this)); - } - - utils.removeElementPromise(this); - - assign(this.props, promise.value()); - - this.render = this.renderResolved; - this.forceUpdate(); - } }; \ No newline at end of file diff --git a/dist/resolver.js b/dist/resolver.js deleted file mode 100644 index fd2f095..0000000 --- a/dist/resolver.js +++ /dev/null @@ -1,251 +0,0 @@ -"use strict"; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; - -var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _React = require("react"); - -var _React2 = _interopRequireWildcard(_React); - -var _Container = require("./Container"); - -var _Container2 = _interopRequireWildcard(_Container); - -var _ResolverError = require("./ResolverError"); - -var _ResolverError2 = _interopRequireWildcard(_ResolverError); - -var Resolver = (function () { - function Resolver() { - var states = arguments[0] === undefined ? {} : arguments[0]; - - _classCallCheck(this, Resolver); - - this.frozen = false; - this.promises = []; - this.states = states; - } - - _createClass(Resolver, [{ - key: "await", - value: function await() { - var promises = arguments[0] === undefined ? [] : arguments[0]; - - this.promises = this.promises.concat(promises); - - return Promise.all(promises); - } - }, { - key: "finish", - value: function finish() { - var _this = this; - - var total = this.promises.length; - - return Promise.all(this.promises).then(function (values) { - if (_this.promises.length > total) { - return _this.finish(); - } - - return values; - }); - } - }, { - key: "freeze", - value: function freeze() { - this.frozen = true; - } - }, { - key: "fulfillState", - value: function fulfillState(state, callback) { - state.error = undefined; - state.fulfilled = true; - state.rejected = false; - - return callback ? callback(state) : state; - } - }, { - key: "getContainerState", - value: function getContainerState(container) { - var id = container.id; - - if (!id) { - throw new ReferenceError("" + container.constructor.displayName + " should have an ID"); - } - - var state = this.states.hasOwnProperty(id) ? this.states[id] : { - fulfilled: false, - rejected: false, - values: {} }; - - if (!this.states.hasOwnProperty(id)) { - this.states[id] = state; - } - - return state; - } - }, { - key: "rejectState", - value: function rejectState(error, state, callback) { - state.error = error; - state.fulfilled = false; - state.rejected = true; - - if (callback) { - callback(state); - } - - throw new Error("" + this.constructor.displayName + " was rejected: " + error); - } - }, { - key: "resolve", - value: function resolve(container, callback) { - var _this2 = this; - - var asyncProps = container.props.resolve || {}; - var state = this.getContainerState(container); - - var asyncKeys = Object.keys(asyncProps) - // Assign existing prop values - .filter(function (asyncProp) { - if (container.props.hasOwnProperty(asyncProp)) { - state.values[asyncProp] = container.props[asyncProp]; - - return false; - } - - return true; - }) - // Filter out pre-loaded values - .filter(function (asyncProp) { - return !state.values.hasOwnProperty(asyncProp); - }); - - if (!asyncKeys.length) { - return Promise.resolve(this.fulfillState(state, callback)); - } - - if (this.frozen) { - throw new _ResolverError2["default"](["Resolver is frozen for server rendering.", "" + container.constructor.displayName + " (#" + container.id + ") should have already resolved", "\"" + asyncKeys.join("\", \"") + "\". (http://git.io/vvvkr)"].join(" ")); - } - - var promises = asyncKeys.map(function (prop) { - var valueOf = container.props.resolve[prop]; - var value = container.props.hasOwnProperty(prop) ? container.props[prop] : valueOf(container.props); - - return Promise.resolve(value).then(function (value) { - state.values[prop] = value; - - return value; - }); - }); - - return this.await(promises).then(function () { - return _this2.fulfillState(state, callback); - }, function (error) { - return _this2.rejectState(error, state, callback); - }); - } - }], [{ - key: "createContainer", - value: function createContainer(Component) { - var props = arguments[1] === undefined ? {} : arguments[1]; - - if (!Component.hasOwnProperty("displayName")) { - throw new ReferenceError("Resolver.createContainer requires wrapped component to have `displayName`"); - } - - var ComponentContainer = (function (_React$Component) { - function ComponentContainer() { - _classCallCheck(this, ComponentContainer); - - if (_React$Component != null) { - _React$Component.apply(this, arguments); - } - } - - _inherits(ComponentContainer, _React$Component); - - _createClass(ComponentContainer, [{ - key: "render", - value: function render() { - return _React2["default"].createElement(_Container2["default"], _extends({ - component: Component - }, props, this.props)); - } - }]); - - return ComponentContainer; - })(_React2["default"].Component); - - ComponentContainer.displayName = "" + Component.displayName + "Container"; - - return ComponentContainer; - } - }, { - key: "render", - value: function render(element, node) { - var instance = arguments[2] === undefined ? new Resolver() : arguments[2]; - - _React2["default"].render(_React2["default"].createElement( - _Container2["default"], - { resolver: instance }, - element - ), node); - - return instance; - } - }, { - key: "renderToString", - value: function renderToString(element) { - var resolver = new Resolver(); - var context = _React2["default"].createElement( - _Container2["default"], - { resolver: resolver }, - element - ); - - _React2["default"].renderToString(context); - - return resolver.finish().then(function () { - resolver.freeze(); - - return _React2["default"].renderToString(context); - }); - } - }, { - key: "renderToStaticMarkup", - value: function renderToStaticMarkup(element) { - var resolver = new Resolver(); - var context = _React2["default"].createElement( - _Container2["default"], - { resolver: resolver }, - element - ); - - _React2["default"].renderToStaticMarkup(context); - - return resolver.finish().then(function () { - resolver.freeze(); - - return _React2["default"].renderToStaticMarkup(context); - }); - } - }]); - - return Resolver; -})(); - -exports["default"] = Resolver; -module.exports = exports["default"]; \ No newline at end of file diff --git a/dist/utils.js b/dist/utils.js deleted file mode 100644 index 348455b..0000000 --- a/dist/utils.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -module.exports.getElementId = function (element) { - return element._rootNodeID.replace(/\.\w+/, element.constructor.displayName + ".promise"); -}; - -module.exports.getElementPromise = function (element) { - var id = module.exports.getElementId(element); - - return element.context.resolver.promises[id]; -}; - -module.exports.getElementStatics = function (element) { - return element.constructor.resolve; -}; - -module.exports.removeElementPromise = function (element) { - var id = module.exports.getElementId(element); - var promise = module.exports.getElementPromise(element); - - element.context.resolver.promises[id] = null; - - return promise; -}; - -module.exports.setElementPromise = function (element, promise) { - var id = module.exports.getElementId(element); - - element.context.resolver.promises[id] = promise; - - return promise; -}; \ No newline at end of file diff --git a/examples/stargazers/README.md b/examples/stargazers/README.md index ef174ae..a6130dc 100644 --- a/examples/stargazers/README.md +++ b/examples/stargazers/README.md @@ -2,22 +2,10 @@ ### Usage -In the root of the `react-resolver` project, `npm link` this version: - -```shell -react-resolver $ npm link . -``` - -From within this example directory, install dependencies and reference this version: - ```shell -react-resolver $ cd examples/contacts -react-resolver/examples/contacts $ npm install -react-resolver/examples/contacts $ npm link react-resolver +react-resolver $ cd examples/stargazers +react-resolver/examples/stargazers $ npm install +react-resolver/examples/stargazers $ npm start ``` -Now you're ready to run the example: - -```shell -react-resolver/examples/contacts $ npm start -``` +Open . diff --git a/examples/stargazers/components/Nav.js b/examples/stargazers/components/Nav.js index 46dec75..76bbf3a 100644 --- a/examples/stargazers/components/Nav.js +++ b/examples/stargazers/components/Nav.js @@ -1,3 +1,4 @@ +import { Link } from "react-router"; import React from "react"; export default class Nav extends React.Component { @@ -6,12 +7,7 @@ export default class Nav extends React.Component { diff --git a/examples/stargazers/components/Stargazers.js b/examples/stargazers/components/Stargazers.js index c1d659b..4b7e074 100644 --- a/examples/stargazers/components/Stargazers.js +++ b/examples/stargazers/components/Stargazers.js @@ -1,7 +1,7 @@ import axios from "axios"; import React from "react"; - import { Resolver } from "react-resolver"; +import { Link } from "react-router"; class Stargazers extends React.Component { render() { @@ -16,7 +16,8 @@ class Stargazers extends React.Component {
- + +
@@ -42,11 +43,11 @@ class Stargazers extends React.Component { renderUser(user) { return ( ); } diff --git a/examples/stargazers/handlers/User.js b/examples/stargazers/handlers/User.js new file mode 100644 index 0000000..02b5826 --- /dev/null +++ b/examples/stargazers/handlers/User.js @@ -0,0 +1,64 @@ +import axios from "axios"; +import { Link } from "react-router"; +import React from "react"; +import { Resolver } from "react-resolver"; + +class User extends React.Component { + render() { + const user = this.props.user; + + return ( +
+
+
+ + {user.login} + + +
    +
  • + + + {user.name} + +

    + {user.company} +
    + {user.location} +

    +
  • +
+
+ +
+ + + Back + + + + View on Github + +
+
+
+ ); + } +} + +User.displayName = "User"; + +export default Resolver.createContainer(User, { + contextTypes: { + router: React.PropTypes.func.isRequired, + }, + + resolve: { + user: (props, context) => { + const { login } = context.router.getCurrentParams(); + const url = `https://api.github.com/users/${login}`; + + return axios.get(url).then(response => response.data); + }, + }, +}); diff --git a/examples/stargazers/package.json b/examples/stargazers/package.json index 7e465e7..ee25ffd 100644 --- a/examples/stargazers/package.json +++ b/examples/stargazers/package.json @@ -4,7 +4,7 @@ "scripts": { "build": "webpack -p", "postinstall": "npm run build", - "preinstall": "rm -rf node_modules/react-resolver && cp -R ../../dist node_modules/react-resolver", + "install": "rm -rf node_modules/react-resolver && cp -R ../../dist node_modules/react-resolver", "start": "webpack-dev-server --content-base ./public --hot --inline --no-info --devtool inline-source-map" }, "dependencies": { diff --git a/examples/stargazers/public/main.min.js b/examples/stargazers/public/main.min.js index 523fc22..44fa2c9 100644 --- a/examples/stargazers/public/main.min.js +++ b/examples/stargazers/public/main.min.js @@ -1,7 +1,6 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=n(7),i=r(o),a=n(75),s=n(49),u=r(s),c=n(73),l=r(c),p=n(135),d=r(p);l["default"].polyfill(),u["default"].run(d["default"],function(e){a.Resolver.render(i["default"].createElement(e,null),document.getElementById("app"))})},function(e,t,n){function r(){if(!s){s=!0;for(var e,t=a.length;t;){e=a,a=[];for(var n=-1;++nr;r++)n.push(arguments[r]);if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(0!==t.indexOf("Failed Composite propType: ")&&!e){var i=0,a="Warning: "+t.replace(/%s/g,function(){return n[i++]});console.warn(a);try{throw new Error(a)}catch(s){}}}),e.exports=o}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,n){Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[n]:null},set:function(e){"production"!==t.env.NODE_ENV?u(!1,"Don't set the %s property of the React element. Instead, specify the correct value when initially creating the element.",n):null,this._store[n]=e}})}function o(e){try{var t={props:!0};for(var n in t)r(e,n);l=!0}catch(o){}}var i=n(57),a=n(18),s=n(3),u=n(4),c={key:!0,ref:!0},l=!1,p=function(e,n,r,o,i,a){if(this.type=e,this.key=n,this.ref=r,this._owner=o,this._context=i,"production"!==t.env.NODE_ENV){this._store={props:a,originalProps:s({},a)};try{Object.defineProperty(this._store,"validated",{configurable:!1,enumerable:!1,writable:!0})}catch(u){}if(this._store.validated=!1,l)return void Object.freeze(this)}this.props=a};p.prototype={_isReactElement:!0},"production"!==t.env.NODE_ENV&&o(p.prototype),p.createElement=function(e,t,n){var r,o={},s=null,u=null;if(null!=t){u=void 0===t.ref?null:t.ref,s=void 0===t.key?null:""+t.key;for(r in t)t.hasOwnProperty(r)&&!c.hasOwnProperty(r)&&(o[r]=t[r])}var l=arguments.length-2;if(1===l)o.children=n;else if(l>1){for(var d=Array(l),f=0;l>f;f++)d[f]=arguments[f+2];o.children=d}if(e&&e.defaultProps){var h=e.defaultProps;for(r in h)"undefined"==typeof o[r]&&(o[r]=h[r])}return new p(e,s,u,a.current,i.current,o)},p.createFactory=function(e){var t=p.createElement.bind(null,e);return t.type=e,t},p.cloneAndReplaceProps=function(e,n){var r=new p(e.type,e.key,e.ref,e._owner,e._context,n);return"production"!==t.env.NODE_ENV&&(r._store.validated=e._store.validated),r},p.cloneElement=function(e,t,n){var r,o=s({},e.props),i=e.key,u=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(u=t.ref,l=a.current),void 0!==t.key&&(i=""+t.key);for(r in t)t.hasOwnProperty(r)&&!c.hasOwnProperty(r)&&(o[r]=t[r])}var d=arguments.length-2;if(1===d)o.children=n;else if(d>1){for(var f=Array(d),h=0;d>h;h++)f[h]=arguments[h+2];o.children=f}return new p(e.type,i,u,l,e._context,o)},p.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},e.exports=p}).call(t,n(1))},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){e.exports=n(23)},function(e,t,n){"use strict";var r=n(36),o=r({bubbled:null,captured:null}),i=r({topBlur:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),a={topLevelTypes:i,PropagationPhases:o};e.exports=a},function(e,t,n){(function(t){"use strict";function r(e,n,r){for(var o in n)n.hasOwnProperty(o)&&("production"!==t.env.NODE_ENV?D("function"==typeof n[o],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",E[r],o):null)}function o(e,n){var r=T.hasOwnProperty(n)?T[n]:null;I.hasOwnProperty(n)&&("production"!==t.env.NODE_ENV?N(r===x.OVERRIDE_BASE,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",n):N(r===x.OVERRIDE_BASE)),e.hasOwnProperty(n)&&("production"!==t.env.NODE_ENV?N(r===x.DEFINE_MANY||r===x.DEFINE_MANY_MERGED,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n):N(r===x.DEFINE_MANY||r===x.DEFINE_MANY_MERGED))}function i(e,n){if(n){"production"!==t.env.NODE_ENV?N("function"!=typeof n,"ReactClass: You're attempting to use a component class as a mixin. Instead, just use a regular object."):N("function"!=typeof n),"production"!==t.env.NODE_ENV?N(!h.isValidElement(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object."):N(!h.isValidElement(n));var r=e.prototype;n.hasOwnProperty(O)&&P.mixins(e,n.mixins);for(var i in n)if(n.hasOwnProperty(i)&&i!==O){var a=n[i];if(o(r,i),P.hasOwnProperty(i))P[i](e,a);else{var s=T.hasOwnProperty(i),l=r.hasOwnProperty(i),p=a&&a.__reactDontBind,d="function"==typeof a,f=d&&!s&&!l&&!p;if(f)r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[i]=a,r[i]=a;else if(l){var m=T[i];"production"!==t.env.NODE_ENV?N(s&&(m===x.DEFINE_MANY_MERGED||m===x.DEFINE_MANY),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,i):N(s&&(m===x.DEFINE_MANY_MERGED||m===x.DEFINE_MANY)),m===x.DEFINE_MANY_MERGED?r[i]=u(r[i],a):m===x.DEFINE_MANY&&(r[i]=c(r[i],a))}else r[i]=a,"production"!==t.env.NODE_ENV&&"function"==typeof a&&n.displayName&&(r[i].displayName=n.displayName+"_"+i)}}}}function a(e,n){if(n)for(var r in n){var o=n[r];if(n.hasOwnProperty(r)){var i=r in P;"production"!==t.env.NODE_ENV?N(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',r):N(!i);var a=r in e;"production"!==t.env.NODE_ENV?N(!a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",r):N(!a),e[r]=o}}}function s(e,n){"production"!==t.env.NODE_ENV?N(e&&n&&"object"==typeof e&&"object"==typeof n,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."):N(e&&n&&"object"==typeof e&&"object"==typeof n);for(var r in n)n.hasOwnProperty(r)&&("production"!==t.env.NODE_ENV?N(void 0===e[r],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",r):N(void 0===e[r]),e[r]=n[r]);return e}function u(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return s(o,n),s(o,r),o}}function c(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function l(e,n){var r=n.bind(e);if("production"!==t.env.NODE_ENV){r.__reactBoundContext=e,r.__reactBoundMethod=n,r.__reactBoundArguments=null;var o=e.constructor.displayName,i=r.bind;r.bind=function(a){for(var s=[],u=1,c=arguments.length;c>u;u++)s.push(arguments[u]);if(a!==e&&null!==a)"production"!==t.env.NODE_ENV?D(!1,"bind(): React component methods may only be bound to the component instance. See %s",o):null;else if(!s.length)return"production"!==t.env.NODE_ENV?D(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",o):null,r;var l=i.apply(r,arguments);return l.__reactBoundContext=e,l.__reactBoundMethod=n,l.__reactBoundArguments=s,l}}return r}function p(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=l(e,m.guard(n,e.constructor.displayName+"."+t))}}var d=n(92),f=n(18),h=n(5),m=n(186),v=n(26),y=n(59),g=n(60),E=n(42),b=n(61),_=n(3),N=n(2),C=n(36),w=n(13),D=n(4),O=w({mixins:null}),x=C({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),R=[],T={mixins:x.DEFINE_MANY,statics:x.DEFINE_MANY,propTypes:x.DEFINE_MANY,contextTypes:x.DEFINE_MANY,childContextTypes:x.DEFINE_MANY,getDefaultProps:x.DEFINE_MANY_MERGED,getInitialState:x.DEFINE_MANY_MERGED,getChildContext:x.DEFINE_MANY_MERGED,render:x.DEFINE_ONCE,componentWillMount:x.DEFINE_MANY,componentDidMount:x.DEFINE_MANY,componentWillReceiveProps:x.DEFINE_MANY,shouldComponentUpdate:x.DEFINE_ONCE,componentWillUpdate:x.DEFINE_MANY,componentDidUpdate:x.DEFINE_MANY,componentWillUnmount:x.DEFINE_MANY,updateComponent:x.OVERRIDE_BASE},P={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;nr;r++){var o=E[r],i=o._pendingCallbacks;if(o._pendingCallbacks=null,h.performUpdateIfNecessary(o,e.reconcileTransaction),i)for(var s=0;sr;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){var t=M(e);return t&&z.getID(t)}function i(e){var n=a(e);if(n)if(U.hasOwnProperty(n)){var r=U[n];r!==e&&("production"!==t.env.NODE_ENV?S(!l(r,n),"ReactMount: Two valid but unequal nodes with the same `%s`: %s",j,n):S(!l(r,n)),U[n]=e)}else U[n]=e;return n}function a(e){return e&&e.getAttribute&&e.getAttribute(j)||""}function s(e,t){var n=a(e);n!==t&&delete U[n],e.setAttribute(j,t),U[t]=e}function u(e){return U.hasOwnProperty(e)&&l(U[e],e)||(U[e]=z.findReactNodeByID(e)),U[e]}function c(e){var t=C.get(e)._rootNodeID;return _.isNullComponentID(t)?null:(U.hasOwnProperty(t)&&l(U[t],t)||(U[t]=z.findReactNodeByID(t)),U[t])}function l(e,n){if(e){"production"!==t.env.NODE_ENV?S(a(e)===n,"ReactMount: Unexpected modification of `%s`",j):S(a(e)===n);var r=z.findReactContainerForID(n);if(r&&P(r,e))return!0}return!1}function p(e){delete U[e]}function d(e){var t=U[e];return t&&l(t,e)?void(Y=t):!1}function f(e){Y=null,N.traverseAncestors(e,d);var t=Y;return Y=null,t}function h(e,t,n,r,o){var i=O.mountComponent(e,t,r,T);e._isTopLevel=!0,z._mountImageIntoNode(i,n,o)}function m(e,t,n,r){var o=R.ReactReconcileTransaction.getPooled();o.perform(h,null,e,t,n,o,r),R.ReactReconcileTransaction.release(o)}var v=n(22),y=n(24),g=n(18),E=n(5),b=n(34),_=n(40),N=n(25),C=n(26),w=n(98),D=n(19),O=n(31),x=n(61),R=n(10),T=n(45),P=n(106),M=n(226),I=n(67),S=n(2),k=n(69),A=n(70),V=n(4),L=N.SEPARATOR,j=v.ID_ATTRIBUTE_NAME,U={},F=1,B=9,W={},H={};if("production"!==t.env.NODE_ENV)var q={};var K=[],Y=null,z={_instancesByReactRootID:W,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,n,r,i){return"production"!==t.env.NODE_ENV&&b.checkAndWarnForMutatedProps(n),z.scrollMonitor(r,function(){x.enqueueElementInternal(e,n),i&&x.enqueueCallbackInternal(e,i)}),"production"!==t.env.NODE_ENV&&(q[o(r)]=M(r)),e},_registerComponent:function(e,n){"production"!==t.env.NODE_ENV?S(n&&(n.nodeType===F||n.nodeType===B),"_registerComponent(...): Target container is not a DOM element."):S(n&&(n.nodeType===F||n.nodeType===B)),y.ensureScrollValueMonitoring();var r=z.registerContainer(n);return W[r]=e,r},_renderNewRootComponent:function(e,n,r){"production"!==t.env.NODE_ENV?V(null==g.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."):null;var o=I(e,null),i=z._registerComponent(o,n);return R.batchedUpdates(m,o,i,n,r),"production"!==t.env.NODE_ENV&&(q[i]=M(n)),o},render:function(e,n,r){"production"!==t.env.NODE_ENV?S(E.isValidElement(e),"React.render(): Invalid component element.%s","string"==typeof e?" Instead of passing an element string, make sure to instantiate it by passing it to React.createElement.":"function"==typeof e?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":null!=e&&void 0!==e.props?" This may be caused by unintentionally loading two independent copies of React.":""):S(E.isValidElement(e));var i=W[o(n)];if(i){var a=i._currentElement;if(A(a,e))return z._updateRootComponent(i,e,n,r).getPublicInstance();z.unmountComponentAtNode(n)}var s=M(n),u=s&&z.isRenderedByReact(s);if("production"!==t.env.NODE_ENV&&(!u||s.nextSibling))for(var c=s;c;){if(z.isRenderedByReact(c)){"production"!==t.env.NODE_ENV?V(!1,"render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."):null;break}c=c.nextSibling}var l=u&&!i,p=z._renderNewRootComponent(e,n,l).getPublicInstance();return r&&r.call(p),p},constructAndRenderComponent:function(e,t,n){var r=E.createElement(e,t);return z.render(r,n)},constructAndRenderComponentByID:function(e,n,r){var o=document.getElementById(r);return"production"!==t.env.NODE_ENV?S(o,'Tried to get element with id of "%s" but it is not present on the page.',r):S(o),z.constructAndRenderComponent(e,n,o)},registerContainer:function(e){var t=o(e);return t&&(t=N.getReactRootIDFromNodeID(t)),t||(t=N.createReactRootID()),H[t]=e,t},unmountComponentAtNode:function(e){"production"!==t.env.NODE_ENV?V(null==g.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."):null,"production"!==t.env.NODE_ENV?S(e&&(e.nodeType===F||e.nodeType===B),"unmountComponentAtNode(...): Target container is not a DOM element."):S(e&&(e.nodeType===F||e.nodeType===B));var n=o(e),r=W[n];return r?(z.unmountComponentFromNode(r,e),delete W[n],delete H[n],"production"!==t.env.NODE_ENV&&delete q[n],!0):!1},unmountComponentFromNode:function(e,t){for(O.unmountComponent(e),t.nodeType===B&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var n=N.getReactRootIDFromNodeID(e),r=H[n];if("production"!==t.env.NODE_ENV){var o=q[n];if(o&&o.parentNode!==r){"production"!==t.env.NODE_ENV?S(a(o)===n,"ReactMount: Root element ID differed from reactRootID."):S(a(o)===n);var i=r.firstChild;i&&n===a(i)?q[n]=i:"production"!==t.env.NODE_ENV?V(!1,"ReactMount: Root element has been removed from its original container. New container:",o.parentNode):null}}return r},findReactNodeByID:function(e){var t=z.findReactContainerForID(e);return z.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=z.getID(e);return t?t.charAt(0)===L:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(z.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,n){var r=K,o=0,i=f(n)||e;for(r[0]=i.firstChild,r.length=1;o when using tables, nesting tags like
,

, or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",n,z.getID(e)):S(!1)},_mountImageIntoNode:function(e,n,o){if("production"!==t.env.NODE_ENV?S(n&&(n.nodeType===F||n.nodeType===B),"mountComponentIntoNode(...): Target container is not valid."):S(n&&(n.nodeType===F||n.nodeType===B)),o){var i=M(n);if(w.canReuseMarkup(e,i))return;var a=i.getAttribute(w.CHECKSUM_ATTR_NAME);i.removeAttribute(w.CHECKSUM_ATTR_NAME);var s=i.outerHTML;i.setAttribute(w.CHECKSUM_ATTR_NAME,a);var u=r(e,s),c=" (client) "+e.substring(u-20,u+20)+"\n (server) "+s.substring(u-20,u+20);"production"!==t.env.NODE_ENV?S(n.nodeType!==B,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",c):S(n.nodeType!==B),"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?V(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",c):null)}"production"!==t.env.NODE_ENV?S(n.nodeType!==B,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See React.renderToString() for server rendering."):S(n.nodeType!==B),k(n,e)},getReactRootID:o,getID:i,setID:s,getNode:u,getNodeFromInstance:c,purgeID:p};D.measureMethods(z,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),e.exports=z}).call(t,n(1))},function(e,t,n){function r(e){return function(){return e}}function o(){}o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){var r=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=r},function(e,t,n){"use strict";function r(e){return"[object Array]"===y.call(e)}function o(e){return"[object ArrayBuffer]"===y.call(e)}function i(e){return"[object FormData]"===y.call(e)}function a(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function u(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function l(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===y.call(e)}function d(e){return"[object File]"===y.call(e)}function f(e){return"[object Blob]"===y.call(e)}function h(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function m(e,t){if(null!==e&&"undefined"!=typeof e){var n=r(e)||"object"==typeof e&&!isNaN(e.length);if("object"==typeof e||n||(e=[e]),n)for(var o=0,i=e.length;i>o;o++)t.call(null,e[o],o,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(null,e[a],a,e)}}function v(){var e={};return m(arguments,function(t){m(t,function(t,n){e[n]=t})}),e}var y=Object.prototype.toString;e.exports={isArray:r,isArrayBuffer:o,isFormData:i,isArrayBufferView:a,isString:s,isNumber:u,isObject:l,isUndefined:c,isDate:p,isFile:d,isBlob:f,forEach:m,merge:v,trim:h}},function(e,t,n){"use strict";var r=n(3),o=n(7).PropTypes,i=n(21),a=r({},o,{falsy:function(e,t,n){return e[t]?new Error("<"+n+'> may not have a "'+t+'" prop'):void 0},route:o.instanceOf(i),router:o.func});e.exports=a},function(e,t,n){(function(t){"use strict";var r=n(2),o=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,n,r,o),a}return new i(e,t,n,r,o)},u=function(e){var n=this;"production"!==t.env.NODE_ENV?r(e instanceof n,"Trying to release an instance into a pool of a different type."):r(e instanceof n),e.destructor&&e.destructor(),n.instancePool.length'}}},{createRoute:{value:function(t,n){t=t||{},"string"==typeof t&&(t={path:t});var o=r;o?u(null==t.parentRoute||t.parentRoute===o,"You should not use parentRoute with createRoute inside another route's child callback; it is ignored"):o=t.parentRoute;var i=t.name,a=t.path||i;!a||t.isDefault||t.isNotFound?a=o?o.path:"/":c.isAbsolute(a)?o&&s(a===o.path||0===o.paramNames.length,'You cannot nest path "%s" inside "%s"; the parent requires URL parameters',a,o.path):a=o?c.join(o.path,a):"/"+a,t.isNotFound&&!/\*$/.test(a)&&(a+="*");var l=new e(i,a,t.ignoreScrollBehavior,t.isDefault,t.isNotFound,t.onEnter,t.onLeave,t.handler);if(o&&(l.isDefault?(s(null==o.defaultRoute,"%s may not have more than one default route",o),o.defaultRoute=l):l.isNotFound&&(s(null==o.notFoundRoute,"%s may not have more than one not found route",o),o.notFoundRoute=l),o.appendChild(l)),"function"==typeof n){var p=r;r=l,n.call(l,l),r=p}return l}},createDefaultRoute:{value:function(t){return e.createRoute(a({},t,{isDefault:!0}))}},createNotFoundRoute:{value:function(t){return e.createRoute(a({},t,{isNotFound:!0}))}},createRedirect:{value:function(t){return e.createRoute(a({},t,{path:t.path||t.from||"*",onEnter:function(e,n,r){e.redirect(t.to,t.params||n,t.query||r)}}))}}}),e}();e.exports=l},function(e,t,n){(function(t){"use strict";function r(e,t){return(e&t)===t}var o=n(2),i={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var n=e.Properties||{},a=e.DOMAttributeNames||{},u=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var l in n){"production"!==t.env.NODE_ENV?o(!s.isStandardName.hasOwnProperty(l),"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",l):o(!s.isStandardName.hasOwnProperty(l)),s.isStandardName[l]=!0;var p=l.toLowerCase();if(s.getPossibleStandardName[p]=l,a.hasOwnProperty(l)){var d=a[l];s.getPossibleStandardName[d]=l,s.getAttributeName[l]=d}else s.getAttributeName[l]=p;s.getPropertyName[l]=u.hasOwnProperty(l)?u[l]:l,c.hasOwnProperty(l)?s.getMutationMethod[l]=c[l]:s.getMutationMethod[l]=null;var f=n[l];s.mustUseAttribute[l]=r(f,i.MUST_USE_ATTRIBUTE),s.mustUseProperty[l]=r(f,i.MUST_USE_PROPERTY),s.hasSideEffects[l]=r(f,i.HAS_SIDE_EFFECTS),s.hasBooleanValue[l]=r(f,i.HAS_BOOLEAN_VALUE),s.hasNumericValue[l]=r(f,i.HAS_NUMERIC_VALUE),s.hasPositiveNumericValue[l]=r(f,i.HAS_POSITIVE_NUMERIC_VALUE),s.hasOverloadedBooleanValue[l]=r(f,i.HAS_OVERLOADED_BOOLEAN_VALUE),"production"!==t.env.NODE_ENV?o(!s.mustUseAttribute[l]||!s.mustUseProperty[l],"DOMProperty: Cannot require using both attribute and property: %s",l):o(!s.mustUseAttribute[l]||!s.mustUseProperty[l]),"production"!==t.env.NODE_ENV?o(s.mustUseProperty[l]||!s.hasSideEffects[l],"DOMProperty: Properties that have side effects must use property: %s",l):o(s.mustUseProperty[l]||!s.hasSideEffects[l]),"production"!==t.env.NODE_ENV?o(!!s.hasBooleanValue[l]+!!s.hasNumericValue[l]+!!s.hasOverloadedBooleanValue[l]<=1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",l):o(!!s.hasBooleanValue[l]+!!s.hasNumericValue[l]+!!s.hasOverloadedBooleanValue[l]<=1)}}},a={},s={ID_ATTRIBUTE_NAME:"data-reactid",isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasSideEffects:{},hasBooleanValue:{},hasNumericValue:{},hasPositiveNumericValue:{},hasOverloadedBooleanValue:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t-1&&"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&console.debug("Download the React DevTools for a better development experience: http://fb.me/react-devtools");for(var T=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.split,String.prototype.trim,Object.create,Object.freeze],P=0;Pc;c++){var d=s[c];i.hasOwnProperty(d)&&i[d]||(d===u.topWheel?l("wheel")?v.ReactEventListener.trapBubbledEvent(u.topWheel,"wheel",n):l("mousewheel")?v.ReactEventListener.trapBubbledEvent(u.topWheel,"mousewheel",n):v.ReactEventListener.trapBubbledEvent(u.topWheel,"DOMMouseScroll",n):d===u.topScroll?l("scroll",!0)?v.ReactEventListener.trapCapturedEvent(u.topScroll,"scroll",n):v.ReactEventListener.trapBubbledEvent(u.topScroll,"scroll",v.ReactEventListener.WINDOW_HANDLE):d===u.topFocus||d===u.topBlur?(l("focus",!0)?(v.ReactEventListener.trapCapturedEvent(u.topFocus,"focus",n),v.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",n)):l("focusin")&&(v.ReactEventListener.trapBubbledEvent(u.topFocus,"focusin",n),v.ReactEventListener.trapBubbledEvent(u.topBlur,"focusout",n)),i[u.topBlur]=!0,i[u.topFocus]=!0):h.hasOwnProperty(d)&&v.ReactEventListener.trapBubbledEvent(d,h[d],n),i[d]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!d){var e=u.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),d=!0}},eventNameDispatchConfigs:i.eventNameDispatchConfigs,registrationNameModules:i.registrationNameModules,putListener:i.putListener,getListener:i.getListener,deleteListener:i.deleteListener,deleteAllListeners:i.deleteAllListeners});e.exports=v},function(e,t,n){(function(t){"use strict";function r(e){return f+e.toString(36)}function o(e,t){return e.charAt(t)===f||t===e.length}function i(e){return""===e||e.charAt(0)===f&&e.charAt(e.length-1)!==f}function a(e,t){return 0===t.indexOf(e)&&o(t,e.length)}function s(e){return e?e.substr(0,e.lastIndexOf(f)):""}function u(e,n){if("production"!==t.env.NODE_ENV?d(i(e)&&i(n),"getNextDescendantID(%s, %s): Received an invalid React DOM ID.",e,n):d(i(e)&&i(n)),"production"!==t.env.NODE_ENV?d(a(e,n),"getNextDescendantID(...): React has made an invalid assumption about the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.",e,n):d(a(e,n)),e===n)return e;var r,s=e.length+h;for(r=s;r=s;s++)if(o(e,s)&&o(n,s))a=s;else if(e.charAt(s)!==n.charAt(s))break;var u=e.substr(0,a);return"production"!==t.env.NODE_ENV?d(i(u),"getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s",e,n,u):d(i(u)),u}function l(e,n,r,o,i,c){e=e||"",n=n||"","production"!==t.env.NODE_ENV?d(e!==n,"traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.",e):d(e!==n);var l=a(n,e);"production"!==t.env.NODE_ENV?d(l||a(e,n),"traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do not have a parent path.",e,n):d(l||a(e,n));for(var p=0,f=l?s:u,h=e;;h=f(h,n)){var v;if(i&&h===e||c&&h===n||(v=r(h,l,o)),v===!1||h===n)break;"production"!==t.env.NODE_ENV?d(p++1){var t=e.indexOf(f,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var i=c(e,t);i!==e&&l(e,i,n,r,!1,!0),i!==t&&l(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},_getFirstCommonAncestorID:c,_getNextDescendantID:u,isAncestorIDOf:a,SEPARATOR:f};e.exports=v}).call(t,n(1))},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){"use strict";var r=n(2),o=n(6).canUseDOM,i={length:1,back:function(){r(o,"Cannot use History.back without a DOM"),i.length-=1,window.history.back()}};e.exports=i},function(e,t,n){(function(t){"use strict";function r(){var e=d&&d.traverseTwoPhase&&d.traverseEnterLeave;"production"!==t.env.NODE_ENV?u(e,"InstanceHandle not injected before use!"):u(e)}var o=n(90),i=n(52),a=n(62),s=n(63),u=n(2),c={},l=null,p=function(e){if(e){var t=i.executeDispatch,n=o.getPluginModuleForEvent(e);n&&n.executeDispatch&&(t=n.executeDispatch),i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e)}},d=null,f={injection:{injectMount:i.injection.injectMount,injectInstanceHandle:function(e){d=e,"production"!==t.env.NODE_ENV&&r()},getInstanceHandle:function(){return"production"!==t.env.NODE_ENV&&r(),d},injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:function(e,n,r){"production"!==t.env.NODE_ENV?u(!r||"function"==typeof r,"Expected %s listener to be a function, instead got type %s",n,typeof r):u(!r||"function"==typeof r);var o=c[n]||(c[n]={});o[e]=r},getListener:function(e,t){var n=c[t];return n&&n[e]},deleteListener:function(e,t){var n=c[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in c)delete c[t][e]},extractEvents:function(e,t,n,r){for(var i,s=o.plugins,u=0,c=s.length;c>u;u++){var l=s[u];if(l){var p=l.extractEvents(e,t,n,r);p&&(i=a(i,p))}}return i},enqueueEvents:function(e){e&&(l=a(l,e))},processEventQueue:function(){var e=l;l=null,s(e,p),"production"!==t.env.NODE_ENV?u(!l,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."):u(!l)},__purge:function(){c={}},__getListenerBank:function(){return c}};e.exports=f}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return v(e,r)}function o(e,n,o){if("production"!==t.env.NODE_ENV&&!e)throw new Error("Dispatching id must not be null");var i=n?m.bubbled:m.captured,a=r(e,o,i);a&&(o._dispatchListeners=f(o._dispatchListeners,a),o._dispatchIDs=f(o._dispatchIDs,e))}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&d.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,o,e)}function a(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=v(e,r);o&&(n._dispatchListeners=f(n._dispatchListeners,o),n._dispatchIDs=f(n._dispatchIDs,e))}}function s(e){e&&e.dispatchConfig.registrationName&&a(e.dispatchMarker,null,e)}function u(e){h(e,i)}function c(e,t,n,r){d.injection.getInstanceHandle().traverseEnterLeave(n,r,a,e,t)}function l(e){h(e,s)}var p=n(8),d=n(28),f=n(62),h=n(63),m=p.PropagationPhases,v=d.getListener,y={accumulateTwoPhaseDispatches:u,accumulateDirectDispatches:l,accumulateEnterLeaveDispatches:c};e.exports=y}).call(t,n(1))},function(e,t,n){(function(t){"use strict";var r=n(5),o=n(4);if("production"!==t.env.NODE_ENV){var i="_reactFragment",a="_reactDidWarn",s=!1;try{var u=function(){return 1};Object.defineProperty({},i,{enumerable:!1,value:!0}),Object.defineProperty({},"key",{enumerable:!0,get:u}),s=!0}catch(c){}var l=function(e,n){Object.defineProperty(e,n,{enumerable:!0,get:function(){return"production"!==t.env.NODE_ENV?o(this[a],"A ReactFragment is an opaque type. Accessing any of its properties is deprecated. Pass it to one of the React.Children helpers."):null,this[a]=!0,this[i][n]},set:function(e){"production"!==t.env.NODE_ENV?o(this[a],"A ReactFragment is an immutable opaque type. Mutating its properties is deprecated."):null,this[a]=!0,this[i][n]=e}})},p={},d=function(e){var t="";for(var n in e)t+=n+":"+typeof e[n]+",";var r=!!p[t];return p[t]=!0,r}}var f={create:function(e){if("production"!==t.env.NODE_ENV){if("object"!=typeof e||!e||Array.isArray(e))return"production"!==t.env.NODE_ENV?o(!1,"React.addons.createFragment only accepts a single object.",e):null,e;if(r.isValidElement(e))return"production"!==t.env.NODE_ENV?o(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."):null,e;if(s){var n={};Object.defineProperty(n,i,{enumerable:!1,value:e}),Object.defineProperty(n,a,{writable:!0,enumerable:!1,value:!1});for(var u in e)l(n,u);return Object.preventExtensions(n),n}}return e},extract:function(e){return"production"!==t.env.NODE_ENV&&s?e[i]?e[i]:("production"!==t.env.NODE_ENV?o(d(e),"Any use of a keyed object should be wrapped in React.addons.createFragment(object) before being passed as a child."):null,e):e},extractIfFragment:function(e){if("production"!==t.env.NODE_ENV&&s){if(e[i])return e[i];for(var n in e)if(e.hasOwnProperty(n)&&r.isValidElement(e[n]))return f.extract(e)}return e}};e.exports=f}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=n(195),i=n(34),a={mountComponent:function(e,n,o,a){var s=e.mountComponent(n,o,a);return"production"!==t.env.NODE_ENV&&i.checkAndWarnForMutatedProps(e._currentElement),o.getReactMountReady().enqueue(r,e),s},unmountComponent:function(e){o.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,n,a,s){var u=e._currentElement;if(n!==u||null==n._owner){"production"!==t.env.NODE_ENV&&i.checkAndWarnForMutatedProps(n);var c=o.shouldUpdateRefs(u,n);c&&o.detachRefs(e,u),e.receiveComponent(n,a,s),c&&a.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};e.exports=a}).call(t,n(1))},function(e,t,n){"use strict";var r={PUSH:"push",REPLACE:"replace",POP:"pop"};e.exports=r},function(e,t,n){(function(t){"use strict";function r(e,t){return null==t||o.hasBooleanValue[e]&&!t||o.hasNumericValue[e]&&isNaN(t)||o.hasPositiveNumericValue[e]&&1>t||o.hasOverloadedBooleanValue[e]&&t===!1}var o=n(22),i=n(236),a=n(4);if("production"!==t.env.NODE_ENV)var s={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},u={},c=function(e){if(!(s.hasOwnProperty(e)&&s[e]||u.hasOwnProperty(e)&&u[e])){u[e]=!0;var n=e.toLowerCase(),r=o.isCustomAttribute(n)?n:o.getPossibleStandardName.hasOwnProperty(n)?o.getPossibleStandardName[n]:null;"production"!==t.env.NODE_ENV?a(null==r,"Unknown DOM property %s. Did you mean %s?",e,r):null}};var l={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+i(e)},createMarkupForProperty:function(e,n){if(o.isStandardName.hasOwnProperty(e)&&o.isStandardName[e]){if(r(e,n))return"";var a=o.getAttributeName[e];return o.hasBooleanValue[e]||o.hasOverloadedBooleanValue[e]&&n===!0?a:a+"="+i(n)}return o.isCustomAttribute(e)?null==n?"":e+"="+i(n):("production"!==t.env.NODE_ENV&&c(e),null)},setValueForProperty:function(e,n,i){if(o.isStandardName.hasOwnProperty(n)&&o.isStandardName[n]){var a=o.getMutationMethod[n];if(a)a(e,i);else if(r(n,i))this.deleteValueForProperty(e,n);else if(o.mustUseAttribute[n])e.setAttribute(o.getAttributeName[n],""+i);else{var s=o.getPropertyName[n];o.hasSideEffects[n]&&""+e[s]==""+i||(e[s]=i)}}else o.isCustomAttribute(n)?null==i?e.removeAttribute(n):e.setAttribute(n,""+i):"production"!==t.env.NODE_ENV&&c(n)},deleteValueForProperty:function(e,n){if(o.isStandardName.hasOwnProperty(n)&&o.isStandardName[n]){var r=o.getMutationMethod[n];if(r)r(e,void 0);else if(o.mustUseAttribute[n])e.removeAttribute(o.getAttributeName[n]);else{var i=o.getPropertyName[n],a=o.getDefaultValueForProperty(e.nodeName,i);o.hasSideEffects[n]&&""+e[i]===a||(e[i]=a)}}else o.isCustomAttribute(n)?e.removeAttribute(n):"production"!==t.env.NODE_ENV&&c(n)}};e.exports=l}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){if(E.current){var e=E.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e){var t=e&&e.getPublicInstance();if(!t)return void 0;var n=t.constructor;return n?n.displayName||n.name||void 0:void 0}function i(){var e=E.current;return e&&o(e)||void 0}function a(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,u('Each child in an array or iterator should have a unique "key" prop.',e,t))}function s(e,t,n){O.test(e)&&u("Child objects should have non-numeric keys so ordering is preserved.",t,n)}function u(e,n,r){var a=i(),s="string"==typeof r?r:r.displayName||r.name,u=a||s,c=w[e]||(w[e]={});if(!c.hasOwnProperty(u)){c[u]=!0;var l=a?" Check the render method of "+a+".":s?" Check the React.render call using <"+s+">.":"",p="";if(n&&n._owner&&n._owner!==E.current){var d=o(n._owner);p=" It was passed a child from "+d+"."}"production"!==t.env.NODE_ENV?C(!1,e+"%s%s See http://fb.me/react-warning-keys for more information.",l,p):null}}function c(e,t){if(Array.isArray(e))for(var n=0;n");var u="";i&&(u=" The element was created by "+i+"."),"production"!==t.env.NODE_ENV?C(!1,"Don't set .props.%s of the React component%s. Instead, specify the correct value when initially creating the element.%s",e,s,u):null}}function d(e,t){return e!==e?t!==t:0===e&&0===t?1/e===1/t:e===t}function f(e){if(e._store){var t=e._store.originalProps,n=e.props;for(var r in n)n.hasOwnProperty(r)&&(t.hasOwnProperty(r)&&d(t[r],n[r])||(p(r,e),t[r]=n[r]))}}function h(e){if(null!=e.type){var n=b.getComponentClassForElement(e),r=n.displayName||n.name;n.propTypes&&l(r,n.propTypes,e.props,y.prop),"function"==typeof n.getDefaultProps&&("production"!==t.env.NODE_ENV?C(n.getDefaultProps.isReactClassApproved,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."):null)}}var m=n(5),v=n(30),y=n(60),g=n(42),E=n(18),b=n(41),_=n(110),N=n(2),C=n(4),w={},D={},O=/^\d+$/,x={},R={checkAndWarnForMutatedProps:f,createElement:function(e,n,r){"production"!==t.env.NODE_ENV?C(null!=e,"React.createElement: type should not be null or undefined. It should be a string (for DOM elements) or a ReactClass (for composite components)."):null;var o=m.createElement.apply(this,arguments);if(null==o)return o;for(var i=2;i":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;e.exports=o},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function s(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:s(o,t,n)}if("value"in r)return r.value;var i=r.get;return void 0===i?void 0:i.call(n)},i=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(e){r(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.name=this.constructor.name,this.message=e,Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack}return i(t,e),t}(Error);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){if(!(e in p)){var t=[],n=e.replace(s,function(e,n){return n?(t.push(n),"([^/?#]+)"):"*"===e?(t.push("splat"),"(.*?)"):"\\"+e; - -});p[e]={matcher:new RegExp("^"+n+"$","i"),paramNames:t}}return p[e]}var o=n(2),i=n(150),a=n(151),s=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g,u=/:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g,c=/\/\/\?|\/\?\/|\/\?/g,l=/\?(.*)$/,p={},d={isAbsolute:function(e){return"/"===e.charAt(0)},join:function(e,t){return e.replace(/\/*$/,"/")+t},extractParamNames:function(e){return r(e).paramNames},extractParams:function(e,t){var n=r(e),o=n.matcher,i=n.paramNames,a=t.match(o);if(!a)return null;var s={};return i.forEach(function(e,t){s[e]=a[t+1]}),s},injectParams:function(e,t){t=t||{};var n=0;return e.replace(u,function(r,i){if(i=i||"splat","?"===i.slice(-1)){if(i=i.slice(0,-1),null==t[i])return""}else o(null!=t[i],'Missing "%s" parameter for path "%s"',i,e);var a;return"splat"===i&&Array.isArray(t[i])?(a=t[i][n++],o(null!=a,'Missing splat # %s for path "%s"',n,e)):a=t[i],a}).replace(c,"/")},extractQuery:function(e){var t=e.match(l);return t&&a.parse(t[1])},withoutQuery:function(e){return e.replace(l,"")},withQuery:function(e,t){var n=d.extractQuery(e);n&&(t=t?i(n,t):n);var r=a.stringify(t,{arrayFormat:"brackets"});return r?d.withoutQuery(e)+"?"+r:d.withoutQuery(e)}};e.exports=d},function(e,t,n){"use strict";t.DefaultRoute=n(79),t.Link=n(144),t.NotFoundRoute=n(80),t.Redirect=n(81),t.Route=n(37),t.RouteHandler=n(38),t.HashLocation=n(84),t.HistoryLocation=n(50),t.RefreshLocation=n(85),t.StaticLocation=n(86),t.TestLocation=n(147),t.ImitateBrowserBehavior=n(78),t.ScrollToTopBehavior=n(142),t.History=n(27),t.Navigation=n(138),t.State=n(140),t.createRoute=n(21).createRoute,t.createDefaultRoute=n(21).createDefaultRoute,t.createNotFoundRoute=n(21).createNotFoundRoute,t.createRedirect=n(21).createRedirect,t.createRoutesFromReactChildren=n(83),t.create=n(82),t.run=n(148)},function(e,t,n){"use strict";function r(e){var t={path:c.getCurrentPath(),type:e};s.forEach(function(e){e.call(c,t)})}function o(e){void 0!==e.state&&r(i.POP)}var i=n(32),a=n(27),s=[],u=!1,c={addChangeListener:function(e){s.push(e),u||(window.addEventListener?window.addEventListener("popstate",o,!1):window.attachEvent("onpopstate",o),u=!0)},removeChangeListener:function(e){s=s.filter(function(t){return t!==e}),0===s.length&&(window.addEventListener?window.removeEventListener("popstate",o,!1):window.removeEvent("onpopstate",o),u=!1)},push:function(e){window.history.pushState({path:e},"",e),a.length+=1,r(i.PUSH)},replace:function(e){window.history.replaceState({path:e},"",e),r(i.REPLACE)},pop:a.back,getCurrentPath:function(){return decodeURI(window.location.pathname+window.location.search)},toString:function(){return""}};e.exports=c},function(e,t,n){(function(t){"use strict";function r(){this._callbacks=null,this._contexts=null}var o=n(16),i=n(3),a=n(2);i(r.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,n=this._contexts;if(e){"production"!==t.env.NODE_ENV?a(e.length===n.length,"Mismatched list of contexts in callback queue"):a(e.length===n.length),this._callbacks=null,this._contexts=null;for(var r=0,o=e.length;o>r;r++)e[r].call(n[r]);e.length=0,n.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),o.addPoolingTo(r),e.exports=r}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e){return e===y.topMouseUp||e===y.topTouchEnd||e===y.topTouchCancel}function o(e){return e===y.topMouseMove||e===y.topTouchMove}function i(e){return e===y.topMouseDown||e===y.topTouchStart}function a(e,n){var r=e._dispatchListeners,o=e._dispatchIDs;if("production"!==t.env.NODE_ENV&&f(e),Array.isArray(r))for(var i=0;i";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,n)+o},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(C.hasOwnProperty(r))o(this._rootNodeID,r,i,e);else{r===D&&(i&&(i=this._previousStyleCopy=m({},t.style)),i=s.createMarkupForStyles(i));var a=c.createMarkupForProperty(r,i);a&&(n+=" "+a)}}if(e.renderToStaticMarkup)return n+">";var u=c.createMarkupForID(this._rootNodeID);return n+" "+u+">"},_createContentMarkup:function(e,t){var n="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(n="\n");var r=this._currentElement.props,o=r.dangerouslySetInnerHTML;if(null!=o){if(null!=o.__html)return n+o.__html}else{var i=w[typeof r.children]?r.children:null,a=null!=i?null:r.children;if(null!=i)return n+v(i);if(null!=a){var s=this.mountChildren(a,e,t);return n+s.join("")}}return n},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,o){r(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,o)},_updateDOMProperties:function(e,t){var n,r,i,a=this._currentElement.props;for(n in e)if(!a.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===D){var s=this._previousStyleCopy;for(r in s)s.hasOwnProperty(r)&&(i=i||{},i[r]="");this._previousStyleCopy=null}else C.hasOwnProperty(n)?_(this._rootNodeID,n):(u.isStandardName[n]||u.isCustomAttribute(n))&&x.deletePropertyByID(this._rootNodeID,n);for(n in a){var c=a[n],l=n===D?this._previousStyleCopy:e[n];if(a.hasOwnProperty(n)&&c!==l)if(n===D)if(c&&(c=this._previousStyleCopy=m({},c)),l){for(r in l)!l.hasOwnProperty(r)||c&&c.hasOwnProperty(r)||(i=i||{},i[r]="");for(r in c)c.hasOwnProperty(r)&&l[r]!==c[r]&&(i=i||{},i[r]=c[r])}else i=c;else C.hasOwnProperty(n)?o(this._rootNodeID,n,c,t):(u.isStandardName[n]||u.isCustomAttribute(n))&&x.updatePropertyByID(this._rootNodeID,n,c)}i&&x.updateStylesByID(this._rootNodeID,i)},_updateDOMChildren:function(e,t,n){var r=this._currentElement.props,o=w[typeof e.children]?e.children:null,i=w[typeof r.children]?r.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=r.dangerouslySetInnerHTML&&r.dangerouslySetInnerHTML.__html,u=null!=o?null:e.children,c=null!=i?null:r.children,l=null!=o||null!=a,p=null!=i||null!=s;null!=u&&null==c?this.updateChildren(null,t,n):l&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=s?a!==s&&x.updateInnerHTMLByID(this._rootNodeID,s):null!=c&&this.updateChildren(c,t,n)},unmountComponent:function(){this.unmountChildren(),l.deleteAllListeners(this._rootNodeID),p.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},h.measureMethods(a,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),m(a.prototype,a.Mixin,f.Mixin),a.injection={injectIDOperations:function(e){a.BackendIDOperations=x=e}},e.exports=a}).call(t,n(1))},function(e,t,n){"use strict";var r={currentlyMountingInstance:null,currentlyUnmountingInstance:null};e.exports=r},function(e,t,n){"use strict";var r=n(36),o=r({prop:null,context:null,childContext:null});e.exports=o},function(e,t,n){(function(t){"use strict";function r(e){e!==i.currentlyMountingInstance&&c.enqueueUpdate(e)}function o(e,n){"production"!==t.env.NODE_ENV?p(null==a.current,"%s(...): Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.",n):p(null==a.current);var r=u.get(e);return r?r===i.currentlyUnmountingInstance?null:r:("production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?d(!n,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op.",n,n):null),null)}var i=n(59),a=n(18),s=n(5),u=n(26),c=n(10),l=n(3),p=n(2),d=n(4),f={enqueueCallback:function(e,n){"production"!==t.env.NODE_ENV?p("function"==typeof n,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):p("function"==typeof n);var a=o(e);return a&&a!==i.currentlyMountingInstance?(a._pendingCallbacks?a._pendingCallbacks.push(n):a._pendingCallbacks=[n],void r(a)):null},enqueueCallbackInternal:function(e,n){"production"!==t.env.NODE_ENV?p("function"==typeof n,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):p("function"==typeof n),e._pendingCallbacks?e._pendingCallbacks.push(n):e._pendingCallbacks=[n],r(e)},enqueueForceUpdate:function(e){var t=o(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t){var n=o(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,r(n))},enqueueSetState:function(e,t){var n=o(e,"setState");if(n){var i=n._pendingStateQueue||(n._pendingStateQueue=[]);i.push(t),r(n)}},enqueueSetProps:function(e,n){var i=o(e,"setProps");if(i){"production"!==t.env.NODE_ENV?p(i._isTopLevel,"setProps(...): You called `setProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):p(i._isTopLevel);var a=i._pendingElement||i._currentElement,u=l({},a.props,n);i._pendingElement=s.cloneAndReplaceProps(a,u),r(i)}},enqueueReplaceProps:function(e,n){var i=o(e,"replaceProps");if(i){"production"!==t.env.NODE_ENV?p(i._isTopLevel,"replaceProps(...): You called `replaceProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):p(i._isTopLevel);var a=i._pendingElement||i._currentElement;i._pendingElement=s.cloneAndReplaceProps(a,n),r(i)}},enqueueElementInternal:function(e,t){e._pendingElement=t,r(e)}};e.exports=f}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,n){if("production"!==t.env.NODE_ENV?o(null!=n,"accumulateInto(...): Accumulated items must not be null or undefined."):o(null!=n),null==e)return n;var r=Array.isArray(e),i=Array.isArray(n);return r&&i?(e.push.apply(e,n),e):r?(e.push(n),e):i?[e].concat(n):[e,n]}var o=n(2);e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";var r=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=r},function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return r?!!n[r]:!1}function o(e){return r}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=o},function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){return"function"==typeof e&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e,n){var o;if((null===e||e===!1)&&(e=a.emptyElement),"object"==typeof e){var i=e;"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?l(i&&("function"==typeof i.type||"string"==typeof i.type),"Only functions or strings can be mounted as React components."):null),o=n===i.type&&"string"==typeof i.type?s.createInternalComponent(i):r(i.type)?new i.type(i):new p}else"string"==typeof e||"number"==typeof e?o=s.createInstanceForText(e):"production"!==t.env.NODE_ENV?c(!1,"Encountered invalid React node of type %s",typeof e):c(!1);return"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?l("function"==typeof o.construct&&"function"==typeof o.mountComponent&&"function"==typeof o.receiveComponent&&"function"==typeof o.unmountComponent,"Only React Components can be mounted."):null),o.construct(e),o._mountIndex=0,o._mountImage=null,"production"!==t.env.NODE_ENV&&(o._isOwnerNecessary=!1,o._warnedAboutRefsInRender=!1),"production"!==t.env.NODE_ENV&&Object.preventExtensions&&Object.preventExtensions(o),o}var i=n(93),a=n(40),s=n(41),u=n(3),c=n(2),l=n(4),p=function(){};u(p.prototype,i.Mixin,{_instantiateReactComponent:o}),e.exports=o}).call(t,n(1))},function(e,t,n){"use strict";/** +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=n(7),i=r(o),a=n(48),u=n(24),s=r(u),c=n(75),l=r(c),p=n(129),d=r(p);l["default"].polyfill(),s["default"].run(d["default"],function(e){a.Resolver.render(i["default"].createElement(e,null),document.getElementById("app"))})},function(e,t,n){function r(){l=!1,u.length?c=u.concat(c):p=-1,c.length&&o()}function o(){if(!l){var e=setTimeout(r);l=!0;for(var t=c.length;t;){for(u=c,c=[];++p1)for(var n=1;nr;r++)n.push(arguments[r]);if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(0!==t.indexOf("Failed Composite propType: ")&&!e){var i=0,a="Warning: "+t.replace(/%s/g,function(){return n[i++]});console.warn(a);try{throw new Error(a)}catch(u){}}}),e.exports=o}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,n){Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:function(){return this._store?this._store[n]:null},set:function(e){"production"!==t.env.NODE_ENV?s(!1,"Don't set the %s property of the React element. Instead, specify the correct value when initially creating the element.",n):null,this._store[n]=e}})}function o(e){try{var t={props:!0};for(var n in t)r(e,n);l=!0}catch(o){}}var i=n(57),a=n(16),u=n(3),s=n(4),c={key:!0,ref:!0},l=!1,p=function(e,n,r,o,i,a){if(this.type=e,this.key=n,this.ref=r,this._owner=o,this._context=i,"production"!==t.env.NODE_ENV){this._store={props:a,originalProps:u({},a)};try{Object.defineProperty(this._store,"validated",{configurable:!1,enumerable:!1,writable:!0})}catch(s){}if(this._store.validated=!1,l)return void Object.freeze(this)}this.props=a};p.prototype={_isReactElement:!0},"production"!==t.env.NODE_ENV&&o(p.prototype),p.createElement=function(e,t,n){var r,o={},u=null,s=null;if(null!=t){s=void 0===t.ref?null:t.ref,u=void 0===t.key?null:""+t.key;for(r in t)t.hasOwnProperty(r)&&!c.hasOwnProperty(r)&&(o[r]=t[r])}var l=arguments.length-2;if(1===l)o.children=n;else if(l>1){for(var d=Array(l),f=0;l>f;f++)d[f]=arguments[f+2];o.children=d}if(e&&e.defaultProps){var h=e.defaultProps;for(r in h)"undefined"==typeof o[r]&&(o[r]=h[r])}return new p(e,u,s,a.current,i.current,o)},p.createFactory=function(e){var t=p.createElement.bind(null,e);return t.type=e,t},p.cloneAndReplaceProps=function(e,n){var r=new p(e.type,e.key,e.ref,e._owner,e._context,n);return"production"!==t.env.NODE_ENV&&(r._store.validated=e._store.validated),r},p.cloneElement=function(e,t,n){var r,o=u({},e.props),i=e.key,s=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,l=a.current),void 0!==t.key&&(i=""+t.key);for(r in t)t.hasOwnProperty(r)&&!c.hasOwnProperty(r)&&(o[r]=t[r])}var d=arguments.length-2;if(1===d)o.children=n;else if(d>1){for(var f=Array(d),h=0;d>h;h++)f[h]=arguments[h+2];o.children=f}return new p(e.type,i,s,l,e._context,o)},p.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},e.exports=p}).call(t,n(1))},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){e.exports=n(160)},function(e,t,n){"use strict";var r=n(35),o=r({bubbled:null,captured:null}),i=r({topBlur:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topContextMenu:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),a={topLevelTypes:i,PropagationPhases:o};e.exports=a},function(e,t,n){(function(t){"use strict";function r(e,n,r){for(var o in n)n.hasOwnProperty(o)&&("production"!==t.env.NODE_ENV?D("function"==typeof n[o],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",E[r],o):null)}function o(e,n){var r=T.hasOwnProperty(n)?T[n]:null;I.hasOwnProperty(n)&&("production"!==t.env.NODE_ENV?N(r===x.OVERRIDE_BASE,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",n):N(r===x.OVERRIDE_BASE)),e.hasOwnProperty(n)&&("production"!==t.env.NODE_ENV?N(r===x.DEFINE_MANY||r===x.DEFINE_MANY_MERGED,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n):N(r===x.DEFINE_MANY||r===x.DEFINE_MANY_MERGED))}function i(e,n){if(n){"production"!==t.env.NODE_ENV?N("function"!=typeof n,"ReactClass: You're attempting to use a component class as a mixin. Instead, just use a regular object."):N("function"!=typeof n),"production"!==t.env.NODE_ENV?N(!h.isValidElement(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object."):N(!h.isValidElement(n));var r=e.prototype;n.hasOwnProperty(O)&&P.mixins(e,n.mixins);for(var i in n)if(n.hasOwnProperty(i)&&i!==O){var a=n[i];if(o(r,i),P.hasOwnProperty(i))P[i](e,a);else{var u=T.hasOwnProperty(i),l=r.hasOwnProperty(i),p=a&&a.__reactDontBind,d="function"==typeof a,f=d&&!u&&!l&&!p;if(f)r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[i]=a,r[i]=a;else if(l){var m=T[i];"production"!==t.env.NODE_ENV?N(u&&(m===x.DEFINE_MANY_MERGED||m===x.DEFINE_MANY),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,i):N(u&&(m===x.DEFINE_MANY_MERGED||m===x.DEFINE_MANY)),m===x.DEFINE_MANY_MERGED?r[i]=s(r[i],a):m===x.DEFINE_MANY&&(r[i]=c(r[i],a))}else r[i]=a,"production"!==t.env.NODE_ENV&&"function"==typeof a&&n.displayName&&(r[i].displayName=n.displayName+"_"+i)}}}}function a(e,n){if(n)for(var r in n){var o=n[r];if(n.hasOwnProperty(r)){var i=r in P;"production"!==t.env.NODE_ENV?N(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',r):N(!i);var a=r in e;"production"!==t.env.NODE_ENV?N(!a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",r):N(!a),e[r]=o}}}function u(e,n){"production"!==t.env.NODE_ENV?N(e&&n&&"object"==typeof e&&"object"==typeof n,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects."):N(e&&n&&"object"==typeof e&&"object"==typeof n);for(var r in n)n.hasOwnProperty(r)&&("production"!==t.env.NODE_ENV?N(void 0===e[r],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",r):N(void 0===e[r]),e[r]=n[r]);return e}function s(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return u(o,n),u(o,r),o}}function c(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function l(e,n){var r=n.bind(e);if("production"!==t.env.NODE_ENV){r.__reactBoundContext=e,r.__reactBoundMethod=n,r.__reactBoundArguments=null;var o=e.constructor.displayName,i=r.bind;r.bind=function(a){for(var u=[],s=1,c=arguments.length;c>s;s++)u.push(arguments[s]);if(a!==e&&null!==a)"production"!==t.env.NODE_ENV?D(!1,"bind(): React component methods may only be bound to the component instance. See %s",o):null;else if(!u.length)return"production"!==t.env.NODE_ENV?D(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",o):null,r;var l=i.apply(r,arguments);return l.__reactBoundContext=e,l.__reactBoundMethod=n,l.__reactBoundArguments=u,l}}return r}function p(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=l(e,m.guard(n,e.constructor.displayName+"."+t))}}var d=n(92),f=n(16),h=n(5),m=n(178),v=n(27),y=n(60),g=n(61),E=n(41),b=n(62),_=n(3),N=n(2),C=n(35),w=n(18),D=n(4),O=w({mixins:null}),x=C({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),R=[],T={mixins:x.DEFINE_MANY,statics:x.DEFINE_MANY,propTypes:x.DEFINE_MANY,contextTypes:x.DEFINE_MANY,childContextTypes:x.DEFINE_MANY,getDefaultProps:x.DEFINE_MANY_MERGED,getInitialState:x.DEFINE_MANY_MERGED,getChildContext:x.DEFINE_MANY_MERGED,render:x.DEFINE_ONCE,componentWillMount:x.DEFINE_MANY,componentDidMount:x.DEFINE_MANY,componentWillReceiveProps:x.DEFINE_MANY,shouldComponentUpdate:x.DEFINE_ONCE,componentWillUpdate:x.DEFINE_MANY,componentDidUpdate:x.DEFINE_MANY,componentWillUnmount:x.DEFINE_MANY,updateComponent:x.OVERRIDE_BASE},P={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;nr;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){var t=M(e);return t&&z.getID(t)}function i(e){var n=a(e);if(n)if(j.hasOwnProperty(n)){var r=j[n];r!==e&&("production"!==t.env.NODE_ENV?k(!l(r,n),"ReactMount: Two valid but unequal nodes with the same `%s`: %s",U,n):k(!l(r,n)),j[n]=e)}else j[n]=e;return n}function a(e){return e&&e.getAttribute&&e.getAttribute(U)||""}function u(e,t){var n=a(e);n!==t&&delete j[n],e.setAttribute(U,t),j[t]=e}function s(e){return j.hasOwnProperty(e)&&l(j[e],e)||(j[e]=z.findReactNodeByID(e)),j[e]}function c(e){var t=C.get(e)._rootNodeID;return _.isNullComponentID(t)?null:(j.hasOwnProperty(t)&&l(j[t],t)||(j[t]=z.findReactNodeByID(t)),j[t])}function l(e,n){if(e){"production"!==t.env.NODE_ENV?k(a(e)===n,"ReactMount: Unexpected modification of `%s`",U):k(a(e)===n);var r=z.findReactContainerForID(n);if(r&&P(r,e))return!0}return!1}function p(e){delete j[e]}function d(e){var t=j[e];return t&&l(t,e)?void(Y=t):!1}function f(e){Y=null,N.traverseAncestors(e,d);var t=Y;return Y=null,t}function h(e,t,n,r,o){var i=O.mountComponent(e,t,r,T);e._isTopLevel=!0,z._mountImageIntoNode(i,n,o)}function m(e,t,n,r){var o=R.ReactReconcileTransaction.getPooled();o.perform(h,null,e,t,n,o,r),R.ReactReconcileTransaction.release(o)}var v=n(21),y=n(25),g=n(16),E=n(5),b=n(33),_=n(59),N=n(26),C=n(27),w=n(96),D=n(19),O=n(28),x=n(62),R=n(11),T=n(44),P=n(102),M=n(212),I=n(68),k=n(2),S=n(70),A=n(71),V=n(4),L=N.SEPARATOR,U=v.ID_ATTRIBUTE_NAME,j={},F=1,B=9,H={},q={};if("production"!==t.env.NODE_ENV)var W={};var K=[],Y=null,z={_instancesByReactRootID:H,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,n,r,i){return"production"!==t.env.NODE_ENV&&b.checkAndWarnForMutatedProps(n),z.scrollMonitor(r,function(){x.enqueueElementInternal(e,n),i&&x.enqueueCallbackInternal(e,i)}),"production"!==t.env.NODE_ENV&&(W[o(r)]=M(r)),e},_registerComponent:function(e,n){"production"!==t.env.NODE_ENV?k(n&&(n.nodeType===F||n.nodeType===B),"_registerComponent(...): Target container is not a DOM element."):k(n&&(n.nodeType===F||n.nodeType===B)),y.ensureScrollValueMonitoring();var r=z.registerContainer(n);return H[r]=e,r},_renderNewRootComponent:function(e,n,r){"production"!==t.env.NODE_ENV?V(null==g.current,"_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."):null;var o=I(e,null),i=z._registerComponent(o,n);return R.batchedUpdates(m,o,i,n,r),"production"!==t.env.NODE_ENV&&(W[i]=M(n)),o},render:function(e,n,r){"production"!==t.env.NODE_ENV?k(E.isValidElement(e),"React.render(): Invalid component element.%s","string"==typeof e?" Instead of passing an element string, make sure to instantiate it by passing it to React.createElement.":"function"==typeof e?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":null!=e&&void 0!==e.props?" This may be caused by unintentionally loading two independent copies of React.":""):k(E.isValidElement(e));var i=H[o(n)];if(i){var a=i._currentElement;if(A(a,e))return z._updateRootComponent(i,e,n,r).getPublicInstance();z.unmountComponentAtNode(n)}var u=M(n),s=u&&z.isRenderedByReact(u);if("production"!==t.env.NODE_ENV&&(!s||u.nextSibling))for(var c=u;c;){if(z.isRenderedByReact(c)){"production"!==t.env.NODE_ENV?V(!1,"render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."):null;break}c=c.nextSibling}var l=s&&!i,p=z._renderNewRootComponent(e,n,l).getPublicInstance();return r&&r.call(p),p},constructAndRenderComponent:function(e,t,n){var r=E.createElement(e,t);return z.render(r,n)},constructAndRenderComponentByID:function(e,n,r){var o=document.getElementById(r);return"production"!==t.env.NODE_ENV?k(o,'Tried to get element with id of "%s" but it is not present on the page.',r):k(o),z.constructAndRenderComponent(e,n,o)},registerContainer:function(e){var t=o(e);return t&&(t=N.getReactRootIDFromNodeID(t)),t||(t=N.createReactRootID()),q[t]=e,t},unmountComponentAtNode:function(e){"production"!==t.env.NODE_ENV?V(null==g.current,"unmountComponentAtNode(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate."):null,"production"!==t.env.NODE_ENV?k(e&&(e.nodeType===F||e.nodeType===B),"unmountComponentAtNode(...): Target container is not a DOM element."):k(e&&(e.nodeType===F||e.nodeType===B));var n=o(e),r=H[n];return r?(z.unmountComponentFromNode(r,e),delete H[n],delete q[n],"production"!==t.env.NODE_ENV&&delete W[n],!0):!1},unmountComponentFromNode:function(e,t){for(O.unmountComponent(e),t.nodeType===B&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var n=N.getReactRootIDFromNodeID(e),r=q[n];if("production"!==t.env.NODE_ENV){var o=W[n];if(o&&o.parentNode!==r){"production"!==t.env.NODE_ENV?k(a(o)===n,"ReactMount: Root element ID differed from reactRootID."):k(a(o)===n);var i=r.firstChild;i&&n===a(i)?W[n]=i:"production"!==t.env.NODE_ENV?V(!1,"ReactMount: Root element has been removed from its original container. New container:",o.parentNode):null}}return r},findReactNodeByID:function(e){var t=z.findReactContainerForID(e);return z.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=z.getID(e);return t?t.charAt(0)===L:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(z.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,n){var r=K,o=0,i=f(n)||e;for(r[0]=i.firstChild,r.length=1;o when using tables, nesting tags like
,

, or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",n,z.getID(e)):k(!1)},_mountImageIntoNode:function(e,n,o){if("production"!==t.env.NODE_ENV?k(n&&(n.nodeType===F||n.nodeType===B),"mountComponentIntoNode(...): Target container is not valid."):k(n&&(n.nodeType===F||n.nodeType===B)),o){var i=M(n);if(w.canReuseMarkup(e,i))return;var a=i.getAttribute(w.CHECKSUM_ATTR_NAME);i.removeAttribute(w.CHECKSUM_ATTR_NAME);var u=i.outerHTML;i.setAttribute(w.CHECKSUM_ATTR_NAME,a);var s=r(e,u),c=" (client) "+e.substring(s-20,s+20)+"\n (server) "+u.substring(s-20,s+20);"production"!==t.env.NODE_ENV?k(n.nodeType!==B,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",c):k(n.nodeType!==B),"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?V(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",c):null)}"production"!==t.env.NODE_ENV?k(n.nodeType!==B,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See React.renderToString() for server rendering."):k(n.nodeType!==B),S(n,e)},getReactRootID:o,getID:i,setID:u,getNode:s,getNodeFromInstance:c,purgeID:p};D.measureMethods(z,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),e.exports=z}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){"production"!==t.env.NODE_ENV?y(R.ReactReconcileTransaction&&N,"ReactUpdates: must inject a reconcile transaction class and batching strategy"):y(R.ReactReconcileTransaction&&N)}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=l.getPooled(),this.reconcileTransaction=R.ReactReconcileTransaction.getPooled()}function i(e,t,n,o,i){r(),N.batchedUpdates(e,t,n,o,i)}function a(e,t){return e._mountOrder-t._mountOrder}function u(e){var n=e.dirtyComponentsLength;"production"!==t.env.NODE_ENV?y(n===E.length,"Expected flush transaction's stored dirty-components length (%s) to match dirty-components array length (%s).",n,E.length):y(n===E.length),E.sort(a);for(var r=0;n>r;r++){var o=E[r],i=o._pendingCallbacks;if(o._pendingCallbacks=null,h.performUpdateIfNecessary(o,e.reconcileTransaction),i)for(var u=0;uo;o++)t.call(null,e[o],o,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(null,e[a],a,e)}}function v(){var e={};return m(arguments,function(t){m(t,function(t,n){e[n]=t})}),e}var y=Object.prototype.toString;e.exports={isArray:r,isArrayBuffer:o,isFormData:i,isArrayBufferView:a,isString:u,isNumber:s,isObject:l,isUndefined:c,isDate:p,isFile:d,isBlob:f,forEach:m,merge:v,trim:h}},function(e,t,n){"use strict";var r=n(3),o=n(7).PropTypes,i=n(20),a=r({},o,{falsy:function(e,t,n){return e[t]?new Error("<"+n+'> should not have a "'+t+'" prop'):void 0},route:o.instanceOf(i),router:o.func});e.exports=a},function(e,t,n){(function(t){"use strict";var r=n(2),o=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},u=function(e,t,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,n,r,o),a}return new i(e,t,n,r,o)},s=function(e){var n=this;"production"!==t.env.NODE_ENV?r(e instanceof n,"Trying to release an instance into a pool of a different type."):r(e instanceof n),e.destructor&&e.destructor(),n.instancePool.length'}}],[{key:"createRoute",value:function(t,n){t=t||{},"string"==typeof t&&(t={path:t});var o=r;o?s(null==t.parentRoute||t.parentRoute===o,"You should not use parentRoute with createRoute inside another route's child callback; it is ignored"):o=t.parentRoute;var i=t.name,a=t.path||i;!a||t.isDefault||t.isNotFound?a=o?o.path:"/":c.isAbsolute(a)?o&&u(a===o.path||0===o.paramNames.length,'You cannot nest path "%s" inside "%s"; the parent requires URL parameters',a,o.path):a=o?c.join(o.path,a):"/"+a,t.isNotFound&&!/\*$/.test(a)&&(a+="*");var l=new e(i,a,t.ignoreScrollBehavior,t.isDefault,t.isNotFound,t.onEnter,t.onLeave,t.handler);if(o&&(l.isDefault?(u(null==o.defaultRoute,"%s may not have more than one default route",o),o.defaultRoute=l):l.isNotFound&&(u(null==o.notFoundRoute,"%s may not have more than one not found route",o),o.notFoundRoute=l),o.appendChild(l)),"function"==typeof n){var p=r;r=l, +n.call(l,l),r=p}return l}},{key:"createDefaultRoute",value:function(t){return e.createRoute(a({},t,{isDefault:!0}))}},{key:"createNotFoundRoute",value:function(t){return e.createRoute(a({},t,{isNotFound:!0}))}},{key:"createRedirect",value:function(t){return e.createRoute(a({},t,{path:t.path||t.from||"*",onEnter:function(e,n,r){e.redirect(t.to,t.params||n,t.query||r)}}))}}]),e}();e.exports=l},function(e,t,n){(function(t){"use strict";function r(e,t){return(e&t)===t}var o=n(2),i={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var n=e.Properties||{},a=e.DOMAttributeNames||{},s=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&u._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var l in n){"production"!==t.env.NODE_ENV?o(!u.isStandardName.hasOwnProperty(l),"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",l):o(!u.isStandardName.hasOwnProperty(l)),u.isStandardName[l]=!0;var p=l.toLowerCase();if(u.getPossibleStandardName[p]=l,a.hasOwnProperty(l)){var d=a[l];u.getPossibleStandardName[d]=l,u.getAttributeName[l]=d}else u.getAttributeName[l]=p;u.getPropertyName[l]=s.hasOwnProperty(l)?s[l]:l,c.hasOwnProperty(l)?u.getMutationMethod[l]=c[l]:u.getMutationMethod[l]=null;var f=n[l];u.mustUseAttribute[l]=r(f,i.MUST_USE_ATTRIBUTE),u.mustUseProperty[l]=r(f,i.MUST_USE_PROPERTY),u.hasSideEffects[l]=r(f,i.HAS_SIDE_EFFECTS),u.hasBooleanValue[l]=r(f,i.HAS_BOOLEAN_VALUE),u.hasNumericValue[l]=r(f,i.HAS_NUMERIC_VALUE),u.hasPositiveNumericValue[l]=r(f,i.HAS_POSITIVE_NUMERIC_VALUE),u.hasOverloadedBooleanValue[l]=r(f,i.HAS_OVERLOADED_BOOLEAN_VALUE),"production"!==t.env.NODE_ENV?o(!u.mustUseAttribute[l]||!u.mustUseProperty[l],"DOMProperty: Cannot require using both attribute and property: %s",l):o(!u.mustUseAttribute[l]||!u.mustUseProperty[l]),"production"!==t.env.NODE_ENV?o(u.mustUseProperty[l]||!u.hasSideEffects[l],"DOMProperty: Properties that have side effects must use property: %s",l):o(u.mustUseProperty[l]||!u.hasSideEffects[l]),"production"!==t.env.NODE_ENV?o(!!u.hasBooleanValue[l]+!!u.hasNumericValue[l]+!!u.hasOverloadedBooleanValue[l]<=1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",l):o(!!u.hasBooleanValue[l]+!!u.hasNumericValue[l]+!!u.hasOverloadedBooleanValue[l]<=1)}}},a={},u={ID_ATTRIBUTE_NAME:"data-reactid",isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasSideEffects:{},hasBooleanValue:{},hasNumericValue:{},hasPositiveNumericValue:{},hasOverloadedBooleanValue:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;tc;c++){var d=u[c];i.hasOwnProperty(d)&&i[d]||(d===s.topWheel?l("wheel")?v.ReactEventListener.trapBubbledEvent(s.topWheel,"wheel",n):l("mousewheel")?v.ReactEventListener.trapBubbledEvent(s.topWheel,"mousewheel",n):v.ReactEventListener.trapBubbledEvent(s.topWheel,"DOMMouseScroll",n):d===s.topScroll?l("scroll",!0)?v.ReactEventListener.trapCapturedEvent(s.topScroll,"scroll",n):v.ReactEventListener.trapBubbledEvent(s.topScroll,"scroll",v.ReactEventListener.WINDOW_HANDLE):d===s.topFocus||d===s.topBlur?(l("focus",!0)?(v.ReactEventListener.trapCapturedEvent(s.topFocus,"focus",n),v.ReactEventListener.trapCapturedEvent(s.topBlur,"blur",n)):l("focusin")&&(v.ReactEventListener.trapBubbledEvent(s.topFocus,"focusin",n),v.ReactEventListener.trapBubbledEvent(s.topBlur,"focusout",n)),i[s.topBlur]=!0,i[s.topFocus]=!0):h.hasOwnProperty(d)&&v.ReactEventListener.trapBubbledEvent(d,h[d],n),i[d]=!0)}},trapBubbledEvent:function(e,t,n){return v.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return v.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!d){var e=s.refreshScrollValues;v.ReactEventListener.monitorScrollValue(e),d=!0}},eventNameDispatchConfigs:i.eventNameDispatchConfigs,registrationNameModules:i.registrationNameModules,putListener:i.putListener,getListener:i.getListener,deleteListener:i.deleteListener,deleteAllListeners:i.deleteAllListeners});e.exports=v},function(e,t,n){(function(t){"use strict";function r(e){return f+e.toString(36)}function o(e,t){return e.charAt(t)===f||t===e.length}function i(e){return""===e||e.charAt(0)===f&&e.charAt(e.length-1)!==f}function a(e,t){return 0===t.indexOf(e)&&o(t,e.length)}function u(e){return e?e.substr(0,e.lastIndexOf(f)):""}function s(e,n){if("production"!==t.env.NODE_ENV?d(i(e)&&i(n),"getNextDescendantID(%s, %s): Received an invalid React DOM ID.",e,n):d(i(e)&&i(n)),"production"!==t.env.NODE_ENV?d(a(e,n),"getNextDescendantID(...): React has made an invalid assumption about the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.",e,n):d(a(e,n)),e===n)return e;var r,u=e.length+h;for(r=u;r=u;u++)if(o(e,u)&&o(n,u))a=u;else if(e.charAt(u)!==n.charAt(u))break;var s=e.substr(0,a);return"production"!==t.env.NODE_ENV?d(i(s),"getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s",e,n,s):d(i(s)),s}function l(e,n,r,o,i,c){e=e||"",n=n||"","production"!==t.env.NODE_ENV?d(e!==n,"traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.",e):d(e!==n);var l=a(n,e);"production"!==t.env.NODE_ENV?d(l||a(e,n),"traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do not have a parent path.",e,n):d(l||a(e,n));for(var p=0,f=l?u:s,h=e;;h=f(h,n)){var v;if(i&&h===e||c&&h===n||(v=r(h,l,o)),v===!1||h===n)break;"production"!==t.env.NODE_ENV?d(p++1){var t=e.indexOf(f,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var i=c(e,t);i!==e&&l(e,i,n,r,!1,!0),i!==t&&l(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},_getFirstCommonAncestorID:c,_getNextDescendantID:s,isAncestorIDOf:a,SEPARATOR:f};e.exports=v}).call(t,n(1))},function(e,t,n){"use strict";var r={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};e.exports=r},function(e,t,n){(function(t){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=n(186),i=n(33),a={mountComponent:function(e,n,o,a){var u=e.mountComponent(n,o,a);return"production"!==t.env.NODE_ENV&&i.checkAndWarnForMutatedProps(e._currentElement),o.getReactMountReady().enqueue(r,e),u},unmountComponent:function(e){o.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,n,a,u){var s=e._currentElement;if(n!==s||null==n._owner){"production"!==t.env.NODE_ENV&&i.checkAndWarnForMutatedProps(n);var c=o.shouldUpdateRefs(s,n);c&&o.detachRefs(e,s),e.receiveComponent(n,a,u),c&&a.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};e.exports=a}).call(t,n(1))},function(e,t,n){"use strict";var r={PUSH:"push",REPLACE:"replace",POP:"pop"};e.exports=r},function(e,t,n){(function(t){"use strict";function r(e,t){return null==t||o.hasBooleanValue[e]&&!t||o.hasNumericValue[e]&&isNaN(t)||o.hasPositiveNumericValue[e]&&1>t||o.hasOverloadedBooleanValue[e]&&t===!1}var o=n(21),i=n(223),a=n(4);if("production"!==t.env.NODE_ENV)var u={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},s={},c=function(e){if(!(u.hasOwnProperty(e)&&u[e]||s.hasOwnProperty(e)&&s[e])){s[e]=!0;var n=e.toLowerCase(),r=o.isCustomAttribute(n)?n:o.getPossibleStandardName.hasOwnProperty(n)?o.getPossibleStandardName[n]:null;"production"!==t.env.NODE_ENV?a(null==r,"Unknown DOM property %s. Did you mean %s?",e,r):null}};var l={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+i(e)},createMarkupForProperty:function(e,n){if(o.isStandardName.hasOwnProperty(e)&&o.isStandardName[e]){if(r(e,n))return"";var a=o.getAttributeName[e];return o.hasBooleanValue[e]||o.hasOverloadedBooleanValue[e]&&n===!0?a:a+"="+i(n)}return o.isCustomAttribute(e)?null==n?"":e+"="+i(n):("production"!==t.env.NODE_ENV&&c(e),null)},setValueForProperty:function(e,n,i){if(o.isStandardName.hasOwnProperty(n)&&o.isStandardName[n]){var a=o.getMutationMethod[n];if(a)a(e,i);else if(r(n,i))this.deleteValueForProperty(e,n);else if(o.mustUseAttribute[n])e.setAttribute(o.getAttributeName[n],""+i);else{var u=o.getPropertyName[n];o.hasSideEffects[n]&&""+e[u]==""+i||(e[u]=i)}}else o.isCustomAttribute(n)?null==i?e.removeAttribute(n):e.setAttribute(n,""+i):"production"!==t.env.NODE_ENV&&c(n)},deleteValueForProperty:function(e,n){if(o.isStandardName.hasOwnProperty(n)&&o.isStandardName[n]){var r=o.getMutationMethod[n];if(r)r(e,void 0);else if(o.mustUseAttribute[n])e.removeAttribute(o.getAttributeName[n]);else{var i=o.getPropertyName[n],a=o.getDefaultValueForProperty(e.nodeName,i);o.hasSideEffects[n]&&""+e[i]===a||(e[i]=a)}}else o.isCustomAttribute(n)?e.removeAttribute(n):"production"!==t.env.NODE_ENV&&c(n)}};e.exports=l}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){var e=d&&d.traverseTwoPhase&&d.traverseEnterLeave;"production"!==t.env.NODE_ENV?s(e,"InstanceHandle not injected before use!"):s(e)}var o=n(91),i=n(52),a=n(63),u=n(64),s=n(2),c={},l=null,p=function(e){if(e){var t=i.executeDispatch,n=o.getPluginModuleForEvent(e);n&&n.executeDispatch&&(t=n.executeDispatch),i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e)}},d=null,f={injection:{injectMount:i.injection.injectMount,injectInstanceHandle:function(e){d=e,"production"!==t.env.NODE_ENV&&r()},getInstanceHandle:function(){return"production"!==t.env.NODE_ENV&&r(),d},injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:function(e,n,r){"production"!==t.env.NODE_ENV?s(!r||"function"==typeof r,"Expected %s listener to be a function, instead got type %s",n,typeof r):s(!r||"function"==typeof r);var o=c[n]||(c[n]={});o[e]=r},getListener:function(e,t){var n=c[t];return n&&n[e]},deleteListener:function(e,t){var n=c[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in c)delete c[t][e]},extractEvents:function(e,t,n,r){for(var i,u=o.plugins,s=0,c=u.length;c>s;s++){var l=u[s];if(l){var p=l.extractEvents(e,t,n,r);p&&(i=a(i,p))}}return i},enqueueEvents:function(e){e&&(l=a(l,e))},processEventQueue:function(){var e=l;l=null,u(e,p),"production"!==t.env.NODE_ENV?s(!l,"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."):s(!l)},__purge:function(){c={}},__getListenerBank:function(){return c}};e.exports=f}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return v(e,r)}function o(e,n,o){if("production"!==t.env.NODE_ENV&&!e)throw new Error("Dispatching id must not be null");var i=n?m.bubbled:m.captured,a=r(e,o,i);a&&(o._dispatchListeners=f(o._dispatchListeners,a),o._dispatchIDs=f(o._dispatchIDs,e))}function i(e){e&&e.dispatchConfig.phasedRegistrationNames&&d.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,o,e)}function a(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=v(e,r);o&&(n._dispatchListeners=f(n._dispatchListeners,o),n._dispatchIDs=f(n._dispatchIDs,e))}}function u(e){e&&e.dispatchConfig.registrationName&&a(e.dispatchMarker,null,e)}function s(e){h(e,i)}function c(e,t,n,r){d.injection.getInstanceHandle().traverseEnterLeave(n,r,a,e,t)}function l(e){h(e,u)}var p=n(8),d=n(31),f=n(63),h=n(64),m=p.PropagationPhases,v=d.getListener,y={accumulateTwoPhaseDispatches:s,accumulateDirectDispatches:l,accumulateEnterLeaveDispatches:c};e.exports=y}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){if(E.current){var e=E.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e){var t=e&&e.getPublicInstance();if(!t)return void 0;var n=t.constructor;return n?n.displayName||n.name||void 0:void 0}function i(){var e=E.current;return e&&o(e)||void 0}function a(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,s('Each child in an array or iterator should have a unique "key" prop.',e,t))}function u(e,t,n){O.test(e)&&s("Child objects should have non-numeric keys so ordering is preserved.",t,n)}function s(e,n,r){var a=i(),u="string"==typeof r?r:r.displayName||r.name,s=a||u,c=w[e]||(w[e]={});if(!c.hasOwnProperty(s)){c[s]=!0;var l=a?" Check the render method of "+a+".":u?" Check the React.render call using <"+u+">.":"",p="";if(n&&n._owner&&n._owner!==E.current){var d=o(n._owner);p=" It was passed a child from "+d+"."}"production"!==t.env.NODE_ENV?C(!1,e+"%s%s See https://fb.me/react-warning-keys for more information.",l,p):null}}function c(e,t){if(Array.isArray(e))for(var n=0;n");var s="";i&&(s=" The element was created by "+i+"."),"production"!==t.env.NODE_ENV?C(!1,"Don't set .props.%s of the React component%s. Instead, specify the correct value when initially creating the element or use React.cloneElement to make a new element with updated props.%s",e,u,s):null}}function d(e,t){return e!==e?t!==t:0===e&&0===t?1/e===1/t:e===t}function f(e){if(e._store){var t=e._store.originalProps,n=e.props;for(var r in n)n.hasOwnProperty(r)&&(t.hasOwnProperty(r)&&d(t[r],n[r])||(p(r,e),t[r]=n[r]))}}function h(e){if(null!=e.type){var n=b.getComponentClassForElement(e),r=n.displayName||n.name;n.propTypes&&l(r,n.propTypes,e.props,y.prop),"function"==typeof n.getDefaultProps&&("production"!==t.env.NODE_ENV?C(n.getDefaultProps.isReactClassApproved,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."):null)}}var m=n(5),v=n(39),y=n(61),g=n(41),E=n(16),b=n(40),_=n(106),N=n(2),C=n(4),w={},D={},O=/^\d+$/,x={},R={checkAndWarnForMutatedProps:f,createElement:function(e,n,r){"production"!==t.env.NODE_ENV?C(null!=e,"React.createElement: type should not be null or undefined. It should be a string (for DOM elements) or a ReactClass (for composite components)."):null;var o=m.createElement.apply(this,arguments);if(null==o)return o;for(var i=2;i":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;e.exports=o},function(e,t,n){(function(e,r){function o(e,t){this._id=e,this._clearFn=t}var i=n(1).nextTick,a=Function.prototype.apply,u=Array.prototype.slice,s={},c=0;t.setTimeout=function(){return new o(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new o(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:u.call(arguments,1);return s[n]=!0,i(function(){s[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(t,n(46).setImmediate,n(46).clearImmediate)},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(n){r(this,t);var o=new e(n);return o.__proto__=t.prototype,o.name=o.constructor.name,o.message=n,Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace(o,o.constructor):o.stack=(new Error).stack,o}return o(t,e),t}(Error);t["default"]=i,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=n(76),i=r(o),a=n(130),u=r(a),s=n(47),c=r(s);e.exports.Container=i["default"],e.exports.Error=c["default"],e.exports.Resolver=u["default"]},function(e,t,n){"use strict";function r(e){if(!(e in p)){var t=[],n=e.replace(u,function(e,n){return n?(t.push(n),"([^/?#]+)"):"*"===e?(t.push("splat"),"(.*?)"):"\\"+e});p[e]={matcher:new RegExp("^"+n+"$","i"),paramNames:t}}return p[e]}var o=n(2),i=n(144),a=n(145),u=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g,s=/:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g,c=/\/\/\?|\/\?\/|\/\?/g,l=/\?(.*)$/,p={},d={ +isAbsolute:function(e){return"/"===e.charAt(0)},join:function(e,t){return e.replace(/\/*$/,"/")+t},extractParamNames:function(e){return r(e).paramNames},extractParams:function(e,t){var n=r(e),o=n.matcher,i=n.paramNames,a=t.match(o);if(!a)return null;var u={};return i.forEach(function(e,t){u[e]=a[t+1]}),u},injectParams:function(e,t){t=t||{};var n=0;return e.replace(s,function(r,i){if(i=i||"splat","?"===i.slice(-1)){if(i=i.slice(0,-1),null==t[i])return""}else o(null!=t[i],'Missing "%s" parameter for path "%s"',i,e);var a;return"splat"===i&&Array.isArray(t[i])?(a=t[i][n++],o(null!=a,'Missing splat # %s for path "%s"',n,e)):a=t[i],a}).replace(c,"/")},extractQuery:function(e){var t=e.match(l);return t&&a.parse(t[1])},withoutQuery:function(e){return e.replace(l,"")},withQuery:function(e,t){var n=d.extractQuery(e);n&&(t=t?i(n,t):n);var r=a.stringify(t,{arrayFormat:"brackets"});return r?d.withoutQuery(e)+"?"+r:d.withoutQuery(e)}};e.exports=d},function(e,t,n){"use strict";function r(e){var t={path:c.getCurrentPath(),type:e};u.forEach(function(e){e.call(c,t)})}function o(e){void 0!==e.state&&r(i.POP)}var i=n(29),a=n(23),u=[],s=!1,c={addChangeListener:function(e){u.push(e),s||(window.addEventListener?window.addEventListener("popstate",o,!1):window.attachEvent("onpopstate",o),s=!0)},removeChangeListener:function(e){u=u.filter(function(t){return t!==e}),0===u.length&&(window.addEventListener?window.removeEventListener("popstate",o,!1):window.removeEvent("onpopstate",o),s=!1)},push:function(e){window.history.pushState({path:e},"",e),a.length+=1,r(i.PUSH)},replace:function(e){window.history.replaceState({path:e},"",e),r(i.REPLACE)},pop:a.back,getCurrentPath:function(){return decodeURI(window.location.pathname+window.location.search)},toString:function(){return""}};e.exports=c},function(e,t,n){(function(t){"use strict";function r(){this._callbacks=null,this._contexts=null}var o=n(14),i=n(3),a=n(2);i(r.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,n=this._contexts;if(e){"production"!==t.env.NODE_ENV?a(e.length===n.length,"Mismatched list of contexts in callback queue"):a(e.length===n.length),this._callbacks=null,this._contexts=null;for(var r=0,o=e.length;o>r;r++)e[r].call(n[r]);e.length=0,n.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),o.addPoolingTo(r),e.exports=r}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e){return e===y.topMouseUp||e===y.topTouchEnd||e===y.topTouchCancel}function o(e){return e===y.topMouseMove||e===y.topTouchMove}function i(e){return e===y.topMouseDown||e===y.topTouchStart}function a(e,n){var r=e._dispatchListeners,o=e._dispatchIDs;if("production"!==t.env.NODE_ENV&&f(e),Array.isArray(r))for(var i=0;i";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,n)+o},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(C.hasOwnProperty(r))o(this._rootNodeID,r,i,e);else{r===D&&(i&&(i=this._previousStyleCopy=m({},t.style)),i=u.createMarkupForStyles(i));var a=c.createMarkupForProperty(r,i);a&&(n+=" "+a)}}if(e.renderToStaticMarkup)return n+">";var s=c.createMarkupForID(this._rootNodeID);return n+" "+s+">"},_createContentMarkup:function(e,t){var n="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(n="\n");var r=this._currentElement.props,o=r.dangerouslySetInnerHTML;if(null!=o){if(null!=o.__html)return n+o.__html}else{var i=w[typeof r.children]?r.children:null,a=null!=i?null:r.children;if(null!=i)return n+v(i);if(null!=a){var u=this.mountChildren(a,e,t);return n+u.join("")}}return n},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,o){r(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,o)},_updateDOMProperties:function(e,t){var n,r,i,a=this._currentElement.props;for(n in e)if(!a.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===D){var u=this._previousStyleCopy;for(r in u)u.hasOwnProperty(r)&&(i=i||{},i[r]="");this._previousStyleCopy=null}else C.hasOwnProperty(n)?_(this._rootNodeID,n):(s.isStandardName[n]||s.isCustomAttribute(n))&&x.deletePropertyByID(this._rootNodeID,n);for(n in a){var c=a[n],l=n===D?this._previousStyleCopy:e[n];if(a.hasOwnProperty(n)&&c!==l)if(n===D)if(c?c=this._previousStyleCopy=m({},c):this._previousStyleCopy=null,l){for(r in l)!l.hasOwnProperty(r)||c&&c.hasOwnProperty(r)||(i=i||{},i[r]="");for(r in c)c.hasOwnProperty(r)&&l[r]!==c[r]&&(i=i||{},i[r]=c[r])}else i=c;else C.hasOwnProperty(n)?o(this._rootNodeID,n,c,t):(s.isStandardName[n]||s.isCustomAttribute(n))&&x.updatePropertyByID(this._rootNodeID,n,c)}i&&x.updateStylesByID(this._rootNodeID,i)},_updateDOMChildren:function(e,t,n){var r=this._currentElement.props,o=w[typeof e.children]?e.children:null,i=w[typeof r.children]?r.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,u=r.dangerouslySetInnerHTML&&r.dangerouslySetInnerHTML.__html,s=null!=o?null:e.children,c=null!=i?null:r.children,l=null!=o||null!=a,p=null!=i||null!=u;null!=s&&null==c?this.updateChildren(null,t,n):l&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=u?a!==u&&x.updateInnerHTMLByID(this._rootNodeID,u):null!=c&&this.updateChildren(c,t,n)},unmountComponent:function(){this.unmountChildren(),l.deleteAllListeners(this._rootNodeID),p.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},h.measureMethods(a,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),m(a.prototype,a.Mixin,f.Mixin),a.injection={injectIDOperations:function(e){a.BackendIDOperations=x=e}},e.exports=a}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e){l[e]=!0}function o(e){delete l[e]}function i(e){return!!l[e]}var a,u=n(5),s=n(27),c=n(2),l={},p={injectEmptyComponent:function(e){a=u.createFactory(e)}},d=function(){};d.prototype.componentDidMount=function(){var e=s.get(this);e&&r(e._rootNodeID)},d.prototype.componentWillUnmount=function(){var e=s.get(this);e&&o(e._rootNodeID)},d.prototype.render=function(){return"production"!==t.env.NODE_ENV?c(a,"Trying to return null from a render, but no null placeholder component was injected."):c(a),a()};var f=u.createElement(d),h={emptyElement:f,injection:p,isNullComponentID:i};e.exports=h}).call(t,n(1))},function(e,t,n){"use strict";var r={currentlyMountingInstance:null,currentlyUnmountingInstance:null};e.exports=r},function(e,t,n){"use strict";var r=n(35),o=r({prop:null,context:null,childContext:null});e.exports=o},function(e,t,n){(function(t){"use strict";function r(e){e!==i.currentlyMountingInstance&&c.enqueueUpdate(e)}function o(e,n){"production"!==t.env.NODE_ENV?p(null==a.current,"%s(...): Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.",n):p(null==a.current);var r=s.get(e);return r?r===i.currentlyUnmountingInstance?null:r:("production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?d(!n,"%s(...): Can only update a mounted or mounting component. This usually means you called %s() on an unmounted component. This is a no-op.",n,n):null),null)}var i=n(60),a=n(16),u=n(5),s=n(27),c=n(11),l=n(3),p=n(2),d=n(4),f={enqueueCallback:function(e,n){"production"!==t.env.NODE_ENV?p("function"==typeof n,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):p("function"==typeof n);var a=o(e);return a&&a!==i.currentlyMountingInstance?(a._pendingCallbacks?a._pendingCallbacks.push(n):a._pendingCallbacks=[n],void r(a)):null},enqueueCallbackInternal:function(e,n){"production"!==t.env.NODE_ENV?p("function"==typeof n,"enqueueCallback(...): You called `setProps`, `replaceProps`, `setState`, `replaceState`, or `forceUpdate` with a callback that isn't callable."):p("function"==typeof n),e._pendingCallbacks?e._pendingCallbacks.push(n):e._pendingCallbacks=[n],r(e)},enqueueForceUpdate:function(e){var t=o(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t){var n=o(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,r(n))},enqueueSetState:function(e,t){var n=o(e,"setState");if(n){var i=n._pendingStateQueue||(n._pendingStateQueue=[]);i.push(t),r(n)}},enqueueSetProps:function(e,n){var i=o(e,"setProps");if(i){"production"!==t.env.NODE_ENV?p(i._isTopLevel,"setProps(...): You called `setProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):p(i._isTopLevel);var a=i._pendingElement||i._currentElement,s=l({},a.props,n);i._pendingElement=u.cloneAndReplaceProps(a,s),r(i)}},enqueueReplaceProps:function(e,n){var i=o(e,"replaceProps");if(i){"production"!==t.env.NODE_ENV?p(i._isTopLevel,"replaceProps(...): You called `replaceProps` on a component with a parent. This is an anti-pattern since props will get reactively updated when rendered. Instead, change the owner's `render` method to pass the correct value as props to the component where it is created."):p(i._isTopLevel);var a=i._pendingElement||i._currentElement;i._pendingElement=u.cloneAndReplaceProps(a,n),r(i)}},enqueueElementInternal:function(e,t){e._pendingElement=t,r(e)}};e.exports=f}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,n){if("production"!==t.env.NODE_ENV?o(null!=n,"accumulateInto(...): Accumulated items must not be null or undefined."):o(null!=n),null==e)return n;var r=Array.isArray(e),i=Array.isArray(n);return r&&i?(e.push.apply(e,n),e):r?(e.push(n),e):i?[e].concat(n):[e,n]}var o=n(2);e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";var r=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=r},function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return r?!!n[r]:!1}function o(e){return r}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=o},function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e,n){var o;if((null===e||e===!1)&&(e=a.emptyElement),"object"==typeof e){var i=e;"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?l(i&&("function"==typeof i.type||"string"==typeof i.type),"Only functions or strings can be mounted as React components."):null),o=n===i.type&&"string"==typeof i.type?u.createInternalComponent(i):r(i.type)?new i.type(i):new p}else"string"==typeof e||"number"==typeof e?o=u.createInstanceForText(e):"production"!==t.env.NODE_ENV?c(!1,"Encountered invalid React node of type %s",typeof e):c(!1);return"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?l("function"==typeof o.construct&&"function"==typeof o.mountComponent&&"function"==typeof o.receiveComponent&&"function"==typeof o.unmountComponent,"Only React Components can be mounted."):null),o.construct(e),o._mountIndex=0,o._mountImage=null,"production"!==t.env.NODE_ENV&&(o._isOwnerNecessary=!1,o._warnedAboutRefsInRender=!1),"production"!==t.env.NODE_ENV&&Object.preventExtensions&&Object.preventExtensions(o),o}var i=n(163),a=n(59),u=n(40),s=n(3),c=n(2),l=n(4),p=function(){};s(p.prototype,i.Mixin,{_instantiateReactComponent:o}),e.exports=o}).call(t,n(1))},function(e,t,n){"use strict";/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, @@ -15,21 +14,20 @@ this.childRoutes||(this.childRoutes=[]),this.childRoutes.push(t)}},toString:{val * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ -function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(6);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e,t,n){"use strict";var r=n(6),o=/^[ \r\n\t\f]/,i=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(a=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&i.test(t)){e.innerHTML="\ufeff"+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=a},function(e,t,n){(function(t){"use strict";function r(e,n){if(null!=e&&null!=n){var r=typeof e,i=typeof n;if("string"===r||"number"===r)return"string"===i||"number"===i;if("object"===i&&e.type===n.type&&e.key===n.key){var a=e._owner===n._owner,s=null,u=null,c=null;return"production"!==t.env.NODE_ENV&&(a||(null!=e._owner&&null!=e._owner.getPublicInstance()&&null!=e._owner.getPublicInstance().constructor&&(s=e._owner.getPublicInstance().constructor.displayName),null!=n._owner&&null!=n._owner.getPublicInstance()&&null!=n._owner.getPublicInstance().constructor&&(u=n._owner.getPublicInstance().constructor.displayName),null!=n.type&&null!=n.type.displayName&&(c=n.type.displayName),null!=n.type&&"string"==typeof n.type&&(c=n.type),("string"!=typeof n.type||"input"===n.type||"textarea"===n.type)&&(null!=e._owner&&e._owner._isOwnerNecessary===!1||null!=n._owner&&n._owner._isOwnerNecessary===!1)&&(null!=e._owner&&(e._owner._isOwnerNecessary=!0),null!=n._owner&&(n._owner._isOwnerNecessary=!0),"production"!==t.env.NODE_ENV?o(!1,"<%s /> is being rendered by both %s and %s using the same key (%s) in the same place. Currently, this means that they don't preserve state. This behavior should be very rare so we're considering deprecating it. Please contact the React team and explain your use case so that we can take that into consideration.",c||"Unknown Component",s||"[Unknown]",u||"[Unknown]",e.key):null))),a}}return!1}var o=n(4);e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";var r=n(72),o=n(14),i=n(122),a=n(123),s=n(125),u=n(127),c=n(128);e.exports=function(e,t,n){var l=u(n.data,n.headers,n.transformRequest),p=o.merge(r.headers.common,r.headers[n.method]||{},n.headers||{});o.isFormData(l)&&delete p["Content-Type"];var d=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");d.open(n.method.toUpperCase(),i(n.url,n.params),!0),d.onreadystatechange=function(){if(d&&4===d.readyState){var r=s(d.getAllResponseHeaders()),o=-1!==["text",""].indexOf(n.responseType||"")?d.responseText:d.response,i={data:u(o,r,n.transformResponse),status:d.status,statusText:d.statusText,headers:r,config:n};(d.status>=200&&d.status<300?e:t)(i),d=null}};var f=c(n.url)?a.read(n.xsrfCookieName||r.xsrfCookieName):void 0;if(f&&(p[n.xsrfHeaderName||r.xsrfHeaderName]=f),o.forEach(p,function(e,t){l||"content-type"!==t.toLowerCase()?d.setRequestHeader(t,e):delete p[t]}),n.withCredentials&&(d.withCredentials=!0),n.responseType)try{d.responseType=n.responseType}catch(h){if("json"!==d.responseType)throw h}o.isArrayBuffer(l)&&(l=new DataView(l)),d.send(l)}},function(e,t,n){"use strict";var r=n(14),o=/^\)\]\}',?\n/,i={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return r.isFormData(e)?e:r.isArrayBuffer(e)?e:r.isArrayBufferView(e)?e.buffer:!r.isObject(e)||r.isFile(e)||r.isBlob(e)?e:(!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]="application/json;charset=utf-8"),JSON.stringify(e))}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(o,"");try{e=JSON.parse(e)}catch(t){}}return e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(i),post:r.merge(i),put:r.merge(i)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e,t,n){var r;(function(e,o,i){/*! +function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(6);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e,t,n){"use strict";var r=n(6),o=/^[ \r\n\t\f]/,i=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(a=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var u=document.createElement("div");u.innerHTML=" ",""===u.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&i.test(t)){e.innerHTML="\ufeff"+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=a},function(e,t,n){(function(t){"use strict";function r(e,n){if(null!=e&&null!=n){var r=typeof e,i=typeof n;if("string"===r||"number"===r)return"string"===i||"number"===i;if("object"===i&&e.type===n.type&&e.key===n.key){var a=e._owner===n._owner,u=null,s=null,c=null;return"production"!==t.env.NODE_ENV&&(a||(null!=e._owner&&null!=e._owner.getPublicInstance()&&null!=e._owner.getPublicInstance().constructor&&(u=e._owner.getPublicInstance().constructor.displayName),null!=n._owner&&null!=n._owner.getPublicInstance()&&null!=n._owner.getPublicInstance().constructor&&(s=n._owner.getPublicInstance().constructor.displayName),null!=n.type&&null!=n.type.displayName&&(c=n.type.displayName),null!=n.type&&"string"==typeof n.type&&(c=n.type),("string"!=typeof n.type||"input"===n.type||"textarea"===n.type)&&(null!=e._owner&&e._owner._isOwnerNecessary===!1||null!=n._owner&&n._owner._isOwnerNecessary===!1)&&(null!=e._owner&&(e._owner._isOwnerNecessary=!0),null!=n._owner&&(n._owner._isOwnerNecessary=!0),"production"!==t.env.NODE_ENV?o(!1,"<%s /> is being rendered by both %s and %s using the same key (%s) in the same place. Currently, this means that they don't preserve state. This behavior should be very rare so we're considering deprecating it. Please contact the React team and explain your use case so that we can take that into consideration.",c||"Unknown Component",u||"[Unknown]",s||"[Unknown]",e.key):null))),a}}return!1}var o=n(4);e.exports=r}).call(t,n(1))},function(e,t,n){e.exports=n(112)},function(e,t,n){"use strict";var r=n(74),o=n(12),i=n(115),a=n(116),u=n(118),s=n(120),c=n(121);e.exports=function(e,t,n){var l=s(n.data,n.headers,n.transformRequest),p=o.merge(r.headers.common,r.headers[n.method]||{},n.headers||{});o.isFormData(l)&&delete p["Content-Type"];var d=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP");d.open(n.method.toUpperCase(),i(n.url,n.params),!0),d.onreadystatechange=function(){if(d&&4===d.readyState){var r=u(d.getAllResponseHeaders()),o=-1!==["text",""].indexOf(n.responseType||"")?d.responseText:d.response,i={data:s(o,r,n.transformResponse),status:d.status,statusText:d.statusText,headers:r,config:n};(d.status>=200&&d.status<300?e:t)(i),d=null}};var f=c(n.url)?a.read(n.xsrfCookieName||r.xsrfCookieName):void 0;if(f&&(p[n.xsrfHeaderName||r.xsrfHeaderName]=f),o.forEach(p,function(e,t){l||"content-type"!==t.toLowerCase()?d.setRequestHeader(t,e):delete p[t]}),n.withCredentials&&(d.withCredentials=!0),n.responseType)try{d.responseType=n.responseType}catch(h){if("json"!==d.responseType)throw h}o.isArrayBuffer(l)&&(l=new DataView(l)),d.send(l)}},function(e,t,n){"use strict";var r=n(12),o=/^\)\]\}',?\n/,i={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return r.isFormData(e)?e:r.isArrayBuffer(e)?e:r.isArrayBufferView(e)?e.buffer:!r.isObject(e)||r.isFile(e)||r.isBlob(e)?e:(!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]="application/json;charset=utf-8"),JSON.stringify(e))}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(o,"");try{e=JSON.parse(e)}catch(t){}}return e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(i),post:r.merge(i),put:r.merge(i)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e,t,n){var r;(function(e,o,i,a){/*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE - * @version 2.0.1 + * @version 2.1.1 */ -(function(){"use strict";function a(e){return"function"==typeof e||"object"==typeof e&&null!==e}function s(e){return"function"==typeof e}function u(e){return"object"==typeof e&&null!==e}function c(){}function l(){return function(){e.nextTick(h)}}function p(){var e=0,t=new H(h),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function d(){var e=new MessageChannel;return e.port1.onmessage=h,function(){e.port2.postMessage(0)}}function f(){return function(){setTimeout(h,1)}}function h(){for(var e=0;F>e;e+=2){var t=K[e],n=K[e+1];t(n),K[e]=void 0,K[e+1]=void 0}F=0}function m(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function g(e){try{return e.then}catch(t){return G.error=t,G}}function E(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function b(e,t,n){B(function(e){var r=!1,o=E(n,t,function(n){r||(r=!0,t!==n?C(e,n):D(e,n))},function(t){r||(r=!0,O(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,O(e,o))},e)}function _(e,t){t._state===z?D(e,t._result):e._state===Q?O(e,t._result):x(t,void 0,function(t){C(e,t)},function(t){O(e,t)})}function N(e,t){if(t.constructor===e.constructor)_(e,t);else{var n=g(t);n===G?O(e,G.error):void 0===n?D(e,t):s(n)?b(e,t,n):D(e,t)}}function C(e,t){e===t?O(e,v()):a(t)?N(e,t):D(e,t)}function w(e){e._onerror&&e._onerror(e._result),R(e)}function D(e,t){e._state===Y&&(e._result=t,e._state=z,0===e._subscribers.length||B(R,e))}function O(e,t){e._state===Y&&(e._state=Q,e._result=t,B(w,e))}function x(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+z]=n,o[i+Q]=r,0===i&&e._state&&B(R,e)}function R(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,i=e._result,a=0;a1)throw new Error("Second argument not supported");if("object"!=typeof e)throw new TypeError("Argument must be an object");return c.prototype=e,new c},0),B=function(e,t){K[F]=e,K[F+1]=t,F+=2,2===F&&j()},W="undefined"!=typeof window?window:{},H=W.MutationObserver||W.WebKitMutationObserver,q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,K=new Array(1e3);j="undefined"!=typeof e&&"[object process]"==={}.toString.call(e)?l():H?p():q?d():f();var Y=void 0,z=1,Q=2,G=new T,X=new T;S.prototype._validateInput=function(e){return U(e)},S.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},S.prototype._init=function(){this._result=new Array(this.length)};var $=S;S.prototype._enumerate=function(){for(var e=this.length,t=this.promise,n=this._input,r=0;t._state===Y&&e>r;r++)this._eachEntry(n[r],r)},S.prototype._eachEntry=function(e,t){var n=this._instanceConstructor;u(e)?e.constructor===n&&e._state!==Y?(e._onerror=null,this._settledAt(e._state,t,e._result)):this._willSettleAt(n.resolve(e),t):(this._remaining--,this._result[t]=this._makeResult(z,t,e))},S.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===Y&&(this._remaining--,this._abortOnReject&&e===Q?O(r,n):this._result[t]=this._makeResult(e,t,n)),0===this._remaining&&D(r,this._result)},S.prototype._makeResult=function(e,t,n){return n},S.prototype._willSettleAt=function(e,t){var n=this;x(e,void 0,function(e){n._settledAt(z,t,e)},function(e){n._settledAt(Q,t,e)})};var J=function(e,t){return new $(this,e,!0,t).promise},Z=function(e,t){function n(e){C(i,e)}function r(e){O(i,e)}var o=this,i=new o(m,t);if(!U(e))return O(i,new TypeError("You must pass an array to race.")),i;for(var a=e.length,s=0;i._state===Y&&a>s;s++)x(o.resolve(e[s]),void 0,n,r);return i},ee=function(e,t){var n=this;if(e&&"object"==typeof e&&e.constructor===n)return e;var r=new n(m,t);return C(r,e),r},te=function(e,t){var n=this,r=new n(m,t);return O(r,e),r},ne=0,re=V;V.all=J,V.race=Z,V.resolve=ee,V.reject=te,V.prototype={constructor:V,then:function(e,t){var n=this,r=n._state;if(r===z&&!e||r===Q&&!t)return this;var o=new this.constructor(m),i=n._result;if(r){var a=arguments[r-1];B(function(){M(r,o,a,i)})}else x(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var oe=function(){var e;e="undefined"!=typeof o?o:"undefined"!=typeof window&&window.document?window:self;var t="Promise"in e&&"resolve"in e.Promise&&"reject"in e.Promise&&"all"in e.Promise&&"race"in e.Promise&&function(){var t;return new e.Promise(function(e){t=e}),s(t)}();t||(e.Promise=re)},ie={Promise:re,polyfill:oe};n(240).amd?(r=function(){return ie}.call(t,n,t,i),!(void 0!==r&&(i.exports=r))):"undefined"!=typeof i&&i.exports?i.exports=ie:"undefined"!=typeof this&&(this.ES6Promise=ie)}).call(this)}).call(t,n(1),function(){return this}(),n(241)(e))},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;n?)");return e}},{key:"shouldComponentUpdate",value:function(e,t){return t.fulfilled}},{key:"render",value:function(){if(!this.state.fulfilled)return!1;if(this.props.component)return c["default"].createElement(this.props.component,this.state.values);if(this.props.element)return f(this.props.element);if(this.props.children)return 1===d.count(this.props.children)?f(d.only(this.props.children)):c["default"].createElement("span",null,d.map(this.props.children,f));throw new p["default"](" requires one of the following props to render: `element`, `component`, or `children`")}}]),t}(c["default"].Component);h.childContextTypes={parent:c["default"].PropTypes.instanceOf(h),resolver:c["default"].PropTypes.object.isRequired},h.contextTypes={parent:c["default"].PropTypes.instanceOf(h),resolver:c["default"].PropTypes.object},h.displayName="ResolverContainer",h.propTypes={component:c["default"].PropTypes.any,element:c["default"].PropTypes.element,resolve:c["default"].PropTypes.object,resolver:c["default"].PropTypes.object},t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=n(74),i=r(o),a=n(136),s=r(a),u=n(47),c=r(u);e.exports.Container=i["default"],e.exports.Error=c["default"],e.exports.Resolver=s["default"]},function(e,t,n){"use strict";function r(){}e.exports=r},function(e,t,n){"use strict";function r(e,t,n){this.to=e,this.params=t,this.query=n}e.exports=r},function(e,t,n){"use strict";var r=n(32),o={updateScrollPosition:function(e,t){switch(t){case r.PUSH:case r.REPLACE:window.scrollTo(0,0);break;case r.POP:e?window.scrollTo(e.x,e.y):window.scrollTo(0,0)}}};e.exports=o},function(e,t,n){"use strict";var r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(15),a=n(38),s=n(37),u=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return r(t,e),t}(s);u.propTypes={name:i.string,path:i.falsy,children:i.falsy,handler:i.func.isRequired},u.defaultProps={handler:a},e.exports=u},function(e,t,n){"use strict";var r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(15),a=n(38),s=n(37),u=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return r(t,e),t}(s);u.propTypes={name:i.string,path:i.falsy,children:i.falsy,handler:i.func.isRequired},u.defaultProps={handler:a},e.exports=u},function(e,t,n){"use strict";var r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(15),a=n(37),s=function(e){function t(){o(this,t),null!=e&&e.apply(this,arguments)}return r(t,e),t}(a);s.propTypes={path:i.string,from:i.string,to:i.string,handler:i.falsy},s.defaultProps={},e.exports=s},function(e,t,n){(function(t){"use strict";function r(e,t){for(var n in t)if(t.hasOwnProperty(n)&&e[n]!==t[n])return!1;return!0}function o(e,t,n,o,i,a){return e.some(function(e){if(e!==t)return!1;for(var s,u=t.paramNames,c=0,l=u.length;l>c;++c)if(s=u[c],o[s]!==n[s])return!1;return r(i,a)&&r(a,i)})}function i(e,t){for(var n,r=0,o=e.length;o>r;++r)n=e[r],n.name&&(d(null==t[n.name],'You may not have more than one route named "%s"',n.name),t[n.name]=n),n.childRoutes&&i(n.childRoutes,t)}function a(e,t){return e.some(function(e){return e.name===t})}function s(e,t){for(var n in t)if(String(e[n])!==String(t[n]))return!1;return!0}function u(e,t){for(var n in t)if(String(e[n])!==String(t[n]))return!1;return!0}function c(e){e=e||{},N(e)&&(e={routes:e});var n=[],r=e.location||I,c=e.scrollBehavior||S,m={},k={},A=null,V=null;"string"==typeof r&&(r=new E(r)),r instanceof E?p(!f||"test"===t.env.NODE_ENV,"You should not use a static location in a DOM environment because the router will not be kept in sync with the current URL"):d(f||r.needsDOM===!1,"You cannot use %s without a DOM",r),r!==y||P()||(r=g);var L=l.createClass({displayName:"Router",statics:{isRunning:!1,cancelPendingTransition:function(){A&&(A.cancel(),A=null)},clearAllRoutes:function(){L.cancelPendingTransition(),L.namedRoutes={},L.routes=[]},addRoutes:function(e){N(e)&&(e=_(e)),i(e,L.namedRoutes),L.routes.push.apply(L.routes,e)},replaceRoutes:function(e){L.clearAllRoutes(),L.addRoutes(e),L.refresh()},match:function(e){return R.findMatch(L.routes,e)},makePath:function(e,t,n){var r;if(M.isAbsolute(e))r=e;else{var o=e instanceof T?e:L.namedRoutes[e];d(o instanceof T,'Cannot find a route named "%s"',e),r=o.path}return M.withQuery(M.injectParams(r,t),n)},makeHref:function(e,t,n){var o=L.makePath(e,t,n);return r===v?"#"+o:o},transitionTo:function(e,t,n){var o=L.makePath(e,t,n);A?r.replace(o):r.push(o)},replaceWith:function(e,t,n){r.replace(L.makePath(e,t,n))},goBack:function(){return O.length>1||r===g?(r.pop(),!0):(p(!1,"goBack() was ignored because there is no router history"),!1)},handleAbort:e.onAbort||function(e){if(r instanceof E)throw new Error("Unhandled aborted transition! Reason: "+e);e instanceof x||(e instanceof D?r.replace(L.makePath(e.to,e.params,e.query)):r.pop())},handleError:e.onError||function(e){throw e},handleLocationChange:function(e){L.dispatch(e.path,e.type)},dispatch:function(e,t){L.cancelPendingTransition();var r=m.path,i=null==t;if(r!==e||i){r&&t===h.PUSH&&L.recordScrollPosition(r);var a=L.match(e);p(null!=a,'No route matches path "%s". Make sure you have somewhere in your routes',e,e),null==a&&(a={});var s,u,c=m.routes||[],l=m.params||{},d=m.query||{},f=a.routes||[],v=a.params||{},y=a.query||{};c.length?(s=c.filter(function(e){return!o(f,e,l,v,d,y)}),u=f.filter(function(e){return!o(c,e,l,v,d,y)})):(s=[],u=f);var g=new C(e,L.replaceWith.bind(L,e));A=g;var E=n.slice(c.length-s.length);C.from(g,s,E,function(n){return n||g.abortReason?V.call(L,n,g):void C.to(g,u,v,y,function(n){V.call(L,n,g,{path:e,action:t,pathname:a.pathname,routes:f,params:v,query:y})})})}},run:function(e){d(!L.isRunning,"Router is already running"),V=function(t,n,r){t&&L.handleError(t),A===n&&(A=null,n.abortReason?L.handleAbort(n.abortReason):e.call(L,L,k=r))},r instanceof E||(r.addChangeListener&&r.addChangeListener(L.handleLocationChange),L.isRunning=!0),L.refresh()},refresh:function(){L.dispatch(r.getCurrentPath(),null)},stop:function(){L.cancelPendingTransition(),r.removeChangeListener&&r.removeChangeListener(L.handleLocationChange),L.isRunning=!1},getLocation:function(){return r},getScrollBehavior:function(){return c},getRouteAtDepth:function(e){var t=m.routes;return t&&t[e]},setRouteComponentAtDepth:function(e,t){n[e]=t},getCurrentPath:function(){return m.path},getCurrentPathname:function(){return m.pathname},getCurrentParams:function(){return m.params},getCurrentQuery:function(){return m.query},getCurrentRoutes:function(){return m.routes},isActive:function(e,t,n){return M.isAbsolute(e)?e===m.path:a(m.routes,e)&&s(m.params,t)&&(null==n||u(m.query,n))}},mixins:[b],propTypes:{children:w.falsy},childContextTypes:{routeDepth:w.number.isRequired,router:w.router.isRequired},getChildContext:function(){return{routeDepth:1,router:L}},getInitialState:function(){return m=k},componentWillReceiveProps:function(){this.setState(m=k)},componentWillUnmount:function(){L.stop()},render:function(){var e=L.getRouteAtDepth(0);return e?l.createElement(e.handler,this.props):null}});return L.clearAllRoutes(),e.routes&&L.addRoutes(e.routes),L}var l=n(7),p=n(4),d=n(2),f=n(6).canUseDOM,h=n(32),m=n(78),v=n(84),y=n(50),g=n(85),E=n(86),b=n(139),_=n(83),N=n(146),C=n(141),w=n(15),D=n(77),O=n(27),x=n(76),R=n(137),T=n(21),P=n(149),M=n(48),I=f?v:"/",S=f?m:null;e.exports=c}).call(t,n(1))},function(e,t,n){"use strict";function r(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var o=t[r](n,r,e);o instanceof Error&&c(!1,o.message)}}function o(e){var t=u({},e),n=t.handler;return n&&(t.onEnter=n.willTransitionTo,t.onLeave=n.willTransitionFrom),t}function i(e){if(s.isValidElement(e)){var t=e.type,n=u({},t.defaultProps,e.props);return t.propTypes&&r(t.displayName,t.propTypes,n),t===l?f.createDefaultRoute(o(n)):t===p?f.createNotFoundRoute(o(n)):t===d?f.createRedirect(o(n)):f.createRoute(o(n),function(){n.children&&a(n.children)})}}function a(e){var t=[];return s.Children.forEach(e,function(e){(e=i(e))&&t.push(e)}),t}var s=n(7),u=n(3),c=n(4),l=n(79),p=n(80),d=n(81),f=n(21);e.exports=a},function(e,t,n){"use strict";function r(e){e===s.PUSH&&(u.length+=1);var t={path:p.getCurrentPath(),type:e};c.forEach(function(e){e.call(p,t)})}function o(){var e=p.getCurrentPath();return"/"===e.charAt(0)?!0:(p.replace("/"+e),!1)}function i(){if(o()){var e=a;a=null,r(e||s.POP)}}var a,s=n(32),u=n(27),c=[],l=!1,p={addChangeListener:function(e){c.push(e),o(),l||(window.addEventListener?window.addEventListener("hashchange",i,!1):window.attachEvent("onhashchange",i),l=!0)},removeChangeListener:function(e){c=c.filter(function(t){return t!==e}),0===c.length&&(window.removeEventListener?window.removeEventListener("hashchange",i,!1):window.removeEvent("onhashchange",i),l=!1)},push:function(e){a=s.PUSH,window.location.hash=e},replace:function(e){a=s.REPLACE,window.location.replace(window.location.pathname+window.location.search+"#"+e)},pop:function(){a=s.POP,u.back()},getCurrentPath:function(){return decodeURI(window.location.href.split("#")[1]||"")},toString:function(){return""}};e.exports=p},function(e,t,n){"use strict";var r=n(50),o=n(27),i={push:function(e){window.location=e},replace:function(e){window.location.replace(e)},pop:o.back,getCurrentPath:r.getCurrentPath,toString:function(){return""}};e.exports=i},function(e,t,n){"use strict";function r(){a(!1,"You cannot modify a static location")}var o=function(){function e(e,t){for(var n in t){var r=t[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(e,t)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=n(2),s=function(){function e(t){i(this,e),this.path=t}return o(e,{getCurrentPath:{value:function(){return this.path}},toString:{value:function(){return''}}}),e}();s.prototype.push=r,s.prototype.replace=r,s.prototype.pop=r,e.exports=s},function(e,t,n){t.arrayToObject=function(e){for(var t={},n=0,r=e.length;r>n;++n)"undefined"!=typeof e[n]&&(t[n]=e[n]);return t},t.merge=function(e,n){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):e[n]=!0,e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e));for(var r=Object.keys(n),o=0,i=r.length;i>o;++o){var a=r[o],s=n[a];e[a]?e[a]=t.merge(e[a],s):e[a]=s}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],i=0,a=e.length;a>i;++i)"undefined"!=typeof e[i]&&o.push(e[i]);return o}var s=Object.keys(e);for(i=0,a=s.length;a>i;++i){var u=s[i];e[u]=t.compact(e[u],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},i=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){i.forEach(function(t){o[r(t,e)]=o[e]})});var a={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},s={isUnitlessNumber:o,shorthandPropertyExpansions:a};e.exports=s},function(e,t,n){(function(t){"use strict";var r=n(88),o=n(6),i=n(217),a=n(222),s=n(229),u=n(233),c=n(4),l=u(function(e){return s(e)}),p="cssFloat";if(o.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(p="styleFloat"),"production"!==t.env.NODE_ENV)var d=/^(?:webkit|moz|o)[A-Z]/,f=/;\s*$/,h={},m={},v=function(e){h.hasOwnProperty(e)&&h[e]||(h[e]=!0,"production"!==t.env.NODE_ENV?c(!1,"Unsupported style property %s. Did you mean %s?",e,i(e)):null)},y=function(e){h.hasOwnProperty(e)&&h[e]||(h[e]=!0,"production"!==t.env.NODE_ENV?c(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):null)},g=function(e,n){m.hasOwnProperty(n)&&m[n]||(m[n]=!0,"production"!==t.env.NODE_ENV?c(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,n.replace(f,"")):null)},E=function(e,t){e.indexOf("-")>-1?v(e):d.test(e)?y(e):f.test(t)&&g(e,t)};var b={createMarkupForStyles:function(e){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];"production"!==t.env.NODE_ENV&&E(r,o),null!=o&&(n+=l(r)+":",n+=a(r,o)+";")}return n||null},setValueForStyles:function(e,n){var o=e.style;for(var i in n)if(n.hasOwnProperty(i)){"production"!==t.env.NODE_ENV&&E(i,n[i]);var s=a(i,n[i]);if("float"===i&&(i=p),s)o[i]=s;else{var u=r.shorthandPropertyExpansions[i];if(u)for(var c in u)o[c]="";else o[i]=""}}}};e.exports=b}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){if(s)for(var e in u){var n=u[e],r=s.indexOf(e);if("production"!==t.env.NODE_ENV?a(r>-1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):a(r>-1),!c.plugins[r]){"production"!==t.env.NODE_ENV?a(n.extractEvents,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):a(n.extractEvents),c.plugins[r]=n;var i=n.eventTypes;for(var l in i)"production"!==t.env.NODE_ENV?a(o(i[l],n,l),"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",l,e):a(o(i[l],n,l))}}}function o(e,n,r){"production"!==t.env.NODE_ENV?a(!c.eventNameDispatchConfigs.hasOwnProperty(r),"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",r):a(!c.eventNameDispatchConfigs.hasOwnProperty(r)),c.eventNameDispatchConfigs[r]=e;var o=e.phasedRegistrationNames;if(o){for(var s in o)if(o.hasOwnProperty(s)){var u=o[s];i(u,n,r)}return!0}return e.registrationName?(i(e.registrationName,n,r),!0):!1}function i(e,n,r){"production"!==t.env.NODE_ENV?a(!c.registrationNameModules[e],"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):a(!c.registrationNameModules[e]),c.registrationNameModules[e]=n,c.registrationNameDependencies[e]=n.eventTypes[r].dependencies}var a=n(2),s=null,u={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){"production"!==t.env.NODE_ENV?a(!s,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):a(!s),s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var n=!1;for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];u.hasOwnProperty(o)&&u[o]===i||("production"!==t.env.NODE_ENV?a(!u[o],"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",o):a(!u[o]),u[o]=i,n=!0)}n&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=c.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=c}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,t){this.forEachFunction=e,this.forEachContext=t}function o(e,t,n,r){var o=e;o.forEachFunction.call(o.forEachContext,t,r)}function i(e,t,n){if(null==e)return e;var i=r.getPooled(t,n);f(e,o,i),r.release(i)}function a(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function s(e,n,r,o){var i=e,a=i.mapResult,s=!a.hasOwnProperty(r);if("production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?h(s,"ReactChildren.map(...): Encountered two children with the same key, `%s`. Child keys must be unique; when two children share a key, only the first child will be used.",r):null),s){var u=i.mapFunction.call(i.mapContext,n,o);a[r]=u}}function u(e,t,n){if(null==e)return e;var r={},o=a.getPooled(r,t,n);return f(e,s,o),a.release(o),d.create(r)}function c(e,t,n,r){return null}function l(e,t){return f(e,c,null)}var p=n(16),d=n(30),f=n(117),h=n(4),m=p.twoArgumentPooler,v=p.threeArgumentPooler;p.addPoolingTo(r,m),p.addPoolingTo(a,v);var y={forEach:i,map:u,count:l};e.exports=y}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,t){this.props=e,this.context=t}var o=n(61),i=n(2),a=n(4);if(r.prototype.setState=function(e,n){"production"!==t.env.NODE_ENV?i("object"==typeof e||"function"==typeof e||null==e,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."):i("object"==typeof e||"function"==typeof e||null==e),"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?a(null!=e,"setState(...): You passed an undefined or null state object; instead, use forceUpdate()."):null),o.enqueueSetState(this,e),n&&o.enqueueCallback(this,n)},r.prototype.forceUpdate=function(e){o.enqueueForceUpdate(this),e&&o.enqueueCallback(this,e)},"production"!==t.env.NODE_ENV){var s={getDOMNode:"getDOMNode",isMounted:"isMounted",replaceProps:"replaceProps",replaceState:"replaceState",setProps:"setProps"},u=function(e,n){try{Object.defineProperty(r.prototype,e,{get:function(){return void("production"!==t.env.NODE_ENV?a(!1,"%s(...) is deprecated in plain JavaScript React classes.",n):null)}})}catch(o){}};for(var c in s)s.hasOwnProperty(c)&&u(c,s[c])}e.exports=r}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}var o=n(56),i=n(57),a=n(18),s=n(5),u=n(34),c=n(26),l=n(59),p=n(41),d=n(19),f=n(60),h=n(42),m=n(31),v=n(10),y=n(3),g=n(45),E=n(2),b=n(70),_=n(4),N=1,C={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._isTopLevel=!1,this._pendingCallbacks=null},mountComponent:function(e,n,r){this._context=r,this._mountOrder=N++,this._rootNodeID=e;var o=this._processProps(this._currentElement.props),i=this._processContext(this._currentElement._context),a=p.getComponentClassForElement(this._currentElement),s=new a(o,i);"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?_(null!=s.render,"%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render` in your component or you may have accidentally tried to render an element whose type is a function that isn't a React component.",a.displayName||a.name||"Component"):null),s.props=o,s.context=i,s.refs=g,this._instance=s,c.set(s,this),"production"!==t.env.NODE_ENV&&this._warnIfContextsDiffer(this._currentElement._context,r),"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?_(!s.getInitialState||s.getInitialState.isReactClassApproved,"getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",this.getName()||"a component"):null,"production"!==t.env.NODE_ENV?_(!s.propTypes,"propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",this.getName()||"a component"):null,"production"!==t.env.NODE_ENV?_(!s.contextTypes,"contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",this.getName()||"a component"):null,"production"!==t.env.NODE_ENV?_("function"!=typeof s.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",this.getName()||"A component"):null);var u=s.state;void 0===u&&(s.state=u=null),"production"!==t.env.NODE_ENV?E("object"==typeof u&&!Array.isArray(u),"%s.state: must be set to an object or null",this.getName()||"ReactCompositeComponent"):E("object"==typeof u&&!Array.isArray(u)),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var d,f=l.currentlyMountingInstance;l.currentlyMountingInstance=this;try{s.componentWillMount&&(s.componentWillMount(),this._pendingStateQueue&&(s.state=this._processPendingState(s.props,s.context))),d=this._renderValidatedComponent()}finally{l.currentlyMountingInstance=f}this._renderedComponent=this._instantiateReactComponent(d,this._currentElement.type);var h=m.mountComponent(this._renderedComponent,e,n,this._processChildContext(r));return s.componentDidMount&&n.getReactMountReady().enqueue(s.componentDidMount,s),h},unmountComponent:function(){var e=this._instance;if(e.componentWillUnmount){var t=l.currentlyUnmountingInstance;l.currentlyUnmountingInstance=this;try{e.componentWillUnmount()}finally{l.currentlyUnmountingInstance=t}}m.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,c.remove(e)},_setPropsInternal:function(e,t){var n=this._pendingElement||this._currentElement;this._pendingElement=s.cloneAndReplaceProps(n,y({},n.props,e)),v.enqueueUpdate(this,t)},_maskContext:function(e){var t=null;if("string"==typeof this._currentElement.type)return g;var n=this._currentElement.type.contextTypes;if(!n)return g;t={};for(var r in n)t[r]=e[r];return t},_processContext:function(e){var n=this._maskContext(e);if("production"!==t.env.NODE_ENV){var r=p.getComponentClassForElement(this._currentElement);r.contextTypes&&this._checkPropTypes(r.contextTypes,n,f.context)}return n},_processChildContext:function(e){var n=this._instance,r=n.getChildContext&&n.getChildContext();if(r){"production"!==t.env.NODE_ENV?E("object"==typeof n.constructor.childContextTypes,"%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",this.getName()||"ReactCompositeComponent"):E("object"==typeof n.constructor.childContextTypes), -"production"!==t.env.NODE_ENV&&this._checkPropTypes(n.constructor.childContextTypes,r,f.childContext);for(var o in r)"production"!==t.env.NODE_ENV?E(o in n.constructor.childContextTypes,'%s.getChildContext(): key "%s" is not defined in childContextTypes.',this.getName()||"ReactCompositeComponent",o):E(o in n.constructor.childContextTypes);return y({},e,r)}return e},_processProps:function(e){if("production"!==t.env.NODE_ENV){var n=p.getComponentClassForElement(this._currentElement);n.propTypes&&this._checkPropTypes(n.propTypes,e,f.prop)}return e},_checkPropTypes:function(e,n,o){var i=this.getName();for(var a in e)if(e.hasOwnProperty(a)){var s;try{"production"!==t.env.NODE_ENV?E("function"==typeof e[a],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",i||"React class",h[o],a):E("function"==typeof e[a]),s=e[a](n,a,i,o)}catch(u){s=u}if(s instanceof Error){var c=r(this);o===f.prop?"production"!==t.env.NODE_ENV?_(!1,"Failed Composite propType: %s%s",s.message,c):null:"production"!==t.env.NODE_ENV?_(!1,"Failed Context Types: %s%s",s.message,c):null}}},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&m.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&("production"!==t.env.NODE_ENV&&u.checkAndWarnForMutatedProps(this._currentElement),this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context))},_warnIfContextsDiffer:function(e,n){e=this._maskContext(e),n=this._maskContext(n);for(var r=Object.keys(n).sort(),o=this.getName()||"ReactCompositeComponent",i=0;i"+o+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;n!==this._stringText&&(this._stringText=n,i.BackendIDOperations.updateTextContentByID(this._rootNodeID,n))}},unmountComponent:function(){o.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=u},function(e,t,n){"use strict";function r(e){return Math.floor(100*e)/100}function o(e,t,n){e[t]=(e[t]||0)+n}var i=n(22),a=n(185),s=n(11),u=n(19),c=n(235),l={_allMeasurements:[],_mountStack:[0],_injected:!1,start:function(){l._injected||u.injection.injectMeasure(l.measure),l._allMeasurements.length=0,u.enableMeasure=!0},stop:function(){u.enableMeasure=!1},getLastMeasurements:function(){return l._allMeasurements},printExclusive:function(e){e=e||l._allMeasurements;var t=a.getExclusiveSummary(e);console.table(t.map(function(e){return{"Component class name":e.componentName,"Total inclusive time (ms)":r(e.inclusive),"Exclusive mount time (ms)":r(e.exclusive),"Exclusive render time (ms)":r(e.render),"Mount time per instance (ms)":r(e.exclusive/e.count),"Render time per instance (ms)":r(e.render/e.count),Instances:e.count}}))},printInclusive:function(e){e=e||l._allMeasurements;var t=a.getInclusiveSummary(e);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Inclusive time (ms)":r(e.time),Instances:e.count}})),console.log("Total time:",a.getTotalTime(e).toFixed(2)+" ms")},getMeasurementsSummaryMap:function(e){var t=a.getInclusiveSummary(e,!0);return t.map(function(e){return{"Owner > component":e.componentName,"Wasted time (ms)":e.time,Instances:e.count}})},printWasted:function(e){e=e||l._allMeasurements,console.table(l.getMeasurementsSummaryMap(e)),console.log("Total time:",a.getTotalTime(e).toFixed(2)+" ms")},printDOM:function(e){e=e||l._allMeasurements;var t=a.getDOMSummary(e);console.table(t.map(function(e){var t={};return t[i.ID_ATTRIBUTE_NAME]=e.id,t.type=e.type,t.args=JSON.stringify(e.args),t})),console.log("Total time:",a.getTotalTime(e).toFixed(2)+" ms")},_recordWrite:function(e,t,n,r){var o=l._allMeasurements[l._allMeasurements.length-1].writes;o[e]=o[e]||[],o[e].push({type:t,time:n,args:r})},measure:function(e,t,n){return function(){for(var r=[],i=0,a=arguments.length;a>i;i++)r.push(arguments[i]);var u,p,d;if("_renderNewRootComponent"===t||"flushBatchedUpdates"===t)return l._allMeasurements.push({exclusive:{},inclusive:{},render:{},counts:{},writes:{},displayNames:{},totalTime:0}),d=c(),p=n.apply(this,r),l._allMeasurements[l._allMeasurements.length-1].totalTime=c()-d,p;if("_mountImageIntoNode"===t||"ReactDOMIDOperations"===e){if(d=c(),p=n.apply(this,r),u=c()-d,"_mountImageIntoNode"===t){var f=s.getID(r[1]);l._recordWrite(f,t,u,r[0])}else"dangerouslyProcessChildrenUpdates"===t?r[0].forEach(function(e){var t={};null!==e.fromIndex&&(t.fromIndex=e.fromIndex),null!==e.toIndex&&(t.toIndex=e.toIndex),null!==e.textContent&&(t.textContent=e.textContent),null!==e.markupIndex&&(t.markup=r[1][e.markupIndex]),l._recordWrite(e.parentID,e.type,u,t)}):l._recordWrite(r[0],t,u,Array.prototype.slice.call(r,1));return p}if("ReactCompositeComponent"!==e||"mountComponent"!==t&&"updateComponent"!==t&&"_renderValidatedComponent"!==t)return n.apply(this,r);if("string"==typeof this._currentElement.type)return n.apply(this,r);var h="mountComponent"===t?r[0]:this._rootNodeID,m="_renderValidatedComponent"===t,v="mountComponent"===t,y=l._mountStack,g=l._allMeasurements[l._allMeasurements.length-1];if(m?o(g.counts,h,1):v&&y.push(0),d=c(),p=n.apply(this,r),u=c()-d,m)o(g.render,h,u);else if(v){var E=y.pop();y[y.length-1]+=u,o(g.exclusive,h,u-E),o(g.inclusive,h,u)}else o(g.inclusive,h,u);return g.displayNames[h]={current:this.getName(),owner:this._currentElement._owner?this._currentElement._owner.getName():""},p}}};e.exports=l},function(e,t,n){"use strict";function r(e){return i(document.documentElement,e)}var o=n(181),i=n(106),a=n(108),s=n(109),u={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=s();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=s(),n=e.focusedElem,o=e.selectionRange;t!==n&&r(n)&&(u.hasSelectionCapabilities(n)&&u.setSelection(n,o),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=o.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if("undefined"==typeof r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",r-n),i.select()}else o.setOffsets(e,t)}};e.exports=u},function(e,t,n){"use strict";var r=n(215),o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(">"," "+o.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var n=t.getAttribute(o.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var i=r(e);return i===n}};e.exports=o},function(e,t,n){"use strict";var r=n(36),o=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});e.exports=o},function(e,t,n){"use strict";function r(e){function t(t,n,r,o,i){if(o=o||_,null==n[r]){var a=E[i];return t?new Error("Required "+a+" `"+r+"` was not specified in "+("`"+o+"`.")):null}return e(n,r,o,i)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){function t(t,n,r,o){var i=t[n],a=m(i);if(a!==e){var s=E[o],u=v(i);return new Error("Invalid "+s+" `"+n+"` of type `"+u+"` "+("supplied to `"+r+"`, expected `"+e+"`."))}return null}return r(t)}function i(){return r(b.thatReturns(null))}function a(e){function t(t,n,r,o){var i=t[n];if(!Array.isArray(i)){var a=E[o],s=m(i);return new Error("Invalid "+a+" `"+n+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an array."))}for(var u=0;u>",N=s(),C=d(),w={array:o("array"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),any:i(),arrayOf:a,element:N,instanceOf:u,node:C,objectOf:l,oneOf:c,oneOfType:p,shape:f};e.exports=w},function(e,t,n){"use strict";function r(){this.listenersToPut=[]}var o=n(16),i=n(24),a=n(3);a(r.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e":a.innerHTML="<"+e+">",s[e]=!a.firstChild),s[e]?d[e]:null}var o=n(6),i=n(2),a=o.canUseDOM?document.createElement("div"):null,s={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},u=[1,'"],c=[1,"","
"],l=[3,"","
"],p=[1,"",""],d={"*":[1,"?

"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:u,option:u,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:l,th:l,circle:p,defs:p,ellipse:p,g:p,line:p,linearGradient:p,path:p,polygon:p,polyline:p,radialGradient:p,rect:p,stop:p,text:p};e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=n(6),i=null;e.exports=r},function(e,t,n){function r(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&("INPUT"===e.nodeName&&o[e.type]||"TEXTAREA"===e.nodeName)}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){return"production"!==t.env.NODE_ENV?i(o.isValidElement(e),"onlyChild must be passed a children with exactly one child."):i(o.isValidElement(e)),e}var o=n(5),i=n(2);e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){return y[e]}function o(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function i(e){return(""+e).replace(g,r)}function a(e){return"$"+i(e)}function s(e,n,r,i,u){var p=typeof e;if(("undefined"===p||"boolean"===p)&&(e=null),null===e||"string"===p||"number"===p||c.isValidElement(e))return i(u,e,""===n?m+o(e,0):n,r),1;var y,g,b,_=0;if(Array.isArray(e))for(var N=0;N0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(14);e.exports={write:function(e,t,n,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";e.exports=function(e,t,n){try{console.warn("DEPRECATED method `"+e+"`."+(t?" Use `"+t+"` instead.":"")+" This method will be removed in a future release."),n&&console.warn("For more information about usage see "+n)}catch(r){}}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";e.exports=function(e){return function(t){e.apply(null,t)}}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return a&&(s.setAttribute("href",t),t=s.href),s.setAttribute("href",t),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:"/"===s.pathname.charAt(0)?s.pathname:"/"+s.pathname}}var o,i=n(14),a=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a");o=r(window.location.href),e.exports=function(e){var t=i.isString(e)?r(e):e;return t.protocol===o.protocol&&t.host===o.host}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;nt?e.finish():n})}},{key:"freeze",value:function(){this.frozen=!0}},{key:"fulfillState",value:function(e,t){return e.error=void 0,e.fulfilled=!0,e.rejected=!1,t?t(e):e}},{key:"getContainerState",value:function(e){var t=e.id;if(!t)throw new ReferenceError(""+e.constructor.displayName+" should have an ID");var n=this.states.hasOwnProperty(t)?this.states[t]:{fulfilled:!1,rejected:!1,values:{}};return this.states.hasOwnProperty(t)||(this.states[t]=n),n}},{key:"rejectState",value:function(e,t,n){throw t.error=e,t.fulfilled=!1,t.rejected=!0,n&&n(t),new Error(""+this.constructor.displayName+" was rejected: "+e)}},{key:"resolve",value:function(e,t){var n=this,r=e.props.resolve||{},o=this.getContainerState(e),i=Object.keys(r).filter(function(t){return e.props.hasOwnProperty(t)?(o.values[t]=e.props[t],!1):!0}).filter(function(e){return!o.values.hasOwnProperty(e)});if(!i.length)return Promise.resolve(this.fulfillState(o,t));if(this.frozen)throw new f["default"](["Resolver is frozen for server rendering.",""+e.constructor.displayName+" (#"+e.id+") should have already resolved",'"'+i.join('", "')+'". (http://git.io/vvvkr)'].join(" "));var a=i.map(function(t){var n=e.props.resolve[t],r=e.props.hasOwnProperty(t)?e.props[t]:n(e.props);return Promise.resolve(r).then(function(e){return o.values[t]=e,e})});return this.await(a).then(function(){return n.fulfillState(o,t)},function(e){return n.rejectState(e,o,t)})}}],[{key:"createContainer",value:function(e){var t=void 0===arguments[1]?{}:arguments[1];if(!e.hasOwnProperty("displayName"))throw new ReferenceError("Resolver.createContainer requires wrapped component to have `displayName`");var n=function(n){function r(){i(this,r),null!=n&&n.apply(this,arguments)}return o(r,n),a(r,[{key:"render",value:function(){return c["default"].createElement(p["default"],s({component:e},t,this.props))}}]),r}(c["default"].Component);return n.displayName=""+e.displayName+"Container",n}},{key:"render",value:function(t,n){var r=void 0===arguments[2]?new e:arguments[2];return c["default"].render(c["default"].createElement(p["default"],{resolver:r},t),n),r}},{key:"renderToString",value:function(t){var n=new e,r=c["default"].createElement(p["default"],{resolver:n},t);return c["default"].renderToString(r),n.finish().then(function(){return n.freeze(),c["default"].renderToString(r)})}},{key:"renderToStaticMarkup",value:function(t){var n=new e,r=c["default"].createElement(p["default"],{resolver:n},t);return c["default"].renderToStaticMarkup(r),n.finish().then(function(){return n.freeze(),c["default"].renderToStaticMarkup(r)})}}]),e}();t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){var o=e.childRoutes;if(o)for(var i,u,c=0,l=o.length;l>c;++c)if(u=o[c],!u.isDefault&&!u.isNotFound&&(i=r(u,t,n)))return i.routes.unshift(e),i;var p=e.defaultRoute;if(p&&(f=a.extractParams(p.path,t)))return new s(t,f,n,[e,p]);var d=e.notFoundRoute;if(d&&(f=a.extractParams(d.path,t)))return new s(t,f,n,[e,d]);var f=a.extractParams(e.path,t);return f?new s(t,f,n,[e]):null}var o=function(){function e(e,t){for(var n in t){var r=t[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(e,t)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=n(48),s=function(){function e(t,n,r,o){i(this,e),this.pathname=t,this.params=n,this.query=r,this.routes=o}return o(e,null,{findMatch:{value:function(e,t){for(var n=a.withoutQuery(t),o=a.extractQuery(t),i=null,s=0,u=e.length;null==i&&u>s;++s)i=r(e[s],n,o);return i}}}),e}();e.exports=s},function(e,t,n){"use strict";function r(e,t){return function(){return o(!1,"Router.Navigation is deprecated. Please use this.context.router."+e+"() instead"),t.apply(this,arguments)}}var o=n(4),i=n(15),a={contextTypes:{router:i.router.isRequired},makePath:r("makePath",function(e,t,n){return this.context.router.makePath(e,t,n)}),makeHref:r("makeHref",function(e,t,n){return this.context.router.makeHref(e,t,n)}),transitionTo:r("transitionTo",function(e,t,n){this.context.router.transitionTo(e,t,n)}),replaceWith:r("replaceWith",function(e,t,n){this.context.router.replaceWith(e,t,n)}),goBack:r("goBack",function(){return this.context.router.goBack()})};e.exports=a},function(e,t,n){"use strict";function r(e,t){if(!t)return!0;if(e.pathname===t.pathname)return!1;var n=e.routes,r=t.routes,o=n.filter(function(e){return-1!==r.indexOf(e)});return!o.some(function(e){return e.ignoreScrollBehavior})}var o=n(2),i=n(6).canUseDOM,a=n(145),s={statics:{recordScrollPosition:function(e){this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[e]=a()},getScrollPosition:function(e){return this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[e]||null}},componentWillMount:function(){o(null==this.constructor.getScrollBehavior()||i,"Cannot use scroll behavior without a DOM")},componentDidMount:function(){this._updateScroll()},componentDidUpdate:function(e,t){this._updateScroll(t)},_updateScroll:function(e){if(r(this.state,e)){var t=this.constructor.getScrollBehavior();t&&t.updateScrollPosition(this.constructor.getScrollPosition(this.state.path),this.state.action)}}};e.exports=s},function(e,t,n){"use strict";function r(e,t){return function(){return o(!1,"Router.State is deprecated. Please use this.context.router."+e+"() instead"),t.apply(this,arguments)}}var o=n(4),i=n(15),a={contextTypes:{router:i.router.isRequired},getPath:r("getCurrentPath",function(){return this.context.router.getCurrentPath()}),getPathname:r("getCurrentPathname",function(){return this.context.router.getCurrentPathname()}),getParams:r("getCurrentParams",function(){return this.context.router.getCurrentParams()}),getQuery:r("getCurrentQuery",function(){return this.context.router.getCurrentQuery()}),getRoutes:r("getCurrentRoutes",function(){return this.context.router.getCurrentRoutes()}),isActive:r("isActive",function(e,t,n){return this.context.router.isActive(e,t,n)})};e.exports=a},function(e,t,n){"use strict";function r(e,t){this.path=e,this.abortReason=null,this.retry=t.bind(this)}var o=n(76),i=n(77);r.prototype.abort=function(e){null==this.abortReason&&(this.abortReason=e||"ABORT")},r.prototype.redirect=function(e,t,n){this.abort(new i(e,t,n))},r.prototype.cancel=function(){this.abort(new o)},r.from=function(e,t,n,r){t.reduce(function(t,r,o){return function(i){if(i||e.abortReason)t(i);else if(r.onLeave)try{r.onLeave(e,n[o],t),r.onLeave.length<3&&t()}catch(a){t(a)}else t()}},r)()},r.to=function(e,t,n,r,o){t.reduceRight(function(t,o){return function(i){if(i||e.abortReason)t(i);else if(o.onEnter)try{o.onEnter(e,n,r,t),o.onEnter.length<4&&t()}catch(a){t(a)}else t()}},o)()},e.exports=r},function(e,t,n){"use strict";var r={updateScrollPosition:function(){window.scrollTo(0,0)}};e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n in t){var r=t[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(e,t)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=n(7),s=function(e){function t(){i(this,t),null!=e&&e.apply(this,arguments)}return o(t,e),r(t,{render:{value:function(){return this.props.children}}}),t}(a.Component);e.exports=s},function(e,t,n){"use strict";function r(e){return 0===e.button}function o(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var i=function(){function e(e,t){for(var n in t){var r=t[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(e,t)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},u=n(7),c=n(3),l=n(15),p=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return a(t,e),i(t,{handleClick:{value:function(e){var t,n=!0;this.props.onClick&&(t=this.props.onClick(e)),!o(e)&&r(e)&&((t===!1||e.defaultPrevented===!0)&&(n=!1),e.preventDefault(),n&&this.context.router.transitionTo(this.props.to,this.props.params,this.props.query))}},getHref:{value:function(){return this.context.router.makeHref(this.props.to,this.props.params,this.props.query)}},getClassName:{value:function(){var e=this.props.className;return this.getActiveState()&&(e+=" "+this.props.activeClassName),e}},getActiveState:{value:function(){return this.context.router.isActive(this.props.to,this.props.params,this.props.query)}},render:{value:function(){var e=c({},this.props,{href:this.getHref(),className:this.getClassName(),onClick:this.handleClick.bind(this)});return e.activeStyle&&this.getActiveState()&&(e.style=e.activeStyle),u.DOM.a(e,this.props.children)}}}),t}(u.Component);p.contextTypes={router:l.router.isRequired},p.propTypes={activeClassName:l.string.isRequired,to:l.oneOfType([l.string,l.route]).isRequired,params:l.object,query:l.object,activeStyle:l.object,onClick:l.func},p.defaultProps={activeClassName:"active",className:""},e.exports=p},function(e,t,n){"use strict";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(2),i=n(6).canUseDOM;e.exports=r},function(e,t,n){"use strict";function r(e){return null==e||i.isValidElement(e)}function o(e){return r(e)||Array.isArray(e)&&e.every(r)}var i=n(7);e.exports=o},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n in t){var r=t[n];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(e,t)}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=n(2),a=n(32),s=n(27),u=function(){function e(t){o(this,e),this.history=t||[],this.listeners=[],this._updateHistoryLength()}return r(e,{needsDOM:{get:function(){return!1}},_updateHistoryLength:{value:function(){s.length=this.history.length}},_notifyChange:{value:function(e){for(var t={path:this.getCurrentPath(),type:e},n=0,r=this.listeners.length;r>n;++n)this.listeners[n].call(this,t)}},addChangeListener:{value:function(e){this.listeners.push(e)}},removeChangeListener:{value:function(e){this.listeners=this.listeners.filter(function(t){return t!==e})}},push:{value:function(e){this.history.push(e),this._updateHistoryLength(),this._notifyChange(a.PUSH)}},replace:{value:function(e){i(this.history.length,"You cannot replace the current path with no history"),this.history[this.history.length-1]=e,this._notifyChange(a.REPLACE)}},pop:{value:function(){this.history.pop(),this._updateHistoryLength(),this._notifyChange(a.POP)}},getCurrentPath:{value:function(){return this.history[this.history.length-1]}},toString:{value:function(){return""}}}),e}();e.exports=u},function(e,t,n){"use strict";function r(e,t,n){"function"==typeof t&&(n=t,t=null);var r=o({routes:e,location:t});return r.run(n),r}var o=n(82);e.exports=r},function(e,t,n){"use strict";function r(){/*! taken from modernizr +(function(){"use strict";function u(e){return"function"==typeof e||"object"==typeof e&&null!==e}function s(e){return"function"==typeof e}function c(e){return"object"==typeof e&&null!==e}function l(e,t){ne[G]=e,ne[G+1]=t,G+=2,2===G&&z()}function p(){var t=e.nextTick,n=e.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(n)&&"0"===n[1]&&"10"===n[2]&&(t=o),function(){t(v)}}function d(){return function(){Y(v)}}function f(){var e=0,t=new Z(v),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function h(){var e=new MessageChannel;return e.port1.onmessage=v,function(){e.port2.postMessage(0)}}function m(){return function(){setTimeout(v,1)}}function v(){for(var e=0;G>e;e+=2){var t=ne[e],n=ne[e+1];t(n),ne[e]=void 0,ne[e+1]=void 0}G=0}function y(){try{var e=n(229);return Y=e.runOnLoop||e.runOnContext,d()}catch(t){return m()}}function g(){}function E(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function _(e){try{return e.then}catch(t){return ae.error=t,ae}}function N(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function C(e,t,n){X(function(e){var r=!1,o=N(n,t,function(n){r||(r=!0,t!==n?O(e,n):R(e,n))},function(t){r||(r=!0,T(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,T(e,o))},e)}function w(e,t){t._state===oe?R(e,t._result):t._state===ie?T(e,t._result):P(t,void 0,function(t){O(e,t)},function(t){T(e,t)})}function D(e,t){if(t.constructor===e.constructor)w(e,t);else{var n=_(t);n===ae?T(e,ae.error):void 0===n?R(e,t):s(n)?C(e,t,n):R(e,t)}}function O(e,t){e===t?T(e,E()):u(t)?D(e,t):R(e,t)}function x(e){e._onerror&&e._onerror(e._result),M(e)}function R(e,t){e._state===re&&(e._result=t,e._state=oe,0!==e._subscribers.length&&X(M,e))}function T(e,t){e._state===re&&(e._state=ie,e._result=t,X(x,e))}function P(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+oe]=n,o[i+ie]=r,0===i&&e._state&&X(M,e)}function M(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,i=e._result,a=0;aa;a++)P(r.resolve(e[a]),void 0,t,n);return o}function j(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(g);return O(n,e),n}function F(e){var t=this,n=new t(g);return T(n,e),n}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function H(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function q(e){this._id=fe++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==e&&(s(e)||B(),this instanceof q||H(),A(this,e))}function W(){var e;if("undefined"!=typeof i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(e.Promise=he)}var K;K=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Y,z,Q=K,G=0,X=({}.toString,l),$="undefined"!=typeof window?window:void 0,J=$||{},Z=J.MutationObserver||J.WebKitMutationObserver,ee="undefined"!=typeof e&&"[object process]"==={}.toString.call(e),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ne=new Array(1e3);z=ee?p():Z?f():te?h():void 0===$?y():m();var re=void 0,oe=1,ie=2,ae=new I,ue=new I;V.prototype._validateInput=function(e){return Q(e)},V.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},V.prototype._init=function(){this._result=new Array(this.length)};var se=V;V.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,o=0;n._state===re&&t>o;o++)e._eachEntry(r[o],o)},V.prototype._eachEntry=function(e,t){var n=this,r=n._instanceConstructor;c(e)?e.constructor===r&&e._state!==re?(e._onerror=null,n._settledAt(e._state,t,e._result)):n._willSettleAt(r.resolve(e),t):(n._remaining--,n._result[t]=e)},V.prototype._settledAt=function(e,t,n){var r=this,o=r.promise;o._state===re&&(r._remaining--,e===ie?T(o,n):r._result[t]=n),0===r._remaining&&R(o,r._result)},V.prototype._willSettleAt=function(e,t){var n=this;P(e,void 0,function(e){n._settledAt(oe,t,e)},function(e){n._settledAt(ie,t,e)})};var ce=L,le=U,pe=j,de=F,fe=0,he=q;q.all=ce,q.race=le,q.resolve=pe,q.reject=de,q.prototype={constructor:q,then:function(e,t){var n=this,r=n._state;if(r===oe&&!e||r===ie&&!t)return this;var o=new this.constructor(g),i=n._result;if(r){var a=arguments[r-1];X(function(){S(r,o,a,i)})}else P(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var me=W,ve={Promise:he,polyfill:me};n(227).amd?(r=function(){return ve}.call(t,n,t,a),!(void 0!==r&&(a.exports=r))):"undefined"!=typeof a&&a.exports?a.exports=ve:"undefined"!=typeof this&&(this.ES6Promise=ve),me()}).call(this)}).call(t,n(1),n(46).setImmediate,function(){return this}(),n(228)(e))},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;n?)");return e}},{key:"shouldComponentUpdate",value:function(e,t){return t.fulfilled}},{key:"render",value:function(){if(!this.state.fulfilled)return!1;if(this.props.component)return c["default"].createElement(this.props.component,this.state.values);if(this.props.element)return p["default"](this.props.element);if(this.props.children)return 1===h.count(this.props.children)?p["default"](h.only(this.props.children)):c["default"].createElement("span",null,h.map(this.props.children,p["default"]));throw new f["default"](" requires one of the following props to render: `element`, `component`, or `children`")}},{key:"resolve",value:function(){var e=this,t=this.getResolver().getContainerState(this);this.setState(t),t.fulfilled||this.getResolver().resolve(this,function(t){return new Promise(function(n){e.setState(t,n)})})}}]),t}(c["default"].Component);m.childContextTypes={parent:c["default"].PropTypes.instanceOf(m),resolver:c["default"].PropTypes.object.isRequired},m.contextTypes={parent:c["default"].PropTypes.instanceOf(m),resolver:c["default"].PropTypes.object},m.displayName="ResolverContainer",m.propTypes={component:c["default"].PropTypes.any,element:c["default"].PropTypes.element,resolve:c["default"].PropTypes.object,resolver:c["default"].PropTypes.object},t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(){}e.exports=r},function(e,t,n){"use strict";function r(e,t,n){this.to=e,this.params=t,this.query=n}e.exports=r},function(e,t,n){"use strict";var r=n(29),o={updateScrollPosition:function(e,t){switch(t){case r.PUSH:case r.REPLACE:window.scrollTo(0,0);break;case r.POP:e?window.scrollTo(e.x,e.y):window.scrollTo(0,0)}}};e.exports=o},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=n(13),a=n(37),u=n(36),s=function(e){function t(){r(this,t),null!=e&&e.apply(this,arguments)}return o(t,e),t}(u);s.propTypes={name:i.string,path:i.falsy,children:i.falsy,handler:i.func.isRequired},s.defaultProps={handler:a},e.exports=s},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=n(13),a=n(37),u=n(36),s=function(e){function t(){r(this,t),null!=e&&e.apply(this,arguments)}return o(t,e),t}(u);s.propTypes={name:i.string,path:i.falsy,children:i.falsy,handler:i.func.isRequired},s.defaultProps={handler:a},e.exports=s},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=n(13),a=n(36),u=function(e){function t(){r(this,t),null!=e&&e.apply(this,arguments)}return o(t,e),t}(a);u.propTypes={path:i.string,from:i.string,to:i.string,handler:i.falsy},u.defaultProps={},e.exports=u},function(e,t,n){(function(t){"use strict";function r(e,t){for(var n in t)if(t.hasOwnProperty(n)&&e[n]!==t[n])return!1;return!0}function o(e,t,n,o,i,a){return e.some(function(e){if(e!==t)return!1;for(var u,s=t.paramNames,c=0,l=s.length;l>c;++c)if(u=s[c],o[u]!==n[u])return!1;return r(i,a)&&r(a,i)})}function i(e,t){for(var n,r=0,o=e.length;o>r;++r)n=e[r],n.name&&(d(null==t[n.name],'You may not have more than one route named "%s"',n.name),t[n.name]=n),n.childRoutes&&i(n.childRoutes,t)}function a(e,t){return e.some(function(e){return e.name===t})}function u(e,t){for(var n in t)if(String(e[n])!==String(t[n]))return!1;return!0}function s(e,t){for(var n in t)if(String(e[n])!==String(t[n]))return!1;return!0}function c(e){e=e||{},N(e)&&(e={routes:e});var n=[],r=e.location||I,c=e.scrollBehavior||k,m={},S={},A=null,V=null;"string"==typeof r&&(r=new E(r)),r instanceof E?p(!f||"test"===t.env.NODE_ENV,"You should not use a static location in a DOM environment because the router will not be kept in sync with the current URL"):d(f||r.needsDOM===!1,"You cannot use %s without a DOM",r),r!==y||P()||(r=g);var L=l.createClass({displayName:"Router",statics:{isRunning:!1,cancelPendingTransition:function(){A&&(A.cancel(),A=null)},clearAllRoutes:function(){L.cancelPendingTransition(),L.namedRoutes={},L.routes=[]},addRoutes:function(e){N(e)&&(e=_(e)),i(e,L.namedRoutes),L.routes.push.apply(L.routes,e)},replaceRoutes:function(e){L.clearAllRoutes(),L.addRoutes(e),L.refresh()},match:function(e){return R.findMatch(L.routes,e)},makePath:function(e,t,n){var r;if(M.isAbsolute(e))r=e;else{var o=e instanceof T?e:L.namedRoutes[e];d(o instanceof T,'Cannot find a route named "%s"',e),r=o.path}return M.withQuery(M.injectParams(r,t),n)},makeHref:function(e,t,n){var o=L.makePath(e,t,n);return r===v?"#"+o:o},transitionTo:function(e,t,n){var o=L.makePath(e,t,n);A?r.replace(o):r.push(o)},replaceWith:function(e,t,n){r.replace(L.makePath(e,t,n))},goBack:function(){return O.length>1||r===g?(r.pop(),!0):(p(!1,"goBack() was ignored because there is no router history"),!1)},handleAbort:e.onAbort||function(e){if(r instanceof E)throw new Error("Unhandled aborted transition! Reason: "+e);e instanceof x||(e instanceof D?r.replace(L.makePath(e.to,e.params,e.query)):r.pop())},handleError:e.onError||function(e){throw e},handleLocationChange:function(e){L.dispatch(e.path,e.type)},dispatch:function(e,t){L.cancelPendingTransition();var r=m.path,i=null==t;if(r!==e||i){r&&t===h.PUSH&&L.recordScrollPosition(r);var a=L.match(e);p(null!=a,'No route matches path "%s". Make sure you have somewhere in your routes',e,e),null==a&&(a={});var u,s,c=m.routes||[],l=m.params||{},d=m.query||{},f=a.routes||[],v=a.params||{},y=a.query||{};c.length?(u=c.filter(function(e){return!o(f,e,l,v,d,y)}),s=f.filter(function(e){return!o(c,e,l,v,d,y)})):(u=[],s=f);var g=new C(e,L.replaceWith.bind(L,e));A=g;var E=n.slice(c.length-u.length);C.from(g,u,E,function(n){return n||g.abortReason?V.call(L,n,g):void C.to(g,s,v,y,function(n){V.call(L,n,g,{path:e,action:t,pathname:a.pathname,routes:f,params:v,query:y})})})}},run:function(e){d(!L.isRunning,"Router is already running"),V=function(t,n,r){t&&L.handleError(t),A===n&&(A=null,n.abortReason?L.handleAbort(n.abortReason):e.call(L,L,S=r))},r instanceof E||(r.addChangeListener&&r.addChangeListener(L.handleLocationChange),L.isRunning=!0),L.refresh()},refresh:function(){L.dispatch(r.getCurrentPath(),null)},stop:function(){L.cancelPendingTransition(),r.removeChangeListener&&r.removeChangeListener(L.handleLocationChange),L.isRunning=!1},getLocation:function(){return r},getScrollBehavior:function(){return c},getRouteAtDepth:function(e){var t=m.routes;return t&&t[e]},setRouteComponentAtDepth:function(e,t){n[e]=t},getCurrentPath:function(){return m.path},getCurrentPathname:function(){return m.pathname},getCurrentParams:function(){return m.params},getCurrentQuery:function(){return m.query},getCurrentRoutes:function(){return m.routes},isActive:function(e,t,n){return M.isAbsolute(e)?e===m.path:a(m.routes,e)&&u(m.params,t)&&(null==n||s(m.query,n))}},mixins:[b],propTypes:{children:w.falsy},childContextTypes:{routeDepth:w.number.isRequired,router:w.router.isRequired},getChildContext:function(){return{routeDepth:1,router:L}},getInitialState:function(){return m=S},componentWillReceiveProps:function(){this.setState(m=S)},componentWillUnmount:function(){L.stop()},render:function(){var e=L.getRouteAtDepth(0);return e?l.createElement(e.handler,this.props):null}});return L.clearAllRoutes(),e.routes&&L.addRoutes(e.routes),L}var l=n(7),p=n(4),d=n(2),f=n(6).canUseDOM,h=n(29),m=n(79),v=n(85),y=n(50),g=n(86),E=n(87),b=n(133),_=n(84),N=n(140),C=n(135),w=n(13),D=n(78),O=n(23),x=n(77),R=n(131),T=n(20),P=n(143),M=n(49),I=f?v:"/",k=f?m:null;e.exports=c}).call(t,n(1))},function(e,t,n){"use strict";function r(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var o=t[r](n,r,e);o instanceof Error&&c(!1,o.message)}}function o(e){var t=s({},e),n=t.handler;return n&&(t.onEnter=n.willTransitionTo,t.onLeave=n.willTransitionFrom),t}function i(e){if(u.isValidElement(e)){var t=e.type,n=s({},t.defaultProps,e.props);return t.propTypes&&r(t.displayName,t.propTypes,n),t===l?f.createDefaultRoute(o(n)):t===p?f.createNotFoundRoute(o(n)):t===d?f.createRedirect(o(n)):f.createRoute(o(n),function(){n.children&&a(n.children)})}}function a(e){var t=[];return u.Children.forEach(e,function(e){(e=i(e))&&t.push(e)}),t}var u=n(7),s=n(3),c=n(4),l=n(80),p=n(81),d=n(82),f=n(20);e.exports=a},function(e,t,n){"use strict";function r(e){e===u.PUSH&&(s.length+=1);var t={path:p.getCurrentPath(),type:e};c.forEach(function(e){e.call(p,t)})}function o(){var e=p.getCurrentPath();return"/"===e.charAt(0)?!0:(p.replace("/"+e),!1)}function i(){if(o()){var e=a;a=null,r(e||u.POP)}}var a,u=n(29),s=n(23),c=[],l=!1,p={addChangeListener:function(e){c.push(e),o(),l||(window.addEventListener?window.addEventListener("hashchange",i,!1):window.attachEvent("onhashchange",i),l=!0)},removeChangeListener:function(e){c=c.filter(function(t){return t!==e}),0===c.length&&(window.removeEventListener?window.removeEventListener("hashchange",i,!1):window.removeEvent("onhashchange",i),l=!1)},push:function(e){a=u.PUSH,window.location.hash=e},replace:function(e){a=u.REPLACE,window.location.replace(window.location.pathname+window.location.search+"#"+e)},pop:function(){a=u.POP,s.back()},getCurrentPath:function(){return decodeURI(window.location.href.split("#")[1]||"")},toString:function(){return""}};e.exports=p},function(e,t,n){"use strict";var r=n(50),o=n(23),i={push:function(e){window.location=e},replace:function(e){window.location.replace(e)},pop:o.back,getCurrentPath:r.getCurrentPath,toString:function(){return""}};e.exports=i},function(e,t,n){"use strict";function r(){a(!1,"You cannot modify a static location")}var o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;n'}}]),e}();u.prototype.push=r,u.prototype.replace=r,u.prototype.pop=r,e.exports=u},function(e,t,n){t.arrayToObject=function(e){for(var t={},n=0,r=e.length;r>n;++n)"undefined"!=typeof e[n]&&(t[n]=e[n]);return t},t.merge=function(e,n){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):e[n]=!0,e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e));for(var r=Object.keys(n),o=0,i=r.length;i>o;++o){var a=r[o],u=n[a];e[a]?e[a]=t.merge(e[a],u):e[a]=u}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],i=0,a=e.length;a>i;++i)"undefined"!=typeof e[i]&&o.push(e[i]);return o}var u=Object.keys(e);for(i=0,a=u.length;a>i;++i){var s=u[i];e[s]=t.compact(e[s],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},i=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){i.forEach(function(t){o[r(t,e)]=o[e]})});var a={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},u={isUnitlessNumber:o,shorthandPropertyExpansions:a};e.exports=u},function(e,t,n){(function(t){"use strict";var r=n(89),o=n(6),i=n(203),a=n(208),u=n(215),s=n(219),c=n(4),l=s(function(e){return u(e)}),p="cssFloat";if(o.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(p="styleFloat"),"production"!==t.env.NODE_ENV)var d=/^(?:webkit|moz|o)[A-Z]/,f=/;\s*$/,h={},m={},v=function(e){h.hasOwnProperty(e)&&h[e]||(h[e]=!0,"production"!==t.env.NODE_ENV?c(!1,"Unsupported style property %s. Did you mean %s?",e,i(e)):null)},y=function(e){h.hasOwnProperty(e)&&h[e]||(h[e]=!0,"production"!==t.env.NODE_ENV?c(!1,"Unsupported vendor-prefixed style property %s. Did you mean %s?",e,e.charAt(0).toUpperCase()+e.slice(1)):null)},g=function(e,n){m.hasOwnProperty(n)&&m[n]||(m[n]=!0,"production"!==t.env.NODE_ENV?c(!1,'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.',e,n.replace(f,"")):null)},E=function(e,t){e.indexOf("-")>-1?v(e):d.test(e)?y(e):f.test(t)&&g(e,t)};var b={createMarkupForStyles:function(e){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];"production"!==t.env.NODE_ENV&&E(r,o),null!=o&&(n+=l(r)+":",n+=a(r,o)+";")}return n||null},setValueForStyles:function(e,n){var o=e.style;for(var i in n)if(n.hasOwnProperty(i)){"production"!==t.env.NODE_ENV&&E(i,n[i]);var u=a(i,n[i]);if("float"===i&&(i=p),u)o[i]=u;else{var s=r.shorthandPropertyExpansions[i];if(s)for(var c in s)o[c]="";else o[i]=""}}}};e.exports=b}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(){if(u)for(var e in s){var n=s[e],r=u.indexOf(e);if("production"!==t.env.NODE_ENV?a(r>-1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):a(r>-1),!c.plugins[r]){"production"!==t.env.NODE_ENV?a(n.extractEvents,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):a(n.extractEvents),c.plugins[r]=n;var i=n.eventTypes;for(var l in i)"production"!==t.env.NODE_ENV?a(o(i[l],n,l),"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",l,e):a(o(i[l],n,l))}}}function o(e,n,r){"production"!==t.env.NODE_ENV?a(!c.eventNameDispatchConfigs.hasOwnProperty(r),"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",r):a(!c.eventNameDispatchConfigs.hasOwnProperty(r)),c.eventNameDispatchConfigs[r]=e;var o=e.phasedRegistrationNames;if(o){for(var u in o)if(o.hasOwnProperty(u)){var s=o[u];i(s,n,r)}return!0}return e.registrationName?(i(e.registrationName,n,r),!0):!1}function i(e,n,r){"production"!==t.env.NODE_ENV?a(!c.registrationNameModules[e],"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):a(!c.registrationNameModules[e]),c.registrationNameModules[e]=n,c.registrationNameDependencies[e]=n.eventTypes[r].dependencies}var a=n(2),u=null,s={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){"production"!==t.env.NODE_ENV?a(!u,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):a(!u),u=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var n=!1;for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];s.hasOwnProperty(o)&&s[o]===i||("production"!==t.env.NODE_ENV?a(!s[o],"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",o):a(!s[o]),s[o]=i,n=!0)}n&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=c.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){u=null;for(var e in s)s.hasOwnProperty(e)&&delete s[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=c}).call(t,n(1))},function(e,t,n){(function(t){"use strict";function r(e,t){this.props=e,this.context=t}var o=n(62),i=n(2),a=n(4);if(r.prototype.setState=function(e,n){"production"!==t.env.NODE_ENV?i("object"==typeof e||"function"==typeof e||null==e,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."):i("object"==typeof e||"function"==typeof e||null==e),"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?a(null!=e,"setState(...): You passed an undefined or null state object; instead, use forceUpdate()."):null),o.enqueueSetState(this,e),n&&o.enqueueCallback(this,n)},r.prototype.forceUpdate=function(e){o.enqueueForceUpdate(this),e&&o.enqueueCallback(this,e)},"production"!==t.env.NODE_ENV){var u={getDOMNode:["getDOMNode","Use React.findDOMNode(component) instead."],isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceProps:["replaceProps","Instead, call React.render again at the top level."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."],setProps:["setProps","Instead, call React.render again at the top level."]},s=function(e,n){try{Object.defineProperty(r.prototype,e,{get:function(){return void("production"!==t.env.NODE_ENV?a(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",n[0],n[1]):null)}})}catch(o){}};for(var c in u)u.hasOwnProperty(c)&&s(c,u[c])}e.exports=r}).call(t,n(1))},function(e,t,n){(function(t){"use strict";var r=n(90),o=n(152),i=n(30),a=n(10),u=n(19),s=n(2),c=n(70),l={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},p={updatePropertyByID:function(e,n,r){var o=a.getNode(e);"production"!==t.env.NODE_ENV?s(!l.hasOwnProperty(n),"updatePropertyByID(...): %s",l[n]):s(!l.hasOwnProperty(n)),null!=r?i.setValueForProperty(o,n,r):i.deleteValueForProperty(o,n)},deletePropertyByID:function(e,n,r){var o=a.getNode(e);"production"!==t.env.NODE_ENV?s(!l.hasOwnProperty(n),"updatePropertyByID(...): %s",l[n]):s(!l.hasOwnProperty(n)),i.deleteValueForProperty(o,n,r)},updateStylesByID:function(e,t){var n=a.getNode(e);r.setValueForStyles(n,t)},updateInnerHTMLByID:function(e,t){var n=a.getNode(e);c(n,t)},updateTextContentByID:function(e,t){var n=a.getNode(e);o.updateTextContent(n,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=a.getNode(e);o.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n"+o+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;n!==this._stringText&&(this._stringText=n,i.BackendIDOperations.updateTextContentByID(this._rootNodeID,n))}},unmountComponent:function(){o.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=s},function(e,t,n){"use strict";function r(e){return i(document.documentElement,e)}var o=n(172),i=n(102),a=n(104),u=n(105),s={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=u();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t=u(),n=e.focusedElem,o=e.selectionRange;t!==n&&r(n)&&(s.hasSelectionCapabilities(n)&&s.setSelection(n,o),a(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=o.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,r=t.end;if("undefined"==typeof r&&(r=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(r,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",r-n),i.select()}else o.setOffsets(e,t)}};e.exports=s},function(e,t,n){"use strict";var r=n(201),o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(">"," "+o.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var n=t.getAttribute(o.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var i=r(e);return i===n}};e.exports=o},function(e,t,n){"use strict";var r=n(35),o=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});e.exports=o},function(e,t,n){"use strict";function r(e){function t(t,n,r,o,i){if(o=o||_,null==n[r]){var a=E[i];return t?new Error("Required "+a+" `"+r+"` was not specified in "+("`"+o+"`.")):null}return e(n,r,o,i)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){function t(t,n,r,o){var i=t[n],a=m(i);if(a!==e){var u=E[o],s=v(i);return new Error("Invalid "+u+" `"+n+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `"+e+"`."))}return null}return r(t)}function i(){return r(b.thatReturns(null))}function a(e){function t(t,n,r,o){var i=t[n];if(!Array.isArray(i)){var a=E[o],u=m(i);return new Error("Invalid "+a+" `"+n+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var s=0;s>",N=u(),C=d(),w={array:o("array"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),any:i(),arrayOf:a,element:N,instanceOf:s,node:C,objectOf:l,oneOf:c,oneOfType:p,shape:f};e.exports=w},function(e,t,n){"use strict";function r(){this.listenersToPut=[]}var o=n(14),i=n(25),a=n(3);a(r.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e":a.innerHTML="<"+e+">",u[e]=!a.firstChild),u[e]?d[e]:null}var o=n(6),i=n(2),a=o.canUseDOM?document.createElement("div"):null,u={circle:!0,clipPath:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},s=[1,'"],c=[1,"","
"],l=[3,"","
"],p=[1,"",""],d={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:s,option:s,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:l,th:l,circle:p,clipPath:p,defs:p,ellipse:p,g:p,line:p,linearGradient:p,path:p,polygon:p,polyline:p,radialGradient:p,rect:p,stop:p,text:p};e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=n(6),i=null;e.exports=r},function(e,t,n){function r(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e){return e&&("INPUT"===e.nodeName&&o[e.type]||"TEXTAREA"===e.nodeName)}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){return y[e]}function o(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function i(e){return(""+e).replace(g,r)}function a(e){return"$"+i(e)}function u(e,n,r,i,s){var p=typeof e;if(("undefined"===p||"boolean"===p)&&(e=null),null===e||"string"===p||"number"===p||c.isValidElement(e))return i(s,e,""===n?m+o(e,0):n,r),1;var y,g,b,_=0;if(Array.isArray(e))for(var N=0;N0&&(e+=(-1===e.indexOf("?")?"?":"&")+n.join("&")),e}},function(e,t,n){"use strict";var r=n(12);e.exports={write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}},function(e,t,n){"use strict";e.exports=function(e,t,n){try{console.warn("DEPRECATED method `"+e+"`."+(t?" Use `"+t+"` instead.":"")+" This method will be removed in a future release."),n&&console.warn("For more information about usage see "+n)}catch(r){}}},function(e,t,n){"use strict";var r=n(12);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";e.exports=function(e){return function(t){e.apply(null,t)}}},function(e,t,n){"use strict";var r=n(12);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(e){var t=e;return a&&(u.setAttribute("href",t),t=u.href),u.setAttribute("href",t),{href:u.href,protocol:u.protocol?u.protocol.replace(/:$/,""):"",host:u.host,search:u.search?u.search.replace(/^\?/,""):"",hash:u.hash?u.hash.replace(/^#/,""):"",hostname:u.hostname,port:u.port,pathname:"/"===u.pathname.charAt(0)?u.pathname:"/"+u.pathname}}var o,i=n(12),a=/(msie|trident)/i.test(navigator.userAgent),u=document.createElement("a");o=r(window.location.href),e.exports=function(e){var t=i.isString(e)?r(e):e;return t.protocol===o.protocol&&t.host===o.host}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;nt?e.finish():n})}},{key:"freeze",value:function(){this.frozen=!0}},{key:"fulfillState",value:function(e,t){return e.error=void 0,e.fulfilled=!0,e.rejected=!1,t?t(e):e}},{key:"getContainerState",value:function(e){var t=e.id;if(!t)throw new ReferenceError(""+e.constructor.displayName+" should have an ID");var n=this.states[t]||{fulfilled:!1,rejected:!1,values:{}};return this.states[t]||(this.states[t]=n),n}},{key:"clearContainerState",value:function(e){var t=this,n=e.id;Object.keys(this.states).filter(function(e){return 0===e.indexOf(n)}).forEach(function(e){return t.states[e]=void 0})}},{key:"rejectState",value:function(e,t,n){throw t.error=e,t.fulfilled=!1,t.rejected=!0,n&&n(t),new Error(""+this.constructor.displayName+" was rejected: "+e)}},{key:"resolve",value:function(e,t){var n=this,r=e.props.resolve||{},o=this.getContainerState(e),i=Object.keys(r).filter(function(t){return e.props.hasOwnProperty(t)?(o.values[t]=e.props[t],!1):!0}).filter(function(e){return!o.values.hasOwnProperty(e)});if(!i.length)return Promise.resolve(this.fulfillState(o,t));if(this.frozen)throw new f["default"](["Resolver is frozen for server rendering.",""+e.constructor.displayName+" (#"+e.id+") should have already resolved",'"'+i.join('", "')+'". (http://git.io/vvvkr)'].join(" "));var a=i.map(function(t){var n=e.props.resolve[t],r=e.props.hasOwnProperty(t)?e.props[t]:n(e.props.props,e.props.context);return Promise.resolve(r).then(function(e){return o.values[t]=e,e})});return this.await(a).then(function(){return n.fulfillState(o,t)},function(e){return n.rejectState(e,o,t)})}}],[{key:"createContainer",value:function(e){var t=void 0===arguments[1]?{}:arguments[1];if(!e.hasOwnProperty("displayName"))throw new ReferenceError("Resolver.createContainer requires wrapped component to have `displayName`");var n=function(n){function r(){i(this,r),null!=n&&n.apply(this,arguments)}return o(r,n),a(r,[{key:"render",value:function(){return c["default"].createElement(p["default"],u({component:e,context:this.context,props:this.props},t))}}]),r}(c["default"].Component);return n.contextTypes=t.contextTypes,n.displayName=""+e.displayName+"Container",n}},{key:"render",value:function(t,n){var r=void 0===arguments[2]?new e:arguments[2];return c["default"].render(c["default"].createElement(p["default"],{resolver:r},t),n),r}},{key:"renderToString",value:function(t){var n=new e,r=c["default"].createElement(p["default"],{resolver:n},t);return c["default"].renderToString(r),n.finish().then(function(){return n.freeze(),c["default"].renderToString(r)})}},{key:"renderToStaticMarkup",value:function(t){var n=new e,r=c["default"].createElement(p["default"],{resolver:n},t);return c["default"].renderToStaticMarkup(r),n.finish().then(function(){return n.freeze(),c["default"].renderToStaticMarkup(r)})}}]),e}();t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){var o=e.childRoutes;if(o)for(var i,s,c=0,l=o.length;l>c;++c)if(s=o[c],!s.isDefault&&!s.isNotFound&&(i=r(s,t,n)))return i.routes.unshift(e),i;var p=e.defaultRoute;if(p&&(f=a.extractParams(p.path,t)))return new u(t,f,n,[e,p]);var d=e.notFoundRoute;if(d&&(f=a.extractParams(d.path,t)))return new u(t,f,n,[e,d]);var f=a.extractParams(e.path,t);return f?new u(t,f,n,[e]):null}var o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var n=0;nu;++u)i=r(e[u],n,o);return i}}]),e}();e.exports=u},function(e,t,n){"use strict";var r=n(13),o={contextTypes:{router:r.router.isRequired},makePath:function(e,t,n){return this.context.router.makePath(e,t,n)},makeHref:function(e,t,n){return this.context.router.makeHref(e,t,n)},transitionTo:function(e,t,n){this.context.router.transitionTo(e,t,n)},replaceWith:function(e,t,n){this.context.router.replaceWith(e,t,n)},goBack:function(){return this.context.router.goBack()}};e.exports=o},function(e,t,n){"use strict";function r(e,t){if(!t)return!0;if(e.pathname===t.pathname)return!1;var n=e.routes,r=t.routes,o=n.filter(function(e){return-1!==r.indexOf(e)});return!o.some(function(e){return e.ignoreScrollBehavior})}var o=n(2),i=n(6).canUseDOM,a=n(139),u={statics:{recordScrollPosition:function(e){this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[e]=a()},getScrollPosition:function(e){return this.scrollHistory||(this.scrollHistory={}),this.scrollHistory[e]||null}},componentWillMount:function(){o(null==this.constructor.getScrollBehavior()||i,"Cannot use scroll behavior without a DOM")},componentDidMount:function(){this._updateScroll()},componentDidUpdate:function(e,t){this._updateScroll(t)},_updateScroll:function(e){if(r(this.state,e)){var t=this.constructor.getScrollBehavior();t&&t.updateScrollPosition(this.constructor.getScrollPosition(this.state.path),this.state.action)}}};e.exports=u},function(e,t,n){"use strict";var r=n(13),o={contextTypes:{router:r.router.isRequired},getPath:function(){return this.context.router.getCurrentPath()},getPathname:function(){return this.context.router.getCurrentPathname()},getParams:function(){return this.context.router.getCurrentParams()},getQuery:function(){return this.context.router.getCurrentQuery()},getRoutes:function(){return this.context.router.getCurrentRoutes()},isActive:function(e,t,n){return this.context.router.isActive(e,t,n)}};e.exports=o},function(e,t,n){"use strict";function r(e,t){this.path=e,this.abortReason=null,this.retry=t.bind(this)}var o=n(77),i=n(78);r.prototype.abort=function(e){null==this.abortReason&&(this.abortReason=e||"ABORT")},r.prototype.redirect=function(e,t,n){this.abort(new i(e,t,n))},r.prototype.cancel=function(){this.abort(new o)},r.from=function(e,t,n,r){t.reduce(function(t,r,o){return function(i){if(i||e.abortReason)t(i);else if(r.onLeave)try{r.onLeave(e,n[o],t),r.onLeave.length<3&&t()}catch(a){t(a)}else t()}},r)()},r.to=function(e,t,n,r,o){t.reduceRight(function(t,o){return function(i){if(i||e.abortReason)t(i);else if(o.onEnter)try{o.onEnter(e,n,r,t),o.onEnter.length<4&&t()}catch(a){t(a)}else t()}},o)()},e.exports=r},function(e,t,n){"use strict";var r={updateScrollPosition:function(){window.scrollTo(0,0)}};e.exports=r},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(){function e(e,t){for(var n=0;nn;++n)this.listeners[n].call(this,t)}},{key:"addChangeListener",value:function(e){this.listeners.push(e)}},{key:"removeChangeListener",value:function(e){this.listeners=this.listeners.filter(function(t){return t!==e})}},{key:"push",value:function(e){this.history.push(e),this._updateHistoryLength(),this._notifyChange(a.PUSH)}},{key:"replace",value:function(e){i(this.history.length,"You cannot replace the current path with no history"),this.history[this.history.length-1]=e,this._notifyChange(a.REPLACE)}},{key:"pop",value:function(){this.history.pop(),this._updateHistoryLength(),this._notifyChange(a.POP)}},{key:"getCurrentPath",value:function(){return this.history[this.history.length-1]}},{key:"toString",value:function(){return""}}]),e}();e.exports=s},function(e,t,n){"use strict";function r(e,t,n){"function"==typeof t&&(n=t,t=null);var r=o({routes:e,location:t});return r.run(n),r}var o=n(83);e.exports=r},function(e,t,n){"use strict";function r(){/*! 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 e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}e.exports=r},function(e,t,n){"use strict";function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var n,o,i=r(e),a=1;ai;++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)),l=r.decode(s.slice(u+1));if(Object.prototype.hasOwnProperty(c))continue;n.hasOwnProperty(c)?n[c]=[].concat(n[c]).concat(l):n[c]=l}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r=e.shift(),i={};if("[]"===r)i=[],i=i.concat(o.parseObject(e,t,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(e,t,n)):i[a]=o.parseObject(e,t,n)}return i},o.parseKeys=function(e,t,n){if(e){var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=r.exec(e);if(!Object.prototype.hasOwnProperty(a[1])){var s=[];a[1]&&s.push(a[1]);for(var u=0;null!==(a=i.exec(e))&&us;++s){var c=a[s],l=o.parseKeys(c,n[c],t);i=r.merge(i,l)}return r.compact(i)}},function(e,t,n){var r=n(87),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}}};o.stringify=function(e,t,n){if(r.isBuffer(e)?e=e.toString():e instanceof Date?e=e.toISOString():null===e&&(e=""),"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[encodeURIComponent(t)+"="+encodeURIComponent(e)];var i=[];if("undefined"==typeof e)return i;for(var a=Object.keys(e),s=0,u=a.length;u>s;++s){var c=a[s];i=i.concat(Array.isArray(e)?o.stringify(e[c],n(t,c),n):o.stringify(e[c],t+"["+c+"]",n))}return i},e.exports=function(e,t){t=t||{};var n="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,r=[];if("object"!=typeof e||null===e)return"";var i;i=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";for(var a=o.arrayPrefixGenerators[i],s=Object.keys(e),u=0,c=s.length;c>u;++u){var l=s[u];r=r.concat(o.stringify(e[l],l,a))}return r.join(n)}},function(e,t,n){e.exports=n(202)},function(e,t,n){"use strict";function r(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function o(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function i(e){switch(e){case R.topCompositionStart:return T.compositionStart;case R.topCompositionEnd:return T.compositionEnd;case R.topCompositionUpdate:return T.compositionUpdate}}function a(e,t){return e===R.topKeyDown&&t.keyCode===_}function s(e,t){switch(e){case R.topKeyUp:return-1!==b.indexOf(t.keyCode);case R.topKeyDown:return t.keyCode!==_;case R.topKeyPress:case R.topMouseDown:case R.topBlur:return!0;default:return!1}}function u(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function c(e,t,n,r){var o,c;if(N?o=i(e):M?s(e,r)&&(o=T.compositionEnd):a(e,r)&&(o=T.compositionStart),!o)return null;D&&(M||o!==T.compositionStart?o===T.compositionEnd&&M&&(c=M.getData()):M=v.getPooled(t));var l=y.getPooled(o,n,r);if(c)l.data=c;else{var p=u(r);null!==p&&(l.data=p)}return h.accumulateTwoPhaseDispatches(l),l}function l(e,t){switch(e){case R.topCompositionEnd:return u(t);case R.topKeyPress:var n=t.which;return n!==O?null:(P=!0,x);case R.topTextInput:var r=t.data;return r===x&&P?null:r;default:return null}}function p(e,t){if(M){if(e===R.topCompositionEnd||s(e,t)){var n=M.getData();return v.release(M),M=null,n}return null}switch(e){case R.topPaste:return null;case R.topKeyPress:return t.which&&!o(t)?String.fromCharCode(t.which):null;case R.topCompositionEnd:return D?null:t.data;default:return null}}function d(e,t,n,r){var o;if(o=w?l(e,r):p(e,r),!o)return null;var i=g.getPooled(T.beforeInput,n,r);return i.data=o,h.accumulateTwoPhaseDispatches(i),i}var f=n(8),h=n(29),m=n(6),v=n(165),y=n(208),g=n(211),E=n(13),b=[9,13,27,32],_=229,N=m.canUseDOM&&"CompositionEvent"in window,C=null;m.canUseDOM&&"documentMode"in document&&(C=document.documentMode);var w=m.canUseDOM&&"TextEvent"in window&&!C&&!r(),D=m.canUseDOM&&(!N||C&&C>8&&11>=C),O=32,x=String.fromCharCode(O),R=f.topLevelTypes,T={beforeInput:{phasedRegistrationNames:{bubbled:E({onBeforeInput:null}),captured:E({onBeforeInputCapture:null})},dependencies:[R.topCompositionEnd,R.topKeyPress,R.topTextInput,R.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:E({onCompositionEnd:null}),captured:E({onCompositionEndCapture:null})},dependencies:[R.topBlur,R.topCompositionEnd,R.topKeyDown,R.topKeyPress,R.topKeyUp,R.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:E({onCompositionStart:null}),captured:E({onCompositionStartCapture:null})},dependencies:[R.topBlur,R.topCompositionStart,R.topKeyDown,R.topKeyPress,R.topKeyUp,R.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:E({onCompositionUpdate:null}),captured:E({onCompositionUpdateCapture:null})},dependencies:[R.topBlur,R.topCompositionUpdate,R.topKeyDown,R.topKeyPress,R.topKeyUp,R.topMouseDown]}},P=!1,M=null,I={eventTypes:T,extractEvents:function(e,t,n,r){return[c(e,t,n,r),d(e,t,n,r)]}};e.exports=I},function(e,t,n){(function(t){var r=n(2),o={addClass:function(e,n){return"production"!==t.env.NODE_ENV?r(!/\s/.test(n),'CSSCore.addClass takes only a single class name. "%s" contains multiple classes.',n):r(!/\s/.test(n)),n&&(e.classList?e.classList.add(n):o.hasClass(e,n)||(e.className=e.className+" "+n)),e},removeClass:function(e,n){return"production"!==t.env.NODE_ENV?r(!/\s/.test(n),'CSSCore.removeClass takes only a single class name. "%s" contains multiple classes.',n):r(!/\s/.test(n)),n&&(e.classList?e.classList.remove(n):o.hasClass(e,n)&&(e.className=e.className.replace(new RegExp("(^|\\s)"+n+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,""))),e},conditionClass:function(e,t,n){return(n?o.addClass:o.removeClass)(e,t)},hasClass:function(e,n){return"production"!==t.env.NODE_ENV?r(!/\s/.test(n),"CSS.hasClass takes only a single class name."):r(!/\s/.test(n)),e.classList?!!n&&e.classList.contains(n):(" "+e.className+" ").indexOf(" "+n+" ")>-1}};e.exports=o}).call(t,n(1))},function(e,t,n){"use strict";function r(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function o(e){var t=C.getPooled(R.change,P,e);b.accumulateTwoPhaseDispatches(t),N.batchedUpdates(i,t)}function i(e){E.enqueueEvents(e),E.processEventQueue()}function a(e,t){T=e,P=t,T.attachEvent("onchange",o)}function s(){T&&(T.detachEvent("onchange",o),T=null,P=null)}function u(e,t,n){return e===x.topChange?n:void 0}function c(e,t,n){e===x.topFocus?(s(),a(t,n)):e===x.topBlur&&s()}function l(e,t){T=e,P=t,M=e.value,I=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(T,"value",A),T.attachEvent("onpropertychange",d)}function p(){T&&(delete T.value,T.detachEvent("onpropertychange",d),T=null,P=null,M=null,I=null)}function d(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==M&&(M=t,o(e))}}function f(e,t,n){return e===x.topInput?n:void 0}function h(e,t,n){e===x.topFocus?(p(),l(t,n)):e===x.topBlur&&p()}function m(e,t,n){return e!==x.topSelectionChange&&e!==x.topKeyUp&&e!==x.topKeyDown||!T||T.value===M?void 0:(M=T.value,P)}function v(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function y(e,t,n){return e===x.topClick?n:void 0}var g=n(8),E=n(28),b=n(29),_=n(6),N=n(10),C=n(20),w=n(68),D=n(114),O=n(13),x=g.topLevelTypes,R={change:{phasedRegistrationNames:{bubbled:O({onChange:null}),captured:O({onChangeCapture:null})},dependencies:[x.topBlur,x.topChange,x.topClick,x.topFocus,x.topInput,x.topKeyDown,x.topKeyUp,x.topSelectionChange]}},T=null,P=null,M=null,I=null,S=!1;_.canUseDOM&&(S=w("change")&&(!("documentMode"in document)||document.documentMode>8));var k=!1;_.canUseDOM&&(k=w("input")&&(!("documentMode"in document)||document.documentMode>9));var A={get:function(){return I.get.call(this)},set:function(e){M=""+e,I.set.call(this,e)}},V={eventTypes:R,extractEvents:function(e,t,n,o){var i,a;if(r(t)?S?i=u:a=c:D(t)?k?i=f:(i=m,a=h):v(t)&&(i=y),i){var s=i(e,t,n);if(s){var l=C.getPooled(R.change,s,o);return b.accumulateTwoPhaseDispatches(l),l}}a&&a(e,t,n)}};e.exports=V},function(e,t,n){"use strict";var r=0,o={createReactRootIndex:function(){return r++}};e.exports=o},function(e,t,n){(function(t){"use strict";function r(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var o=n(161),i=n(99),a=n(237),s=n(2),u={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,updateTextContent:a,processUpdates:function(e,n){for(var u,c=null,l=null,p=0;p when using tables, nesting tags like ,

, or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",d,h):s(f),c=c||{},c[h]=c[h]||[],c[h][d]=f,l=l||[],l.push(f)}var m=o.dangerouslyRenderMarkup(n);if(l)for(var v=0;v]+)/,l="data-danger-index",p={dangerouslyRenderMarkup:function(e){"production"!==t.env.NODE_ENV?u(o.canUseDOM,"dangerouslyRenderMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use React.renderToString for server rendering."):u(o.canUseDOM);for(var n,p={},d=0;d node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See React.renderToString()."):u("html"!==e.tagName.toLowerCase());var r=i(n,a)[0];e.parentNode.replaceChild(r,e)}};e.exports=p}).call(t,n(1))},function(e,t,n){"use strict";var r=n(13),o=[r({ResponderEventPlugin:null}),r({SimpleEventPlugin:null}),r({TapEventPlugin:null}),r({EnterLeaveEventPlugin:null}),r({ChangeEventPlugin:null}),r({SelectEventPlugin:null}),r({BeforeInputEventPlugin:null}),r({AnalyticsEventPlugin:null}),r({MobileSafariClickEventPlugin:null})];e.exports=o},function(e,t,n){"use strict";var r=n(8),o=n(29),i=n(43),a=n(11),s=n(13),u=r.topLevelTypes,c=a.getFirstReactDOM,l={mouseEnter:{registrationName:s({onMouseEnter:null}),dependencies:[u.topMouseOut,u.topMouseOver]},mouseLeave:{registrationName:s({onMouseLeave:null}),dependencies:[u.topMouseOut,u.topMouseOver]}},p=[null,null],d={eventTypes:l,extractEvents:function(e,t,n,r){if(e===u.topMouseOver&&(r.relatedTarget||r.fromElement))return null;if(e!==u.topMouseOut&&e!==u.topMouseOver)return null;var s;if(t.window===t)s=t;else{var d=t.ownerDocument;s=d?d.defaultView||d.parentWindow:window}var f,h;if(e===u.topMouseOut?(f=t,h=c(r.relatedTarget||r.toElement)||s):(f=s,h=t),f===h)return null;var m=f?a.getID(f):"",v=h?a.getID(h):"",y=i.getPooled(l.mouseLeave,m,r);y.type="mouseleave",y.target=f,y.relatedTarget=h;var g=i.getPooled(l.mouseEnter,v,r);return g.type="mouseenter",g.target=h,g.relatedTarget=f,o.accumulateEnterLeaveDispatches(y,g,m,v),p[0]=y,p[1]=g,p}};e.exports=d},function(e,t,n){(function(t){var r=n(12),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,n,o){return e.addEventListener?(e.addEventListener(n,o,!0),{remove:function(){e.removeEventListener(n,o,!0)}}):("production"!==t.env.NODE_ENV&&console.error("Attempted to listen to events during the capture phase on a browser that does not support the capture phase. Your application will not receive some events."),{remove:r})},registerDefault:function(){}};e.exports=o}).call(t,n(1))},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=n(16),i=n(3),a=n(112);i(r.prototype,{getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;r>e&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r,o=n(22),i=n(6),a=o.injection.MUST_USE_ATTRIBUTE,s=o.injection.MUST_USE_PROPERTY,u=o.injection.HAS_BOOLEAN_VALUE,c=o.injection.HAS_SIDE_EFFECTS,l=o.injection.HAS_NUMERIC_VALUE,p=o.injection.HAS_POSITIVE_NUMERIC_VALUE,d=o.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(i.canUseDOM){var f=document.implementation;r=f&&f.hasFeature&&f.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:a|u,allowTransparency:a,alt:null,async:u,autoComplete:null,autoPlay:u,cellPadding:null,cellSpacing:null,charSet:a,checked:s|u,classID:a,className:r?a:s,cols:a|p,colSpan:null,content:null,contentEditable:null,contextMenu:a,controls:s|u,coords:null,crossOrigin:null,data:null,dateTime:a,defer:u,dir:null,disabled:a|u,download:d,draggable:null,encType:null,form:a,formAction:a,formEncType:a,formMethod:a,formNoValidate:u,formTarget:a,frameBorder:a,headers:null,height:a,hidden:a|u,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,label:null,lang:null,list:a,loop:s|u,manifest:a,marginHeight:null,marginWidth:null,max:null,maxLength:a,media:a,mediaGroup:null,method:null,min:null,multiple:s|u,muted:s|u,name:null,noValidate:u,open:u,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|u,rel:null,required:u,role:a,rows:a|p,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:a|u,selected:s|u,shape:null,size:a|p,sizes:a,span:p,spellCheck:null,src:null,srcDoc:s,srcSet:a,start:l,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|c,width:a,wmode:a,autoCapitalize:null,autoCorrect:null,itemProp:a,itemScope:a|u,itemType:a,itemID:a,itemRef:a,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};e.exports=h},function(e,t,n){"use strict";var r=n(190),o=n(198),i={linkState:function(e){return new r(this.state[e],o.createStateKeySetter(this,e))}};e.exports=i},function(e,t,n){"use strict";var r=n(8),o=n(12),i=r.topLevelTypes,a={eventTypes:null,extractEvents:function(e,t,n,r){if(e===i.topTouchStart){var a=r.target;a&&!a.onclick&&(a.onclick=o)}}};e.exports=a},function(e,t,n){"use strict";var r=n(23),o=n(3),i=r.createFactory(n(103)),a=r.createFactory(n(170)),s=r.createClass({displayName:"ReactCSSTransitionGroup",propTypes:{transitionName:r.PropTypes.string.isRequired,transitionAppear:r.PropTypes.bool,transitionEnter:r.PropTypes.bool,transitionLeave:r.PropTypes.bool},getDefaultProps:function(){return{transitionAppear:!1,transitionEnter:!0,transitionLeave:!0}},_wrapChild:function(e){return a({name:this.props.transitionName,appear:this.props.transitionAppear,enter:this.props.transitionEnter,leave:this.props.transitionLeave},e)},render:function(){return i(o({},this.props,{childFactory:this._wrapChild}))}});e.exports=s},function(e,t,n){(function(t){"use strict";var r=n(23),o=n(157),i=n(201),a=n(115),s=n(4),u=17,c=5e3,l=null;"production"!==t.env.NODE_ENV&&(l=function(){"production"!==t.env.NODE_ENV?s(!1,"transition(): tried to perform an animation without an animationend or transitionend event after timeout (%sms). You should either disable this transition in JS or add a CSS animation/transition.",c):null});var p=r.createClass({displayName:"ReactCSSTransitionGroupChild",transition:function(e,n){var r=this.getDOMNode(),a=this.props.name+"-"+e,s=a+"-active",u=null,p=function(e){e&&e.target!==r||("production"!==t.env.NODE_ENV&&clearTimeout(u),o.removeClass(r,a),o.removeClass(r,s),i.removeEndEventListener(r,p),n&&n())};i.addEndEventListener(r,p),o.addClass(r,a),this.queueClass(s),"production"!==t.env.NODE_ENV&&(u=setTimeout(l,c))},queueClass:function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this.flushClassNameQueue,u))},flushClassNameQueue:function(){this.isMounted()&&this.classNameQueue.forEach(o.addClass.bind(o,this.getDOMNode())),this.classNameQueue.length=0,this.timeout=null},componentWillMount:function(){this.classNameQueue=[]},componentWillUnmount:function(){this.timeout&&clearTimeout(this.timeout)},componentWillAppear:function(e){this.props.appear?this.transition("appear",e):e()},componentWillEnter:function(e){this.props.enter?this.transition("enter",e):e()},componentWillLeave:function(e){this.props.leave?this.transition("leave",e):e()},render:function(){return a(this.props.children)}});e.exports=p}).call(t,n(1))},function(e,t,n){"use strict";var r=n(31),o=n(223),i=n(67),a=n(70),s={instantiateChildren:function(e,t,n){var r=o(e);for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=i(s,null);r[a]=u}return r},updateChildren:function(e,t,n,s){var u=o(t);if(!u&&!e)return null;var c;for(c in u)if(u.hasOwnProperty(c)){var l=e&&e[c],p=l&&l._currentElement,d=u[c];if(a(p,d))r.receiveComponent(l,d,n,s),u[c]=l;else{l&&r.unmountComponent(l,c);var f=i(d,null);u[c]=f}}for(c in e)!e.hasOwnProperty(c)||u&&u.hasOwnProperty(c)||r.unmountComponent(e[c]);return u},unmountChildren:function(e){for(var t in e){var n=e[t];r.unmountComponent(n)}}};e.exports=s},function(e,t,n){"use strict";var r=n(116),o={shouldComponentUpdate:function(e,t){return!r(this.props,e)||!r(this.state,t)}};e.exports=o},function(e,t,n){(function(t){"use strict";function r(e){return"production"!==t.env.NODE_ENV?i.createFactory(e):o.createFactory(e)}var o=n(5),i=n(34),a=n(232),s=a({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",defs:"defs",ellipse:"ellipse",g:"g",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);e.exports=s}).call(t,n(1))},function(e,t,n){"use strict";var r=n(39),o=n(17),i=n(9),a=n(5),s=n(36),u=a.createFactory("button"),c=s({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),l=i.createClass({displayName:"ReactDOMButton",tagName:"BUTTON",mixins:[r,o],render:function(){var e={};for(var t in this.props)!this.props.hasOwnProperty(t)||this.props.disabled&&c[t]||(e[t]=this.props[t]);return u(e,this.props.children)}});e.exports=l},function(e,t,n){"use strict";var r=n(8),o=n(54),i=n(17),a=n(9),s=n(5),u=s.createFactory("form"),c=a.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[i,o],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(r.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(r.topLevelTypes.topSubmit,"submit")}});e.exports=c},function(e,t,n){"use strict";var r=n(8),o=n(54),i=n(17),a=n(9),s=n(5),u=s.createFactory("iframe"),c=a.createClass({displayName:"ReactDOMIframe",tagName:"IFRAME",mixins:[i,o],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(r.topLevelTypes.topLoad,"load")}});e.exports=c},function(e,t,n){"use strict";var r=n(8),o=n(54),i=n(17),a=n(9),s=n(5),u=s.createFactory("img"),c=a.createClass({displayName:"ReactDOMImg",tagName:"IMG",mixins:[i,o],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(r.topLevelTypes.topLoad,"load"),this.trapBubbledEvent(r.topLevelTypes.topError,"error")}});e.exports=c},function(e,t,n){(function(t){"use strict";function r(){this.isMounted()&&this.forceUpdate()}var o=n(39),i=n(33),a=n(53),s=n(17),u=n(9),c=n(5),l=n(11),p=n(10),d=n(3),f=n(2),h=c.createFactory("input"),m={},v=u.createClass({displayName:"ReactDOMInput",tagName:"INPUT",mixins:[o,a.Mixin,s],getInitialState:function(){var e=this.props.defaultValue;return{initialChecked:this.props.defaultChecked||!1,initialValue:null!=e?e:null}},render:function(){var e=d({},this.props);e.defaultChecked=null,e.defaultValue=null;var t=a.getValue(this);e.value=null!=t?t:this.state.initialValue;var n=a.getChecked(this);return e.checked=null!=n?n:this.state.initialChecked,e.onChange=this._handleChange,h(e,this.props.children)},componentDidMount:function(){var e=l.getID(this.getDOMNode());m[e]=this},componentWillUnmount:function(){var e=this.getDOMNode(),t=l.getID(e);delete m[t]},componentDidUpdate:function(e,t,n){var r=this.getDOMNode();null!=this.props.checked&&i.setValueForProperty(r,"checked",this.props.checked||!1);var o=a.getValue(this);null!=o&&i.setValueForProperty(r,"value",""+o)},_handleChange:function(e){var n,o=a.getOnChange(this);o&&(n=o.call(this,e)),p.asap(r,this);var i=this.props.name;if("radio"===this.props.type&&null!=i){for(var s=this.getDOMNode(),u=s;u.parentNode;)u=u.parentNode;for(var c=u.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),d=0,h=c.length;h>d;d++){var v=c[d];if(v!==s&&v.form===s.form){var y=l.getID(v);"production"!==t.env.NODE_ENV?f(y,"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."):f(y);var g=m[y];"production"!==t.env.NODE_ENV?f(g,"ReactDOMInput: Unknown radio button ID %s.",y):f(g),p.asap(r,g)}}}return n}});e.exports=v}).call(t,n(1))},function(e,t,n){(function(t){"use strict";var r=n(17),o=n(9),i=n(5),a=n(4),s=i.createFactory("option"),u=o.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[r],componentWillMount:function(){"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?a(null==this.props.selected,"Use the `defaultValue` or `value` props on , and ) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.",this.constructor.displayName):a(!1)},render:function(){return n(this.props)}});return r}var o=n(9),i=n(5),a=n(2);e.exports=r}).call(t,n(1))},function(e,t,n){(function(t){function r(e){var t=e.match(l);return t&&t[1].toLowerCase()}function o(e,n){var o=c;"production"!==t.env.NODE_ENV?u(!!c,"createNodesFromMarkup dummy not initialized"):u(!!c);var i=r(e),l=i&&s(i);if(l){o.innerHTML=l[1]+e+l[2]; - -for(var p=l[0];p--;)o=o.lastChild}else o.innerHTML=e;var d=o.getElementsByTagName("script");d.length&&("production"!==t.env.NODE_ENV?u(n,"createNodesFromMarkup(...): Unexpected