/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/slim-store@3.0.6/slim-esm.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var isPlainObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},isPlainString=function(e){return"string"==typeof e},error=function(e){throw new Error(e)},warn=window.console.warn,throwIf=function(e,t){e&&error(t)},warnIf=function(e,t){e&&warn(t)},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},defineProperty=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},toConsumableArray=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},fnT="Function",fnO="Object",isFn=function(e){return"function"==typeof e},passFunction=function(e,t){return Object.keys(e).forEach(function(n){var r=e[n];throwIf(!isFn(r),t+" for key ["+n+"] must be type of ["+fnT+"] but got ["+(void 0===r?"undefined":_typeof(r))+"]")}),e},passPlugin=function(e){if(!e)return[];var t=Array.isArray(e)?e:[e];return t.forEach(function(e){validatePlugin(e)}),t},validatePlugin=function(e){throwIf(!isPlainObject(e),msgHelper.shouldBe("Plugin",fnO,void 0===e?"undefined":_typeof(e)));var t=e.before,n=e.after,r=e.beforeSet;t&&throwIf(!isFn(t),msgHelper.shouldBe("Plugin.before",fnT,void 0===t?"undefined":_typeof(t))),r&&throwIf(!isFn(r),msgHelper.shouldBe("Plugin.beforeSet",fnT,void 0===r?"undefined":_typeof(r))),n&&throwIf(!isFn(n),msgHelper.shouldBe("Plugin.after",fnT,void 0===n?"undefined":_typeof(n)))},walkInsidePlugins=function(e,t,n,r,o,i){t&&t.forEach(function(t){walkPlugin(e,t,n,r,o,i)})},walkPlugins=function(e,t,n,r){t&&t.forEach(function(t){walkPlugin(e,t,n,r)})},walkPlugin=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];t[e]&&t[e].apply(t,r)},msgHelper={typeError:function(e){return"type of state expect to [Object] but got ["+e+"]"},shouldBe:function(e,t,n){return e+" should be type of ["+t+"] but got ["+n+"]"},cantCall:function(e){return"You may not call "+e+" while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store."},cantAssign:function(){return"You may not be able to assign values ​​directly to state. Please return a new state for reducing or edit with state in reducer."}},parse2Json=function(e){return isPlainObject(e)?e:JSON.parse(e)},injectPlugins=[],isDispatching=null,isStrict=!1,store=void 0,validateFn=void 0,customSetterFn=void 0,plugins=void 0,STRICT="strict",__DEVTOOL_EXT__="__SLIM_DEVTOOL_SET__",createStore=function(e){var t=e.reducers,n=void 0===t?{}:t,r=e.actions,o=void 0===r?{}:r,i=e.state,_=void 0===i?{}:i,a=e.plugin,s=e.getters,u=void 0===s?{}:s,f=e.mode,c=void 0===f?STRICT:f,l=e.setterValidator,d=e.customSetter;if(!isPlainObject(_))throw new TypeError(msgHelper.typeError(void 0===_?"undefined":_typeof(_)));isStrict=c===STRICT,validateFn=isFn(l)?l:void 0,customSetterFn=isFn(d)?d:void 0;var p=observeObject(_),O=passFunction(_extends({},n,defineProperty({},__DEVTOOL_EXT__,function(e,t){return t})),"Reducer"),g=passFunction(_extends({},o,defineProperty({},__DEVTOOL_EXT__,function(e,t){return e.commit(__DEVTOOL_EXT__,t)})),"Action");plugins=[].concat(injectPlugins,toConsumableArray(passPlugin(a)));u=new Proxy(function(e){return Object.keys(e).forEach(function(t){var n=e[t];throwIf(!isFn(n),msgHelper.shouldBe("Getter."+t,fnT,void 0===n?"undefined":_typeof(n)))}),e}(u),{get:function(e,t){return e.hasOwnProperty(t)?e[t](p):void 0},set:function(){throw new Error(msgHelper.cantAssign())}});var y=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throwIf(!isPlainString(e),msgHelper.shouldBe("reducerKey","string",void 0===e?"undefined":_typeof(e))),throwIf(isDispatching,"Reducers may not commit will another reducer is dispatching.");try{if(isDispatching=!0,warnIf(!O[e],"You may not has not registered Reducer:["+e+"] in store"),walkPlugins("before",plugins,p,e),O[e]){var o=O[e].apply(O,[p].concat(n));o&&o!==p&&(p=observeObject(o),store.state=p)}walkPlugins("after",plugins,p,e)}finally{isDispatching=null}return store};return store={dispatch:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return throwIf(!isPlainString(e),msgHelper.shouldBe("Actions","string",void 0===e?"undefined":_typeof(e))),warnIf(!g[e],"You may not has not registered Action:["+e+"] in store"),g[e]&&g[e].apply(g,[store].concat(n)),store},commit:y,getGetter:function(e){return e?u[e]:u},state:p},walkPlugins("init",plugins,store),store},observeObject=function(e){var t=function(e){return isPlainObject(e)||Array.isArray(e)?n(e):e},n=function(e){var n={set:function(e,n,r,o){throwIf(!isDispatching&&(validateFn&&!validateFn(e,n,r,o)||!validateFn),msgHelper.cantAssign()),walkInsidePlugins("beforeSet",plugins,e,n,r,o);var i=function(){return Reflect.set(e,n,t(r),o)};return customSetterFn?customSetterFn(e,n,r,o,i):i()},get:function(e,t,n){return Reflect.get(e,t,n)}};for(var r in e)e[r]=t(e[r]);return new Proxy(e,n)};return isStrict?n(e):e},use=function(e){validatePlugin(e),injectPlugins.push(e)},eventMap={},EventCenter={on:function(e,t){eventMap[e]||(eventMap[e]=[]),eventMap[e].push(t)},off:function(e,t){var n=eventMap[e];if(Array.isArray(n)){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}},emit:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=eventMap[e];warnIf(!o,"there are no handler for event ["+e+"]"),o&&o.forEach(function(e){e.apply(void 0,toConsumableArray(n))})}},__DEV__=!1;try{process&&(__DEV__="production"!==process.env.NODE_ENV)}catch(e){}var __VERSION__="3.0.5",__SLIM_DEVTOOL_INIT__="__SLIM_DEVTOOL_INIT__",__SLIM_DEVTOOL_INIT_ANSWER__="__SLIM_DEVTOOL_INIT_ANSWER__",__SLIM_DEVTOOL_ANSWER__="__SLIM_DEVTOOL_ANSWER__",__SLIM_DEVTOOL_SET__="__SLIM_DEVTOOL_SET__",__SLIM_DEVTOOL__="__SLIM_DEVTOOL__",__PROXY__=Proxy||window.Proxy,__SICK_PROXY__='Your browser not support [Proxy]. Slim will force making mode to "loose" for lib available.',_createStore=function(){function e(){}return __DEV__?throwIf(!__PROXY__,__SICK_PROXY__):warnIf(!__PROXY__,__SICK_PROXY__),warnIf(__DEV__&&"string"==typeof e.name&&"isCrushed"!==e.name,'You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Slim. '),__DEV__&&use({init:function(e){var t=function(){window.postMessage({version:__VERSION__,type:__SLIM_DEVTOOL_INIT_ANSWER__,state:JSON.stringify(e.state)},"*")};setTimeout(function(){t()},500),window.addEventListener("message",function(e){var n=parse2Json(e.data),r=n.type,o=n.state;r===__SLIM_DEVTOOL_ANSWER__?Slim.emit(__SLIM_DEVTOOL_ANSWER__,parse2Json(o)):r===__SLIM_DEVTOOL_INIT__&&t()})},after:function(e,t){-1===[__SLIM_DEVTOOL_INIT__,__SLIM_DEVTOOL_INIT_ANSWER__,__SLIM_DEVTOOL_ANSWER__,__SLIM_DEVTOOL_SET__,__SLIM_DEVTOOL__].indexOf(t)&&window.postMessage({version:__VERSION__,type:__SLIM_DEVTOOL__,state:JSON.stringify(e),actionType:t},"*")}}),createStore},on=EventCenter.on,off=EventCenter.off,emit=EventCenter.emit,Slim={__VERSION__:__VERSION__,createStore:_createStore(),use:use,on:on,off:off,emit:emit};export default Slim;
