From 96c66c123e67668df5a64e62e82e762f533140af Mon Sep 17 00:00:00 2001 From: Josh Perez Date: Wed, 23 Mar 2016 15:41:09 -0700 Subject: [PATCH] Update babel, use loose mode --- .babelrc | 3 +- dist/alt.js | 588 +++++++++++++++++++++++------------------------- dist/alt.min.js | 2 +- package.json | 7 +- 4 files changed, 284 insertions(+), 316 deletions(-) diff --git a/.babelrc b/.babelrc index a7b99e54..b1331e45 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,7 @@ { "presets": ["airbnb", "stage-0"], "plugins": [ - "add-module-exports" + "add-module-exports", + ["transform-es2015-classes", { loose: true }] ] } diff --git a/dist/alt.js b/dist/alt.js index ba55be5c..637a7cd8 100644 --- a/dist/alt.js +++ b/dist/alt.js @@ -63,8 +63,6 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* global window */ - Object.defineProperty(exports, "__esModule", { value: true }); @@ -99,7 +97,8 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /* global window */ + var Alt = function () { function Alt() { @@ -123,341 +122,316 @@ return /******/ (function(modules) { // webpackBootstrap this._lastSnapshot = {}; } - _createClass(Alt, [{ - key: 'dispatch', - value: function () { - function dispatch(action, data, details) { - var _this = this; - - this.batchingFunction(function () { - var id = Math.random().toString(18).substr(2, 16); - - // support straight dispatching of FSA-style actions - if (action.hasOwnProperty('type') && action.hasOwnProperty('payload')) { - var fsaDetails = { - id: action.type, - namespace: action.type, - name: action.type - }; - return _this.dispatcher.dispatch(utils.fsa(id, action.type, action.payload, fsaDetails)); - } + Alt.prototype.dispatch = function () { + function dispatch(action, data, details) { + var _this = this; - if (action.id && action.dispatch) { - return utils.dispatch(id, action, data, _this); - } + this.batchingFunction(function () { + var id = Math.random().toString(18).substr(2, 16); - return _this.dispatcher.dispatch(utils.fsa(id, action, data, details)); - }); - } + // support straight dispatching of FSA-style actions + if (action.hasOwnProperty('type') && action.hasOwnProperty('payload')) { + var fsaDetails = { + id: action.type, + namespace: action.type, + name: action.type + }; + return _this.dispatcher.dispatch(utils.fsa(id, action.type, action.payload, fsaDetails)); + } - return dispatch; - }() - }, { - key: 'createUnsavedStore', - value: function () { - function createUnsavedStore(StoreModel) { - var key = StoreModel.displayName || ''; - store.createStoreConfig(this.config, StoreModel); - var Store = store.transformStore(this.storeTransforms, StoreModel); - - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + if (action.id && action.dispatch) { + return utils.dispatch(id, action, data, _this); } - return fn.isFunction(Store) ? store.createStoreFromClass.apply(store, [this, Store, key].concat(args)) : store.createStoreFromObject(this, Store, key); - } + return _this.dispatcher.dispatch(utils.fsa(id, action, data, details)); + }); + } - return createUnsavedStore; - }() - }, { - key: 'createStore', - value: function () { - function createStore(StoreModel, iden) { - var key = iden || StoreModel.displayName || StoreModel.name || ''; - store.createStoreConfig(this.config, StoreModel); - var Store = store.transformStore(this.storeTransforms, StoreModel); - - /* istanbul ignore next */ - if (false) delete this.stores[key]; - - if (this.stores[key] || !key) { - if (this.stores[key]) { - utils.warn('A store named ' + String(key) + ' already exists, double check your store ' + 'names or pass in your own custom identifier for each store'); - } else { - utils.warn('Store name was not specified'); - } + return dispatch; + }(); - key = utils.uid(this.stores, key); - } + Alt.prototype.createUnsavedStore = function () { + function createUnsavedStore(StoreModel) { + var key = StoreModel.displayName || ''; + store.createStoreConfig(this.config, StoreModel); + var Store = store.transformStore(this.storeTransforms, StoreModel); - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return fn.isFunction(Store) ? store.createStoreFromClass.apply(store, [this, Store, key].concat(args)) : store.createStoreFromObject(this, Store, key); + } - var storeInstance = fn.isFunction(Store) ? store.createStoreFromClass.apply(store, [this, Store, key].concat(args)) : store.createStoreFromObject(this, Store, key); + return createUnsavedStore; + }(); - this.stores[key] = storeInstance; - StateFunctions.saveInitialSnapshot(this, key); + Alt.prototype.createStore = function () { + function createStore(StoreModel, iden) { + var key = iden || StoreModel.displayName || StoreModel.name || ''; + store.createStoreConfig(this.config, StoreModel); + var Store = store.transformStore(this.storeTransforms, StoreModel); - return storeInstance; - } + /* istanbul ignore next */ + if (false) delete this.stores[key]; - return createStore; - }() - }, { - key: 'generateActions', - value: function () { - function generateActions() { - var actions = { name: 'global' }; - - for (var _len3 = arguments.length, actionNames = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - actionNames[_key3] = arguments[_key3]; + if (this.stores[key] || !key) { + if (this.stores[key]) { + utils.warn('A store named ' + String(key) + ' already exists, double check your store ' + 'names or pass in your own custom identifier for each store'); + } else { + utils.warn('Store name was not specified'); } - return this.createActions(actionNames.reduce(function (obj, action) { - obj[action] = utils.dispatchIdentity; - return obj; - }, actions)); + key = utils.uid(this.stores, key); } - return generateActions; - }() - }, { - key: 'createAction', - value: function () { - function createAction(name, implementation, obj) { - return (0, _actions2.default)(this, 'global', name, implementation, obj); + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; } - return createAction; - }() - }, { - key: 'createActions', - value: function () { - function createActions(ActionsClass) { - var _this3 = this; + var storeInstance = fn.isFunction(Store) ? store.createStoreFromClass.apply(store, [this, Store, key].concat(args)) : store.createStoreFromObject(this, Store, key); - var exportObj = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + this.stores[key] = storeInstance; + StateFunctions.saveInitialSnapshot(this, key); - var actions = {}; - var key = utils.uid(this._actionsRegistry, ActionsClass.displayName || ActionsClass.name || 'Unknown'); + return storeInstance; + } - if (fn.isFunction(ActionsClass)) { - fn.assign(actions, utils.getPrototypeChain(ActionsClass)); + return createStore; + }(); - var ActionsGenerator = function (_ActionsClass) { - _inherits(ActionsGenerator, _ActionsClass); + Alt.prototype.generateActions = function () { + function generateActions() { + var actions = { name: 'global' }; - function ActionsGenerator() { - var _Object$getPrototypeO; + for (var _len3 = arguments.length, actionNames = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + actionNames[_key3] = arguments[_key3]; + } - _classCallCheck(this, ActionsGenerator); + return this.createActions(actionNames.reduce(function (obj, action) { + obj[action] = utils.dispatchIdentity; + return obj; + }, actions)); + } - for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { - args[_key5] = arguments[_key5]; - } + return generateActions; + }(); - return _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(ActionsGenerator)).call.apply(_Object$getPrototypeO, [this].concat(args))); - } + Alt.prototype.createAction = function () { + function createAction(name, implementation, obj) { + return (0, _actions2.default)(this, 'global', name, implementation, obj); + } - _createClass(ActionsGenerator, [{ - key: 'generateActions', - value: function () { - function generateActions() { - for (var _len6 = arguments.length, actionNames = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { - actionNames[_key6] = arguments[_key6]; - } + return createAction; + }(); - actionNames.forEach(function (actionName) { - actions[actionName] = utils.dispatchIdentity; - }); - } + Alt.prototype.createActions = function () { + function createActions(ActionsClass) { + var _this3 = this; - return generateActions; - }() - }]); + var exportObj = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - return ActionsGenerator; - }(ActionsClass); + var actions = {}; + var key = utils.uid(this._actionsRegistry, ActionsClass.displayName || ActionsClass.name || 'Unknown'); - for (var _len4 = arguments.length, argsForConstructor = Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) { - argsForConstructor[_key4 - 2] = arguments[_key4]; - } + if (fn.isFunction(ActionsClass)) { + fn.assign(actions, utils.getPrototypeChain(ActionsClass)); - fn.assign(actions, new (Function.prototype.bind.apply(ActionsGenerator, [null].concat(argsForConstructor)))()); - } else { - fn.assign(actions, ActionsClass); - } + var ActionsGenerator = function (_ActionsClass) { + _inherits(ActionsGenerator, _ActionsClass); - this.actions[key] = this.actions[key] || {}; + function ActionsGenerator() { + _classCallCheck(this, ActionsGenerator); - fn.eachObject(function (actionName, action) { - if (!fn.isFunction(action)) { - exportObj[actionName] = action; - return; + for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; + } + + return _possibleConstructorReturn(this, _ActionsClass.call.apply(_ActionsClass, [this].concat(args))); } - // create the action - exportObj[actionName] = (0, _actions2.default)(_this3, key, actionName, action, exportObj); + ActionsGenerator.prototype.generateActions = function () { + function generateActions() { + for (var _len6 = arguments.length, actionNames = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + actionNames[_key6] = arguments[_key6]; + } - // generate a constant - var constant = utils.formatAsConstant(actionName); - exportObj[constant] = exportObj[actionName].id; - }, [actions]); + actionNames.forEach(function (actionName) { + actions[actionName] = utils.dispatchIdentity; + }); + } - return exportObj; - } + return generateActions; + }(); - return createActions; - }() - }, { - key: 'takeSnapshot', - value: function () { - function takeSnapshot() { - for (var _len7 = arguments.length, storeNames = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { - storeNames[_key7] = arguments[_key7]; + return ActionsGenerator; + }(ActionsClass); + + for (var _len4 = arguments.length, argsForConstructor = Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) { + argsForConstructor[_key4 - 2] = arguments[_key4]; } - var state = StateFunctions.snapshot(this, storeNames); - fn.assign(this._lastSnapshot, state); - return this.serialize(state); + fn.assign(actions, new (Function.prototype.bind.apply(ActionsGenerator, [null].concat(argsForConstructor)))()); + } else { + fn.assign(actions, ActionsClass); } - return takeSnapshot; - }() - }, { - key: 'rollback', - value: function () { - function rollback() { - StateFunctions.setAppState(this, this.serialize(this._lastSnapshot), function (storeInst) { - storeInst.lifecycle('rollback'); - storeInst.emitChange(); - }); - } + this.actions[key] = this.actions[key] || {}; - return rollback; - }() - }, { - key: 'recycle', - value: function () { - function recycle() { - for (var _len8 = arguments.length, storeNames = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { - storeNames[_key8] = arguments[_key8]; + fn.eachObject(function (actionName, action) { + if (!fn.isFunction(action)) { + exportObj[actionName] = action; + return; } - var initialSnapshot = storeNames.length ? StateFunctions.filterSnapshots(this, this._initSnapshot, storeNames) : this._initSnapshot; + // create the action + exportObj[actionName] = (0, _actions2.default)(_this3, key, actionName, action, exportObj); - StateFunctions.setAppState(this, this.serialize(initialSnapshot), function (storeInst) { - storeInst.lifecycle('init'); - storeInst.emitChange(); - }); - } + // generate a constant + var constant = utils.formatAsConstant(actionName); + exportObj[constant] = exportObj[actionName].id; + }, [actions]); - return recycle; - }() - }, { - key: 'flush', - value: function () { - function flush() { - var state = this.serialize(StateFunctions.snapshot(this)); - this.recycle(); - return state; - } + return exportObj; + } - return flush; - }() - }, { - key: 'bootstrap', - value: function () { - function bootstrap(data) { - StateFunctions.setAppState(this, data, function (storeInst, state) { - storeInst.lifecycle('bootstrap', state); - storeInst.emitChange(); - }); - } + return createActions; + }(); - return bootstrap; - }() - }, { - key: 'prepare', - value: function () { - function prepare(storeInst, payload) { - var data = {}; - if (!storeInst.displayName) { - throw new ReferenceError('Store provided does not have a name'); - } - data[storeInst.displayName] = payload; - return this.serialize(data); + Alt.prototype.takeSnapshot = function () { + function takeSnapshot() { + for (var _len7 = arguments.length, storeNames = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + storeNames[_key7] = arguments[_key7]; } - return prepare; - }() + var state = StateFunctions.snapshot(this, storeNames); + fn.assign(this._lastSnapshot, state); + return this.serialize(state); + } - // Instance type methods for injecting alt into your application as context + return takeSnapshot; + }(); - }, { - key: 'addActions', - value: function () { - function addActions(name, ActionsClass) { - for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) { - args[_key9 - 2] = arguments[_key9]; - } + Alt.prototype.rollback = function () { + function rollback() { + StateFunctions.setAppState(this, this.serialize(this._lastSnapshot), function (storeInst) { + storeInst.lifecycle('rollback'); + storeInst.emitChange(); + }); + } + + return rollback; + }(); - this.actions[name] = Array.isArray(ActionsClass) ? this.generateActions.apply(this, ActionsClass) : this.createActions.apply(this, [ActionsClass].concat(args)); + Alt.prototype.recycle = function () { + function recycle() { + for (var _len8 = arguments.length, storeNames = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { + storeNames[_key8] = arguments[_key8]; } - return addActions; - }() - }, { - key: 'addStore', - value: function () { - function addStore(name, StoreModel) { - for (var _len10 = arguments.length, args = Array(_len10 > 2 ? _len10 - 2 : 0), _key10 = 2; _key10 < _len10; _key10++) { - args[_key10 - 2] = arguments[_key10]; - } + var initialSnapshot = storeNames.length ? StateFunctions.filterSnapshots(this, this._initSnapshot, storeNames) : this._initSnapshot; + + StateFunctions.setAppState(this, this.serialize(initialSnapshot), function (storeInst) { + storeInst.lifecycle('init'); + storeInst.emitChange(); + }); + } + + return recycle; + }(); + + Alt.prototype.flush = function () { + function flush() { + var state = this.serialize(StateFunctions.snapshot(this)); + this.recycle(); + return state; + } - this.createStore.apply(this, [StoreModel, name].concat(args)); + return flush; + }(); + + Alt.prototype.bootstrap = function () { + function bootstrap(data) { + StateFunctions.setAppState(this, data, function (storeInst, state) { + storeInst.lifecycle('bootstrap', state); + storeInst.emitChange(); + }); + } + + return bootstrap; + }(); + + Alt.prototype.prepare = function () { + function prepare(storeInst, payload) { + var data = {}; + if (!storeInst.displayName) { + throw new ReferenceError('Store provided does not have a name'); } + data[storeInst.displayName] = payload; + return this.serialize(data); + } - return addStore; - }() - }, { - key: 'getActions', - value: function () { - function getActions(name) { - return this.actions[name]; + return prepare; + }(); + + // Instance type methods for injecting alt into your application as context + + Alt.prototype.addActions = function () { + function addActions(name, ActionsClass) { + for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) { + args[_key9 - 2] = arguments[_key9]; } - return getActions; - }() - }, { - key: 'getStore', - value: function () { - function getStore(name) { - return this.stores[name]; + this.actions[name] = Array.isArray(ActionsClass) ? this.generateActions.apply(this, ActionsClass) : this.createActions.apply(this, [ActionsClass].concat(args)); + } + + return addActions; + }(); + + Alt.prototype.addStore = function () { + function addStore(name, StoreModel) { + for (var _len10 = arguments.length, args = Array(_len10 > 2 ? _len10 - 2 : 0), _key10 = 2; _key10 < _len10; _key10++) { + args[_key10 - 2] = arguments[_key10]; } - return getStore; - }() - }], [{ - key: 'debug', - value: function () { - function debug(name, alt, win) { - var key = 'alt.js.org'; - var context = win; - if (!context && typeof window !== 'undefined') { - context = window; - } - if (typeof context !== 'undefined') { - context[key] = context[key] || []; - context[key].push({ name: name, alt: alt }); - } - return alt; + this.createStore.apply(this, [StoreModel, name].concat(args)); + } + + return addStore; + }(); + + Alt.prototype.getActions = function () { + function getActions(name) { + return this.actions[name]; + } + + return getActions; + }(); + + Alt.prototype.getStore = function () { + function getStore(name) { + return this.stores[name]; + } + + return getStore; + }(); + + Alt.debug = function () { + function debug(name, alt, win) { + var key = 'alt.js.org'; + var context = win; + if (!context && typeof window !== 'undefined') { + context = window; } + if (typeof context !== 'undefined') { + context[key] = context[key] || []; + context[key].push({ name: name, alt: alt }); + } + return alt; + } - return debug; - }() - }]); + return debug; + }(); return Alt; }(); @@ -1035,6 +1009,7 @@ return /******/ (function(modules) { // webpackBootstrap var config = storeInstance.StoreModel.config; + var nextState = fn.isFunction(state) ? state(storeInstance.state) : state; storeInstance.state = config.setState.call(store, storeInstance.state, nextState); @@ -1100,7 +1075,7 @@ return /******/ (function(modules) { // webpackBootstrap } function createStoreFromObject(alt, StoreModel, key) { - var storeInstance = undefined; + var storeInstance = void 0; var StoreProto = createPrototype({}, alt, key, fn.assign({ getInstance: function () { @@ -1147,7 +1122,7 @@ return /******/ (function(modules) { // webpackBootstrap } function createStoreFromClass(alt, StoreModel, key) { - var storeInstance = undefined; + var storeInstance = void 0; var config = StoreModel.config; // Creating a class here so we don't overload the provided store's @@ -1158,15 +1133,13 @@ return /******/ (function(modules) { // webpackBootstrap _inherits(Store, _StoreModel); function Store() { - var _Object$getPrototypeO; - _classCallCheck(this, Store); for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } - return _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(Store)).call.apply(_Object$getPrototypeO, [this].concat(args))); + return _possibleConstructorReturn(this, _StoreModel.call.apply(_StoreModel, [this].concat(args))); } return Store; @@ -1333,8 +1306,6 @@ return /******/ (function(modules) { // webpackBootstrap 'use strict'; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - Object.defineProperty(exports, "__esModule", { value: true }); @@ -1414,7 +1385,7 @@ return /******/ (function(modules) { // webpackBootstrap var actionHandlers = model.actionListeners[payload.action]; if (actionHandlers || model.otherwise) { - var result = undefined; + var result = void 0; if (actionHandlers) { result = handleDispatch(function () { @@ -1448,41 +1419,36 @@ return /******/ (function(modules) { // webpackBootstrap this.lifecycle('init'); } - _createClass(AltStore, [{ - key: 'listen', - value: function () { - function listen(cb) { - var _this2 = this; + AltStore.prototype.listen = function () { + function listen(cb) { + var _this2 = this; - if (!fn.isFunction(cb)) throw new TypeError('listen expects a function'); - this.transmitter.subscribe(cb); - return function () { - return _this2.unlisten(cb); - }; - } + if (!fn.isFunction(cb)) throw new TypeError('listen expects a function'); + this.transmitter.subscribe(cb); + return function () { + return _this2.unlisten(cb); + }; + } - return listen; - }() - }, { - key: 'unlisten', - value: function () { - function unlisten(cb) { - this.lifecycle('unlisten'); - this.transmitter.unsubscribe(cb); - } + return listen; + }(); - return unlisten; - }() - }, { - key: 'getState', - value: function () { - function getState() { - return this.StoreModel.config.getState.call(this, this.state); - } + AltStore.prototype.unlisten = function () { + function unlisten(cb) { + this.lifecycle('unlisten'); + this.transmitter.unsubscribe(cb); + } - return getState; - }() - }]); + return unlisten; + }(); + + AltStore.prototype.getState = function () { + function getState() { + return this.StoreModel.config.getState.call(this, this.state); + } + + return getState; + }(); return AltStore; }(); diff --git a/dist/alt.min.js b/dist/alt.min.js index 1f7a573d..854116dd 100644 --- a/dist/alt.min.js +++ b/dist/alt.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Alt=e():t.Alt=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(6)},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"[object Object]"===Object.prototype.toString.call(t)&&o(e)&&!Object.isFrozen(t)&&(e instanceof e||"AltStore"===t.type)}function r(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function i(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];return r(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isMutableObject=n,e.eachObject=r,e.assign=i;var o=e.isFunction=function(t){return"function"==typeof t}},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){var n=e?v:y,r=e?t.prototype:t;return Object.getOwnPropertyNames(r).reduce(function(t,e){return-1!==n.indexOf(e)?t:(t[e]=r[e],t)},{})}function o(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return t===Function.prototype?e:o(Object.getPrototypeOf(t),g.assign(e,i(t,!0)))}function a(t){"undefined"!=typeof console&&console.warn(new ReferenceError(t))}function s(t,e){for(var n=0,r=e;Object.hasOwnProperty.call(t,r);)r=e+String(++n);return r}function u(t){return t.replace(/[a-z]([A-Z])/g,function(t){return String(t[0])+"_"+String(t[1].toLowerCase())}).toUpperCase()}function c(t){if(void 0===t)return null;for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return n.length?[t].concat(n):t}function f(t,e,n,r){return{type:e,payload:n,meta:p({dispatchId:t},r),id:t,action:e,data:n,details:r}}function l(t,e,n,r){var i=e.dispatch(n);if(void 0===i)return null;var o=e.id,a=o,s=o,u={id:o,namespace:a,name:s},c=function(t){return r.dispatch(o,t,u)};return g.isFunction(i)?i(c,r):r.dispatcher.dispatch(f(t,o,i,u))}function h(){}var p=Object.assign||function(t){for(var e=1;e=0&&t.splice(i,1)},i=function(e){t.push(e);var n=function(){return r(e)};return{dispose:n}},o=function(i){if(e)throw new Error("Cannot push while pushing");e=!0;try{t.forEach(function(t){return t(i)})}finally{e=!1,n=n.filter(r)}};return{subscribe:i,push:o,unsubscribe:r,subscriptions:t}}t.exports=n},function(t,e){function n(){c=!1,a.length?u=a.concat(u):f=-1,u.length&&r()}function r(){if(!c){var t=setTimeout(n);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var n=1;no;o++)n[o]=arguments[o];var a=r.apply(i,n),f=a;return void 0===a||l["default"](a)||(s.isFunction(a)?f=a(u,t):u(a)),void 0===a&&c.warn("An action was called but nothing was dispatched"),f};f.defer=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return setTimeout(function(){return f.apply(null,e)})},f.id=o,f.data=a;var h=t.actions[e],p=c.uid(h,n);h[p]=f;var d=c.formatAsConstant(p);return h[d]=o,f}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=o;var a=n(1),s=i(a),u=n(2),c=i(u),f=n(14),l=r(f);t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u=function(){function t(t,e){for(var n=0;n1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];return p.isFunction(n)?g.createStoreFromClass.apply(g,[this,n,e].concat(i)):g.createStoreFromObject(this,n,e)}return t}()},{key:"createStore",value:function(){function t(t,e){var n=e||t.displayName||t.name||"";g.createStoreConfig(this.config,t);var r=g.transformStore(this.storeTransforms,t);(this.stores[n]||!n)&&(this.stores[n]?v.warn("A store named "+String(n)+" already exists, double check your store names or pass in your own custom identifier for each store"):v.warn("Store name was not specified"),n=v.uid(this.stores,n));for(var i=arguments.length,o=Array(i>2?i-2:0),a=2;i>a;a++)o[a-2]=arguments[a];var s=p.isFunction(r)?g.createStoreFromClass.apply(g,[this,r,n].concat(o)):g.createStoreFromObject(this,r,n);return this.stores[n]=s,l.saveInitialSnapshot(this,n),s}return t}()},{key:"generateActions",value:function(){function t(){for(var t={name:"global"},e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return this.createActions(n.reduce(function(t,e){return t[e]=v.dispatchIdentity,t},t))}return t}()},{key:"createAction",value:function(){function t(t,e,n){return m["default"](this,"global",t,e,n)}return t}()},{key:"createActions",value:function(){function t(t){var e=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r={},i=v.uid(this._actionsRegistry,t.displayName||t.name||"Unknown");if(p.isFunction(t)){p.assign(r,v.getPrototypeChain(t));for(var c=function(t){function e(){var t;s(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return o(this,(t=Object.getPrototypeOf(e)).call.apply(t,[this].concat(r)))}return a(e,t),u(e,[{key:"generateActions",value:function(){function t(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t){r[t]=v.dispatchIdentity})}return t}()}]),e}(t),f=arguments.length,l=Array(f>2?f-2:0),h=2;f>h;h++)l[h-2]=arguments[h];p.assign(r,new(Function.prototype.bind.apply(c,[null].concat(l))))}else p.assign(r,t);return this.actions[i]=this.actions[i]||{},p.eachObject(function(t,r){if(!p.isFunction(r))return void(n[t]=r);n[t]=m["default"](e,i,t,r,n);var o=v.formatAsConstant(t);n[o]=n[t].id},[r]),n}return t}()},{key:"takeSnapshot",value:function(){function t(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=l.snapshot(this,e);return p.assign(this._lastSnapshot,r),this.serialize(r)}return t}()},{key:"rollback",value:function(){function t(){l.setAppState(this,this.serialize(this._lastSnapshot),function(t){t.lifecycle("rollback"),t.emitChange()})}return t}()},{key:"recycle",value:function(){function t(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e.length?l.filterSnapshots(this,this._initSnapshot,e):this._initSnapshot;l.setAppState(this,this.serialize(r),function(t){t.lifecycle("init"),t.emitChange()})}return t}()},{key:"flush",value:function(){function t(){var t=this.serialize(l.snapshot(this));return this.recycle(),t}return t}()},{key:"bootstrap",value:function(){function t(t){l.setAppState(this,t,function(t,e){t.lifecycle("bootstrap",e),t.emitChange()})}return t}()},{key:"prepare",value:function(){function t(t,e){var n={};if(!t.displayName)throw new ReferenceError("Store provided does not have a name");return n[t.displayName]=e,this.serialize(n)}return t}()},{key:"addActions",value:function(){function t(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.actions[t]=Array.isArray(e)?this.generateActions.apply(this,e):this.createActions.apply(this,[e].concat(r))}return t}()},{key:"addStore",value:function(){function t(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];this.createStore.apply(this,[e,t].concat(r))}return t}()},{key:"getActions",value:function(){function t(t){return this.actions[t]}return t}()},{key:"getStore",value:function(){function t(t){return this.stores[t]}return t}()}],[{key:"debug",value:function(){function t(t,e,n){var r="alt.js.org",i=n;return i||"undefined"==typeof window||(i=window),"undefined"!=typeof i&&(i[r]=i[r]||[],i[r].push({name:t,alt:e})),e}return t}()}]),t}();e["default"]=w,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var n=0;nn;n++)e[n]=arguments[n];if(!e.length)throw new ReferenceError("Dispatch tokens not provided");var r=e;1===e.length&&(r=Array.isArray(e[0])?e[0]:e);var i=r.map(function(t){return t.dispatchToken||t});this.dispatcher.waitFor(i)}return t}(),exportAsync:function(){function t(t){this.registerAsync(t)}return t}(),registerAsync:function(){function t(t){var e=this,n=0,r=u.isFunction(t)?t(this.alt):t,i=Object.keys(r).reduce(function(t,i){var o=r[i],a=u.isFunction(o)?o(e):o,s=["success","error","loading"];return s.forEach(function(t){if(a[t]&&!a[t].id)throw new Error(String(t)+" handler must be an action function")}),t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];var o=e.getInstance().getState(),s=a.local&&a.local.apply(a,[o].concat(r)),u=a.shouldFetch?a.shouldFetch.apply(a,[o].concat(r)):null==s,c=a.interceptResponse||function(t){return t},f=function(){function t(t,i){return function(o){var a=function(){function e(){if(n-=1,t(c(o,t,r)),i)throw o}return e}();return e.alt.trapAsync?function(){return a()}:a()}}return t}();return u?(n+=1,a.loading&&a.loading(c(null,a.loading,r)),a.remote.apply(a,[o].concat(r)).then(f(a.success),f(a.error,1))):(e.emitChange(),s)},t},{});this.exportPublicMethods(i),this.exportPublicMethods({isLoading:function(){function t(){return n>0}return t}()})}return t}(),exportPublicMethods:function(){function t(t){var e=this;u.eachObject(function(t,n){if(!u.isFunction(n))throw new TypeError("exportPublicMethods expects a function");e.publicMethods[t]=n},[t])}return t}(),emitChange:function(){function t(){this.getInstance().emitChange()}return t}(),on:function(){function t(t,e){"error"===t&&(this.handlesOwnErrors=!0);var n=this.lifecycleEvents[t]||a["default"]();return this.lifecycleEvents[t]=n,n.subscribe(e.bind(this))}return t}(),bindAction:function(){function t(t,e){if(!t)throw new ReferenceError("Invalid action reference passed in");if(!u.isFunction(e))throw new TypeError("bindAction expects a function");var n=t.id?t.id:t;this.actionListeners[n]=this.actionListeners[n]||[],this.actionListeners[n].push(e.bind(this)),this.boundListeners.push(n)}return t}(),bindActions:function(){function t(t){var e=this;u.eachObject(function(t,n){var r=/./,i=t.replace(r,function(t){return"on"+String(t[0].toUpperCase())});if(e[t]&&e[i])throw new ReferenceError("You have multiple action handlers bound to an action: "+(String(t)+" and "+String(i)));var o=e[t]||e[i];o&&e.bindAction(n,o)},[t])}return t}(),bindListeners:function(){function t(t){var e=this;u.eachObject(function(t,n){var r=e[t];if(!r)throw new ReferenceError(String(t)+" defined but does not exist in "+String(e.displayName));Array.isArray(n)?n.forEach(function(t){e.bindAction(t,r)}):e.bindAction(n,r)},[t])}return t}()};e["default"]=c,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e,n){if(n){var r=e.StoreModel.config,i=v.isFunction(n)?n(e.state):n;e.state=r.setState.call(t,e.state,i),t.alt.dispatcher.isDispatching()||t.emitChange()}}function c(t,e,n,r){return v.assign(t,_["default"],{displayName:n,alt:e,dispatcher:e.dispatcher,preventDefault:function(){function t(){this.getInstance().preventDefault=!0}return t}(),boundListeners:[],lifecycleEvents:{},actionListeners:{},publicMethods:{},handlesOwnErrors:!1},r)}function f(t,e){e.config=v.assign({getState:function(){function t(t){return Array.isArray(t)?t.slice():v.isMutableObject(t)?v.assign({},t):t}return t}(),setState:function(){function t(t,e){return v.isMutableObject(e)?v.assign(t,e):e}return t}()},t,e.config)}function l(t,e){return t.reduce(function(t,e){return e(t)},e)}function h(t,e,n){var r=void 0,i=c({},t,n,v.assign({getInstance:function(){function t(){return r}return t}(),setState:function(){function t(t){u(this,r,t)}return t}()},e));return i.bindListeners&&_["default"].bindListeners.call(i,i.bindListeners),i.observe&&_["default"].bindListeners.call(i,i.observe(t)),i.lifecycle&&v.eachObject(function(t,e){_["default"].on.call(i,t,e)},[i.lifecycle]),r=v.assign(new m["default"](t,i,void 0!==i.state?i.state:{},e),i.publicMethods,{displayName:n,config:e.config})}function p(t,e,n){var r=void 0,i=e.config,f=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return a(this,(t=Object.getPrototypeOf(e)).call.apply(t,[this].concat(r)))}return s(e,t),e}(e);c(f.prototype,t,n,{type:"AltStore",getInstance:function(){function t(){return r}return t}(),setState:function(){function t(t){u(this,r,t)}return t}()});for(var l=arguments.length,h=Array(l>3?l-3:0),p=3;l>p;p++)h[p-3]=arguments[p];var d=new(Function.prototype.bind.apply(f,[null].concat(h)));return i.bindListeners&&d.bindListeners(i.bindListeners),i.datasource&&d.registerAsync(i.datasource),r=v.assign(new m["default"](t,d,void 0!==d.state?d.state:d,e),g.getInternalMethods(e),i.publicMethods,{displayName:n})}Object.defineProperty(e,"__esModule",{value:!0}),e.createStoreConfig=f,e.transformStore=l,e.createStoreFromObject=h,e.createStoreFromClass=p;var d=n(2),g=i(d),y=n(1),v=i(y),b=n(7),m=r(b),w=n(8),_=r(w)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e,n){var r=t.deserialize(e);c.eachObject(function(e,i){var o=t.stores[e];o&&!function(){var t=o.StoreModel.config,a=o.state;t.onDeserialize&&(r[e]=t.onDeserialize(i)||i),c.isMutableObject(a)?(c.eachObject(function(t){return delete a[t]},[a]),c.assign(a,r[e])):o.state=r[e],n(o,o.state)}()},[r])}function o(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.length?e:Object.keys(t.stores);return n.reduce(function(e,n){var r=n.displayName||n,i=t.stores[r],o=i.StoreModel.config;i.lifecycle("snapshot");var a=o.onSerialize&&o.onSerialize(i.state);return e[r]=a?a:i.getState(),e},{})}function a(t,e){var n=t.deserialize(t.serialize(t.stores[e].state));t._initSnapshot[e]=n,t._lastSnapshot[e]=n}function s(t,e,n){return n.reduce(function(t,n){var r=n.displayName||n;if(!e[r])throw new ReferenceError(String(r)+" is not a valid store");return t[r]=e[r],t},{})}Object.defineProperty(e,"__esModule",{value:!0}),e.setAppState=i,e.snapshot=o,e.saveInitialSnapshot=a,e.filterSnapshots=s;var u=n(1),c=r(u)},function(t,e,n){t.exports.Dispatcher=n(12)},function(t,e,n){(function(r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var o=n(13),a="ID_",s=function(){function t(){i(this,t),this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}return t.prototype.register=function(t){var e=a+this._lastID++;return this._callbacks[e]=t,e},t.prototype.unregister=function(t){this._callbacks[t]?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t):o(!1),delete this._callbacks[t]},t.prototype.waitFor=function(t){this._isDispatching?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.waitFor(...): Must be invoked while dispatching."):o(!1);for(var e=0;e1?n-1:0),i=1;n>i;i++)e[i-1]=arguments[i];return r(function(n,e){return t[n]=e},e),t}Object.defineProperty(n,"__esModule",{value:!0}),n.isMutableObject=e,n.eachObject=r,n.assign=i;var o=n.isFunction=function(t){return"function"==typeof t}},function(t,n,e){"use strict";function r(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function i(t,n){var e=n?v:y,r=n?t.prototype:t;return Object.getOwnPropertyNames(r).reduce(function(t,n){return-1!==e.indexOf(n)?t:(t[n]=r[n],t)},{})}function o(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return t===Function.prototype?n:o(Object.getPrototypeOf(t),g.assign(n,i(t,!0)))}function a(t){"undefined"!=typeof console&&console.warn(new ReferenceError(t))}function s(t,n){for(var e=0,r=n;Object.hasOwnProperty.call(t,r);)r=n+String(++e);return r}function c(t){return t.replace(/[a-z]([A-Z])/g,function(t){return String(t[0])+"_"+String(t[1].toLowerCase())}).toUpperCase()}function u(t){if(void 0===t)return null;for(var n=arguments.length,e=Array(n>1?n-1:0),r=1;n>r;r++)e[r-1]=arguments[r];return e.length?[t].concat(e):t}function f(t,n,e,r){return{type:n,payload:e,meta:h({dispatchId:t},r),id:t,action:n,data:e,details:r}}function l(t,n,e,r){var i=n.dispatch(e);if(void 0===i)return null;var o=n.id,a=o,s=o,c={id:o,namespace:a,name:s},u=function(t){return r.dispatch(o,t,c)};return g.isFunction(i)?i(u,r):r.dispatcher.dispatch(f(t,o,i,c))}function p(){}var h=Object.assign||function(t){for(var n=1;n=0&&t.splice(i,1)},i=function(n){t.push(n);var e=function(){return r(n)};return{dispose:e}},o=function(i){if(n)throw new Error("Cannot push while pushing");n=!0;try{t.forEach(function(t){return t(i)})}finally{n=!1,e=e.filter(r)}};return{subscribe:i,push:o,unsubscribe:r,subscriptions:t}}t.exports=e},function(t,n){function e(){u=!1,a.length?c=a.concat(c):f=-1,c.length&&r()}function r(){if(!u){var t=setTimeout(e);u=!0;for(var n=c.length;n;){for(a=c,c=[];++f1)for(var e=1;eo;o++)e[o]=arguments[o];var a=r.apply(i,e),f=a;return void 0===a||l["default"](a)||(s.isFunction(a)?f=a(c,t):c(a)),void 0===a&&u.warn("An action was called but nothing was dispatched"),f};f.defer=function(){for(var t=arguments.length,n=Array(t),e=0;t>e;e++)n[e]=arguments[e];return setTimeout(function(){return f.apply(null,n)})},f.id=o,f.data=a;var p=t.actions[n],h=u.uid(p,e);p[h]=f;var d=u.formatAsConstant(h);return p[d]=o,f}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e(1),s=i(a),c=e(2),u=i(c),f=e(14),l=r(f);t.exports=n["default"]},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function o(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}function s(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var c=e(11),u=e(10),f=i(u),l=e(1),p=i(l),h=e(9),d=i(h),g=e(2),y=i(g),v=e(5),b=r(v),m=function(){function t(){var n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];s(this,t),this.config=n,this.serialize=n.serialize||JSON.stringify,this.deserialize=n.deserialize||JSON.parse,this.dispatcher=n.dispatcher||new c.Dispatcher,this.batchingFunction=n.batchingFunction||function(t){return t()},this.actions={global:{}},this.stores={},this.storeTransforms=n.storeTransforms||[],this.trapAsync=!1,this._actionsRegistry={},this._initSnapshot={},this._lastSnapshot={}}return t.prototype.dispatch=function(){function t(t,n,e){var r=this;this.batchingFunction(function(){var i=Math.random().toString(18).substr(2,16);if(t.hasOwnProperty("type")&&t.hasOwnProperty("payload")){var o={id:t.type,namespace:t.type,name:t.type};return r.dispatcher.dispatch(y.fsa(i,t.type,t.payload,o))}return t.id&&t.dispatch?y.dispatch(i,t,n,r):r.dispatcher.dispatch(y.fsa(i,t,n,e))})}return t}(),t.prototype.createUnsavedStore=function(){function t(t){var n=t.displayName||"";d.createStoreConfig(this.config,t);for(var e=d.transformStore(this.storeTransforms,t),r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];return p.isFunction(e)?d.createStoreFromClass.apply(d,[this,e,n].concat(i)):d.createStoreFromObject(this,e,n)}return t}(),t.prototype.createStore=function(){function t(t,n){var e=n||t.displayName||t.name||"";d.createStoreConfig(this.config,t);var r=d.transformStore(this.storeTransforms,t);(this.stores[e]||!e)&&(this.stores[e]?y.warn("A store named "+String(e)+" already exists, double check your store names or pass in your own custom identifier for each store"):y.warn("Store name was not specified"),e=y.uid(this.stores,e));for(var i=arguments.length,o=Array(i>2?i-2:0),a=2;i>a;a++)o[a-2]=arguments[a];var s=p.isFunction(r)?d.createStoreFromClass.apply(d,[this,r,e].concat(o)):d.createStoreFromObject(this,r,e);return this.stores[e]=s,f.saveInitialSnapshot(this,e),s}return t}(),t.prototype.generateActions=function(){function t(){for(var t={name:"global"},n=arguments.length,e=Array(n),r=0;n>r;r++)e[r]=arguments[r];return this.createActions(e.reduce(function(t,n){return t[n]=y.dispatchIdentity,t},t))}return t}(),t.prototype.createAction=function(){function t(t,n,e){return b["default"](this,"global",t,n,e)}return t}(),t.prototype.createActions=function(){function t(t){var n=this,e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r={},i=y.uid(this._actionsRegistry,t.displayName||t.name||"Unknown");if(p.isFunction(t)){p.assign(r,y.getPrototypeChain(t));for(var c=function(t){function n(){s(this,n);for(var e=arguments.length,r=Array(e),i=0;e>i;i++)r[i]=arguments[i];return o(this,t.call.apply(t,[this].concat(r)))}return a(n,t),n.prototype.generateActions=function(){function t(){for(var t=arguments.length,n=Array(t),e=0;t>e;e++)n[e]=arguments[e];n.forEach(function(t){r[t]=y.dispatchIdentity})}return t}(),n}(t),u=arguments.length,f=Array(u>2?u-2:0),l=2;u>l;l++)f[l-2]=arguments[l];p.assign(r,new(Function.prototype.bind.apply(c,[null].concat(f))))}else p.assign(r,t);return this.actions[i]=this.actions[i]||{},p.eachObject(function(t,r){if(!p.isFunction(r))return void(e[t]=r);e[t]=b["default"](n,i,t,r,e);var o=y.formatAsConstant(t);e[o]=e[t].id},[r]),e}return t}(),t.prototype.takeSnapshot=function(){function t(){for(var t=arguments.length,n=Array(t),e=0;t>e;e++)n[e]=arguments[e];var r=f.snapshot(this,n);return p.assign(this._lastSnapshot,r),this.serialize(r)}return t}(),t.prototype.rollback=function(){function t(){f.setAppState(this,this.serialize(this._lastSnapshot),function(t){t.lifecycle("rollback"),t.emitChange()})}return t}(),t.prototype.recycle=function(){function t(){for(var t=arguments.length,n=Array(t),e=0;t>e;e++)n[e]=arguments[e];var r=n.length?f.filterSnapshots(this,this._initSnapshot,n):this._initSnapshot;f.setAppState(this,this.serialize(r),function(t){t.lifecycle("init"),t.emitChange()})}return t}(),t.prototype.flush=function(){function t(){var t=this.serialize(f.snapshot(this));return this.recycle(),t}return t}(),t.prototype.bootstrap=function(){function t(t){f.setAppState(this,t,function(t,n){t.lifecycle("bootstrap",n),t.emitChange()})}return t}(),t.prototype.prepare=function(){function t(t,n){var e={};if(!t.displayName)throw new ReferenceError("Store provided does not have a name");return e[t.displayName]=n,this.serialize(e)}return t}(),t.prototype.addActions=function(){function t(t,n){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;e>i;i++)r[i-2]=arguments[i];this.actions[t]=Array.isArray(n)?this.generateActions.apply(this,n):this.createActions.apply(this,[n].concat(r))}return t}(),t.prototype.addStore=function(){function t(t,n){for(var e=arguments.length,r=Array(e>2?e-2:0),i=2;e>i;i++)r[i-2]=arguments[i];this.createStore.apply(this,[n,t].concat(r))}return t}(),t.prototype.getActions=function(){function t(t){return this.actions[t]}return t}(),t.prototype.getStore=function(){function t(t){return this.stores[t]}return t}(),t.debug=function(){function t(t,n,e){var r="alt.js.org",i=e;return i||"undefined"==typeof window||(i=window),"undefined"!=typeof i&&(i[r]=i[r]||[],i[r].push({name:t,alt:n})),n}return t}(),t}();n["default"]=m,t.exports=n["default"]},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function o(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var a=e(1),s=i(a),c=e(3),u=r(c),f=function(){function t(n,e,r,i){var a=this;o(this,t);var c=e.lifecycleEvents;this.transmitter=u["default"](),this.lifecycle=function(t,n){c[t]&&c[t].push(n)},this.state=r,this.alt=n,this.preventDefault=!1,this.displayName=e.displayName,this.boundListeners=e.boundListeners,this.StoreModel=i,this.reduce=e.reduce||function(t){return t};var f=e.output||function(t){return t};this.emitChange=function(){return a.transmitter.push(f(a.state))};var l=function(t,n){try{return t()}catch(r){if(e.handlesOwnErrors)return a.lifecycle("error",{error:r,payload:n,state:a.state}),!1;throw r}};s.assign(this,e.publicMethods),this.dispatchToken=n.dispatcher.register(function(t){a.preventDefault=!1,a.lifecycle("beforeEach",{payload:t,state:a.state});var n=e.actionListeners[t.action];if(n||e.otherwise){var r=void 0;r=n?l(function(){return n.filter(Boolean).every(function(n){return n.call(e,t.data,t.action)!==!1})},t):l(function(){return e.otherwise(t.data,t.action)},t),r===!1||a.preventDefault||a.emitChange()}e.reduce&&(l(function(){var n=e.reduce(a.state,t);void 0!==n&&(a.state=n)},t),a.preventDefault||a.emitChange()),a.lifecycle("afterEach",{payload:t,state:a.state})}),this.lifecycle("init")}return t.prototype.listen=function(){function t(t){var n=this;if(!s.isFunction(t))throw new TypeError("listen expects a function");return this.transmitter.subscribe(t),function(){return n.unlisten(t)}}return t}(),t.prototype.unlisten=function(){function t(t){this.lifecycle("unlisten"),this.transmitter.unsubscribe(t)}return t}(),t.prototype.getState=function(){function t(){return this.StoreModel.config.getState.call(this,this.state)}return t}(),t}();n["default"]=f,t.exports=n["default"]},function(t,n,e){"use strict";function r(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var o=e(3),a=i(o),s=e(1),c=r(s),u={waitFor:function(){function t(){for(var t=arguments.length,n=Array(t),e=0;t>e;e++)n[e]=arguments[e];if(!n.length)throw new ReferenceError("Dispatch tokens not provided");var r=n;1===n.length&&(r=Array.isArray(n[0])?n[0]:n);var i=r.map(function(t){return t.dispatchToken||t});this.dispatcher.waitFor(i)}return t}(),exportAsync:function(){function t(t){this.registerAsync(t)}return t}(),registerAsync:function(){function t(t){var n=this,e=0,r=c.isFunction(t)?t(this.alt):t,i=Object.keys(r).reduce(function(t,i){var o=r[i],a=c.isFunction(o)?o(n):o,s=["success","error","loading"];return s.forEach(function(t){if(a[t]&&!a[t].id)throw new Error(String(t)+" handler must be an action function")}),t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];var o=n.getInstance().getState(),s=a.local&&a.local.apply(a,[o].concat(r)),c=a.shouldFetch?a.shouldFetch.apply(a,[o].concat(r)):null==s,u=a.interceptResponse||function(t){return t},f=function(){function t(t,i){return function(o){var a=function(){function n(){if(e-=1,t(u(o,t,r)),i)throw o}return n}();return n.alt.trapAsync?function(){return a()}:a()}}return t}();return c?(e+=1,a.loading&&a.loading(u(null,a.loading,r)),a.remote.apply(a,[o].concat(r)).then(f(a.success),f(a.error,1))):(n.emitChange(),s)},t},{});this.exportPublicMethods(i),this.exportPublicMethods({isLoading:function(){function t(){return e>0}return t}()})}return t}(),exportPublicMethods:function(){function t(t){var n=this;c.eachObject(function(t,e){if(!c.isFunction(e))throw new TypeError("exportPublicMethods expects a function");n.publicMethods[t]=e},[t])}return t}(),emitChange:function(){function t(){this.getInstance().emitChange()}return t}(),on:function(){function t(t,n){"error"===t&&(this.handlesOwnErrors=!0);var e=this.lifecycleEvents[t]||a["default"]();return this.lifecycleEvents[t]=e,e.subscribe(n.bind(this))}return t}(),bindAction:function(){function t(t,n){if(!t)throw new ReferenceError("Invalid action reference passed in");if(!c.isFunction(n))throw new TypeError("bindAction expects a function");var e=t.id?t.id:t;this.actionListeners[e]=this.actionListeners[e]||[],this.actionListeners[e].push(n.bind(this)),this.boundListeners.push(e)}return t}(),bindActions:function(){function t(t){var n=this;c.eachObject(function(t,e){var r=/./,i=t.replace(r,function(t){return"on"+String(t[0].toUpperCase())});if(n[t]&&n[i])throw new ReferenceError("You have multiple action handlers bound to an action: "+(String(t)+" and "+String(i)));var o=n[t]||n[i];o&&n.bindAction(e,o)},[t])}return t}(),bindListeners:function(){function t(t){var n=this;c.eachObject(function(t,e){var r=n[t];if(!r)throw new ReferenceError(String(t)+" defined but does not exist in "+String(n.displayName));Array.isArray(e)?e.forEach(function(t){n.bindAction(t,r)}):n.bindAction(e,r)},[t])}return t}()};n["default"]=u,t.exports=n["default"]},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function o(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function a(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function s(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}function c(t,n,e){if(e){var r=n.StoreModel.config,i=v.isFunction(e)?e(n.state):e;n.state=r.setState.call(t,n.state,i),t.alt.dispatcher.isDispatching()||t.emitChange()}}function u(t,n,e,r){return v.assign(t,_["default"],{displayName:e,alt:n,dispatcher:n.dispatcher,preventDefault:function(){function t(){this.getInstance().preventDefault=!0}return t}(),boundListeners:[],lifecycleEvents:{},actionListeners:{},publicMethods:{},handlesOwnErrors:!1},r)}function f(t,n){n.config=v.assign({getState:function(){function t(t){return Array.isArray(t)?t.slice():v.isMutableObject(t)?v.assign({},t):t}return t}(),setState:function(){function t(t,n){return v.isMutableObject(n)?v.assign(t,n):n}return t}()},t,n.config)}function l(t,n){return t.reduce(function(t,n){return n(t)},n)}function p(t,n,e){var r=void 0,i=u({},t,e,v.assign({getInstance:function(){function t(){return r}return t}(),setState:function(){function t(t){c(this,r,t)}return t}()},n));return i.bindListeners&&_["default"].bindListeners.call(i,i.bindListeners),i.observe&&_["default"].bindListeners.call(i,i.observe(t)),i.lifecycle&&v.eachObject(function(t,n){_["default"].on.call(i,t,n)},[i.lifecycle]),r=v.assign(new m["default"](t,i,void 0!==i.state?i.state:{},n),i.publicMethods,{displayName:e,config:n.config})}function h(t,n,e){var r=void 0,i=n.config,f=function(t){function n(){o(this,n);for(var e=arguments.length,r=Array(e),i=0;e>i;i++)r[i]=arguments[i];return a(this,t.call.apply(t,[this].concat(r)))}return s(n,t),n}(n);u(f.prototype,t,e,{type:"AltStore",getInstance:function(){function t(){return r}return t}(),setState:function(){function t(t){c(this,r,t)}return t}()});for(var l=arguments.length,p=Array(l>3?l-3:0),h=3;l>h;h++)p[h-3]=arguments[h];var d=new(Function.prototype.bind.apply(f,[null].concat(p)));return i.bindListeners&&d.bindListeners(i.bindListeners),i.datasource&&d.registerAsync(i.datasource),r=v.assign(new m["default"](t,d,void 0!==d.state?d.state:d,n),g.getInternalMethods(n),i.publicMethods,{displayName:e})}Object.defineProperty(n,"__esModule",{value:!0}),n.createStoreConfig=f,n.transformStore=l,n.createStoreFromObject=p,n.createStoreFromClass=h;var d=e(2),g=i(d),y=e(1),v=i(y),b=e(7),m=r(b),w=e(8),_=r(w)},function(t,n,e){"use strict";function r(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function i(t,n,e){var r=t.deserialize(n);u.eachObject(function(n,i){var o=t.stores[n];o&&!function(){var t=o.StoreModel.config,a=o.state;t.onDeserialize&&(r[n]=t.onDeserialize(i)||i),u.isMutableObject(a)?(u.eachObject(function(t){return delete a[t]},[a]),u.assign(a,r[n])):o.state=r[n],e(o,o.state)}()},[r])}function o(t){var n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],e=n.length?n:Object.keys(t.stores);return e.reduce(function(n,e){var r=e.displayName||e,i=t.stores[r],o=i.StoreModel.config;i.lifecycle("snapshot");var a=o.onSerialize&&o.onSerialize(i.state);return n[r]=a?a:i.getState(),n},{})}function a(t,n){var e=t.deserialize(t.serialize(t.stores[n].state));t._initSnapshot[n]=e,t._lastSnapshot[n]=e}function s(t,n,e){return e.reduce(function(t,e){var r=e.displayName||e;if(!n[r])throw new ReferenceError(String(r)+" is not a valid store");return t[r]=n[r],t},{})}Object.defineProperty(n,"__esModule",{value:!0}),n.setAppState=i,n.snapshot=o,n.saveInitialSnapshot=a,n.filterSnapshots=s;var c=e(1),u=r(c)},function(t,n,e){t.exports.Dispatcher=e(12)},function(t,n,e){(function(r){"use strict";function i(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var o=e(13),a="ID_",s=function(){function t(){i(this,t),this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}return t.prototype.register=function(t){var n=a+this._lastID++;return this._callbacks[n]=t,n},t.prototype.unregister=function(t){this._callbacks[t]?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t):o(!1),delete this._callbacks[t]},t.prototype.waitFor=function(t){this._isDispatching?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.waitFor(...): Must be invoked while dispatching."):o(!1);for(var n=0;n