/*! * Vuex v1.0.1 * (c) 2017 Evan You * Released under the MIT License. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vuex=e()}(this,function(){"use strict";function t(t){return t.reduce(function(t,e){return Object.keys(e).forEach(function(n){var o=t[n];o?Array.isArray(o)?t[n]=o.concat(e[n]):t[n]=[o].concat(e[n]):t[n]=e[n]}),t},{})}function e(t){return null!==t&&"object"===("undefined"==typeof t?"undefined":a(t))}function n(t,e){return e.reduce(function(t,e){return t[e]},t)}function o(t){if(!l){var e=function(){},n=t.$watch(e,e);l=t._watchers[0].constructor,n()}return l}function i(t){return d||(d=t._data.__ob__.dep.constructor),d}function r(t){v&&(v.emit("vuex:init",t),v.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){v.emit("vuex:mutation",t,e)}))}function u(t){return p?void console.warn("[vuex] already installed. Vue.use(Vuex) should be called only once."):(p=t,void h(p))}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},c=function(){function t(t,e){for(var n=0;n=2){var c=t.config._lifecycleHooks.indexOf("init")>-1;t.mixin(c?{init:e}:{beforeCreate:e})}else!function(){var n=t.prototype._init;t.prototype._init=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.init=t.init?[e].concat(t.init):e,n.call(this,t)}}();var f=t.config.optionMergeStrategies.computed;t.config.optionMergeStrategies.vuex=function(t,e){return t?e?{getters:f(t.getters,e.getters),state:f(t.state,e.state),actions:f(t.actions,e.actions)}:t:e}},p=void 0,y=0,_=function(){function i(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.state,o=void 0===n?{}:n,u=e.mutations,a=void 0===u?{}:u,c=e.modules,f=void 0===c?{}:c,l=e.plugins,d=void 0===l?[]:l,v=e.strict,h=void 0!==v&&v;s(this,i),this._getterCacheId="vuex_store_"+y++,this._dispatching=!1,this._rootMutations=this._mutations=a,this._modules=f,this._subscribers=[];var _=this.dispatch;if(this.dispatch=function(){for(var e=arguments.length,n=Array(e),o=0;o1?n-1:0),i=1;i-1&&e.splice(n,1)}}},{key:"hotUpdate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.mutations,n=t.modules;this._rootMutations=this._mutations=e||this._rootMutations,this._setupModuleMutations(n||this._modules)}},{key:"_setupModuleState",value:function(t,n){var o=this;e(n)&&Object.keys(n).forEach(function(e){var i=n[e];p.set(t,e,i.state||{}),o._setupModuleState(t[e],i.modules)})}},{key:"_setupModuleMutations",value:function(e){var n=this._modules;Object.keys(e).forEach(function(t){n[t]=e[t]});var o=this._createModuleMutations(n,[]);this._mutations=t([this._rootMutations].concat(f(o)))}},{key:"_createModuleMutations",value:function(o,i){var r=this;return e(o)?Object.keys(o).map(function(e){var u=o[e],a=i.concat(e),s=r._createModuleMutations(u.modules,a);if(!u||!u.mutations)return t(s);var c={};return Object.keys(u.mutations).forEach(function(t){var e=u.mutations[t];c[t]=function(t){for(var o=arguments.length,i=Array(o>1?o-1:0),r=1;r