├── .babelrc ├── .eslintrc ├── .gitignore ├── .npmignore ├── .tool-versions ├── .travis.yml ├── LICENSE ├── README.md ├── core ├── director.js ├── flight.js └── velocity-composer.js ├── dist ├── .gitkeep ├── foobanzle.js ├── foobanzle.min.js ├── react-flight.js └── react-flight.min.js ├── dom ├── controls.js ├── index.js └── ui.js ├── examples ├── compos-redux │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ ├── src │ │ ├── App.css │ │ ├── App.js │ │ ├── actions │ │ │ ├── action-types.js │ │ │ └── people-actions.js │ │ ├── components │ │ │ ├── PeopleContainer.js │ │ │ ├── PeopleList.js │ │ │ ├── Person.js │ │ │ └── PersonInput.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ ├── reducers │ │ │ ├── index.js │ │ │ └── people-reducer.js │ │ ├── registerServiceWorker.js │ │ └── store │ │ │ └── configure-store.js │ └── yarn.lock └── compos │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ └── manifest.json │ ├── src │ ├── App.css │ ├── App.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ └── registerServiceWorker.js │ └── yarn.lock ├── media └── flight.png ├── package.json ├── src ├── __tests__ │ ├── __snapshots__ │ │ └── index.spec.js.snap │ └── index.spec.js ├── core │ ├── director.js │ ├── flight.js │ └── velocity-composer.js └── dom │ ├── controls.js │ ├── index.js │ └── ui.js ├── webpack.config.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["transform-runtime"], 3 | "presets": ["es2015", "stage-0", "react"] 4 | } 5 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "standard", 4 | "standard-flow", 5 | "standard-jsx" 6 | ], 7 | "rules":{ 8 | "space-before-function-paren": 0, 9 | "comma-dangle":0 10 | }, 11 | "env":{ 12 | "jest": true 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | examples/ 3 | .babelrc 4 | .eslintrc 5 | media/ 6 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 7.7.2 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "6.0" 4 | - "7.0" 5 | - "8.0" 6 | script: yarn build && yarn test && cd examples/compos && yarn 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Dotan Nahum 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](media/flight.png) 2 | [https://jondot.github.io/react-flight/](https://jondot.github.io/react-flight/) 3 | 4 | 5 | 6 | The best way to build animation compositions for React. Design and compose a 7 | component to start with, a component to end with, and Flight will take it from 8 | there. 9 | 10 | Flight tries to be for React what [Principle](http://principleformac.com/) is 11 | for Sketch compositions - the fastest, most friction free way to compose and an 12 | effortless way to animate an idea, an interaction, or a short movie-like 13 | composition in a self-contained widget (a React component after all). 14 | 15 | 16 | Check out the new video: 17 |
18 | 19 | 20 |
21 | React Flight in Three Minutes 22 |
23 | 24 | ## Quick Start (From Scratch) 25 | 26 | Just clone and use the example, built around `create-react-app`: 27 | 28 | ``` 29 | $ git clone https://github.com/jondot/react-flight 30 | $ cd react-flight/examples/compos 31 | $ yarn && yarn start 32 | ``` 33 | 34 | 35 | ## Quick Start (Existing Project) 36 | 37 | With yarn (or npm): 38 | 39 | ``` 40 | $ yarn add react-flight 41 | $ curl https://raw.githubusercontent.com/jondot/react-flight/master/examples/compos/src/index.js -o src/anim.js 42 | ``` 43 | 44 | And now you can frame your compositions in `anim.js`, require and place it in 45 | any other React component. 46 | 47 | Next: 48 | 49 | 1. Add jQuery (or Zepto, or any jQuery drop-in) if you don't have it already in the project. 50 | 2. Or if you use `create-react-app` you can add it to your `public/index.html`, [like here](examples/compos/public/index.html), 51 | or eject and [configure webpack](https://webpack.github.io/docs/library-and-externals.html) for jQuery. 52 | 53 | _NOTE_: jQuery is currently a requirement of one of `react-flight`'s dependencies. 54 | We plan to rebuild that dependency any way, obsoleting this requirement in the 55 | process (also: PRs accepted!). 56 | 57 | ## Workflow 58 | 59 | When you're designing compositions, focus on designing frames. The 60 | first frame is marked `source` because that's the starting point, and 61 | `interactive` because you want to play with it while you go. 62 | 63 | ```jsx 64 | (this.flight = flight)}> 65 | 66 | ``` 67 | 68 | ### Showing Frames 69 | 70 | While designing, you want to have `showFrames` on. It will unpack 71 | all of the frames in front of you, so you could edit them while watching them. With 72 | Webpack hot-reload this becomes a fantastic experience. 73 | 74 | When done, remove `showFrames`. 75 | 76 | ### Controlling Flight Directly 77 | 78 | This is where the `ref` addition comes in: 79 | 80 | ```jsx 81 | (this.flight = flight)}> 82 | 83 | ``` 84 | 85 | Once you can grab an instance of `flight` you can `flight.play()` and `flight.reset()` on 86 | demand from your own components and actions. 87 | 88 | Here's a full layout: 89 | 90 | ```jsx 91 | (this.flight = flight)}> 92 | 93 | 94 | -- your own DOM / React Components --- 95 | -- starting position and styles --- 96 | 97 | 98 | 99 | 100 | 101 | -- your own DOM / React Components --- 102 | -- ending position and styles --- 103 | 104 | 105 | 106 | ``` 107 | 108 | 109 | 110 | 111 | 112 | ## Redux 113 | 114 | If you're using Redux, there's basic support for it. Basic in the sense that `react-flight` is not 115 | going to handle deep renders of a stateful app with all its gotchas, so YMMV. 116 | 117 | You can check out [this Redux example](examples/compos-redux) for a fully working solution. 118 | 119 | 120 | For your app, you can enable Redux support by indicating inclusion of store before using the `Flight` component: 121 | 122 | ```javascript 123 | Flight.contextTypes = { 124 | store: PropTypes.object, 125 | } 126 | 127 | Flight.childContextTypes = { 128 | ...Flight.childContextTypes, 129 | store: PropTypes.object, 130 | } 131 | ``` 132 | 133 | 134 | 135 | ## Under the Hood 136 | 137 | If you want to hack on `react-flight`, here are some context to keep in mind. 138 | 139 | `react-flight` does some cool stuff and some DOM-heavy stuff (perhaps less cool?). For the cool stuff, it 140 | walks the component tree, makes decisions about what should move where, and builds 141 | a clean and nice declarative data structure that represents the way compositions should 142 | behave. 143 | 144 | Currently it will then hand over this data to a DOM-based adapter, that also uses Velocity.js, 145 | so that it would actually orchestrate the animations. This is where you're welcome 146 | to plug in your own adapter - another animation engine, React Native, and what not. 147 | 148 | Happy hacking! 149 | 150 | 151 | # Contributing 152 | 153 | Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :). 154 | 155 | 156 | ### Thanks: 157 | 158 | To all [Contributors](https://github.com/jondot/react-flight/graphs/contributors) - you make this happen, thanks! 159 | 160 | 161 | # Copyright 162 | 163 | Copyright (c) 2017 [Dotan Nahum](http://gplus.to/dotan) [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE) for further details. 164 | -------------------------------------------------------------------------------- /core/director.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | 7 | var _keys = require('babel-runtime/core-js/object/keys'); 8 | 9 | var _keys2 = _interopRequireDefault(_keys); 10 | 11 | var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); 12 | 13 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 14 | 15 | var _createClass2 = require('babel-runtime/helpers/createClass'); 16 | 17 | var _createClass3 = _interopRequireDefault(_createClass2); 18 | 19 | var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); 20 | 21 | var _defineProperty3 = _interopRequireDefault(_defineProperty2); 22 | 23 | var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray'); 24 | 25 | var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); 26 | 27 | var _extends2 = require('babel-runtime/helpers/extends'); 28 | 29 | var _extends3 = _interopRequireDefault(_extends2); 30 | 31 | var _react = require('react'); 32 | 33 | var _react2 = _interopRequireDefault(_react); 34 | 35 | var _flattenDeep = require('lodash/flattenDeep'); 36 | 37 | var _flattenDeep2 = _interopRequireDefault(_flattenDeep); 38 | 39 | var _merge = require('lodash/merge'); 40 | 41 | var _merge2 = _interopRequireDefault(_merge); 42 | 43 | var _mergeWith = require('lodash/mergeWith'); 44 | 45 | var _mergeWith2 = _interopRequireDefault(_mergeWith); 46 | 47 | var _map = require('lodash/map'); 48 | 49 | var _map2 = _interopRequireDefault(_map); 50 | 51 | var _isFunction = require('lodash/isFunction'); 52 | 53 | var _isFunction2 = _interopRequireDefault(_isFunction); 54 | 55 | var _reduce = require('lodash/reduce'); 56 | 57 | var _reduce2 = _interopRequireDefault(_reduce); 58 | 59 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 60 | 61 | var walk = function walk(root, c) { 62 | if (!c.props) { 63 | return []; 64 | } 65 | 66 | return _react.Children.toArray(c.props.children).map(function (child) { 67 | if (!child) { 68 | return []; 69 | } 70 | 71 | //TODO use a better classifier than className. maybe anim prop? 72 | if (!child.props) { 73 | console.log('warn: no props', child); 74 | } 75 | 76 | // try extracting style and class from React component, 77 | // if not - go through a forced render (and set resolvedchild) 78 | var resolvedChild = child; 79 | if (!(child.props && child.props.className && child.props.style)) { 80 | //if we're both type and has name we're probably a react comp. 81 | if ((0, _isFunction2.default)(child.type)) { 82 | var renderable = new child.type( 83 | // source is a context field - synthesize it instead of 84 | // manufacturing a real context. It's OK because this 85 | // render goes to trash after we're done, and not the DOM. 86 | (0, _extends3.default)({ source: true }, child.props), root.context); 87 | if ((0, _isFunction2.default)(renderable.render)) { 88 | resolvedChild = renderable.render(); 89 | } 90 | } 91 | } 92 | 93 | // all this className circus is just to pick a name we can treat 94 | // as a grouping key when later locating pairs (or more) of connected 95 | // components. 96 | if (resolvedChild.props && resolvedChild.props.className && resolvedChild.props.style) { 97 | var _styles = resolvedChild.props.style; 98 | var name = resolvedChild.props.className || resolvedChild.props.name; 99 | return [(0, _defineProperty3.default)({}, name, { styles: [_styles], ref: resolvedChild, name: name })].concat((0, _toConsumableArray3.default)(walk(root, resolvedChild))); 100 | } else { 101 | return walk(root, child); 102 | } 103 | }); 104 | }; 105 | var styles = function styles(root) { 106 | var extract = function extract(comp) { 107 | return _merge2.default.apply(undefined, (0, _toConsumableArray3.default)((0, _flattenDeep2.default)(walk(root, comp)))); 108 | }; 109 | 110 | var extracts = _react.Children.toArray(root.props.children).map(extract); 111 | return _mergeWith2.default.apply(undefined, (0, _toConsumableArray3.default)(extracts).concat([function (objValue, srcValue) { 112 | return { 113 | styles: objValue.styles.concat(srcValue.styles), 114 | ref: objValue.ref, 115 | name: objValue.name 116 | }; 117 | }])); 118 | }; 119 | 120 | var Director = function () { 121 | function Director(comp, composer) { 122 | (0, _classCallCheck3.default)(this, Director); 123 | 124 | this.root = comp; 125 | var stylemap = styles(comp); 126 | var frames = (0, _map2.default)(_react.Children.toArray(comp.props.children), function (c) { 127 | return { 128 | duration: c.props.duration || 500 129 | }; 130 | }); 131 | 132 | var movements = (0, _reduce2.default)((0, _keys2.default)(stylemap), function (acc, k) { 133 | var movement = (0, _map2.default)(frames, function (f, i) { 134 | var to = stylemap[k].styles[i + 1]; 135 | var _stylemap$k = stylemap[k], 136 | ref = _stylemap$k.ref, 137 | name = _stylemap$k.name; 138 | 139 | if (to) { 140 | return { 141 | root: { namespace: comp.namespace }, 142 | target: { style: to, ref: ref, name: name }, 143 | duration: f.duration 144 | }; 145 | } 146 | return {}; // one extra null movement 147 | }); 148 | 149 | return [].concat((0, _toConsumableArray3.default)(acc), [movement]); 150 | }, []); 151 | 152 | this.frames = frames; 153 | this.movements = movements; 154 | this.composer = composer(movements); 155 | } 156 | 157 | (0, _createClass3.default)(Director, [{ 158 | key: 'pause', 159 | value: function pause() { 160 | this.composer.pause(); 161 | } 162 | }, { 163 | key: 'loop', 164 | value: function loop() { 165 | this.composer.loop(); 166 | } 167 | }, { 168 | key: 'play', 169 | value: function play() { 170 | this.composer.play(); 171 | } 172 | }, { 173 | key: 'reset', 174 | value: function reset() { 175 | this.composer.reset(); 176 | } 177 | }]); 178 | return Director; 179 | }(); 180 | 181 | exports.default = Director; -------------------------------------------------------------------------------- /core/flight.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | 7 | var _extends2 = require('babel-runtime/helpers/extends'); 8 | 9 | var _extends3 = _interopRequireDefault(_extends2); 10 | 11 | var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); 12 | 13 | var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); 14 | 15 | var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); 16 | 17 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 18 | 19 | var _createClass2 = require('babel-runtime/helpers/createClass'); 20 | 21 | var _createClass3 = _interopRequireDefault(_createClass2); 22 | 23 | var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); 24 | 25 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 26 | 27 | var _inherits2 = require('babel-runtime/helpers/inherits'); 28 | 29 | var _inherits3 = _interopRequireDefault(_inherits2); 30 | 31 | var _react = require('react'); 32 | 33 | var _react2 = _interopRequireDefault(_react); 34 | 35 | var _propTypes = require('prop-types'); 36 | 37 | var _propTypes2 = _interopRequireDefault(_propTypes); 38 | 39 | var _velocityComposer = require('./velocity-composer'); 40 | 41 | var _velocityComposer2 = _interopRequireDefault(_velocityComposer); 42 | 43 | var _director = require('./director'); 44 | 45 | var _director2 = _interopRequireDefault(_director); 46 | 47 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 48 | 49 | var flight = function flight(Container, Controls) { 50 | var connector = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (_) { 51 | return _; 52 | }; 53 | 54 | var Flight = function (_Component) { 55 | (0, _inherits3.default)(Flight, _Component); 56 | 57 | function Flight(props) { 58 | (0, _classCallCheck3.default)(this, Flight); 59 | 60 | var _this = (0, _possibleConstructorReturn3.default)(this, (Flight.__proto__ || (0, _getPrototypeOf2.default)(Flight)).call(this, props)); 61 | 62 | _this.play = function () { 63 | var director = _this.state.director; 64 | if (director) { 65 | director.play(); 66 | _this.setState((0, _extends3.default)({}, _this.state, { action: 'play' })); 67 | } 68 | }; 69 | 70 | _this.reset = function () { 71 | var director = _this.state.director; 72 | if (director) { 73 | director.reset(); 74 | _this.setState((0, _extends3.default)({}, _this.state, { action: 'reset' })); 75 | } 76 | }; 77 | 78 | _this.nothing = function () {}; 79 | 80 | _this.namespace = 'flt__id__' + parseInt(Math.random() * Math.pow(2, 32), 10); 81 | _this.state = {}; 82 | return _this; 83 | } 84 | 85 | (0, _createClass3.default)(Flight, [{ 86 | key: 'getChildContext', 87 | value: function getChildContext() { 88 | return (0, _extends3.default)({}, this.context, { director: this.state.director }); 89 | } 90 | }, { 91 | key: 'componentDidMount', 92 | value: function componentDidMount() { 93 | var _this2 = this; 94 | 95 | requestAnimationFrame(function () { 96 | var director = new _director2.default(_this2, function (_) { 97 | return new _velocityComposer2.default(_); 98 | }); 99 | _this2.setState({ 100 | director: director 101 | }); // force context refetch 102 | }); 103 | } 104 | }, { 105 | key: 'render', 106 | value: function render() { 107 | var interactive = this.props.interactive; 108 | 109 | var action = interactive ? this.state.action === 'play' ? this.reset : this.play : this.nothing; 110 | return _react2.default.createElement( 111 | Container, 112 | { 113 | id: this.namespace, 114 | style: this.props.style, 115 | onPress: action 116 | }, 117 | this.props.controls && _react2.default.createElement(Controls, { onPlay: this.play, onReset: this.reset }), 118 | this.props.showFrames ? this.props.children : _react.Children.toArray(this.props.children)[0] 119 | ); 120 | } 121 | }]); 122 | return Flight; 123 | }(_react.Component); 124 | 125 | Flight.childContextTypes = { 126 | director: _propTypes2.default.object 127 | }; 128 | 129 | var Frame = function (_Component2) { 130 | (0, _inherits3.default)(Frame, _Component2); 131 | 132 | function Frame() { 133 | (0, _classCallCheck3.default)(this, Frame); 134 | return (0, _possibleConstructorReturn3.default)(this, (Frame.__proto__ || (0, _getPrototypeOf2.default)(Frame)).apply(this, arguments)); 135 | } 136 | 137 | (0, _createClass3.default)(Frame, [{ 138 | key: 'getChildContext', 139 | value: function getChildContext() { 140 | return { 141 | source: this.props.source 142 | }; 143 | } 144 | }, { 145 | key: 'render', 146 | value: function render() { 147 | return _react.Children.only(this.props.children); 148 | } 149 | }]); 150 | return Frame; 151 | }(_react.Component); 152 | 153 | Frame.childContextTypes = { 154 | source: _propTypes2.default.bool 155 | }; 156 | Flight.Frame = connector(Frame); 157 | return connector(Flight); 158 | }; 159 | 160 | exports.default = flight; -------------------------------------------------------------------------------- /core/velocity-composer.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | 7 | var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); 8 | 9 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 10 | 11 | var _createClass2 = require('babel-runtime/helpers/createClass'); 12 | 13 | var _createClass3 = _interopRequireDefault(_createClass2); 14 | 15 | var _reduce = require('lodash/reduce'); 16 | 17 | var _reduce2 = _interopRequireDefault(_reduce); 18 | 19 | var _map = require('lodash/map'); 20 | 21 | var _map2 = _interopRequireDefault(_map); 22 | 23 | var _velocity = require('tweene/velocity'); 24 | 25 | var _velocity2 = _interopRequireDefault(_velocity); 26 | 27 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 28 | 29 | _velocity2.default.defaultDriver = 'velocity'; 30 | 31 | var VelocityComposer = function () { 32 | function VelocityComposer(movements) { 33 | (0, _classCallCheck3.default)(this, VelocityComposer); 34 | 35 | this.timelines = this._build(movements); 36 | } 37 | 38 | (0, _createClass3.default)(VelocityComposer, [{ 39 | key: '_build', 40 | value: function _build(movements) { 41 | var timelines = (0, _map2.default)(movements, function (movement) { 42 | return (0, _reduce2.default)(movement, function (timeline, step) { 43 | if (step.target) { 44 | timeline.add(_velocity2.default.to('#' + step.root.namespace + ' #' + step.target.name, step.target.style, { 45 | duration: step.duration, 46 | paused: true 47 | })); 48 | } 49 | return timeline; 50 | }, _velocity2.default.line()); 51 | }); 52 | return timelines; 53 | } 54 | }, { 55 | key: '__timelines', 56 | value: function __timelines(cmd) { 57 | this.timelines.forEach(function (t) { 58 | return t[cmd](); 59 | }); 60 | } 61 | }, { 62 | key: 'resume', 63 | value: function resume() { 64 | this.__timelines('resume'); 65 | } 66 | }, { 67 | key: 'pause', 68 | value: function pause() { 69 | this.__timelines('pause'); 70 | } 71 | }, { 72 | key: 'loop', 73 | value: function loop() { 74 | this.__timelines('loop'); 75 | } 76 | }, { 77 | key: 'play', 78 | value: function play() { 79 | this.__timelines('play'); 80 | } 81 | }, { 82 | key: 'reset', 83 | value: function reset() { 84 | this.__timelines('reverse'); 85 | } 86 | }]); 87 | return VelocityComposer; 88 | }(); 89 | 90 | exports.default = VelocityComposer; -------------------------------------------------------------------------------- /dist/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jondot/react-flight/d12697130abceffeec1dbd7e363a42ea1ffd61c0/dist/.gitkeep -------------------------------------------------------------------------------- /dist/foobanzle.js: -------------------------------------------------------------------------------- 1 | (function webpackUniversalModuleDefinition(root, factory) { 2 | if(typeof exports === 'object' && typeof module === 'object') 3 | module.exports = factory(require("lodash")); 4 | else if(typeof define === 'function' && define.amd) 5 | define(["lodash"], factory); 6 | else { 7 | var a = typeof exports === 'object' ? factory(require("lodash")) : factory(root["lodash"]); 8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; 9 | } 10 | })(this, function(__WEBPACK_EXTERNAL_MODULE_71__) { 11 | return /******/ (function(modules) { // webpackBootstrap 12 | /******/ // The module cache 13 | /******/ var installedModules = {}; 14 | 15 | /******/ // The require function 16 | /******/ function __webpack_require__(moduleId) { 17 | 18 | /******/ // Check if module is in cache 19 | /******/ if(installedModules[moduleId]) 20 | /******/ return installedModules[moduleId].exports; 21 | 22 | /******/ // Create a new module (and put it into the cache) 23 | /******/ var module = installedModules[moduleId] = { 24 | /******/ exports: {}, 25 | /******/ id: moduleId, 26 | /******/ loaded: false 27 | /******/ }; 28 | 29 | /******/ // Execute the module function 30 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31 | 32 | /******/ // Flag the module as loaded 33 | /******/ module.loaded = true; 34 | 35 | /******/ // Return the exports of the module 36 | /******/ return module.exports; 37 | /******/ } 38 | 39 | 40 | /******/ // expose the modules object (__webpack_modules__) 41 | /******/ __webpack_require__.m = modules; 42 | 43 | /******/ // expose the module cache 44 | /******/ __webpack_require__.c = installedModules; 45 | 46 | /******/ // __webpack_public_path__ 47 | /******/ __webpack_require__.p = ""; 48 | 49 | /******/ // Load entry module and return exports 50 | /******/ return __webpack_require__(0); 51 | /******/ }) 52 | /************************************************************************/ 53 | /******/ ([ 54 | /* 0 */ 55 | /***/ function(module, exports, __webpack_require__) { 56 | 57 | 'use strict'; 58 | 59 | Object.defineProperty(exports, "__esModule", { 60 | value: true 61 | }); 62 | 63 | var _regenerator = __webpack_require__(36); 64 | 65 | var _regenerator2 = _interopRequireDefault(_regenerator); 66 | 67 | var _promise = __webpack_require__(20); 68 | 69 | var _promise2 = _interopRequireDefault(_promise); 70 | 71 | var _asyncToGenerator2 = __webpack_require__(33); 72 | 73 | var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); 74 | 75 | var _lodash = __webpack_require__(71); 76 | 77 | var _lodash2 = _interopRequireDefault(_lodash); 78 | 79 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 80 | 81 | var foobar = function () { 82 | var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { 83 | return _regenerator2.default.wrap(function _callee$(_context) { 84 | while (1) { 85 | switch (_context.prev = _context.next) { 86 | case 0: 87 | return _context.abrupt('return', _promise2.default.resolve('whoo')); 88 | 89 | case 1: 90 | case 'end': 91 | return _context.stop(); 92 | } 93 | } 94 | }, _callee, undefined); 95 | })); 96 | 97 | return function foobar() { 98 | return _ref.apply(this, arguments); 99 | }; 100 | }(); 101 | var foobanzle = function () { 102 | var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(array) { 103 | var res; 104 | return _regenerator2.default.wrap(function _callee2$(_context2) { 105 | while (1) { 106 | switch (_context2.prev = _context2.next) { 107 | case 0: 108 | _context2.next = 2; 109 | return foobar(); 110 | 111 | case 2: 112 | res = _context2.sent; 113 | return _context2.abrupt('return', res + ' : ' + _lodash2.default.head(array)); 114 | 115 | case 4: 116 | case 'end': 117 | return _context2.stop(); 118 | } 119 | } 120 | }, _callee2, undefined); 121 | })); 122 | 123 | return function foobanzle(_x) { 124 | return _ref2.apply(this, arguments); 125 | }; 126 | }(); 127 | 128 | exports.default = foobanzle; 129 | 130 | /***/ }, 131 | /* 1 */ 132 | /***/ function(module, exports, __webpack_require__) { 133 | 134 | var store = __webpack_require__(29)('wks') 135 | , uid = __webpack_require__(32) 136 | , Symbol = __webpack_require__(2).Symbol 137 | , USE_SYMBOL = typeof Symbol == 'function'; 138 | 139 | var $exports = module.exports = function(name){ 140 | return store[name] || (store[name] = 141 | USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); 142 | }; 143 | 144 | $exports.store = store; 145 | 146 | /***/ }, 147 | /* 2 */ 148 | /***/ function(module, exports) { 149 | 150 | // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 151 | var global = module.exports = typeof window != 'undefined' && window.Math == Math 152 | ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 153 | if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef 154 | 155 | /***/ }, 156 | /* 3 */ 157 | /***/ function(module, exports, __webpack_require__) { 158 | 159 | var isObject = __webpack_require__(11); 160 | module.exports = function(it){ 161 | if(!isObject(it))throw TypeError(it + ' is not an object!'); 162 | return it; 163 | }; 164 | 165 | /***/ }, 166 | /* 4 */ 167 | /***/ function(module, exports, __webpack_require__) { 168 | 169 | var dP = __webpack_require__(12) 170 | , createDesc = __webpack_require__(28); 171 | module.exports = __webpack_require__(6) ? function(object, key, value){ 172 | return dP.f(object, key, createDesc(1, value)); 173 | } : function(object, key, value){ 174 | object[key] = value; 175 | return object; 176 | }; 177 | 178 | /***/ }, 179 | /* 5 */ 180 | /***/ function(module, exports) { 181 | 182 | var core = module.exports = {version: '2.4.0'}; 183 | if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef 184 | 185 | /***/ }, 186 | /* 6 */ 187 | /***/ function(module, exports, __webpack_require__) { 188 | 189 | // Thank's IE8 for his funny defineProperty 190 | module.exports = !__webpack_require__(24)(function(){ 191 | return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; 192 | }); 193 | 194 | /***/ }, 195 | /* 7 */ 196 | /***/ function(module, exports) { 197 | 198 | module.exports = {}; 199 | 200 | /***/ }, 201 | /* 8 */ 202 | /***/ function(module, exports) { 203 | 204 | var toString = {}.toString; 205 | 206 | module.exports = function(it){ 207 | return toString.call(it).slice(8, -1); 208 | }; 209 | 210 | /***/ }, 211 | /* 9 */ 212 | /***/ function(module, exports, __webpack_require__) { 213 | 214 | // optional / simple context binding 215 | var aFunction = __webpack_require__(13); 216 | module.exports = function(fn, that, length){ 217 | aFunction(fn); 218 | if(that === undefined)return fn; 219 | switch(length){ 220 | case 1: return function(a){ 221 | return fn.call(that, a); 222 | }; 223 | case 2: return function(a, b){ 224 | return fn.call(that, a, b); 225 | }; 226 | case 3: return function(a, b, c){ 227 | return fn.call(that, a, b, c); 228 | }; 229 | } 230 | return function(/* ...args */){ 231 | return fn.apply(that, arguments); 232 | }; 233 | }; 234 | 235 | /***/ }, 236 | /* 10 */ 237 | /***/ function(module, exports) { 238 | 239 | var hasOwnProperty = {}.hasOwnProperty; 240 | module.exports = function(it, key){ 241 | return hasOwnProperty.call(it, key); 242 | }; 243 | 244 | /***/ }, 245 | /* 11 */ 246 | /***/ function(module, exports) { 247 | 248 | module.exports = function(it){ 249 | return typeof it === 'object' ? it !== null : typeof it === 'function'; 250 | }; 251 | 252 | /***/ }, 253 | /* 12 */ 254 | /***/ function(module, exports, __webpack_require__) { 255 | 256 | var anObject = __webpack_require__(3) 257 | , IE8_DOM_DEFINE = __webpack_require__(42) 258 | , toPrimitive = __webpack_require__(63) 259 | , dP = Object.defineProperty; 260 | 261 | exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes){ 262 | anObject(O); 263 | P = toPrimitive(P, true); 264 | anObject(Attributes); 265 | if(IE8_DOM_DEFINE)try { 266 | return dP(O, P, Attributes); 267 | } catch(e){ /* empty */ } 268 | if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); 269 | if('value' in Attributes)O[P] = Attributes.value; 270 | return O; 271 | }; 272 | 273 | /***/ }, 274 | /* 13 */ 275 | /***/ function(module, exports) { 276 | 277 | module.exports = function(it){ 278 | if(typeof it != 'function')throw TypeError(it + ' is not a function!'); 279 | return it; 280 | }; 281 | 282 | /***/ }, 283 | /* 14 */ 284 | /***/ function(module, exports) { 285 | 286 | // 7.2.1 RequireObjectCoercible(argument) 287 | module.exports = function(it){ 288 | if(it == undefined)throw TypeError("Can't call method on " + it); 289 | return it; 290 | }; 291 | 292 | /***/ }, 293 | /* 15 */ 294 | /***/ function(module, exports, __webpack_require__) { 295 | 296 | var isObject = __webpack_require__(11) 297 | , document = __webpack_require__(2).document 298 | // in old IE typeof document.createElement is 'object' 299 | , is = isObject(document) && isObject(document.createElement); 300 | module.exports = function(it){ 301 | return is ? document.createElement(it) : {}; 302 | }; 303 | 304 | /***/ }, 305 | /* 16 */ 306 | /***/ function(module, exports, __webpack_require__) { 307 | 308 | var def = __webpack_require__(12).f 309 | , has = __webpack_require__(10) 310 | , TAG = __webpack_require__(1)('toStringTag'); 311 | 312 | module.exports = function(it, tag, stat){ 313 | if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); 314 | }; 315 | 316 | /***/ }, 317 | /* 17 */ 318 | /***/ function(module, exports, __webpack_require__) { 319 | 320 | var shared = __webpack_require__(29)('keys') 321 | , uid = __webpack_require__(32); 322 | module.exports = function(key){ 323 | return shared[key] || (shared[key] = uid(key)); 324 | }; 325 | 326 | /***/ }, 327 | /* 18 */ 328 | /***/ function(module, exports) { 329 | 330 | // 7.1.4 ToInteger 331 | var ceil = Math.ceil 332 | , floor = Math.floor; 333 | module.exports = function(it){ 334 | return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 335 | }; 336 | 337 | /***/ }, 338 | /* 19 */ 339 | /***/ function(module, exports, __webpack_require__) { 340 | 341 | // to indexed object, toObject with fallback for non-array-like ES3 strings 342 | var IObject = __webpack_require__(44) 343 | , defined = __webpack_require__(14); 344 | module.exports = function(it){ 345 | return IObject(defined(it)); 346 | }; 347 | 348 | /***/ }, 349 | /* 20 */ 350 | /***/ function(module, exports, __webpack_require__) { 351 | 352 | module.exports = { "default": __webpack_require__(37), __esModule: true }; 353 | 354 | /***/ }, 355 | /* 21 */ 356 | /***/ function(module, exports, __webpack_require__) { 357 | 358 | // getting tag from 19.1.3.6 Object.prototype.toString() 359 | var cof = __webpack_require__(8) 360 | , TAG = __webpack_require__(1)('toStringTag') 361 | // ES3 wrong here 362 | , ARG = cof(function(){ return arguments; }()) == 'Arguments'; 363 | 364 | // fallback for IE11 Script Access Denied error 365 | var tryGet = function(it, key){ 366 | try { 367 | return it[key]; 368 | } catch(e){ /* empty */ } 369 | }; 370 | 371 | module.exports = function(it){ 372 | var O, T, B; 373 | return it === undefined ? 'Undefined' : it === null ? 'Null' 374 | // @@toStringTag case 375 | : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T 376 | // builtinTag case 377 | : ARG ? cof(O) 378 | // ES3 arguments fallback 379 | : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; 380 | }; 381 | 382 | /***/ }, 383 | /* 22 */ 384 | /***/ function(module, exports) { 385 | 386 | // IE 8- don't enum bug keys 387 | module.exports = ( 388 | 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' 389 | ).split(','); 390 | 391 | /***/ }, 392 | /* 23 */ 393 | /***/ function(module, exports, __webpack_require__) { 394 | 395 | var global = __webpack_require__(2) 396 | , core = __webpack_require__(5) 397 | , ctx = __webpack_require__(9) 398 | , hide = __webpack_require__(4) 399 | , PROTOTYPE = 'prototype'; 400 | 401 | var $export = function(type, name, source){ 402 | var IS_FORCED = type & $export.F 403 | , IS_GLOBAL = type & $export.G 404 | , IS_STATIC = type & $export.S 405 | , IS_PROTO = type & $export.P 406 | , IS_BIND = type & $export.B 407 | , IS_WRAP = type & $export.W 408 | , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) 409 | , expProto = exports[PROTOTYPE] 410 | , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] 411 | , key, own, out; 412 | if(IS_GLOBAL)source = name; 413 | for(key in source){ 414 | // contains in native 415 | own = !IS_FORCED && target && target[key] !== undefined; 416 | if(own && key in exports)continue; 417 | // export native or passed 418 | out = own ? target[key] : source[key]; 419 | // prevent global pollution for namespaces 420 | exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] 421 | // bind timers to global for call from export context 422 | : IS_BIND && own ? ctx(out, global) 423 | // wrap global constructors for prevent change them in library 424 | : IS_WRAP && target[key] == out ? (function(C){ 425 | var F = function(a, b, c){ 426 | if(this instanceof C){ 427 | switch(arguments.length){ 428 | case 0: return new C; 429 | case 1: return new C(a); 430 | case 2: return new C(a, b); 431 | } return new C(a, b, c); 432 | } return C.apply(this, arguments); 433 | }; 434 | F[PROTOTYPE] = C[PROTOTYPE]; 435 | return F; 436 | // make static versions for prototype methods 437 | })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 438 | // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% 439 | if(IS_PROTO){ 440 | (exports.virtual || (exports.virtual = {}))[key] = out; 441 | // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% 442 | if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); 443 | } 444 | } 445 | }; 446 | // type bitmap 447 | $export.F = 1; // forced 448 | $export.G = 2; // global 449 | $export.S = 4; // static 450 | $export.P = 8; // proto 451 | $export.B = 16; // bind 452 | $export.W = 32; // wrap 453 | $export.U = 64; // safe 454 | $export.R = 128; // real proto method for `library` 455 | module.exports = $export; 456 | 457 | /***/ }, 458 | /* 24 */ 459 | /***/ function(module, exports) { 460 | 461 | module.exports = function(exec){ 462 | try { 463 | return !!exec(); 464 | } catch(e){ 465 | return true; 466 | } 467 | }; 468 | 469 | /***/ }, 470 | /* 25 */ 471 | /***/ function(module, exports, __webpack_require__) { 472 | 473 | module.exports = __webpack_require__(2).document && document.documentElement; 474 | 475 | /***/ }, 476 | /* 26 */ 477 | /***/ function(module, exports, __webpack_require__) { 478 | 479 | 'use strict'; 480 | var LIBRARY = __webpack_require__(27) 481 | , $export = __webpack_require__(23) 482 | , redefine = __webpack_require__(57) 483 | , hide = __webpack_require__(4) 484 | , has = __webpack_require__(10) 485 | , Iterators = __webpack_require__(7) 486 | , $iterCreate = __webpack_require__(47) 487 | , setToStringTag = __webpack_require__(16) 488 | , getPrototypeOf = __webpack_require__(53) 489 | , ITERATOR = __webpack_require__(1)('iterator') 490 | , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` 491 | , FF_ITERATOR = '@@iterator' 492 | , KEYS = 'keys' 493 | , VALUES = 'values'; 494 | 495 | var returnThis = function(){ return this; }; 496 | 497 | module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ 498 | $iterCreate(Constructor, NAME, next); 499 | var getMethod = function(kind){ 500 | if(!BUGGY && kind in proto)return proto[kind]; 501 | switch(kind){ 502 | case KEYS: return function keys(){ return new Constructor(this, kind); }; 503 | case VALUES: return function values(){ return new Constructor(this, kind); }; 504 | } return function entries(){ return new Constructor(this, kind); }; 505 | }; 506 | var TAG = NAME + ' Iterator' 507 | , DEF_VALUES = DEFAULT == VALUES 508 | , VALUES_BUG = false 509 | , proto = Base.prototype 510 | , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] 511 | , $default = $native || getMethod(DEFAULT) 512 | , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined 513 | , $anyNative = NAME == 'Array' ? proto.entries || $native : $native 514 | , methods, key, IteratorPrototype; 515 | // Fix native 516 | if($anyNative){ 517 | IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); 518 | if(IteratorPrototype !== Object.prototype){ 519 | // Set @@toStringTag to native iterators 520 | setToStringTag(IteratorPrototype, TAG, true); 521 | // fix for some old engines 522 | if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); 523 | } 524 | } 525 | // fix Array#{values, @@iterator}.name in V8 / FF 526 | if(DEF_VALUES && $native && $native.name !== VALUES){ 527 | VALUES_BUG = true; 528 | $default = function values(){ return $native.call(this); }; 529 | } 530 | // Define iterator 531 | if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ 532 | hide(proto, ITERATOR, $default); 533 | } 534 | // Plug for library 535 | Iterators[NAME] = $default; 536 | Iterators[TAG] = returnThis; 537 | if(DEFAULT){ 538 | methods = { 539 | values: DEF_VALUES ? $default : getMethod(VALUES), 540 | keys: IS_SET ? $default : getMethod(KEYS), 541 | entries: $entries 542 | }; 543 | if(FORCED)for(key in methods){ 544 | if(!(key in proto))redefine(proto, key, methods[key]); 545 | } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 546 | } 547 | return methods; 548 | }; 549 | 550 | /***/ }, 551 | /* 27 */ 552 | /***/ function(module, exports) { 553 | 554 | module.exports = true; 555 | 556 | /***/ }, 557 | /* 28 */ 558 | /***/ function(module, exports) { 559 | 560 | module.exports = function(bitmap, value){ 561 | return { 562 | enumerable : !(bitmap & 1), 563 | configurable: !(bitmap & 2), 564 | writable : !(bitmap & 4), 565 | value : value 566 | }; 567 | }; 568 | 569 | /***/ }, 570 | /* 29 */ 571 | /***/ function(module, exports, __webpack_require__) { 572 | 573 | var global = __webpack_require__(2) 574 | , SHARED = '__core-js_shared__' 575 | , store = global[SHARED] || (global[SHARED] = {}); 576 | module.exports = function(key){ 577 | return store[key] || (store[key] = {}); 578 | }; 579 | 580 | /***/ }, 581 | /* 30 */ 582 | /***/ function(module, exports, __webpack_require__) { 583 | 584 | var ctx = __webpack_require__(9) 585 | , invoke = __webpack_require__(43) 586 | , html = __webpack_require__(25) 587 | , cel = __webpack_require__(15) 588 | , global = __webpack_require__(2) 589 | , process = global.process 590 | , setTask = global.setImmediate 591 | , clearTask = global.clearImmediate 592 | , MessageChannel = global.MessageChannel 593 | , counter = 0 594 | , queue = {} 595 | , ONREADYSTATECHANGE = 'onreadystatechange' 596 | , defer, channel, port; 597 | var run = function(){ 598 | var id = +this; 599 | if(queue.hasOwnProperty(id)){ 600 | var fn = queue[id]; 601 | delete queue[id]; 602 | fn(); 603 | } 604 | }; 605 | var listener = function(event){ 606 | run.call(event.data); 607 | }; 608 | // Node.js 0.9+ & IE10+ has setImmediate, otherwise: 609 | if(!setTask || !clearTask){ 610 | setTask = function setImmediate(fn){ 611 | var args = [], i = 1; 612 | while(arguments.length > i)args.push(arguments[i++]); 613 | queue[++counter] = function(){ 614 | invoke(typeof fn == 'function' ? fn : Function(fn), args); 615 | }; 616 | defer(counter); 617 | return counter; 618 | }; 619 | clearTask = function clearImmediate(id){ 620 | delete queue[id]; 621 | }; 622 | // Node.js 0.8- 623 | if(__webpack_require__(8)(process) == 'process'){ 624 | defer = function(id){ 625 | process.nextTick(ctx(run, id, 1)); 626 | }; 627 | // Browsers with MessageChannel, includes WebWorkers 628 | } else if(MessageChannel){ 629 | channel = new MessageChannel; 630 | port = channel.port2; 631 | channel.port1.onmessage = listener; 632 | defer = ctx(port.postMessage, port, 1); 633 | // Browsers with postMessage, skip WebWorkers 634 | // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' 635 | } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ 636 | defer = function(id){ 637 | global.postMessage(id + '', '*'); 638 | }; 639 | global.addEventListener('message', listener, false); 640 | // IE8- 641 | } else if(ONREADYSTATECHANGE in cel('script')){ 642 | defer = function(id){ 643 | html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ 644 | html.removeChild(this); 645 | run.call(id); 646 | }; 647 | }; 648 | // Rest old browsers 649 | } else { 650 | defer = function(id){ 651 | setTimeout(ctx(run, id, 1), 0); 652 | }; 653 | } 654 | } 655 | module.exports = { 656 | set: setTask, 657 | clear: clearTask 658 | }; 659 | 660 | /***/ }, 661 | /* 31 */ 662 | /***/ function(module, exports, __webpack_require__) { 663 | 664 | // 7.1.15 ToLength 665 | var toInteger = __webpack_require__(18) 666 | , min = Math.min; 667 | module.exports = function(it){ 668 | return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 669 | }; 670 | 671 | /***/ }, 672 | /* 32 */ 673 | /***/ function(module, exports) { 674 | 675 | var id = 0 676 | , px = Math.random(); 677 | module.exports = function(key){ 678 | return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 679 | }; 680 | 681 | /***/ }, 682 | /* 33 */ 683 | /***/ function(module, exports, __webpack_require__) { 684 | 685 | "use strict"; 686 | 687 | exports.__esModule = true; 688 | 689 | var _promise = __webpack_require__(20); 690 | 691 | var _promise2 = _interopRequireDefault(_promise); 692 | 693 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 694 | 695 | exports.default = function (fn) { 696 | return function () { 697 | var gen = fn.apply(this, arguments); 698 | return new _promise2.default(function (resolve, reject) { 699 | function step(key, arg) { 700 | try { 701 | var info = gen[key](arg); 702 | var value = info.value; 703 | } catch (error) { 704 | reject(error); 705 | return; 706 | } 707 | 708 | if (info.done) { 709 | resolve(value); 710 | } else { 711 | return _promise2.default.resolve(value).then(function (value) { 712 | step("next", value); 713 | }, function (err) { 714 | step("throw", err); 715 | }); 716 | } 717 | } 718 | 719 | return step("next"); 720 | }); 721 | }; 722 | }; 723 | 724 | /***/ }, 725 | /* 34 */ 726 | /***/ function(module, exports, __webpack_require__) { 727 | 728 | /* WEBPACK VAR INJECTION */(function(global) {// This method of obtaining a reference to the global object needs to be 729 | // kept identical to the way it is obtained in runtime.js 730 | var g = 731 | typeof global === "object" ? global : 732 | typeof window === "object" ? window : 733 | typeof self === "object" ? self : this; 734 | 735 | // Use `getOwnPropertyNames` because not all browsers support calling 736 | // `hasOwnProperty` on the global `self` object in a worker. See #183. 737 | var hadRuntime = g.regeneratorRuntime && 738 | Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; 739 | 740 | // Save the old regeneratorRuntime in case it needs to be restored later. 741 | var oldRuntime = hadRuntime && g.regeneratorRuntime; 742 | 743 | // Force reevalutation of runtime.js. 744 | g.regeneratorRuntime = undefined; 745 | 746 | module.exports = __webpack_require__(35); 747 | 748 | if (hadRuntime) { 749 | // Restore the original runtime. 750 | g.regeneratorRuntime = oldRuntime; 751 | } else { 752 | // Remove the global property added by runtime.js. 753 | try { 754 | delete g.regeneratorRuntime; 755 | } catch(e) { 756 | g.regeneratorRuntime = undefined; 757 | } 758 | } 759 | 760 | /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 761 | 762 | /***/ }, 763 | /* 35 */ 764 | /***/ function(module, exports, __webpack_require__) { 765 | 766 | /* WEBPACK VAR INJECTION */(function(global, process) {/** 767 | * Copyright (c) 2014, Facebook, Inc. 768 | * All rights reserved. 769 | * 770 | * This source code is licensed under the BSD-style license found in the 771 | * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 772 | * additional grant of patent rights can be found in the PATENTS file in 773 | * the same directory. 774 | */ 775 | 776 | !(function(global) { 777 | "use strict"; 778 | 779 | var Op = Object.prototype; 780 | var hasOwn = Op.hasOwnProperty; 781 | var undefined; // More compressible than void 0. 782 | var $Symbol = typeof Symbol === "function" ? Symbol : {}; 783 | var iteratorSymbol = $Symbol.iterator || "@@iterator"; 784 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; 785 | 786 | var inModule = typeof module === "object"; 787 | var runtime = global.regeneratorRuntime; 788 | if (runtime) { 789 | if (inModule) { 790 | // If regeneratorRuntime is defined globally and we're in a module, 791 | // make the exports object identical to regeneratorRuntime. 792 | module.exports = runtime; 793 | } 794 | // Don't bother evaluating the rest of this file if the runtime was 795 | // already defined globally. 796 | return; 797 | } 798 | 799 | // Define the runtime globally (as expected by generated code) as either 800 | // module.exports (if we're in a module) or a new, empty object. 801 | runtime = global.regeneratorRuntime = inModule ? module.exports : {}; 802 | 803 | function wrap(innerFn, outerFn, self, tryLocsList) { 804 | // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. 805 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; 806 | var generator = Object.create(protoGenerator.prototype); 807 | var context = new Context(tryLocsList || []); 808 | 809 | // The ._invoke method unifies the implementations of the .next, 810 | // .throw, and .return methods. 811 | generator._invoke = makeInvokeMethod(innerFn, self, context); 812 | 813 | return generator; 814 | } 815 | runtime.wrap = wrap; 816 | 817 | // Try/catch helper to minimize deoptimizations. Returns a completion 818 | // record like context.tryEntries[i].completion. This interface could 819 | // have been (and was previously) designed to take a closure to be 820 | // invoked without arguments, but in all the cases we care about we 821 | // already have an existing method we want to call, so there's no need 822 | // to create a new function object. We can even get away with assuming 823 | // the method takes exactly one argument, since that happens to be true 824 | // in every case, so we don't have to touch the arguments object. The 825 | // only additional allocation required is the completion record, which 826 | // has a stable shape and so hopefully should be cheap to allocate. 827 | function tryCatch(fn, obj, arg) { 828 | try { 829 | return { type: "normal", arg: fn.call(obj, arg) }; 830 | } catch (err) { 831 | return { type: "throw", arg: err }; 832 | } 833 | } 834 | 835 | var GenStateSuspendedStart = "suspendedStart"; 836 | var GenStateSuspendedYield = "suspendedYield"; 837 | var GenStateExecuting = "executing"; 838 | var GenStateCompleted = "completed"; 839 | 840 | // Returning this object from the innerFn has the same effect as 841 | // breaking out of the dispatch switch statement. 842 | var ContinueSentinel = {}; 843 | 844 | // Dummy constructor functions that we use as the .constructor and 845 | // .constructor.prototype properties for functions that return Generator 846 | // objects. For full spec compliance, you may wish to configure your 847 | // minifier not to mangle the names of these two functions. 848 | function Generator() {} 849 | function GeneratorFunction() {} 850 | function GeneratorFunctionPrototype() {} 851 | 852 | // This is a polyfill for %IteratorPrototype% for environments that 853 | // don't natively support it. 854 | var IteratorPrototype = {}; 855 | IteratorPrototype[iteratorSymbol] = function () { 856 | return this; 857 | }; 858 | 859 | var getProto = Object.getPrototypeOf; 860 | var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); 861 | if (NativeIteratorPrototype && 862 | NativeIteratorPrototype !== Op && 863 | hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { 864 | // This environment has a native %IteratorPrototype%; use it instead 865 | // of the polyfill. 866 | IteratorPrototype = NativeIteratorPrototype; 867 | } 868 | 869 | var Gp = GeneratorFunctionPrototype.prototype = 870 | Generator.prototype = Object.create(IteratorPrototype); 871 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; 872 | GeneratorFunctionPrototype.constructor = GeneratorFunction; 873 | GeneratorFunctionPrototype[toStringTagSymbol] = 874 | GeneratorFunction.displayName = "GeneratorFunction"; 875 | 876 | // Helper for defining the .next, .throw, and .return methods of the 877 | // Iterator interface in terms of a single ._invoke method. 878 | function defineIteratorMethods(prototype) { 879 | ["next", "throw", "return"].forEach(function(method) { 880 | prototype[method] = function(arg) { 881 | return this._invoke(method, arg); 882 | }; 883 | }); 884 | } 885 | 886 | runtime.isGeneratorFunction = function(genFun) { 887 | var ctor = typeof genFun === "function" && genFun.constructor; 888 | return ctor 889 | ? ctor === GeneratorFunction || 890 | // For the native GeneratorFunction constructor, the best we can 891 | // do is to check its .name property. 892 | (ctor.displayName || ctor.name) === "GeneratorFunction" 893 | : false; 894 | }; 895 | 896 | runtime.mark = function(genFun) { 897 | if (Object.setPrototypeOf) { 898 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); 899 | } else { 900 | genFun.__proto__ = GeneratorFunctionPrototype; 901 | if (!(toStringTagSymbol in genFun)) { 902 | genFun[toStringTagSymbol] = "GeneratorFunction"; 903 | } 904 | } 905 | genFun.prototype = Object.create(Gp); 906 | return genFun; 907 | }; 908 | 909 | // Within the body of any async function, `await x` is transformed to 910 | // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test 911 | // `hasOwn.call(value, "__await")` to determine if the yielded value is 912 | // meant to be awaited. 913 | runtime.awrap = function(arg) { 914 | return { __await: arg }; 915 | }; 916 | 917 | function AsyncIterator(generator) { 918 | function invoke(method, arg, resolve, reject) { 919 | var record = tryCatch(generator[method], generator, arg); 920 | if (record.type === "throw") { 921 | reject(record.arg); 922 | } else { 923 | var result = record.arg; 924 | var value = result.value; 925 | if (value && 926 | typeof value === "object" && 927 | hasOwn.call(value, "__await")) { 928 | return Promise.resolve(value.__await).then(function(value) { 929 | invoke("next", value, resolve, reject); 930 | }, function(err) { 931 | invoke("throw", err, resolve, reject); 932 | }); 933 | } 934 | 935 | return Promise.resolve(value).then(function(unwrapped) { 936 | // When a yielded Promise is resolved, its final value becomes 937 | // the .value of the Promise<{value,done}> result for the 938 | // current iteration. If the Promise is rejected, however, the 939 | // result for this iteration will be rejected with the same 940 | // reason. Note that rejections of yielded Promises are not 941 | // thrown back into the generator function, as is the case 942 | // when an awaited Promise is rejected. This difference in 943 | // behavior between yield and await is important, because it 944 | // allows the consumer to decide what to do with the yielded 945 | // rejection (swallow it and continue, manually .throw it back 946 | // into the generator, abandon iteration, whatever). With 947 | // await, by contrast, there is no opportunity to examine the 948 | // rejection reason outside the generator function, so the 949 | // only option is to throw it from the await expression, and 950 | // let the generator function handle the exception. 951 | result.value = unwrapped; 952 | resolve(result); 953 | }, reject); 954 | } 955 | } 956 | 957 | if (typeof process === "object" && process.domain) { 958 | invoke = process.domain.bind(invoke); 959 | } 960 | 961 | var previousPromise; 962 | 963 | function enqueue(method, arg) { 964 | function callInvokeWithMethodAndArg() { 965 | return new Promise(function(resolve, reject) { 966 | invoke(method, arg, resolve, reject); 967 | }); 968 | } 969 | 970 | return previousPromise = 971 | // If enqueue has been called before, then we want to wait until 972 | // all previous Promises have been resolved before calling invoke, 973 | // so that results are always delivered in the correct order. If 974 | // enqueue has not been called before, then it is important to 975 | // call invoke immediately, without waiting on a callback to fire, 976 | // so that the async generator function has the opportunity to do 977 | // any necessary setup in a predictable way. This predictability 978 | // is why the Promise constructor synchronously invokes its 979 | // executor callback, and why async functions synchronously 980 | // execute code before the first await. Since we implement simple 981 | // async functions in terms of async generators, it is especially 982 | // important to get this right, even though it requires care. 983 | previousPromise ? previousPromise.then( 984 | callInvokeWithMethodAndArg, 985 | // Avoid propagating failures to Promises returned by later 986 | // invocations of the iterator. 987 | callInvokeWithMethodAndArg 988 | ) : callInvokeWithMethodAndArg(); 989 | } 990 | 991 | // Define the unified helper method that is used to implement .next, 992 | // .throw, and .return (see defineIteratorMethods). 993 | this._invoke = enqueue; 994 | } 995 | 996 | defineIteratorMethods(AsyncIterator.prototype); 997 | runtime.AsyncIterator = AsyncIterator; 998 | 999 | // Note that simple async functions are implemented on top of 1000 | // AsyncIterator objects; they just return a Promise for the value of 1001 | // the final result produced by the iterator. 1002 | runtime.async = function(innerFn, outerFn, self, tryLocsList) { 1003 | var iter = new AsyncIterator( 1004 | wrap(innerFn, outerFn, self, tryLocsList) 1005 | ); 1006 | 1007 | return runtime.isGeneratorFunction(outerFn) 1008 | ? iter // If outerFn is a generator, return the full iterator. 1009 | : iter.next().then(function(result) { 1010 | return result.done ? result.value : iter.next(); 1011 | }); 1012 | }; 1013 | 1014 | function makeInvokeMethod(innerFn, self, context) { 1015 | var state = GenStateSuspendedStart; 1016 | 1017 | return function invoke(method, arg) { 1018 | if (state === GenStateExecuting) { 1019 | throw new Error("Generator is already running"); 1020 | } 1021 | 1022 | if (state === GenStateCompleted) { 1023 | if (method === "throw") { 1024 | throw arg; 1025 | } 1026 | 1027 | // Be forgiving, per 25.3.3.3.3 of the spec: 1028 | // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume 1029 | return doneResult(); 1030 | } 1031 | 1032 | context.method = method; 1033 | context.arg = arg; 1034 | 1035 | while (true) { 1036 | var delegate = context.delegate; 1037 | if (delegate) { 1038 | var delegateResult = maybeInvokeDelegate(delegate, context); 1039 | if (delegateResult) { 1040 | if (delegateResult === ContinueSentinel) continue; 1041 | return delegateResult; 1042 | } 1043 | } 1044 | 1045 | if (context.method === "next") { 1046 | // Setting context._sent for legacy support of Babel's 1047 | // function.sent implementation. 1048 | context.sent = context._sent = context.arg; 1049 | 1050 | } else if (context.method === "throw") { 1051 | if (state === GenStateSuspendedStart) { 1052 | state = GenStateCompleted; 1053 | throw context.arg; 1054 | } 1055 | 1056 | context.dispatchException(context.arg); 1057 | 1058 | } else if (context.method === "return") { 1059 | context.abrupt("return", context.arg); 1060 | } 1061 | 1062 | state = GenStateExecuting; 1063 | 1064 | var record = tryCatch(innerFn, self, context); 1065 | if (record.type === "normal") { 1066 | // If an exception is thrown from innerFn, we leave state === 1067 | // GenStateExecuting and loop back for another invocation. 1068 | state = context.done 1069 | ? GenStateCompleted 1070 | : GenStateSuspendedYield; 1071 | 1072 | if (record.arg === ContinueSentinel) { 1073 | continue; 1074 | } 1075 | 1076 | return { 1077 | value: record.arg, 1078 | done: context.done 1079 | }; 1080 | 1081 | } else if (record.type === "throw") { 1082 | state = GenStateCompleted; 1083 | // Dispatch the exception by looping back around to the 1084 | // context.dispatchException(context.arg) call above. 1085 | context.method = "throw"; 1086 | context.arg = record.arg; 1087 | } 1088 | } 1089 | }; 1090 | } 1091 | 1092 | // Call delegate.iterator[context.method](context.arg) and handle the 1093 | // result, either by returning a { value, done } result from the 1094 | // delegate iterator, or by modifying context.method and context.arg, 1095 | // setting context.delegate to null, and returning the ContinueSentinel. 1096 | function maybeInvokeDelegate(delegate, context) { 1097 | var method = delegate.iterator[context.method]; 1098 | if (method === undefined) { 1099 | // A .throw or .return when the delegate iterator has no .throw 1100 | // method always terminates the yield* loop. 1101 | context.delegate = null; 1102 | 1103 | if (context.method === "throw") { 1104 | if (delegate.iterator.return) { 1105 | // If the delegate iterator has a return method, give it a 1106 | // chance to clean up. 1107 | context.method = "return"; 1108 | context.arg = undefined; 1109 | maybeInvokeDelegate(delegate, context); 1110 | 1111 | if (context.method === "throw") { 1112 | // If maybeInvokeDelegate(context) changed context.method from 1113 | // "return" to "throw", let that override the TypeError below. 1114 | return ContinueSentinel; 1115 | } 1116 | } 1117 | 1118 | context.method = "throw"; 1119 | context.arg = new TypeError( 1120 | "The iterator does not provide a 'throw' method"); 1121 | } 1122 | 1123 | return ContinueSentinel; 1124 | } 1125 | 1126 | var record = tryCatch(method, delegate.iterator, context.arg); 1127 | 1128 | if (record.type === "throw") { 1129 | context.method = "throw"; 1130 | context.arg = record.arg; 1131 | context.delegate = null; 1132 | return ContinueSentinel; 1133 | } 1134 | 1135 | var info = record.arg; 1136 | 1137 | if (! info) { 1138 | context.method = "throw"; 1139 | context.arg = new TypeError("iterator result is not an object"); 1140 | context.delegate = null; 1141 | return ContinueSentinel; 1142 | } 1143 | 1144 | if (info.done) { 1145 | // Assign the result of the finished delegate to the temporary 1146 | // variable specified by delegate.resultName (see delegateYield). 1147 | context[delegate.resultName] = info.value; 1148 | 1149 | // Resume execution at the desired location (see delegateYield). 1150 | context.next = delegate.nextLoc; 1151 | 1152 | // If context.method was "throw" but the delegate handled the 1153 | // exception, let the outer generator proceed normally. If 1154 | // context.method was "next", forget context.arg since it has been 1155 | // "consumed" by the delegate iterator. If context.method was 1156 | // "return", allow the original .return call to continue in the 1157 | // outer generator. 1158 | if (context.method !== "return") { 1159 | context.method = "next"; 1160 | context.arg = undefined; 1161 | } 1162 | 1163 | } else { 1164 | // Re-yield the result returned by the delegate method. 1165 | return info; 1166 | } 1167 | 1168 | // The delegate iterator is finished, so forget it and continue with 1169 | // the outer generator. 1170 | context.delegate = null; 1171 | return ContinueSentinel; 1172 | } 1173 | 1174 | // Define Generator.prototype.{next,throw,return} in terms of the 1175 | // unified ._invoke helper method. 1176 | defineIteratorMethods(Gp); 1177 | 1178 | Gp[toStringTagSymbol] = "Generator"; 1179 | 1180 | Gp.toString = function() { 1181 | return "[object Generator]"; 1182 | }; 1183 | 1184 | function pushTryEntry(locs) { 1185 | var entry = { tryLoc: locs[0] }; 1186 | 1187 | if (1 in locs) { 1188 | entry.catchLoc = locs[1]; 1189 | } 1190 | 1191 | if (2 in locs) { 1192 | entry.finallyLoc = locs[2]; 1193 | entry.afterLoc = locs[3]; 1194 | } 1195 | 1196 | this.tryEntries.push(entry); 1197 | } 1198 | 1199 | function resetTryEntry(entry) { 1200 | var record = entry.completion || {}; 1201 | record.type = "normal"; 1202 | delete record.arg; 1203 | entry.completion = record; 1204 | } 1205 | 1206 | function Context(tryLocsList) { 1207 | // The root entry object (effectively a try statement without a catch 1208 | // or a finally block) gives us a place to store values thrown from 1209 | // locations where there is no enclosing try statement. 1210 | this.tryEntries = [{ tryLoc: "root" }]; 1211 | tryLocsList.forEach(pushTryEntry, this); 1212 | this.reset(true); 1213 | } 1214 | 1215 | runtime.keys = function(object) { 1216 | var keys = []; 1217 | for (var key in object) { 1218 | keys.push(key); 1219 | } 1220 | keys.reverse(); 1221 | 1222 | // Rather than returning an object with a next method, we keep 1223 | // things simple and return the next function itself. 1224 | return function next() { 1225 | while (keys.length) { 1226 | var key = keys.pop(); 1227 | if (key in object) { 1228 | next.value = key; 1229 | next.done = false; 1230 | return next; 1231 | } 1232 | } 1233 | 1234 | // To avoid creating an additional object, we just hang the .value 1235 | // and .done properties off the next function object itself. This 1236 | // also ensures that the minifier will not anonymize the function. 1237 | next.done = true; 1238 | return next; 1239 | }; 1240 | }; 1241 | 1242 | function values(iterable) { 1243 | if (iterable) { 1244 | var iteratorMethod = iterable[iteratorSymbol]; 1245 | if (iteratorMethod) { 1246 | return iteratorMethod.call(iterable); 1247 | } 1248 | 1249 | if (typeof iterable.next === "function") { 1250 | return iterable; 1251 | } 1252 | 1253 | if (!isNaN(iterable.length)) { 1254 | var i = -1, next = function next() { 1255 | while (++i < iterable.length) { 1256 | if (hasOwn.call(iterable, i)) { 1257 | next.value = iterable[i]; 1258 | next.done = false; 1259 | return next; 1260 | } 1261 | } 1262 | 1263 | next.value = undefined; 1264 | next.done = true; 1265 | 1266 | return next; 1267 | }; 1268 | 1269 | return next.next = next; 1270 | } 1271 | } 1272 | 1273 | // Return an iterator with no values. 1274 | return { next: doneResult }; 1275 | } 1276 | runtime.values = values; 1277 | 1278 | function doneResult() { 1279 | return { value: undefined, done: true }; 1280 | } 1281 | 1282 | Context.prototype = { 1283 | constructor: Context, 1284 | 1285 | reset: function(skipTempReset) { 1286 | this.prev = 0; 1287 | this.next = 0; 1288 | // Resetting context._sent for legacy support of Babel's 1289 | // function.sent implementation. 1290 | this.sent = this._sent = undefined; 1291 | this.done = false; 1292 | this.delegate = null; 1293 | 1294 | this.method = "next"; 1295 | this.arg = undefined; 1296 | 1297 | this.tryEntries.forEach(resetTryEntry); 1298 | 1299 | if (!skipTempReset) { 1300 | for (var name in this) { 1301 | // Not sure about the optimal order of these conditions: 1302 | if (name.charAt(0) === "t" && 1303 | hasOwn.call(this, name) && 1304 | !isNaN(+name.slice(1))) { 1305 | this[name] = undefined; 1306 | } 1307 | } 1308 | } 1309 | }, 1310 | 1311 | stop: function() { 1312 | this.done = true; 1313 | 1314 | var rootEntry = this.tryEntries[0]; 1315 | var rootRecord = rootEntry.completion; 1316 | if (rootRecord.type === "throw") { 1317 | throw rootRecord.arg; 1318 | } 1319 | 1320 | return this.rval; 1321 | }, 1322 | 1323 | dispatchException: function(exception) { 1324 | if (this.done) { 1325 | throw exception; 1326 | } 1327 | 1328 | var context = this; 1329 | function handle(loc, caught) { 1330 | record.type = "throw"; 1331 | record.arg = exception; 1332 | context.next = loc; 1333 | 1334 | if (caught) { 1335 | // If the dispatched exception was caught by a catch block, 1336 | // then let that catch block handle the exception normally. 1337 | context.method = "next"; 1338 | context.arg = undefined; 1339 | } 1340 | 1341 | return !! caught; 1342 | } 1343 | 1344 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1345 | var entry = this.tryEntries[i]; 1346 | var record = entry.completion; 1347 | 1348 | if (entry.tryLoc === "root") { 1349 | // Exception thrown outside of any try block that could handle 1350 | // it, so set the completion value of the entire function to 1351 | // throw the exception. 1352 | return handle("end"); 1353 | } 1354 | 1355 | if (entry.tryLoc <= this.prev) { 1356 | var hasCatch = hasOwn.call(entry, "catchLoc"); 1357 | var hasFinally = hasOwn.call(entry, "finallyLoc"); 1358 | 1359 | if (hasCatch && hasFinally) { 1360 | if (this.prev < entry.catchLoc) { 1361 | return handle(entry.catchLoc, true); 1362 | } else if (this.prev < entry.finallyLoc) { 1363 | return handle(entry.finallyLoc); 1364 | } 1365 | 1366 | } else if (hasCatch) { 1367 | if (this.prev < entry.catchLoc) { 1368 | return handle(entry.catchLoc, true); 1369 | } 1370 | 1371 | } else if (hasFinally) { 1372 | if (this.prev < entry.finallyLoc) { 1373 | return handle(entry.finallyLoc); 1374 | } 1375 | 1376 | } else { 1377 | throw new Error("try statement without catch or finally"); 1378 | } 1379 | } 1380 | } 1381 | }, 1382 | 1383 | abrupt: function(type, arg) { 1384 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1385 | var entry = this.tryEntries[i]; 1386 | if (entry.tryLoc <= this.prev && 1387 | hasOwn.call(entry, "finallyLoc") && 1388 | this.prev < entry.finallyLoc) { 1389 | var finallyEntry = entry; 1390 | break; 1391 | } 1392 | } 1393 | 1394 | if (finallyEntry && 1395 | (type === "break" || 1396 | type === "continue") && 1397 | finallyEntry.tryLoc <= arg && 1398 | arg <= finallyEntry.finallyLoc) { 1399 | // Ignore the finally entry if control is not jumping to a 1400 | // location outside the try/catch block. 1401 | finallyEntry = null; 1402 | } 1403 | 1404 | var record = finallyEntry ? finallyEntry.completion : {}; 1405 | record.type = type; 1406 | record.arg = arg; 1407 | 1408 | if (finallyEntry) { 1409 | this.method = "next"; 1410 | this.next = finallyEntry.finallyLoc; 1411 | return ContinueSentinel; 1412 | } 1413 | 1414 | return this.complete(record); 1415 | }, 1416 | 1417 | complete: function(record, afterLoc) { 1418 | if (record.type === "throw") { 1419 | throw record.arg; 1420 | } 1421 | 1422 | if (record.type === "break" || 1423 | record.type === "continue") { 1424 | this.next = record.arg; 1425 | } else if (record.type === "return") { 1426 | this.rval = this.arg = record.arg; 1427 | this.method = "return"; 1428 | this.next = "end"; 1429 | } else if (record.type === "normal" && afterLoc) { 1430 | this.next = afterLoc; 1431 | } 1432 | 1433 | return ContinueSentinel; 1434 | }, 1435 | 1436 | finish: function(finallyLoc) { 1437 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1438 | var entry = this.tryEntries[i]; 1439 | if (entry.finallyLoc === finallyLoc) { 1440 | this.complete(entry.completion, entry.afterLoc); 1441 | resetTryEntry(entry); 1442 | return ContinueSentinel; 1443 | } 1444 | } 1445 | }, 1446 | 1447 | "catch": function(tryLoc) { 1448 | for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1449 | var entry = this.tryEntries[i]; 1450 | if (entry.tryLoc === tryLoc) { 1451 | var record = entry.completion; 1452 | if (record.type === "throw") { 1453 | var thrown = record.arg; 1454 | resetTryEntry(entry); 1455 | } 1456 | return thrown; 1457 | } 1458 | } 1459 | 1460 | // The context.catch method must only be called with a location 1461 | // argument that corresponds to a known catch block. 1462 | throw new Error("illegal catch attempt"); 1463 | }, 1464 | 1465 | delegateYield: function(iterable, resultName, nextLoc) { 1466 | this.delegate = { 1467 | iterator: values(iterable), 1468 | resultName: resultName, 1469 | nextLoc: nextLoc 1470 | }; 1471 | 1472 | if (this.method === "next") { 1473 | // Deliberately forget the last sent value so that we don't 1474 | // accidentally pass it on to the delegate. 1475 | this.arg = undefined; 1476 | } 1477 | 1478 | return ContinueSentinel; 1479 | } 1480 | }; 1481 | })( 1482 | // Among the various tricks for obtaining a reference to the global 1483 | // object, this seems to be the most reliable technique that does not 1484 | // use indirect eval (which violates Content Security Policy). 1485 | typeof global === "object" ? global : 1486 | typeof window === "object" ? window : 1487 | typeof self === "object" ? self : this 1488 | ); 1489 | 1490 | /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(70))) 1491 | 1492 | /***/ }, 1493 | /* 36 */ 1494 | /***/ function(module, exports, __webpack_require__) { 1495 | 1496 | module.exports = __webpack_require__(34); 1497 | 1498 | 1499 | /***/ }, 1500 | /* 37 */ 1501 | /***/ function(module, exports, __webpack_require__) { 1502 | 1503 | __webpack_require__(66); 1504 | __webpack_require__(68); 1505 | __webpack_require__(69); 1506 | __webpack_require__(67); 1507 | module.exports = __webpack_require__(5).Promise; 1508 | 1509 | /***/ }, 1510 | /* 38 */ 1511 | /***/ function(module, exports) { 1512 | 1513 | module.exports = function(){ /* empty */ }; 1514 | 1515 | /***/ }, 1516 | /* 39 */ 1517 | /***/ function(module, exports) { 1518 | 1519 | module.exports = function(it, Constructor, name, forbiddenField){ 1520 | if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ 1521 | throw TypeError(name + ': incorrect invocation!'); 1522 | } return it; 1523 | }; 1524 | 1525 | /***/ }, 1526 | /* 40 */ 1527 | /***/ function(module, exports, __webpack_require__) { 1528 | 1529 | // false -> Array#indexOf 1530 | // true -> Array#includes 1531 | var toIObject = __webpack_require__(19) 1532 | , toLength = __webpack_require__(31) 1533 | , toIndex = __webpack_require__(61); 1534 | module.exports = function(IS_INCLUDES){ 1535 | return function($this, el, fromIndex){ 1536 | var O = toIObject($this) 1537 | , length = toLength(O.length) 1538 | , index = toIndex(fromIndex, length) 1539 | , value; 1540 | // Array#includes uses SameValueZero equality algorithm 1541 | if(IS_INCLUDES && el != el)while(length > index){ 1542 | value = O[index++]; 1543 | if(value != value)return true; 1544 | // Array#toIndex ignores holes, Array#includes - not 1545 | } else for(;length > index; index++)if(IS_INCLUDES || index in O){ 1546 | if(O[index] === el)return IS_INCLUDES || index || 0; 1547 | } return !IS_INCLUDES && -1; 1548 | }; 1549 | }; 1550 | 1551 | /***/ }, 1552 | /* 41 */ 1553 | /***/ function(module, exports, __webpack_require__) { 1554 | 1555 | var ctx = __webpack_require__(9) 1556 | , call = __webpack_require__(46) 1557 | , isArrayIter = __webpack_require__(45) 1558 | , anObject = __webpack_require__(3) 1559 | , toLength = __webpack_require__(31) 1560 | , getIterFn = __webpack_require__(64) 1561 | , BREAK = {} 1562 | , RETURN = {}; 1563 | var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ 1564 | var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) 1565 | , f = ctx(fn, that, entries ? 2 : 1) 1566 | , index = 0 1567 | , length, step, iterator, result; 1568 | if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); 1569 | // fast case for arrays with default iterator 1570 | if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ 1571 | result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); 1572 | if(result === BREAK || result === RETURN)return result; 1573 | } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ 1574 | result = call(iterator, f, step.value, entries); 1575 | if(result === BREAK || result === RETURN)return result; 1576 | } 1577 | }; 1578 | exports.BREAK = BREAK; 1579 | exports.RETURN = RETURN; 1580 | 1581 | /***/ }, 1582 | /* 42 */ 1583 | /***/ function(module, exports, __webpack_require__) { 1584 | 1585 | module.exports = !__webpack_require__(6) && !__webpack_require__(24)(function(){ 1586 | return Object.defineProperty(__webpack_require__(15)('div'), 'a', {get: function(){ return 7; }}).a != 7; 1587 | }); 1588 | 1589 | /***/ }, 1590 | /* 43 */ 1591 | /***/ function(module, exports) { 1592 | 1593 | // fast apply, http://jsperf.lnkit.com/fast-apply/5 1594 | module.exports = function(fn, args, that){ 1595 | var un = that === undefined; 1596 | switch(args.length){ 1597 | case 0: return un ? fn() 1598 | : fn.call(that); 1599 | case 1: return un ? fn(args[0]) 1600 | : fn.call(that, args[0]); 1601 | case 2: return un ? fn(args[0], args[1]) 1602 | : fn.call(that, args[0], args[1]); 1603 | case 3: return un ? fn(args[0], args[1], args[2]) 1604 | : fn.call(that, args[0], args[1], args[2]); 1605 | case 4: return un ? fn(args[0], args[1], args[2], args[3]) 1606 | : fn.call(that, args[0], args[1], args[2], args[3]); 1607 | } return fn.apply(that, args); 1608 | }; 1609 | 1610 | /***/ }, 1611 | /* 44 */ 1612 | /***/ function(module, exports, __webpack_require__) { 1613 | 1614 | // fallback for non-array-like ES3 and non-enumerable old V8 strings 1615 | var cof = __webpack_require__(8); 1616 | module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ 1617 | return cof(it) == 'String' ? it.split('') : Object(it); 1618 | }; 1619 | 1620 | /***/ }, 1621 | /* 45 */ 1622 | /***/ function(module, exports, __webpack_require__) { 1623 | 1624 | // check on default Array iterator 1625 | var Iterators = __webpack_require__(7) 1626 | , ITERATOR = __webpack_require__(1)('iterator') 1627 | , ArrayProto = Array.prototype; 1628 | 1629 | module.exports = function(it){ 1630 | return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); 1631 | }; 1632 | 1633 | /***/ }, 1634 | /* 46 */ 1635 | /***/ function(module, exports, __webpack_require__) { 1636 | 1637 | // call something on iterator step with safe closing on error 1638 | var anObject = __webpack_require__(3); 1639 | module.exports = function(iterator, fn, value, entries){ 1640 | try { 1641 | return entries ? fn(anObject(value)[0], value[1]) : fn(value); 1642 | // 7.4.6 IteratorClose(iterator, completion) 1643 | } catch(e){ 1644 | var ret = iterator['return']; 1645 | if(ret !== undefined)anObject(ret.call(iterator)); 1646 | throw e; 1647 | } 1648 | }; 1649 | 1650 | /***/ }, 1651 | /* 47 */ 1652 | /***/ function(module, exports, __webpack_require__) { 1653 | 1654 | 'use strict'; 1655 | var create = __webpack_require__(51) 1656 | , descriptor = __webpack_require__(28) 1657 | , setToStringTag = __webpack_require__(16) 1658 | , IteratorPrototype = {}; 1659 | 1660 | // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() 1661 | __webpack_require__(4)(IteratorPrototype, __webpack_require__(1)('iterator'), function(){ return this; }); 1662 | 1663 | module.exports = function(Constructor, NAME, next){ 1664 | Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); 1665 | setToStringTag(Constructor, NAME + ' Iterator'); 1666 | }; 1667 | 1668 | /***/ }, 1669 | /* 48 */ 1670 | /***/ function(module, exports, __webpack_require__) { 1671 | 1672 | var ITERATOR = __webpack_require__(1)('iterator') 1673 | , SAFE_CLOSING = false; 1674 | 1675 | try { 1676 | var riter = [7][ITERATOR](); 1677 | riter['return'] = function(){ SAFE_CLOSING = true; }; 1678 | Array.from(riter, function(){ throw 2; }); 1679 | } catch(e){ /* empty */ } 1680 | 1681 | module.exports = function(exec, skipClosing){ 1682 | if(!skipClosing && !SAFE_CLOSING)return false; 1683 | var safe = false; 1684 | try { 1685 | var arr = [7] 1686 | , iter = arr[ITERATOR](); 1687 | iter.next = function(){ return {done: safe = true}; }; 1688 | arr[ITERATOR] = function(){ return iter; }; 1689 | exec(arr); 1690 | } catch(e){ /* empty */ } 1691 | return safe; 1692 | }; 1693 | 1694 | /***/ }, 1695 | /* 49 */ 1696 | /***/ function(module, exports) { 1697 | 1698 | module.exports = function(done, value){ 1699 | return {value: value, done: !!done}; 1700 | }; 1701 | 1702 | /***/ }, 1703 | /* 50 */ 1704 | /***/ function(module, exports, __webpack_require__) { 1705 | 1706 | var global = __webpack_require__(2) 1707 | , macrotask = __webpack_require__(30).set 1708 | , Observer = global.MutationObserver || global.WebKitMutationObserver 1709 | , process = global.process 1710 | , Promise = global.Promise 1711 | , isNode = __webpack_require__(8)(process) == 'process'; 1712 | 1713 | module.exports = function(){ 1714 | var head, last, notify; 1715 | 1716 | var flush = function(){ 1717 | var parent, fn; 1718 | if(isNode && (parent = process.domain))parent.exit(); 1719 | while(head){ 1720 | fn = head.fn; 1721 | head = head.next; 1722 | try { 1723 | fn(); 1724 | } catch(e){ 1725 | if(head)notify(); 1726 | else last = undefined; 1727 | throw e; 1728 | } 1729 | } last = undefined; 1730 | if(parent)parent.enter(); 1731 | }; 1732 | 1733 | // Node.js 1734 | if(isNode){ 1735 | notify = function(){ 1736 | process.nextTick(flush); 1737 | }; 1738 | // browsers with MutationObserver 1739 | } else if(Observer){ 1740 | var toggle = true 1741 | , node = document.createTextNode(''); 1742 | new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new 1743 | notify = function(){ 1744 | node.data = toggle = !toggle; 1745 | }; 1746 | // environments with maybe non-completely correct, but existent Promise 1747 | } else if(Promise && Promise.resolve){ 1748 | var promise = Promise.resolve(); 1749 | notify = function(){ 1750 | promise.then(flush); 1751 | }; 1752 | // for other environments - macrotask based on: 1753 | // - setImmediate 1754 | // - MessageChannel 1755 | // - window.postMessag 1756 | // - onreadystatechange 1757 | // - setTimeout 1758 | } else { 1759 | notify = function(){ 1760 | // strange IE + webpack dev server bug - use .call(global) 1761 | macrotask.call(global, flush); 1762 | }; 1763 | } 1764 | 1765 | return function(fn){ 1766 | var task = {fn: fn, next: undefined}; 1767 | if(last)last.next = task; 1768 | if(!head){ 1769 | head = task; 1770 | notify(); 1771 | } last = task; 1772 | }; 1773 | }; 1774 | 1775 | /***/ }, 1776 | /* 51 */ 1777 | /***/ function(module, exports, __webpack_require__) { 1778 | 1779 | // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) 1780 | var anObject = __webpack_require__(3) 1781 | , dPs = __webpack_require__(52) 1782 | , enumBugKeys = __webpack_require__(22) 1783 | , IE_PROTO = __webpack_require__(17)('IE_PROTO') 1784 | , Empty = function(){ /* empty */ } 1785 | , PROTOTYPE = 'prototype'; 1786 | 1787 | // Create object with fake `null` prototype: use iframe Object with cleared prototype 1788 | var createDict = function(){ 1789 | // Thrash, waste and sodomy: IE GC bug 1790 | var iframe = __webpack_require__(15)('iframe') 1791 | , i = enumBugKeys.length 1792 | , lt = '<' 1793 | , gt = '>' 1794 | , iframeDocument; 1795 | iframe.style.display = 'none'; 1796 | __webpack_require__(25).appendChild(iframe); 1797 | iframe.src = 'javascript:'; // eslint-disable-line no-script-url 1798 | // createDict = iframe.contentWindow.Object; 1799 | // html.removeChild(iframe); 1800 | iframeDocument = iframe.contentWindow.document; 1801 | iframeDocument.open(); 1802 | iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); 1803 | iframeDocument.close(); 1804 | createDict = iframeDocument.F; 1805 | while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; 1806 | return createDict(); 1807 | }; 1808 | 1809 | module.exports = Object.create || function create(O, Properties){ 1810 | var result; 1811 | if(O !== null){ 1812 | Empty[PROTOTYPE] = anObject(O); 1813 | result = new Empty; 1814 | Empty[PROTOTYPE] = null; 1815 | // add "__proto__" for Object.getPrototypeOf polyfill 1816 | result[IE_PROTO] = O; 1817 | } else result = createDict(); 1818 | return Properties === undefined ? result : dPs(result, Properties); 1819 | }; 1820 | 1821 | 1822 | /***/ }, 1823 | /* 52 */ 1824 | /***/ function(module, exports, __webpack_require__) { 1825 | 1826 | var dP = __webpack_require__(12) 1827 | , anObject = __webpack_require__(3) 1828 | , getKeys = __webpack_require__(55); 1829 | 1830 | module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties){ 1831 | anObject(O); 1832 | var keys = getKeys(Properties) 1833 | , length = keys.length 1834 | , i = 0 1835 | , P; 1836 | while(length > i)dP.f(O, P = keys[i++], Properties[P]); 1837 | return O; 1838 | }; 1839 | 1840 | /***/ }, 1841 | /* 53 */ 1842 | /***/ function(module, exports, __webpack_require__) { 1843 | 1844 | // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) 1845 | var has = __webpack_require__(10) 1846 | , toObject = __webpack_require__(62) 1847 | , IE_PROTO = __webpack_require__(17)('IE_PROTO') 1848 | , ObjectProto = Object.prototype; 1849 | 1850 | module.exports = Object.getPrototypeOf || function(O){ 1851 | O = toObject(O); 1852 | if(has(O, IE_PROTO))return O[IE_PROTO]; 1853 | if(typeof O.constructor == 'function' && O instanceof O.constructor){ 1854 | return O.constructor.prototype; 1855 | } return O instanceof Object ? ObjectProto : null; 1856 | }; 1857 | 1858 | /***/ }, 1859 | /* 54 */ 1860 | /***/ function(module, exports, __webpack_require__) { 1861 | 1862 | var has = __webpack_require__(10) 1863 | , toIObject = __webpack_require__(19) 1864 | , arrayIndexOf = __webpack_require__(40)(false) 1865 | , IE_PROTO = __webpack_require__(17)('IE_PROTO'); 1866 | 1867 | module.exports = function(object, names){ 1868 | var O = toIObject(object) 1869 | , i = 0 1870 | , result = [] 1871 | , key; 1872 | for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); 1873 | // Don't enum bug & hidden keys 1874 | while(names.length > i)if(has(O, key = names[i++])){ 1875 | ~arrayIndexOf(result, key) || result.push(key); 1876 | } 1877 | return result; 1878 | }; 1879 | 1880 | /***/ }, 1881 | /* 55 */ 1882 | /***/ function(module, exports, __webpack_require__) { 1883 | 1884 | // 19.1.2.14 / 15.2.3.14 Object.keys(O) 1885 | var $keys = __webpack_require__(54) 1886 | , enumBugKeys = __webpack_require__(22); 1887 | 1888 | module.exports = Object.keys || function keys(O){ 1889 | return $keys(O, enumBugKeys); 1890 | }; 1891 | 1892 | /***/ }, 1893 | /* 56 */ 1894 | /***/ function(module, exports, __webpack_require__) { 1895 | 1896 | var hide = __webpack_require__(4); 1897 | module.exports = function(target, src, safe){ 1898 | for(var key in src){ 1899 | if(safe && target[key])target[key] = src[key]; 1900 | else hide(target, key, src[key]); 1901 | } return target; 1902 | }; 1903 | 1904 | /***/ }, 1905 | /* 57 */ 1906 | /***/ function(module, exports, __webpack_require__) { 1907 | 1908 | module.exports = __webpack_require__(4); 1909 | 1910 | /***/ }, 1911 | /* 58 */ 1912 | /***/ function(module, exports, __webpack_require__) { 1913 | 1914 | 'use strict'; 1915 | var global = __webpack_require__(2) 1916 | , core = __webpack_require__(5) 1917 | , dP = __webpack_require__(12) 1918 | , DESCRIPTORS = __webpack_require__(6) 1919 | , SPECIES = __webpack_require__(1)('species'); 1920 | 1921 | module.exports = function(KEY){ 1922 | var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; 1923 | if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { 1924 | configurable: true, 1925 | get: function(){ return this; } 1926 | }); 1927 | }; 1928 | 1929 | /***/ }, 1930 | /* 59 */ 1931 | /***/ function(module, exports, __webpack_require__) { 1932 | 1933 | // 7.3.20 SpeciesConstructor(O, defaultConstructor) 1934 | var anObject = __webpack_require__(3) 1935 | , aFunction = __webpack_require__(13) 1936 | , SPECIES = __webpack_require__(1)('species'); 1937 | module.exports = function(O, D){ 1938 | var C = anObject(O).constructor, S; 1939 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); 1940 | }; 1941 | 1942 | /***/ }, 1943 | /* 60 */ 1944 | /***/ function(module, exports, __webpack_require__) { 1945 | 1946 | var toInteger = __webpack_require__(18) 1947 | , defined = __webpack_require__(14); 1948 | // true -> String#at 1949 | // false -> String#codePointAt 1950 | module.exports = function(TO_STRING){ 1951 | return function(that, pos){ 1952 | var s = String(defined(that)) 1953 | , i = toInteger(pos) 1954 | , l = s.length 1955 | , a, b; 1956 | if(i < 0 || i >= l)return TO_STRING ? '' : undefined; 1957 | a = s.charCodeAt(i); 1958 | return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff 1959 | ? TO_STRING ? s.charAt(i) : a 1960 | : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; 1961 | }; 1962 | }; 1963 | 1964 | /***/ }, 1965 | /* 61 */ 1966 | /***/ function(module, exports, __webpack_require__) { 1967 | 1968 | var toInteger = __webpack_require__(18) 1969 | , max = Math.max 1970 | , min = Math.min; 1971 | module.exports = function(index, length){ 1972 | index = toInteger(index); 1973 | return index < 0 ? max(index + length, 0) : min(index, length); 1974 | }; 1975 | 1976 | /***/ }, 1977 | /* 62 */ 1978 | /***/ function(module, exports, __webpack_require__) { 1979 | 1980 | // 7.1.13 ToObject(argument) 1981 | var defined = __webpack_require__(14); 1982 | module.exports = function(it){ 1983 | return Object(defined(it)); 1984 | }; 1985 | 1986 | /***/ }, 1987 | /* 63 */ 1988 | /***/ function(module, exports, __webpack_require__) { 1989 | 1990 | // 7.1.1 ToPrimitive(input [, PreferredType]) 1991 | var isObject = __webpack_require__(11); 1992 | // instead of the ES6 spec version, we didn't implement @@toPrimitive case 1993 | // and the second argument - flag - preferred type is a string 1994 | module.exports = function(it, S){ 1995 | if(!isObject(it))return it; 1996 | var fn, val; 1997 | if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; 1998 | if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; 1999 | if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; 2000 | throw TypeError("Can't convert object to primitive value"); 2001 | }; 2002 | 2003 | /***/ }, 2004 | /* 64 */ 2005 | /***/ function(module, exports, __webpack_require__) { 2006 | 2007 | var classof = __webpack_require__(21) 2008 | , ITERATOR = __webpack_require__(1)('iterator') 2009 | , Iterators = __webpack_require__(7); 2010 | module.exports = __webpack_require__(5).getIteratorMethod = function(it){ 2011 | if(it != undefined)return it[ITERATOR] 2012 | || it['@@iterator'] 2013 | || Iterators[classof(it)]; 2014 | }; 2015 | 2016 | /***/ }, 2017 | /* 65 */ 2018 | /***/ function(module, exports, __webpack_require__) { 2019 | 2020 | 'use strict'; 2021 | var addToUnscopables = __webpack_require__(38) 2022 | , step = __webpack_require__(49) 2023 | , Iterators = __webpack_require__(7) 2024 | , toIObject = __webpack_require__(19); 2025 | 2026 | // 22.1.3.4 Array.prototype.entries() 2027 | // 22.1.3.13 Array.prototype.keys() 2028 | // 22.1.3.29 Array.prototype.values() 2029 | // 22.1.3.30 Array.prototype[@@iterator]() 2030 | module.exports = __webpack_require__(26)(Array, 'Array', function(iterated, kind){ 2031 | this._t = toIObject(iterated); // target 2032 | this._i = 0; // next index 2033 | this._k = kind; // kind 2034 | // 22.1.5.2.1 %ArrayIteratorPrototype%.next() 2035 | }, function(){ 2036 | var O = this._t 2037 | , kind = this._k 2038 | , index = this._i++; 2039 | if(!O || index >= O.length){ 2040 | this._t = undefined; 2041 | return step(1); 2042 | } 2043 | if(kind == 'keys' )return step(0, index); 2044 | if(kind == 'values')return step(0, O[index]); 2045 | return step(0, [index, O[index]]); 2046 | }, 'values'); 2047 | 2048 | // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) 2049 | Iterators.Arguments = Iterators.Array; 2050 | 2051 | addToUnscopables('keys'); 2052 | addToUnscopables('values'); 2053 | addToUnscopables('entries'); 2054 | 2055 | /***/ }, 2056 | /* 66 */ 2057 | /***/ function(module, exports) { 2058 | 2059 | 2060 | 2061 | /***/ }, 2062 | /* 67 */ 2063 | /***/ function(module, exports, __webpack_require__) { 2064 | 2065 | 'use strict'; 2066 | var LIBRARY = __webpack_require__(27) 2067 | , global = __webpack_require__(2) 2068 | , ctx = __webpack_require__(9) 2069 | , classof = __webpack_require__(21) 2070 | , $export = __webpack_require__(23) 2071 | , isObject = __webpack_require__(11) 2072 | , aFunction = __webpack_require__(13) 2073 | , anInstance = __webpack_require__(39) 2074 | , forOf = __webpack_require__(41) 2075 | , speciesConstructor = __webpack_require__(59) 2076 | , task = __webpack_require__(30).set 2077 | , microtask = __webpack_require__(50)() 2078 | , PROMISE = 'Promise' 2079 | , TypeError = global.TypeError 2080 | , process = global.process 2081 | , $Promise = global[PROMISE] 2082 | , process = global.process 2083 | , isNode = classof(process) == 'process' 2084 | , empty = function(){ /* empty */ } 2085 | , Internal, GenericPromiseCapability, Wrapper; 2086 | 2087 | var USE_NATIVE = !!function(){ 2088 | try { 2089 | // correct subclassing with @@species support 2090 | var promise = $Promise.resolve(1) 2091 | , FakePromise = (promise.constructor = {})[__webpack_require__(1)('species')] = function(exec){ exec(empty, empty); }; 2092 | // unhandled rejections tracking support, NodeJS Promise without it fails @@species test 2093 | return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; 2094 | } catch(e){ /* empty */ } 2095 | }(); 2096 | 2097 | // helpers 2098 | var sameConstructor = function(a, b){ 2099 | // with library wrapper special case 2100 | return a === b || a === $Promise && b === Wrapper; 2101 | }; 2102 | var isThenable = function(it){ 2103 | var then; 2104 | return isObject(it) && typeof (then = it.then) == 'function' ? then : false; 2105 | }; 2106 | var newPromiseCapability = function(C){ 2107 | return sameConstructor($Promise, C) 2108 | ? new PromiseCapability(C) 2109 | : new GenericPromiseCapability(C); 2110 | }; 2111 | var PromiseCapability = GenericPromiseCapability = function(C){ 2112 | var resolve, reject; 2113 | this.promise = new C(function($$resolve, $$reject){ 2114 | if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); 2115 | resolve = $$resolve; 2116 | reject = $$reject; 2117 | }); 2118 | this.resolve = aFunction(resolve); 2119 | this.reject = aFunction(reject); 2120 | }; 2121 | var perform = function(exec){ 2122 | try { 2123 | exec(); 2124 | } catch(e){ 2125 | return {error: e}; 2126 | } 2127 | }; 2128 | var notify = function(promise, isReject){ 2129 | if(promise._n)return; 2130 | promise._n = true; 2131 | var chain = promise._c; 2132 | microtask(function(){ 2133 | var value = promise._v 2134 | , ok = promise._s == 1 2135 | , i = 0; 2136 | var run = function(reaction){ 2137 | var handler = ok ? reaction.ok : reaction.fail 2138 | , resolve = reaction.resolve 2139 | , reject = reaction.reject 2140 | , domain = reaction.domain 2141 | , result, then; 2142 | try { 2143 | if(handler){ 2144 | if(!ok){ 2145 | if(promise._h == 2)onHandleUnhandled(promise); 2146 | promise._h = 1; 2147 | } 2148 | if(handler === true)result = value; 2149 | else { 2150 | if(domain)domain.enter(); 2151 | result = handler(value); 2152 | if(domain)domain.exit(); 2153 | } 2154 | if(result === reaction.promise){ 2155 | reject(TypeError('Promise-chain cycle')); 2156 | } else if(then = isThenable(result)){ 2157 | then.call(result, resolve, reject); 2158 | } else resolve(result); 2159 | } else reject(value); 2160 | } catch(e){ 2161 | reject(e); 2162 | } 2163 | }; 2164 | while(chain.length > i)run(chain[i++]); // variable length - can't use forEach 2165 | promise._c = []; 2166 | promise._n = false; 2167 | if(isReject && !promise._h)onUnhandled(promise); 2168 | }); 2169 | }; 2170 | var onUnhandled = function(promise){ 2171 | task.call(global, function(){ 2172 | var value = promise._v 2173 | , abrupt, handler, console; 2174 | if(isUnhandled(promise)){ 2175 | abrupt = perform(function(){ 2176 | if(isNode){ 2177 | process.emit('unhandledRejection', value, promise); 2178 | } else if(handler = global.onunhandledrejection){ 2179 | handler({promise: promise, reason: value}); 2180 | } else if((console = global.console) && console.error){ 2181 | console.error('Unhandled promise rejection', value); 2182 | } 2183 | }); 2184 | // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should 2185 | promise._h = isNode || isUnhandled(promise) ? 2 : 1; 2186 | } promise._a = undefined; 2187 | if(abrupt)throw abrupt.error; 2188 | }); 2189 | }; 2190 | var isUnhandled = function(promise){ 2191 | if(promise._h == 1)return false; 2192 | var chain = promise._a || promise._c 2193 | , i = 0 2194 | , reaction; 2195 | while(chain.length > i){ 2196 | reaction = chain[i++]; 2197 | if(reaction.fail || !isUnhandled(reaction.promise))return false; 2198 | } return true; 2199 | }; 2200 | var onHandleUnhandled = function(promise){ 2201 | task.call(global, function(){ 2202 | var handler; 2203 | if(isNode){ 2204 | process.emit('rejectionHandled', promise); 2205 | } else if(handler = global.onrejectionhandled){ 2206 | handler({promise: promise, reason: promise._v}); 2207 | } 2208 | }); 2209 | }; 2210 | var $reject = function(value){ 2211 | var promise = this; 2212 | if(promise._d)return; 2213 | promise._d = true; 2214 | promise = promise._w || promise; // unwrap 2215 | promise._v = value; 2216 | promise._s = 2; 2217 | if(!promise._a)promise._a = promise._c.slice(); 2218 | notify(promise, true); 2219 | }; 2220 | var $resolve = function(value){ 2221 | var promise = this 2222 | , then; 2223 | if(promise._d)return; 2224 | promise._d = true; 2225 | promise = promise._w || promise; // unwrap 2226 | try { 2227 | if(promise === value)throw TypeError("Promise can't be resolved itself"); 2228 | if(then = isThenable(value)){ 2229 | microtask(function(){ 2230 | var wrapper = {_w: promise, _d: false}; // wrap 2231 | try { 2232 | then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); 2233 | } catch(e){ 2234 | $reject.call(wrapper, e); 2235 | } 2236 | }); 2237 | } else { 2238 | promise._v = value; 2239 | promise._s = 1; 2240 | notify(promise, false); 2241 | } 2242 | } catch(e){ 2243 | $reject.call({_w: promise, _d: false}, e); // wrap 2244 | } 2245 | }; 2246 | 2247 | // constructor polyfill 2248 | if(!USE_NATIVE){ 2249 | // 25.4.3.1 Promise(executor) 2250 | $Promise = function Promise(executor){ 2251 | anInstance(this, $Promise, PROMISE, '_h'); 2252 | aFunction(executor); 2253 | Internal.call(this); 2254 | try { 2255 | executor(ctx($resolve, this, 1), ctx($reject, this, 1)); 2256 | } catch(err){ 2257 | $reject.call(this, err); 2258 | } 2259 | }; 2260 | Internal = function Promise(executor){ 2261 | this._c = []; // <- awaiting reactions 2262 | this._a = undefined; // <- checked in isUnhandled reactions 2263 | this._s = 0; // <- state 2264 | this._d = false; // <- done 2265 | this._v = undefined; // <- value 2266 | this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled 2267 | this._n = false; // <- notify 2268 | }; 2269 | Internal.prototype = __webpack_require__(56)($Promise.prototype, { 2270 | // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) 2271 | then: function then(onFulfilled, onRejected){ 2272 | var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); 2273 | reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; 2274 | reaction.fail = typeof onRejected == 'function' && onRejected; 2275 | reaction.domain = isNode ? process.domain : undefined; 2276 | this._c.push(reaction); 2277 | if(this._a)this._a.push(reaction); 2278 | if(this._s)notify(this, false); 2279 | return reaction.promise; 2280 | }, 2281 | // 25.4.5.1 Promise.prototype.catch(onRejected) 2282 | 'catch': function(onRejected){ 2283 | return this.then(undefined, onRejected); 2284 | } 2285 | }); 2286 | PromiseCapability = function(){ 2287 | var promise = new Internal; 2288 | this.promise = promise; 2289 | this.resolve = ctx($resolve, promise, 1); 2290 | this.reject = ctx($reject, promise, 1); 2291 | }; 2292 | } 2293 | 2294 | $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); 2295 | __webpack_require__(16)($Promise, PROMISE); 2296 | __webpack_require__(58)(PROMISE); 2297 | Wrapper = __webpack_require__(5)[PROMISE]; 2298 | 2299 | // statics 2300 | $export($export.S + $export.F * !USE_NATIVE, PROMISE, { 2301 | // 25.4.4.5 Promise.reject(r) 2302 | reject: function reject(r){ 2303 | var capability = newPromiseCapability(this) 2304 | , $$reject = capability.reject; 2305 | $$reject(r); 2306 | return capability.promise; 2307 | } 2308 | }); 2309 | $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { 2310 | // 25.4.4.6 Promise.resolve(x) 2311 | resolve: function resolve(x){ 2312 | // instanceof instead of internal slot check because we should fix it without replacement native Promise core 2313 | if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; 2314 | var capability = newPromiseCapability(this) 2315 | , $$resolve = capability.resolve; 2316 | $$resolve(x); 2317 | return capability.promise; 2318 | } 2319 | }); 2320 | $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(48)(function(iter){ 2321 | $Promise.all(iter)['catch'](empty); 2322 | })), PROMISE, { 2323 | // 25.4.4.1 Promise.all(iterable) 2324 | all: function all(iterable){ 2325 | var C = this 2326 | , capability = newPromiseCapability(C) 2327 | , resolve = capability.resolve 2328 | , reject = capability.reject; 2329 | var abrupt = perform(function(){ 2330 | var values = [] 2331 | , index = 0 2332 | , remaining = 1; 2333 | forOf(iterable, false, function(promise){ 2334 | var $index = index++ 2335 | , alreadyCalled = false; 2336 | values.push(undefined); 2337 | remaining++; 2338 | C.resolve(promise).then(function(value){ 2339 | if(alreadyCalled)return; 2340 | alreadyCalled = true; 2341 | values[$index] = value; 2342 | --remaining || resolve(values); 2343 | }, reject); 2344 | }); 2345 | --remaining || resolve(values); 2346 | }); 2347 | if(abrupt)reject(abrupt.error); 2348 | return capability.promise; 2349 | }, 2350 | // 25.4.4.4 Promise.race(iterable) 2351 | race: function race(iterable){ 2352 | var C = this 2353 | , capability = newPromiseCapability(C) 2354 | , reject = capability.reject; 2355 | var abrupt = perform(function(){ 2356 | forOf(iterable, false, function(promise){ 2357 | C.resolve(promise).then(capability.resolve, reject); 2358 | }); 2359 | }); 2360 | if(abrupt)reject(abrupt.error); 2361 | return capability.promise; 2362 | } 2363 | }); 2364 | 2365 | /***/ }, 2366 | /* 68 */ 2367 | /***/ function(module, exports, __webpack_require__) { 2368 | 2369 | 'use strict'; 2370 | var $at = __webpack_require__(60)(true); 2371 | 2372 | // 21.1.3.27 String.prototype[@@iterator]() 2373 | __webpack_require__(26)(String, 'String', function(iterated){ 2374 | this._t = String(iterated); // target 2375 | this._i = 0; // next index 2376 | // 21.1.5.2.1 %StringIteratorPrototype%.next() 2377 | }, function(){ 2378 | var O = this._t 2379 | , index = this._i 2380 | , point; 2381 | if(index >= O.length)return {value: undefined, done: true}; 2382 | point = $at(O, index); 2383 | this._i += point.length; 2384 | return {value: point, done: false}; 2385 | }); 2386 | 2387 | /***/ }, 2388 | /* 69 */ 2389 | /***/ function(module, exports, __webpack_require__) { 2390 | 2391 | __webpack_require__(65); 2392 | var global = __webpack_require__(2) 2393 | , hide = __webpack_require__(4) 2394 | , Iterators = __webpack_require__(7) 2395 | , TO_STRING_TAG = __webpack_require__(1)('toStringTag'); 2396 | 2397 | for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ 2398 | var NAME = collections[i] 2399 | , Collection = global[NAME] 2400 | , proto = Collection && Collection.prototype; 2401 | if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); 2402 | Iterators[NAME] = Iterators.Array; 2403 | } 2404 | 2405 | /***/ }, 2406 | /* 70 */ 2407 | /***/ function(module, exports) { 2408 | 2409 | // shim for using process in browser 2410 | var process = module.exports = {}; 2411 | 2412 | // cached from whatever global is present so that test runners that stub it 2413 | // don't break things. But we need to wrap it in a try catch in case it is 2414 | // wrapped in strict mode code which doesn't define any globals. It's inside a 2415 | // function because try/catches deoptimize in certain engines. 2416 | 2417 | var cachedSetTimeout; 2418 | var cachedClearTimeout; 2419 | 2420 | function defaultSetTimout() { 2421 | throw new Error('setTimeout has not been defined'); 2422 | } 2423 | function defaultClearTimeout () { 2424 | throw new Error('clearTimeout has not been defined'); 2425 | } 2426 | (function () { 2427 | try { 2428 | if (typeof setTimeout === 'function') { 2429 | cachedSetTimeout = setTimeout; 2430 | } else { 2431 | cachedSetTimeout = defaultSetTimout; 2432 | } 2433 | } catch (e) { 2434 | cachedSetTimeout = defaultSetTimout; 2435 | } 2436 | try { 2437 | if (typeof clearTimeout === 'function') { 2438 | cachedClearTimeout = clearTimeout; 2439 | } else { 2440 | cachedClearTimeout = defaultClearTimeout; 2441 | } 2442 | } catch (e) { 2443 | cachedClearTimeout = defaultClearTimeout; 2444 | } 2445 | } ()) 2446 | function runTimeout(fun) { 2447 | if (cachedSetTimeout === setTimeout) { 2448 | //normal enviroments in sane situations 2449 | return setTimeout(fun, 0); 2450 | } 2451 | // if setTimeout wasn't available but was latter defined 2452 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 2453 | cachedSetTimeout = setTimeout; 2454 | return setTimeout(fun, 0); 2455 | } 2456 | try { 2457 | // when when somebody has screwed with setTimeout but no I.E. maddness 2458 | return cachedSetTimeout(fun, 0); 2459 | } catch(e){ 2460 | try { 2461 | // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 2462 | return cachedSetTimeout.call(null, fun, 0); 2463 | } catch(e){ 2464 | // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 2465 | return cachedSetTimeout.call(this, fun, 0); 2466 | } 2467 | } 2468 | 2469 | 2470 | } 2471 | function runClearTimeout(marker) { 2472 | if (cachedClearTimeout === clearTimeout) { 2473 | //normal enviroments in sane situations 2474 | return clearTimeout(marker); 2475 | } 2476 | // if clearTimeout wasn't available but was latter defined 2477 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 2478 | cachedClearTimeout = clearTimeout; 2479 | return clearTimeout(marker); 2480 | } 2481 | try { 2482 | // when when somebody has screwed with setTimeout but no I.E. maddness 2483 | return cachedClearTimeout(marker); 2484 | } catch (e){ 2485 | try { 2486 | // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 2487 | return cachedClearTimeout.call(null, marker); 2488 | } catch (e){ 2489 | // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 2490 | // Some versions of I.E. have different rules for clearTimeout vs setTimeout 2491 | return cachedClearTimeout.call(this, marker); 2492 | } 2493 | } 2494 | 2495 | 2496 | 2497 | } 2498 | var queue = []; 2499 | var draining = false; 2500 | var currentQueue; 2501 | var queueIndex = -1; 2502 | 2503 | function cleanUpNextTick() { 2504 | if (!draining || !currentQueue) { 2505 | return; 2506 | } 2507 | draining = false; 2508 | if (currentQueue.length) { 2509 | queue = currentQueue.concat(queue); 2510 | } else { 2511 | queueIndex = -1; 2512 | } 2513 | if (queue.length) { 2514 | drainQueue(); 2515 | } 2516 | } 2517 | 2518 | function drainQueue() { 2519 | if (draining) { 2520 | return; 2521 | } 2522 | var timeout = runTimeout(cleanUpNextTick); 2523 | draining = true; 2524 | 2525 | var len = queue.length; 2526 | while(len) { 2527 | currentQueue = queue; 2528 | queue = []; 2529 | while (++queueIndex < len) { 2530 | if (currentQueue) { 2531 | currentQueue[queueIndex].run(); 2532 | } 2533 | } 2534 | queueIndex = -1; 2535 | len = queue.length; 2536 | } 2537 | currentQueue = null; 2538 | draining = false; 2539 | runClearTimeout(timeout); 2540 | } 2541 | 2542 | process.nextTick = function (fun) { 2543 | var args = new Array(arguments.length - 1); 2544 | if (arguments.length > 1) { 2545 | for (var i = 1; i < arguments.length; i++) { 2546 | args[i - 1] = arguments[i]; 2547 | } 2548 | } 2549 | queue.push(new Item(fun, args)); 2550 | if (queue.length === 1 && !draining) { 2551 | runTimeout(drainQueue); 2552 | } 2553 | }; 2554 | 2555 | // v8 likes predictible objects 2556 | function Item(fun, array) { 2557 | this.fun = fun; 2558 | this.array = array; 2559 | } 2560 | Item.prototype.run = function () { 2561 | this.fun.apply(null, this.array); 2562 | }; 2563 | process.title = 'browser'; 2564 | process.browser = true; 2565 | process.env = {}; 2566 | process.argv = []; 2567 | process.version = ''; // empty string to avoid regexp issues 2568 | process.versions = {}; 2569 | 2570 | function noop() {} 2571 | 2572 | process.on = noop; 2573 | process.addListener = noop; 2574 | process.once = noop; 2575 | process.off = noop; 2576 | process.removeListener = noop; 2577 | process.removeAllListeners = noop; 2578 | process.emit = noop; 2579 | 2580 | process.binding = function (name) { 2581 | throw new Error('process.binding is not supported'); 2582 | }; 2583 | 2584 | process.cwd = function () { return '/' }; 2585 | process.chdir = function (dir) { 2586 | throw new Error('process.chdir is not supported'); 2587 | }; 2588 | process.umask = function() { return 0; }; 2589 | 2590 | 2591 | /***/ }, 2592 | /* 71 */ 2593 | /***/ function(module, exports) { 2594 | 2595 | module.exports = __WEBPACK_EXTERNAL_MODULE_71__; 2596 | 2597 | /***/ } 2598 | /******/ ]) 2599 | }); 2600 | ; -------------------------------------------------------------------------------- /dist/foobanzle.min.js: -------------------------------------------------------------------------------- 1 | !function(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("lodash"));else if("function"==typeof define&&define.amd)define(["lodash"],n);else{var r=n("object"==typeof exports?require("lodash"):t.lodash);for(var e in r)("object"==typeof exports?exports:t)[e]=r[e]}}(this,function(t){return function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var o=r(36),i=e(o),c=r(20),u=e(c),a=r(33),f=e(a),s=r(71),l=e(s),h=function(){var t=(0,f["default"])(i["default"].mark(function n(){return i["default"].wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",u["default"].resolve("whoo"));case 1:case"end":return t.stop()}},n,void 0)}));return function(){return t.apply(this,arguments)}}(),p=function(){var t=(0,f["default"])(i["default"].mark(function n(t){var r;return i["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,h();case 2:return r=n.sent,n.abrupt("return",r+" : "+l["default"].head(t));case 4:case"end":return n.stop()}},n,void 0)}));return function(n){return t.apply(this,arguments)}}();n["default"]=p},function(t,n,r){var e=r(29)("wks"),o=r(32),i=r(2).Symbol,c="function"==typeof i,u=t.exports=function(t){return e[t]||(e[t]=c&&i[t]||(c?i:o)("Symbol."+t))};u.store=e},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(11);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n,r){var e=r(12),o=r(28);t.exports=r(6)?function(t,n,r){return e.f(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,n,r){t.exports=!r(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){t.exports={}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(13);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(3),o=r(42),i=r(63),c=Object.defineProperty;n.f=r(6)?Object.defineProperty:function(t,n,r){if(e(t),n=i(n,!0),e(r),o)try{return c(t,n,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){var e=r(11),o=r(2).document,i=e(o)&&e(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,r){var e=r(12).f,o=r(10),i=r(1)("toStringTag");t.exports=function(t,n,r){t&&!o(t=r?t:t.prototype,i)&&e(t,i,{configurable:!0,value:n})}},function(t,n,r){var e=r(29)("keys"),o=r(32);t.exports=function(t){return e[t]||(e[t]=o(t))}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(44),o=r(14);t.exports=function(t){return e(o(t))}},function(t,n,r){t.exports={"default":r(37),__esModule:!0}},function(t,n,r){var e=r(8),o=r(1)("toStringTag"),i="Arguments"==e(function(){return arguments}()),c=function(t,n){try{return t[n]}catch(e){}};t.exports=function(t){var n,r,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=c(n=Object(t),o))?r:i?e(n):"Object"==(u=e(n))&&"function"==typeof n.callee?"Arguments":u}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var e=r(2),o=r(5),i=r(9),c=r(4),u="prototype",a=function(t,n,r){var f,s,l,h=t&a.F,p=t&a.G,v=t&a.S,d=t&a.P,y=t&a.B,m=t&a.W,g=p?o:o[n]||(o[n]={}),x=g[u],w=p?e:v?e[n]:(e[n]||{})[u];p&&(r=n);for(f in r)s=!h&&w&&void 0!==w[f],s&&f in g||(l=s?w[f]:r[f],g[f]=p&&"function"!=typeof w[f]?r[f]:y&&s?i(l,e):m&&w[f]==l?function(t){var n=function(n,r,e){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,r)}return new t(n,r,e)}return t.apply(this,arguments)};return n[u]=t[u],n}(l):d&&"function"==typeof l?i(Function.call,l):l,d&&((g.virtual||(g.virtual={}))[f]=l,t&a.R&&x&&!x[f]&&c(x,f,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,n){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,n,r){t.exports=r(2).document&&document.documentElement},function(t,n,r){"use strict";var e=r(27),o=r(23),i=r(57),c=r(4),u=r(10),a=r(7),f=r(47),s=r(16),l=r(53),h=r(1)("iterator"),p=!([].keys&&"next"in[].keys()),v="@@iterator",d="keys",y="values",m=function(){return this};t.exports=function(t,n,r,g,x,w,_){f(r,n,g);var b,j,O,E=function(t){if(!p&&t in S)return S[t];switch(t){case d:return function(){return new r(this,t)};case y:return function(){return new r(this,t)}}return function(){return new r(this,t)}},T=n+" Iterator",L=x==y,P=!1,S=t.prototype,k=S[h]||S[v]||x&&S[x],M=k||E(x),A=x?L?E("entries"):M:void 0,R="Array"==n?S.entries||k:k;if(R&&(O=l(R.call(new t)),O!==Object.prototype&&(s(O,T,!0),e||u(O,h)||c(O,h,m))),L&&k&&k.name!==y&&(P=!0,M=function(){return k.call(this)}),e&&!_||!p&&!P&&S[h]||c(S,h,M),a[n]=M,a[T]=m,x)if(b={values:L?M:E(y),keys:w?M:E(d),entries:A},_)for(j in b)j in S||i(S,j,b[j]);else o(o.P+o.F*(p||P),n,b);return b}},function(t,n){t.exports=!0},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e,o,i,c=r(9),u=r(43),a=r(25),f=r(15),s=r(2),l=s.process,h=s.setImmediate,p=s.clearImmediate,v=s.MessageChannel,d=0,y={},m="onreadystatechange",g=function(){var t=+this;if(y.hasOwnProperty(t)){var n=y[t];delete y[t],n()}},x=function(t){g.call(t.data)};h&&p||(h=function(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return y[++d]=function(){u("function"==typeof t?t:Function(t),n)},e(d),d},p=function(t){delete y[t]},"process"==r(8)(l)?e=function(t){l.nextTick(c(g,t,1))}:v?(o=new v,i=o.port2,o.port1.onmessage=x,e=c(i.postMessage,i,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",x,!1)):e=m in f("script")?function(t){a.appendChild(f("script"))[m]=function(){a.removeChild(this),g.call(t)}}:function(t){setTimeout(c(g,t,1),0)}),t.exports={set:h,clear:p}},function(t,n,r){var e=r(18),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var o=r(20),i=e(o);n["default"]=function(t){return function(){var n=t.apply(this,arguments);return new i["default"](function(t,r){function e(o,c){try{var u=n[o](c),a=u.value}catch(error){return void r(error)}return u.done?void t(a):i["default"].resolve(a).then(function(t){e("next",t)},function(t){e("throw",t)})}return e("next")})}}},function(t,n,r){(function(n){var e="object"==typeof n?n:"object"==typeof window?window:"object"==typeof self?self:this,o=e.regeneratorRuntime&&Object.getOwnPropertyNames(e).indexOf("regeneratorRuntime")>=0,i=o&&e.regeneratorRuntime;if(e.regeneratorRuntime=void 0,t.exports=r(35),o)e.regeneratorRuntime=i;else try{delete e.regeneratorRuntime}catch(e){e.regeneratorRuntime=void 0}}).call(n,function(){return this}())},function(t,n,r){(function(n,r){!function(n){"use strict";function e(t,n,r,e){var o=n&&n.prototype instanceof i?n:i,c=Object.create(o.prototype),u=new v(e||[]);return c._invoke=s(t,r,u),c}function o(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(err){return{type:"throw",arg:err}}}function i(){}function c(){}function u(){}function a(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function f(t){function n(r,e,i,c){var u=o(t[r],t,e);if("throw"!==u.type){var a=u.arg,f=a.value;return f&&"object"==typeof f&&x.call(f,"__await")?Promise.resolve(f.__await).then(function(t){n("next",t,i,c)},function(t){n("throw",t,i,c)}):Promise.resolve(f).then(function(t){a.value=t,i(a)},c)}c(u.arg)}function e(t,r){function e(){return new Promise(function(e,o){n(t,r,e,o)})}return i=i?i.then(e,e):e()}"object"==typeof r&&r.domain&&(n=r.domain.bind(n));var i;this._invoke=e}function s(t,n,r){var e=E;return function(i,c){if(e===L)throw Error("Generator is already running");if(e===P){if("throw"===i)throw c;return y()}for(r.method=i,r.arg=c;;){var u=r.delegate;if(u){var a=l(u,r);if(a){if(a===S)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(e===E)throw e=P,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e=L;var f=o(t,n,r);if("normal"===f.type){if(e=r.done?P:T,f.arg===S)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(e=P,r.method="throw",r.arg=f.arg)}}}function l(t,n){var r=t.iterator[n.method];if(r===m){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=m,l(t,n),"throw"===n.method))return S;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return S}var e=o(r,t.iterator,n.arg);if("throw"===e.type)return n.method="throw",n.arg=e.arg,n.delegate=null,S;var i=e.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=m),n.delegate=null,S):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,S)}function h(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function p(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function v(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(h,this),this.reset(!0)}function d(t){if(t){var n=t[_];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,e=function o(){for(;++r=0;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var c=x.call(o,"catchLoc"),u=x.call(o,"finallyLoc");if(c&&u){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(this.prev>=e.tryLoc&&x.call(e,"finallyLoc")&&e.finallyLoc>this.prev){var o=e;break}}!o||"break"!==t&&"continue"!==t||o.tryLoc>n||n>o.finallyLoc||(o=null);var i=o?o.completion:{};return i.type=t,i.arg=n,o?(this.method="next",this.next=o.finallyLoc,S):this.complete(i)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),S},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),p(r),S}},"catch":function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var o=e.arg;p(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:d(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=m),S}}}("object"==typeof n?n:"object"==typeof window?window:"object"==typeof self?self:this)}).call(n,function(){return this}(),r(70))},function(t,n,r){t.exports=r(34)},function(t,n,r){r(66),r(68),r(69),r(67),t.exports=r(5).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var e=r(19),o=r(31),i=r(61);t.exports=function(t){return function(n,r,c){var u,a=e(n),f=o(a.length),s=i(c,f);if(t&&r!=r){for(;f>s;)if(u=a[s++],u!=u)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}}},function(t,n,r){var e=r(9),o=r(46),i=r(45),c=r(3),u=r(31),a=r(64),f={},s={},n=t.exports=function(t,n,r,l,h){var p,v,d,y,m=h?function(){return t}:a(t),g=e(r,l,n?2:1),x=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(p=u(t.length);p>x;x++)if(y=n?g(c(v=t[x])[0],v[1]):g(t[x]),y===f||y===s)return y}else for(d=m.call(t);!(v=d.next()).done;)if(y=o(d,g,v.value,n),y===f||y===s)return y};n.BREAK=f,n.RETURN=s},function(t,n,r){t.exports=!r(6)&&!r(24)(function(){return 7!=Object.defineProperty(r(15)("div"),"a",{get:function(){return 7}}).a})},function(t,n){t.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},function(t,n,r){var e=r(8);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n,r){var e=r(7),o=r(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||i[o]===t)}},function(t,n,r){var e=r(3);t.exports=function(t,n,r,o){try{return o?n(e(r)[0],r[1]):n(r)}catch(e){var i=t["return"];throw void 0!==i&&e(i.call(t)),e}}},function(t,n,r){"use strict";var e=r(51),o=r(28),i=r(16),c={};r(4)(c,r(1)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(c,{next:o(1,r)}),i(t,n+" Iterator")}},function(t,n,r){var e=r(1)("iterator"),o=!1;try{var i=[7][e]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}t.exports=function(t,n){if(!n&&!o)return!1;var r=!1;try{var i=[7],c=i[e]();c.next=function(){return{done:r=!0}},i[e]=function(){return c},t(i)}catch(e){}return r}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,r){var e=r(2),o=r(30).set,i=e.MutationObserver||e.WebKitMutationObserver,c=e.process,u=e.Promise,a="process"==r(8)(c);t.exports=function(){var t,n,r,f=function(){var e,o;for(a&&(e=c.domain)&&e.exit();t;){o=t.fn,t=t.next;try{o()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(a)r=function(){c.nextTick(f)};else if(i){var s=!0,l=document.createTextNode("");new i(f).observe(l,{characterData:!0}),r=function(){l.data=s=!s}}else if(u&&u.resolve){var h=u.resolve();r=function(){h.then(f)}}else r=function(){o.call(e,f)};return function(e){var o={fn:e,next:void 0};n&&(n.next=o),t||(t=o,r()),n=o}}},function(t,n,r){var e=r(3),o=r(52),i=r(22),c=r(17)("IE_PROTO"),u=function(){},a="prototype",f=function(){var t,n=r(15)("iframe"),e=i.length,o="<",c=">";for(n.style.display="none",r(25).appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(o+"script"+c+"document.F=Object"+o+"/script"+c),t.close(),f=t.F;e--;)delete f[a][i[e]];return f()};t.exports=Object.create||function(t,n){var r;return null!==t?(u[a]=e(t),r=new u,u[a]=null,r[c]=t):r=f(),void 0===n?r:o(r,n)}},function(t,n,r){var e=r(12),o=r(3),i=r(55);t.exports=r(6)?Object.defineProperties:function(t,n){o(t);for(var r,c=i(n),u=c.length,a=0;u>a;)e.f(t,r=c[a++],n[r]);return t}},function(t,n,r){var e=r(10),o=r(62),i=r(17)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),e(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},function(t,n,r){var e=r(10),o=r(19),i=r(40)(!1),c=r(17)("IE_PROTO");t.exports=function(t,n){var r,u=o(t),a=0,f=[];for(r in u)r!=c&&e(u,r)&&f.push(r);for(;n.length>a;)e(u,r=n[a++])&&(~i(f,r)||f.push(r));return f}},function(t,n,r){var e=r(54),o=r(22);t.exports=Object.keys||function(t){return e(t,o)}},function(t,n,r){var e=r(4);t.exports=function(t,n,r){for(var o in n)r&&t[o]?t[o]=n[o]:e(t,o,n[o]);return t}},function(t,n,r){t.exports=r(4)},function(t,n,r){"use strict";var e=r(2),o=r(5),i=r(12),c=r(6),u=r(1)("species");t.exports=function(t){var n="function"==typeof o[t]?o[t]:e[t];c&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n,r){var e=r(3),o=r(13),i=r(1)("species");t.exports=function(t,n){var r,c=e(t).constructor;return void 0===c||void 0==(r=e(c)[i])?n:o(r)}},function(t,n,r){var e=r(18),o=r(14);t.exports=function(t){return function(n,r){var i,c,u=o(n)+"",a=e(r),f=u.length;return 0>a||a>=f?t?"":void 0:(i=u.charCodeAt(a),55296>i||i>56319||a+1===f||(c=u.charCodeAt(a+1))<56320||c>57343?t?u.charAt(a):i:t?u.slice(a,a+2):(i-55296<<10)+(c-56320)+65536)}}},function(t,n,r){var e=r(18),o=Math.max,i=Math.min;t.exports=function(t,n){return t=e(t),0>t?o(t+n,0):i(t,n)}},function(t,n,r){var e=r(14);t.exports=function(t){return Object(e(t))}},function(t,n,r){var e=r(11);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(21),o=r(1)("iterator"),i=r(7);t.exports=r(5).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[e(t)]}},function(t,n,r){"use strict";var e=r(38),o=r(49),i=r(7),c=r(19);t.exports=r(26)(Array,"Array",function(t,n){this._t=c(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return t&&t.length>r?"keys"==n?o(0,r):"values"==n?o(0,t[r]):o(0,[r,t[r]]):(this._t=void 0,o(1))},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries")},function(t,n){},function(t,n,r){"use strict";var e,o,i,c=r(27),u=r(2),a=r(9),f=r(21),s=r(23),l=r(11),h=r(13),p=r(39),v=r(41),d=r(59),y=r(30).set,m=r(50)(),g="Promise",x=u.TypeError,w=u.process,_=u[g],w=u.process,b="process"==f(w),j=function(){},O=!!function(){try{var t=_.resolve(1),n=(t.constructor={})[r(1)("species")]=function(t){t(j,j)};return(b||"function"==typeof PromiseRejectionEvent)&&t.then(j)instanceof n}catch(e){}}(),E=function(t,n){return t===n||t===_&&n===i},T=function(t){var n;return!(!l(t)||"function"!=typeof(n=t.then))&&n},L=function(t){return E(_,t)?new P(t):new o(t)},P=o=function(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw x("Bad Promise constructor");n=t,r=e}),this.resolve=h(n),this.reject=h(r)},S=function(t){try{t()}catch(e){return{error:e}}},k=function(t,n){if(!t._n){t._n=!0;var r=t._c;m(function(){for(var e=t._v,o=1==t._s,i=0,c=function(n){var r,i,c=o?n.ok:n.fail,u=n.resolve,a=n.reject,f=n.domain;try{c?(o||(2==t._h&&R(t),t._h=1),c===!0?r=e:(f&&f.enter(),r=c(e),f&&f.exit()),r===n.promise?a(x("Promise-chain cycle")):(i=T(r))?i.call(r,u,a):u(r)):a(e)}catch(e){a(e)}};r.length>i;)c(r[i++]);t._c=[],t._n=!1,n&&!t._h&&M(t)})}},M=function(t){y.call(u,function(){var n,r,e,o=t._v;if(A(t)&&(n=S(function(){b?w.emit("unhandledRejection",o,t):(r=u.onunhandledrejection)?r({promise:t,reason:o}):(e=u.console)&&e.error&&e.error("Unhandled promise rejection",o)}),t._h=b||A(t)?2:1),t._a=void 0,n)throw n.error})},A=function(t){if(1==t._h)return!1;for(var n,r=t._a||t._c,e=0;r.length>e;)if(n=r[e++],n.fail||!A(n.promise))return!1;return!0},R=function(t){y.call(u,function(){var n;b?w.emit("rejectionHandled",t):(n=u.onrejectionhandled)&&n({promise:t,reason:t._v})})},F=function(t){var n=this;n._d||(n._d=!0,n=n._w||n,n._v=t,n._s=2,n._a||(n._a=n._c.slice()),k(n,!0))},N=function(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw x("Promise can't be resolved itself");(n=T(t))?m(function(){var e={_w:r,_d:!1};try{n.call(t,a(N,e,1),a(F,e,1))}catch(e){F.call(e,e)}}):(r._v=t,r._s=1,k(r,!1))}catch(e){F.call({_w:r,_d:!1},e)}}};O||(_=function(t){p(this,_,g,"_h"),h(t),e.call(this);try{t(a(N,this,1),a(F,this,1))}catch(err){F.call(this,err)}},e=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=r(56)(_.prototype,{then:function(t,n){var r=L(d(this,_));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=b?w.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&k(this,!1),r.promise},"catch":function(t){return this.then(void 0,t)}}),P=function(){var t=new e;this.promise=t,this.resolve=a(N,t,1),this.reject=a(F,t,1)}),s(s.G+s.W+s.F*!O,{Promise:_}),r(16)(_,g),r(58)(g),i=r(5)[g],s(s.S+s.F*!O,g,{reject:function(t){var n=L(this),r=n.reject;return r(t),n.promise}}),s(s.S+s.F*(c||!O),g,{resolve:function(t){if(t instanceof _&&E(t.constructor,this))return t;var n=L(this),r=n.resolve;return r(t),n.promise}}),s(s.S+s.F*!(O&&r(48)(function(t){_.all(t)["catch"](j)})),g,{all:function(t){var n=this,r=L(n),e=r.resolve,o=r.reject,i=S(function(){var r=[],i=0,c=1;v(t,!1,function(t){var u=i++,a=!1;r.push(void 0),c++,n.resolve(t).then(function(t){a||(a=!0,r[u]=t,--c||e(r))},o)}),--c||e(r)});return i&&o(i.error),r.promise},race:function(t){var n=this,r=L(n),e=r.reject,o=S(function(){v(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return o&&e(o.error),r.promise}})},function(t,n,r){"use strict";var e=r(60)(!0);r(26)(String,"String",function(t){this._t=t+"",this._i=0},function(){var t,n=this._t,r=this._i;return n.length>r?(t=e(n,r),this._i+=t.length,{value:t,done:!1}):{value:void 0,done:!0}})},function(t,n,r){r(65);for(var e=r(2),o=r(4),i=r(7),c=r(1)("toStringTag"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],a=0;5>a;a++){var f=u[a],s=e[f],l=s&&s.prototype;l&&!l[c]&&o(l,c,f),i[f]=i.Array}},function(t,n){function r(){throw Error("setTimeout has not been defined")}function e(){throw Error("clearTimeout has not been defined")}function o(t){if(s===setTimeout)return setTimeout(t,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(t,0);try{return s(t,0)}catch(e){try{return s.call(null,t,0)}catch(e){return s.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===e||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function c(){d&&p&&(d=!1,p.length?v=p.concat(v):y=-1,v.length&&u())}function u(){if(!d){var t=o(c);d=!0;for(var n=v.length;n;){for(p=v,v=[];++y1)for(var r=1;arguments.length>r;r++)n[r-1]=arguments[r];v.push(new a(t,n)),1!==v.length||d||o(u)},a.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.binding=function(t){throw Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw Error("process.chdir is not supported")},h.umask=function(){return 0}},function(n,r){n.exports=t}])}); -------------------------------------------------------------------------------- /dom/controls.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | 7 | var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); 8 | 9 | var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); 10 | 11 | var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); 12 | 13 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 14 | 15 | var _createClass2 = require('babel-runtime/helpers/createClass'); 16 | 17 | var _createClass3 = _interopRequireDefault(_createClass2); 18 | 19 | var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); 20 | 21 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 22 | 23 | var _inherits2 = require('babel-runtime/helpers/inherits'); 24 | 25 | var _inherits3 = _interopRequireDefault(_inherits2); 26 | 27 | var _react = require('react'); 28 | 29 | var _react2 = _interopRequireDefault(_react); 30 | 31 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 32 | 33 | var Controls = function (_Component) { 34 | (0, _inherits3.default)(Controls, _Component); 35 | 36 | function Controls() { 37 | (0, _classCallCheck3.default)(this, Controls); 38 | return (0, _possibleConstructorReturn3.default)(this, (Controls.__proto__ || (0, _getPrototypeOf2.default)(Controls)).apply(this, arguments)); 39 | } 40 | 41 | (0, _createClass3.default)(Controls, [{ 42 | key: 'render', 43 | value: function render() { 44 | return _react2.default.createElement( 45 | 'div', 46 | null, 47 | _react2.default.createElement( 48 | 'button', 49 | { onClick: this.props.onPlay }, 50 | 'play' 51 | ), 52 | _react2.default.createElement( 53 | 'button', 54 | { onClick: this.props.onReset }, 55 | 'reset' 56 | ) 57 | ); 58 | } 59 | }]); 60 | return Controls; 61 | }(_react.Component); 62 | 63 | exports.default = Controls; -------------------------------------------------------------------------------- /dom/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Rect = exports.Oval = undefined; 7 | 8 | var _flight = require('../core/flight'); 9 | 10 | var _flight2 = _interopRequireDefault(_flight); 11 | 12 | var _ui = require('./ui'); 13 | 14 | var _controls = require('./controls'); 15 | 16 | var _controls2 = _interopRequireDefault(_controls); 17 | 18 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 19 | 20 | var Flight = (0, _flight2.default)(_ui.Rect, _controls2.default); 21 | 22 | exports.default = Flight; 23 | exports.Oval = _ui.Oval; 24 | exports.Rect = _ui.Rect; -------------------------------------------------------------------------------- /dom/ui.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.Rect = exports.Oval = undefined; 7 | 8 | var _assign = require('babel-runtime/core-js/object/assign'); 9 | 10 | var _assign2 = _interopRequireDefault(_assign); 11 | 12 | var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); 13 | 14 | var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); 15 | 16 | var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); 17 | 18 | var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); 19 | 20 | var _createClass2 = require('babel-runtime/helpers/createClass'); 21 | 22 | var _createClass3 = _interopRequireDefault(_createClass2); 23 | 24 | var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); 25 | 26 | var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); 27 | 28 | var _inherits2 = require('babel-runtime/helpers/inherits'); 29 | 30 | var _inherits3 = _interopRequireDefault(_inherits2); 31 | 32 | var _react = require('react'); 33 | 34 | var _react2 = _interopRequireDefault(_react); 35 | 36 | var _propTypes = require('prop-types'); 37 | 38 | var _propTypes2 = _interopRequireDefault(_propTypes); 39 | 40 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 41 | 42 | var Rect = function (_Component) { 43 | (0, _inherits3.default)(Rect, _Component); 44 | 45 | function Rect() { 46 | (0, _classCallCheck3.default)(this, Rect); 47 | return (0, _possibleConstructorReturn3.default)(this, (Rect.__proto__ || (0, _getPrototypeOf2.default)(Rect)).apply(this, arguments)); 48 | } 49 | 50 | (0, _createClass3.default)(Rect, [{ 51 | key: 'render', 52 | value: function render() { 53 | var _props = this.props, 54 | id = _props.id, 55 | source = _props.source, 56 | name = _props.name, 57 | radius = _props.radius, 58 | onPress = _props.onPress, 59 | children = _props.children, 60 | style = _props.style; 61 | 62 | return _react2.default.createElement( 63 | 'div', 64 | { 65 | id: id || (this.context && this.context.source || source) && name, 66 | className: name, 67 | onClick: onPress, 68 | style: (0, _assign2.default)({ borderRadius: radius }, style) 69 | }, 70 | children 71 | ); 72 | } 73 | }]); 74 | return Rect; 75 | }(_react.Component); 76 | 77 | Rect.contextTypes = { 78 | director: _propTypes2.default.object, 79 | source: _propTypes2.default.bool 80 | }; 81 | 82 | //XXX todo 83 | 84 | var Image = function () { 85 | function Image() { 86 | (0, _classCallCheck3.default)(this, Image); 87 | } 88 | 89 | (0, _createClass3.default)(Image, [{ 90 | key: 'render', 91 | value: function render() {} 92 | }]); 93 | return Image; 94 | }(); 95 | 96 | // Yea, not really an oval, more of a circle, but can be an oval 97 | // if you give me another radius.. 98 | 99 | 100 | var Oval = function (_Component2) { 101 | (0, _inherits3.default)(Oval, _Component2); 102 | 103 | function Oval() { 104 | (0, _classCallCheck3.default)(this, Oval); 105 | return (0, _possibleConstructorReturn3.default)(this, (Oval.__proto__ || (0, _getPrototypeOf2.default)(Oval)).apply(this, arguments)); 106 | } 107 | 108 | (0, _createClass3.default)(Oval, [{ 109 | key: 'render', 110 | value: function render() { 111 | var _props2 = this.props, 112 | source = _props2.source, 113 | name = _props2.name, 114 | size = _props2.size, 115 | children = _props2.children, 116 | style = _props2.style; 117 | 118 | return _react2.default.createElement( 119 | 'div', 120 | { 121 | id: (this.context && this.context.source || source) && name, 122 | className: name, 123 | onClick: this.triggerStart, 124 | style: (0, _assign2.default)({ borderRadius: size / 2, width: size, height: size }, style) 125 | }, 126 | children 127 | ); 128 | } 129 | }]); 130 | return Oval; 131 | }(_react.Component); 132 | 133 | Oval.contextTypes = { 134 | director: _propTypes2.default.object, 135 | source: _propTypes2.default.bool 136 | }; 137 | 138 | exports.Oval = Oval; 139 | exports.Rect = Rect; -------------------------------------------------------------------------------- /examples/compos-redux/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /examples/compos-redux/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "compose-redux", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "prop-types": "^15.5.10", 7 | "react": "^15.6.0", 8 | "react-dom": "^15.6.0", 9 | "react-flight": "^1.0.2", 10 | "react-redux": "^5.0.5", 11 | "redux": "^3.7.0" 12 | }, 13 | "devDependencies": { 14 | "react-scripts": "1.0.7" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test --env=jsdom", 20 | "eject": "react-scripts eject", 21 | "add-redux": "add-redux" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/compos-redux/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jondot/react-flight/d12697130abceffeec1dbd7e363a42ea1ffd61c0/examples/compos-redux/public/favicon.ico -------------------------------------------------------------------------------- /examples/compos-redux/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 15 | 16 | 17 | 21 | 30 | React App 31 | 32 | 33 | 36 |
37 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /examples/compos-redux/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /examples/compos-redux/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /examples/compos-redux/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import './App.css' 3 | import Flight, { Rect } from 'react-flight/dom' 4 | import PeopleContainer from './components/PeopleContainer' 5 | import PropTypes from 'prop-types' 6 | 7 | Flight.contextTypes = { 8 | store: PropTypes.object, 9 | } 10 | 11 | Flight.childContextTypes = { 12 | ...Flight.childContextTypes, 13 | store: PropTypes.object, 14 | } 15 | 16 | class App extends Component { 17 | render() { 18 | return ( 19 | (this.flight = flight)}> 20 | 21 |
22 | 33 | 34 | 35 | 46 | 57 | 58 | 69 | 70 | 81 | 82 |
92 | {'{'} 93 |
94 |
104 | {'}'} 105 |
106 |
107 | 108 |
109 | 110 | 111 |
112 | 123 | 124 | 135 | 136 | 147 | 148 | 159 | 160 | 171 | 172 |
182 | {'{'} 183 |
184 |
194 | {'}'} 195 |
196 |
197 | 198 |
199 | 200 |
201 | ) 202 | } 203 | } 204 | 205 | export default App 206 | -------------------------------------------------------------------------------- /examples/compos-redux/src/actions/action-types.js: -------------------------------------------------------------------------------- 1 | export const ADD_PERSON = 'ADD_PERSON'; 2 | -------------------------------------------------------------------------------- /examples/compos-redux/src/actions/people-actions.js: -------------------------------------------------------------------------------- 1 | import * as types from './action-types'; 2 | 3 | export const addPerson = (person) => { 4 | return { 5 | type: types.ADD_PERSON, 6 | person 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /examples/compos-redux/src/components/PeopleContainer.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import {connect} from 'react-redux'; 4 | import {bindActionCreators} from 'redux'; 5 | import * as peopleActions from '../actions/people-actions'; 6 | import PeopleList from './PeopleList'; 7 | import PersonInput from './PersonInput'; 8 | 9 | class PeopleContainer extends Component { 10 | constructor(props) { 11 | super(props); 12 | 13 | this.state = { 14 | people: [] 15 | }; 16 | } 17 | 18 | render() { 19 | const {people} = this.props; 20 | 21 | return ( 22 |
23 | 24 | 25 |
26 | ); 27 | } 28 | } 29 | 30 | PeopleContainer.propTypes = { 31 | people: PropTypes.array.isRequired, 32 | actions: PropTypes.object.isRequired 33 | }; 34 | 35 | function mapStateToProps(state, props) { 36 | return { 37 | people: state.people 38 | }; 39 | } 40 | 41 | function mapDispatchToProps(dispatch) { 42 | return { 43 | actions: bindActionCreators(peopleActions, dispatch) 44 | } 45 | } 46 | 47 | export default connect(mapStateToProps, mapDispatchToProps)(PeopleContainer); 48 | -------------------------------------------------------------------------------- /examples/compos-redux/src/components/PeopleList.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import Person from './Person'; 4 | 5 | const PeopleList = ({people}) => { 6 | return ( 7 |
8 | {people.map((person) => 9 | 10 | )} 11 |
12 | ); 13 | }; 14 | 15 | PeopleList.propTypes = { 16 | people: PropTypes.array.isRequired 17 | }; 18 | 19 | export default PeopleList; 20 | -------------------------------------------------------------------------------- /examples/compos-redux/src/components/Person.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | const Person = ({person}) => { 5 | return ( 6 |
7 | {person.lastname}, {person.firstname} 8 |
9 | ); 10 | }; 11 | 12 | Person.propTypes = { 13 | person: PropTypes.object.isRequired 14 | }; 15 | 16 | export default Person; 17 | -------------------------------------------------------------------------------- /examples/compos-redux/src/components/PersonInput.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | class PersonInput extends Component { 5 | constructor(props) { 6 | super(props); 7 | 8 | this.onAddPersonClick = this.onAddPersonClick.bind(this); 9 | } 10 | 11 | onAddPersonClick() { 12 | const firstNameElement = document.getElementById('firstname'); 13 | const lastNameElement = document.getElementById('lastname'); 14 | 15 | this.props.addPerson({ 16 | firstname: firstNameElement.value, 17 | lastname: lastNameElement.value 18 | }); 19 | 20 | firstNameElement.value = ""; 21 | lastNameElement.value = ""; 22 | 23 | firstNameElement.focus(); 24 | } 25 | 26 | componentDidMount() { 27 | document.getElementById('firstname').focus(); 28 | } 29 | 30 | render() { 31 | return ( 32 |
33 | 34 | 35 | 36 |
37 | ); 38 | } 39 | } 40 | 41 | PersonInput.propTypes = { 42 | addPerson: PropTypes.func.isRequired 43 | }; 44 | 45 | export default PersonInput; 46 | -------------------------------------------------------------------------------- /examples/compos-redux/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /examples/compos-redux/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import App from './App' 4 | import registerServiceWorker from './registerServiceWorker' 5 | import { Provider } from 'react-redux' 6 | import configureStore from './store/configure-store' 7 | 8 | const store = configureStore() 9 | const Root = () => ( 10 | 11 | 12 | 13 | ) 14 | ReactDOM.render(, document.getElementById('root')) -------------------------------------------------------------------------------- /examples/compos-redux/src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/compos-redux/src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import people from './people-reducer.js'; 2 | import {combineReducers} from 'redux'; 3 | 4 | const rootReducer = combineReducers({ 5 | people 6 | }); 7 | 8 | export default rootReducer; 9 | -------------------------------------------------------------------------------- /examples/compos-redux/src/reducers/people-reducer.js: -------------------------------------------------------------------------------- 1 | import * as types from '../actions/action-types'; 2 | 3 | export default (state = [], action) => { 4 | switch (action.type) { 5 | case types.ADD_PERSON: 6 | return [...state, Object.assign({}, action.person)]; 7 | default: 8 | return state; 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /examples/compos-redux/src/registerServiceWorker.js: -------------------------------------------------------------------------------- 1 | // In production, we register a service worker to serve assets from local cache. 2 | 3 | // This lets the app load faster on subsequent visits in production, and gives 4 | // it offline capabilities. However, it also means that developers (and users) 5 | // will only see deployed updates on the "N+1" visit to a page, since previously 6 | // cached resources are updated in the background. 7 | 8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy. 9 | // This link also includes instructions on opting out of this behavior. 10 | 11 | export default function register() { 12 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 13 | window.addEventListener('load', () => { 14 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 15 | navigator.serviceWorker 16 | .register(swUrl) 17 | .then(registration => { 18 | registration.onupdatefound = () => { 19 | const installingWorker = registration.installing; 20 | installingWorker.onstatechange = () => { 21 | if (installingWorker.state === 'installed') { 22 | if (navigator.serviceWorker.controller) { 23 | // At this point, the old content will have been purged and 24 | // the fresh content will have been added to the cache. 25 | // It's the perfect time to display a "New content is 26 | // available; please refresh." message in your web app. 27 | console.log('New content is available; please refresh.'); 28 | } else { 29 | // At this point, everything has been precached. 30 | // It's the perfect time to display a 31 | // "Content is cached for offline use." message. 32 | console.log('Content is cached for offline use.'); 33 | } 34 | } 35 | }; 36 | }; 37 | }) 38 | .catch(error => { 39 | console.error('Error during service worker registration:', error); 40 | }); 41 | }); 42 | } 43 | } 44 | 45 | export function unregister() { 46 | if ('serviceWorker' in navigator) { 47 | navigator.serviceWorker.ready.then(registration => { 48 | registration.unregister(); 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /examples/compos-redux/src/store/configure-store.js: -------------------------------------------------------------------------------- 1 | import rootReducer from '../reducers'; 2 | import {createStore} from 'redux'; 3 | 4 | export default (initialState) => { 5 | return createStore(rootReducer, initialState); 6 | }; 7 | -------------------------------------------------------------------------------- /examples/compos/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /examples/compos/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "compose", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^15.6.0", 7 | "react-dom": "^15.6.0", 8 | "react-flight": "^1.0.2" 9 | }, 10 | "devDependencies": { 11 | "react-scripts": "1.0.7" 12 | }, 13 | "scripts": { 14 | "start": "react-scripts start", 15 | "build": "react-scripts build", 16 | "test": "react-scripts test --env=jsdom", 17 | "eject": "react-scripts eject" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/compos/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jondot/react-flight/d12697130abceffeec1dbd7e363a42ea1ffd61c0/examples/compos/public/favicon.ico -------------------------------------------------------------------------------- /examples/compos/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 15 | 16 | 17 | 21 | 30 | React App 31 | 32 | 33 | 36 |
37 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /examples/compos/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /examples/compos/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /examples/compos/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import './App.css' 3 | import Flight, { Rect } from 'react-flight/dom' 4 | 5 | class App extends Component { 6 | render() { 7 | return ( 8 | (this.flight = flight)}> 9 | 10 |
11 | 22 | 23 | 34 | 45 | 46 | 57 | 58 | 69 | 70 |
80 | {'{'} 81 |
82 |
92 | {'}'} 93 |
94 |
95 | 96 |
97 | 98 | 99 |
100 | 111 | 112 | 123 | 124 | 135 | 136 | 147 | 148 | 159 | 160 |
170 | {'{'} 171 |
172 |
182 | {'}'} 183 |
184 |
185 | 186 |
187 | 188 |
189 | ) 190 | } 191 | } 192 | 193 | export default App 194 | -------------------------------------------------------------------------------- /examples/compos/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /examples/compos/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import registerServiceWorker from './registerServiceWorker'; 5 | import './index.css'; 6 | 7 | ReactDOM.render(, document.getElementById('root')); 8 | registerServiceWorker(); 9 | -------------------------------------------------------------------------------- /examples/compos/src/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/compos/src/registerServiceWorker.js: -------------------------------------------------------------------------------- 1 | // In production, we register a service worker to serve assets from local cache. 2 | 3 | // This lets the app load faster on subsequent visits in production, and gives 4 | // it offline capabilities. However, it also means that developers (and users) 5 | // will only see deployed updates on the "N+1" visit to a page, since previously 6 | // cached resources are updated in the background. 7 | 8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy. 9 | // This link also includes instructions on opting out of this behavior. 10 | 11 | export default function register() { 12 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 13 | window.addEventListener('load', () => { 14 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 15 | navigator.serviceWorker 16 | .register(swUrl) 17 | .then(registration => { 18 | registration.onupdatefound = () => { 19 | const installingWorker = registration.installing; 20 | installingWorker.onstatechange = () => { 21 | if (installingWorker.state === 'installed') { 22 | if (navigator.serviceWorker.controller) { 23 | // At this point, the old content will have been purged and 24 | // the fresh content will have been added to the cache. 25 | // It's the perfect time to display a "New content is 26 | // available; please refresh." message in your web app. 27 | console.log('New content is available; please refresh.'); 28 | } else { 29 | // At this point, everything has been precached. 30 | // It's the perfect time to display a 31 | // "Content is cached for offline use." message. 32 | console.log('Content is cached for offline use.'); 33 | } 34 | } 35 | }; 36 | }; 37 | }) 38 | .catch(error => { 39 | console.error('Error during service worker registration:', error); 40 | }); 41 | }); 42 | } 43 | } 44 | 45 | export function unregister() { 46 | if ('serviceWorker' in navigator) { 47 | navigator.serviceWorker.ready.then(registration => { 48 | registration.unregister(); 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /media/flight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jondot/react-flight/d12697130abceffeec1dbd7e363a42ea1ffd61c0/media/flight.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-flight", 3 | "version": "1.0.2", 4 | "main": "lib/index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "build:lib": "babel src --out-dir . && rm -rf __tests__", 8 | "build:umd:min": "cross-env NODE_ENV=production webpack --display-modules", 9 | "build:umd": "cross-env NODE_ENV=development webpack --display-modules", 10 | "build": "yarn build:lib && yarn build:umd && yarn build:umd:min", 11 | "release": "yarn juild && yarn publish", 12 | "test": "jest", 13 | "watch": "jest --watch" 14 | }, 15 | "dependencies": { 16 | "lodash": "^4.17.2", 17 | "prop-types": "^15.5.10", 18 | "tweene": "^0.5.11", 19 | "velocity-animate": "^1.5.0" 20 | }, 21 | "devDependencies": { 22 | "babel": "^6.23.0", 23 | "babel-cli": "^6.18.0", 24 | "babel-core": "^6.18.2", 25 | "babel-jest": "^17.0.0", 26 | "babel-loader": "^6.2.7", 27 | "babel-plugin-transform-runtime": "^6.12.0", 28 | "babel-polyfill": "6.13.0", 29 | "babel-preset-es2015": "^6.24.1", 30 | "babel-preset-latest": "^6.24.1", 31 | "babel-preset-react": "^6.24.1", 32 | "babel-preset-stage-0": "^6.16.0", 33 | "cross-env": "~5.0.1", 34 | "enzyme": "^2.8.2", 35 | "jest": "^18.0.0", 36 | "react": "^15.5.4", 37 | "react-dom": "^15.5.4", 38 | "react-test-renderer": "^15.5.4", 39 | "webpack": "^1.13.3" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/__tests__/__snapshots__/index.spec.js.snap: -------------------------------------------------------------------------------- 1 | exports[`flight integration 1`] = ` 2 | Object { 3 | "frames": Array [ 4 | Object { 5 | "duration": 500, 6 | }, 7 | Object { 8 | "duration": 500, 9 | }, 10 | ], 11 | "movements": "[[{\"root\":\"-test-\",\"target\":{\"style\":{\"backgroundColor\":\"#95A2AA\",\"left\":777,\"top\":60,\"width\":130,\"height\":10},\"ref\":\"-test-\",\"name\":\"line1\"},\"duration\":500},{}],[{\"root\":\"-test-\",\"target\":{\"style\":{\"borderRadius\":5,\"backgroundColor\":\"#E6ECF0\",\"left\":0,\"top\":75,\"width\":180,\"height\":10},\"ref\":\"-test-\",\"name\":\"line2\"},\"duration\":500},{}],[{\"root\":\"-test-\",\"target\":{\"style\":{\"borderRadius\":8,\"width\":16,\"height\":16,\"backgroundColor\":\"#79CD15\",\"left\":110,\"top\":90},\"ref\":\"-test-\",\"name\":\"circ1\"},\"duration\":500},{}]]", 12 | "timelines": 3, 13 | } 14 | `; 15 | -------------------------------------------------------------------------------- /src/__tests__/index.spec.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { mount, shallow } from 'enzyme' 3 | import Director from '../core/director' 4 | import VelocityComposer from '../core/velocity-composer' 5 | import Flight, { Rect, Oval } from '../dom/index' 6 | window.requestAnimationFrame = f => f() 7 | 8 | class Comp extends Component { 9 | constructor(props) { 10 | super(props) 11 | } 12 | render() { 13 | return ( 14 | 15 | 16 |
17 |
29 | 30 | 41 | 42 | 51 |
52 | 53 | 54 |
55 |
66 | 67 | 78 | 79 | 88 |
89 | 90 | 91 | ) 92 | } 93 | } 94 | 95 | describe('flight', () => { 96 | it('integration', () => { 97 | const c = mount() 98 | const d = c.ref('flight').getNode().state.director 99 | const movements = JSON.stringify(d.movements, (k, v) => { 100 | if (k === 'root' || k === 'ref') { 101 | return '-test-' 102 | } 103 | return v 104 | }) 105 | 106 | // Flight.Frame `source` prop, should signal Flight components to render DOM ids 107 | expect(c.find('#circ1').exists()).toEqual(true) 108 | expect(c.find('#line2').exists()).toEqual(true) 109 | 110 | // capture movements 111 | expect({ 112 | frames: d.frames, 113 | movements, 114 | timelines: d.composer.timelines.length, 115 | }).toMatchSnapshot() 116 | }) 117 | }) 118 | -------------------------------------------------------------------------------- /src/core/director.js: -------------------------------------------------------------------------------- 1 | import React, { Children } from 'react' 2 | import flattenDeep from 'lodash/flattenDeep' 3 | import merge from 'lodash/merge' 4 | import mergeWith from 'lodash/mergeWith' 5 | import map from 'lodash/map' 6 | import isFunction from 'lodash/isFunction' 7 | import reduce from 'lodash/reduce' 8 | 9 | const walk = (root, c) => { 10 | if (!c.props) { 11 | return [] 12 | } 13 | 14 | return Children.toArray(c.props.children).map(child => { 15 | if (!child) { 16 | return [] 17 | } 18 | 19 | //TODO use a better classifier than className. maybe anim prop? 20 | if (!child.props) { 21 | console.log('warn: no props', child) 22 | } 23 | 24 | // try extracting style and class from React component, 25 | // if not - go through a forced render (and set resolvedchild) 26 | let resolvedChild = child 27 | if (!(child.props && child.props.className && child.props.style)) { 28 | //if we're both type and has name we're probably a react comp. 29 | if (isFunction(child.type)) { 30 | const renderable = new child.type( 31 | // source is a context field - synthesize it instead of 32 | // manufacturing a real context. It's OK because this 33 | // render goes to trash after we're done, and not the DOM. 34 | { source: true, ...child.props }, 35 | root.context 36 | ) 37 | if (isFunction(renderable.render)) { 38 | resolvedChild = renderable.render() 39 | } 40 | } 41 | } 42 | 43 | // all this className circus is just to pick a name we can treat 44 | // as a grouping key when later locating pairs (or more) of connected 45 | // components. 46 | if ( 47 | resolvedChild.props && 48 | resolvedChild.props.className && 49 | resolvedChild.props.style 50 | ) { 51 | const styles = resolvedChild.props.style 52 | const name = resolvedChild.props.className || resolvedChild.props.name 53 | return [ 54 | { [name]: { styles: [styles], ref: resolvedChild, name } }, 55 | ...walk(root, resolvedChild), 56 | ] 57 | } else { 58 | return walk(root, child) 59 | } 60 | }) 61 | } 62 | const styles = root => { 63 | const extract = comp => merge(...flattenDeep(walk(root, comp))) 64 | 65 | const extracts = Children.toArray(root.props.children).map(extract) 66 | return mergeWith(...extracts, (objValue, srcValue) => ({ 67 | styles: objValue.styles.concat(srcValue.styles), 68 | ref: objValue.ref, 69 | name: objValue.name, 70 | })) 71 | } 72 | 73 | class Director { 74 | constructor(comp, composer) { 75 | this.root = comp 76 | const stylemap = styles(comp) 77 | const frames = map(Children.toArray(comp.props.children), c => ({ 78 | duration: c.props.duration || 500, 79 | })) 80 | 81 | const movements = reduce( 82 | Object.keys(stylemap), 83 | (acc, k) => { 84 | const movement = map(frames, (f, i) => { 85 | const to = stylemap[k].styles[i + 1] 86 | const { ref, name } = stylemap[k] 87 | if (to) { 88 | return { 89 | root: { namespace: comp.namespace }, 90 | target: { style: to, ref, name }, 91 | duration: f.duration, 92 | } 93 | } 94 | return {} // one extra null movement 95 | }) 96 | 97 | return [...acc, movement] 98 | }, 99 | [] 100 | ) 101 | 102 | this.frames = frames 103 | this.movements = movements 104 | this.composer = composer(movements) 105 | } 106 | 107 | pause() { 108 | this.composer.pause() 109 | } 110 | loop() { 111 | this.composer.loop() 112 | } 113 | play() { 114 | this.composer.play() 115 | } 116 | reset() { 117 | this.composer.reset() 118 | } 119 | } 120 | 121 | export default Director 122 | -------------------------------------------------------------------------------- /src/core/flight.js: -------------------------------------------------------------------------------- 1 | import React, { Children, Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | import VelocityComposer from './velocity-composer' 4 | import Director from './director' 5 | 6 | const flight = (Container, Controls, connector = _ => _) => { 7 | class Flight extends Component { 8 | constructor(props) { 9 | super(props) 10 | this.namespace = `flt__id__${parseInt(Math.random() * Math.pow(2, 32), 10)}` 11 | this.state = {} 12 | } 13 | getChildContext() { 14 | return { ...this.context, director: this.state.director } 15 | } 16 | componentDidMount() { 17 | requestAnimationFrame(() => { 18 | const director = new Director(this, _ => new VelocityComposer(_)) 19 | this.setState({ 20 | director, 21 | }) // force context refetch 22 | }) 23 | } 24 | play = () => { 25 | const director = this.state.director 26 | if (director) { 27 | director.play() 28 | this.setState({ ...this.state, action: 'play' }) 29 | } 30 | } 31 | reset = () => { 32 | const director = this.state.director 33 | if (director) { 34 | director.reset() 35 | this.setState({ ...this.state, action: 'reset' }) 36 | } 37 | } 38 | nothing = () => {} 39 | render() { 40 | const { interactive } = this.props 41 | const action = interactive 42 | ? this.state.action === 'play' ? this.reset : this.play 43 | : this.nothing 44 | return ( 45 | 50 | {this.props.controls && 51 | } 52 | {this.props.showFrames 53 | ? this.props.children 54 | : Children.toArray(this.props.children)[0]} 55 | 56 | ) 57 | } 58 | } 59 | Flight.childContextTypes = { 60 | director: PropTypes.object, 61 | } 62 | 63 | class Frame extends Component { 64 | getChildContext() { 65 | return { 66 | source: this.props.source, 67 | } 68 | } 69 | render() { 70 | return Children.only(this.props.children) 71 | } 72 | } 73 | Frame.childContextTypes = { 74 | source: PropTypes.bool, 75 | } 76 | Flight.Frame = connector(Frame) 77 | return connector(Flight) 78 | } 79 | 80 | export default flight 81 | -------------------------------------------------------------------------------- /src/core/velocity-composer.js: -------------------------------------------------------------------------------- 1 | import reduce from 'lodash/reduce' 2 | import map from 'lodash/map' 3 | import Tweene from 'tweene/velocity' 4 | Tweene.defaultDriver = 'velocity' 5 | 6 | export default class VelocityComposer { 7 | constructor(movements) { 8 | this.timelines = this._build(movements) 9 | } 10 | _build(movements) { 11 | const timelines = map(movements, movement => 12 | reduce( 13 | movement, 14 | (timeline, step) => { 15 | if (step.target) { 16 | timeline.add( 17 | Tweene.to( 18 | `#${step.root.namespace} #${step.target.name}`, 19 | step.target.style, 20 | { 21 | duration: step.duration, 22 | paused: true, 23 | } 24 | ) 25 | ) 26 | } 27 | return timeline 28 | }, 29 | Tweene.line() 30 | ) 31 | ) 32 | return timelines 33 | } 34 | 35 | __timelines(cmd) { 36 | this.timelines.forEach(t => t[cmd]()) 37 | } 38 | resume() { 39 | this.__timelines('resume') 40 | } 41 | pause() { 42 | this.__timelines('pause') 43 | } 44 | loop() { 45 | this.__timelines('loop') 46 | } 47 | play() { 48 | this.__timelines('play') 49 | } 50 | reset() { 51 | this.__timelines('reverse') 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/dom/controls.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | export default class Controls extends Component { 3 | render() { 4 | return ( 5 |
6 | 7 | 8 |
9 | ) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/dom/index.js: -------------------------------------------------------------------------------- 1 | import flight from '../core/flight' 2 | import { Oval, Rect } from './ui' 3 | import Controls from './controls' 4 | const Flight = flight(Rect, Controls) 5 | 6 | export default Flight 7 | export { Oval, Rect } 8 | -------------------------------------------------------------------------------- /src/dom/ui.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | class Rect extends Component { 5 | render() { 6 | const { id, source, name, radius, onPress, children, style } = this.props 7 | return ( 8 |
14 | {children} 15 |
16 | ) 17 | } 18 | } 19 | Rect.contextTypes = { 20 | director: PropTypes.object, 21 | source: PropTypes.bool, 22 | } 23 | 24 | //XXX todo 25 | class Image { 26 | render() {} 27 | } 28 | 29 | // Yea, not really an oval, more of a circle, but can be an oval 30 | // if you give me another radius.. 31 | class Oval extends Component { 32 | render() { 33 | const { source, name, size, children, style } = this.props 34 | return ( 35 |
44 | {children} 45 |
46 | ) 47 | } 48 | } 49 | Oval.contextTypes = { 50 | director: PropTypes.object, 51 | source: PropTypes.bool, 52 | } 53 | 54 | export { Oval, Rect } 55 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | 2 | const webpack = require('webpack') 3 | const path = require('path') 4 | const package = require('./package.json') 5 | 6 | const env = process.env.NODE_ENV 7 | const config = { 8 | entry: './src/dom/index.js', 9 | // target: 'node', // INIT-FIXME: set this for node environments, or leave out for web. 10 | externals: { 11 | lodash: true, 12 | react: true, 13 | jquery: true, 14 | }, 15 | module: { 16 | loaders: [ 17 | { test: /\.js$/, loader: 'babel', exclude: /node_modules/ }, 18 | ] 19 | }, 20 | output: { 21 | libraryTarget: 'umd', 22 | filename: `dist/${package.name}${env === 'production' ? '.min' : ''}.js`, 23 | }, 24 | plugins: [ 25 | new webpack.optimize.OccurrenceOrderPlugin(), 26 | new webpack.DefinePlugin({ 27 | 'process.env.NODE_ENV': JSON.stringify(env) 28 | }) 29 | ] 30 | } 31 | 32 | if (env === 'production'){ 33 | config.plugins.push( 34 | new webpack.optimize.UglifyJsPlugin({ 35 | compressor: { 36 | pure_getters: true, 37 | unsafe: true, 38 | unsafe_comps: true, 39 | warnings: false, 40 | screw_ie8: false 41 | }, 42 | mangle: { 43 | screw_ie8: false 44 | }, 45 | output: { 46 | screw_ie8: false 47 | } 48 | }) 49 | ) 50 | } 51 | 52 | module.exports = config 53 | --------------------------------------------------------------------------------