@ngxs/store 3.6.2 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +2 -2
  2. package/bundles/ngxs-store-operators.umd.js +36 -14
  3. package/bundles/ngxs-store-operators.umd.js.map +1 -1
  4. package/bundles/ngxs-store-operators.umd.min.js +10 -10
  5. package/bundles/ngxs-store-operators.umd.min.js.map +1 -1
  6. package/bundles/ngxs-store.umd.js +76 -44
  7. package/bundles/ngxs-store.umd.js.map +1 -1
  8. package/bundles/ngxs-store.umd.min.js +11 -11
  9. package/bundles/ngxs-store.umd.min.js.map +1 -1
  10. package/esm2015/src/decorators/select/select.js +1 -2
  11. package/esm2015/src/decorators/select/symbols.js +1 -1
  12. package/esm2015/src/internal/dispatcher.js +9 -1
  13. package/esm2015/src/internal/internals.js +3 -3
  14. package/esm2015/src/internal/state-factory.js +12 -3
  15. package/esm2015/src/internal/state-operations.js +3 -3
  16. package/esm2015/src/ivy/ensure-state-class-is-injectable.js +3 -3
  17. package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +6 -16
  18. package/esm2015/src/operators/of-action.js +6 -3
  19. package/esm2015/src/store.js +4 -4
  20. package/esm2015/src/utils/utils.js +4 -2
  21. package/esm5/src/decorators/select/select.js +1 -2
  22. package/esm5/src/decorators/select/symbols.js +1 -1
  23. package/esm5/src/internal/dispatcher.js +9 -1
  24. package/esm5/src/internal/internals.js +3 -3
  25. package/esm5/src/internal/state-factory.js +12 -3
  26. package/esm5/src/internal/state-operations.js +3 -3
  27. package/esm5/src/ivy/ensure-state-class-is-injectable.js +3 -3
  28. package/esm5/src/ivy/ivy-enabled-in-dev-mode.js +6 -16
  29. package/esm5/src/operators/of-action.js +6 -3
  30. package/esm5/src/store.js +5 -5
  31. package/esm5/src/utils/utils.js +4 -2
  32. package/fesm2015/ngxs-store.js +39 -29
  33. package/fesm2015/ngxs-store.js.map +1 -1
  34. package/fesm5/ngxs-store.js +40 -30
  35. package/fesm5/ngxs-store.js.map +1 -1
  36. package/ngxs-store.metadata.json +1 -1
  37. package/package.json +3 -3
  38. package/src/decorators/select/select.d.ts +1 -2
  39. package/src/decorators/select/symbols.d.ts +0 -4
  40. package/src/internal/internals.d.ts +1 -1
  41. package/src/ivy/ivy-enabled-in-dev-mode.d.ts +2 -2
  42. package/src/operators/of-action.d.ts +9 -8
  43. package/src/store.d.ts +1 -1
@@ -1,16 +1,16 @@
1
1
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@ngxs/store/internals"),require("@angular/common"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngxs/store",["exports","@angular/core","@ngxs/store/internals","@angular/common","rxjs","rxjs/operators"],e):e(((t=t||self).ngxs=t.ngxs||{},t.ngxs.store={}),t.ng.core,t.ngxs.store.internals,t.ng.common,t.rxjs,t.rxjs.operators)}(this,(function(t,e,n,r,o,i){"use strict";
2
2
  /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
- this file except in compliance with the License. You may obtain a copy of the
6
- License at http://www.apache.org/licenses/LICENSE-2.0
3
+ Copyright (c) Microsoft Corporation.
7
4
 
8
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11
- MERCHANTABLITY OR NON-INFRINGEMENT.
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
12
7
 
13
- See the Apache Version 2.0 License for specific language governing permissions
14
- and limitations under the License.
15
- ***************************************************************************** */var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function u(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s,c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function p(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}var h={STATE_NAME:"STATE_NAME",STATE_UNIQUE:"STATE_UNIQUE",STATE_NAME_PROPERTY:"STATE_NAME_PROPERTY",STATE_DECORATOR:"STATE_DECORATOR",INCORRECT_PRODUCTION:"INCORRECT_PRODUCTION",INCORRECT_DEVELOPMENT:"INCORRECT_DEVELOPMENT",SELECT_FACTORY_NOT_CONNECTED:"SELECT_FACTORY_NOT_CONNECTED",ACTION_DECORATOR:"ACTION_DECORATOR",SELECTOR_DECORATOR:"SELECTOR_DECORATOR",ZONE_WARNING:"ZONE_WARNING",PATCHING_ARRAY:"PATCHING_ARRAY",PATCHING_PRIMITIVE:"PATCHING_PRIMITIVE",UNDECORATED_STATE_IN_IVY:"UNDECORATED_STATE_IN_IVY"},y=((s={})[h.STATE_NAME]=function(t){return t+" is not a valid state name. It needs to be a valid object property name."},s[h.STATE_NAME_PROPERTY]=function(){return"States must register a 'name' property"},s[h.STATE_UNIQUE]=function(t,e,n){return"State name '"+t+"' from "+e+" already exists in "+n},s[h.STATE_DECORATOR]=function(){return"States must be decorated with @State() decorator"},s[h.INCORRECT_PRODUCTION]=function(){return"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},s[h.INCORRECT_DEVELOPMENT]=function(){return"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},s[h.SELECT_FACTORY_NOT_CONNECTED]=function(){return"You have forgotten to import the NGXS module!"},s[h.ACTION_DECORATOR]=function(){return"@Action() decorator cannot be used with static methods"},s[h.SELECTOR_DECORATOR]=function(){return"Selectors only work on methods"},s[h.ZONE_WARNING]=function(){return"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })"},s[h.PATCHING_ARRAY]=function(){return"Patching arrays is not supported."},s[h.PATCHING_PRIMITIVE]=function(){return"Patching primitives is not supported."},s[h.UNDECORATED_STATE_IN_IVY]=function(t){return"'"+t+"' class should be decorated with @Injectable() right after the @State() decorator"},s),d=function(){function t(t,e){this._ngZone=t,this._platformId=e,this.verifyZoneIsNotNooped(this._ngZone)}return t.prototype.enter=function(t){return r.isPlatformServer(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)},t.prototype.leave=function(t){return this.runInsideAngular(t)},t.prototype.runInsideAngular=function(t){return e.NgZone.isInAngularZone()?t():this._ngZone.run(t)},t.prototype.runOutsideAngular=function(t){return e.NgZone.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()},t.prototype.verifyZoneIsNotNooped=function(t){t instanceof e.NgZone||console.warn(y[h.ZONE_WARNING]())},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.NgZone},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t}();var g=new e.InjectionToken("ROOT_STATE_TOKEN"),S=new e.InjectionToken("FEATURE_STATE_TOKEN"),v=new e.InjectionToken("NGXS_PLUGINS"),_=new e.InjectionToken("NG_TEST_MODE"),O=new e.InjectionToken("NG_DEV_MODE"),E="NGXS_META",T="NGXS_OPTIONS_META",m="NGXS_SELECTOR_META",A=function(){function t(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=d}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[]},t}();var N=function(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n};var I=new e.InjectionToken("NGXS_EXECUTION_STRATEGY");function R(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}var C=function(t,e,n){t=c({},t);var r=e.split("."),o=r.length-1;return r.reduce((function(t,e,r){return t[e]=r===o?n:Array.isArray(t[e])?t[e].slice():c({},t[e]),t&&t[e]}),t),t},b=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)};function x(t){if(!t.hasOwnProperty(E)){var e={name:null,actions:{},defaults:{},path:null,makeRootSelector:function(t){return t.getStateGetter(e.name)},children:[]};Object.defineProperty(t,E,{value:e})}return P(t)}function P(t){return t[E]}function w(t){if(!t.hasOwnProperty(m)){Object.defineProperty(t,m,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:function(){return{}}}})}return j(t)}function j(t){return t[m]}function M(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){var e=t.slice();return(function(t){return e.reduce((function(t,e){return t&&t[e]}),t)})}(t):function(t){for(var e=t,n="store."+e[0],r=0,o=e.length,i=n;++r<o;)i=i+" && "+(n=n+"."+e[r]);return new Function("store","return "+i+";")}(t)}function D(t,e){var n=b(e.currentAppState,t.path),r=b(e.newAppState,t.path);return new N(n,r,!t.isInitialised)}function F(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["DISPATCHED"])}function k(t,e,n){void 0===n&&(n=L);var r=t.reduce((function(t,e){return t[R(e)]=!0,t}),{}),o=e&&function(t){return t.reduce((function(t,e){return t[e]=!0,t}),{})}(e);return function(t){return t.pipe(function(t,e){return i.filter((function(n){var r=R(n.action),o=t[r],i=!e||e[n.status];return o&&i}))}(r,o),n())}}function U(){return i.map((function(t){var e=t.action,n=t.status;return({action:e,result:{successful:"SUCCESSFUL"===n,canceled:"CANCELED"===n,error:t.error}})}))}function L(){return i.map((function(t){return t.action}))}function G(t){return function(e){return new o.Observable((function(n){return e.subscribe({next:function(e){t.leave((function(){return n.next(e)}))},error:function(e){t.leave((function(){return n.error(e)}))},complete:function(){t.leave((function(){return n.complete()}))}})}))}}var V=function(){function t(t){this._executionStrategy=t}return t.prototype.enter=function(t){return this._executionStrategy.enter(t)},t.prototype.leave=function(t){return this._executionStrategy.leave(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[I]}]}]},t}();var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._itemQueue=[],e._busyPushingNext=!1,e}return u(e,t),e.prototype.next=function(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,t.prototype.next.call(this,e);this._itemQueue.length>0;){var n=this._itemQueue.pop();t.prototype.next.call(this,n)}this._busyPushingNext=!1}},e}(o.Subject);var H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(B),Y=function(t){function n(e,n){return t.call(this,(function(t){var r=e.pipe(G(n)).subscribe({next:function(e){return t.next(e)},error:function(e){return t.error(e)},complete:function(){return t.complete()}});t.add(r)}))||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[{type:H},{type:V}]},n}(o.Observable),Z=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.shift();return r.apply(void 0,l(e,[function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Z(t).apply(void 0,l(e))}]))}},X=function(t){function n(){return t.call(this,{})||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]},n}(o.BehaviorSubject),q=function(){function t(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}return Object.defineProperty(t.prototype,"rootPlugins",{get:function(){return this._parentManager&&this._parentManager.plugins||this.plugins},enumerable:!0,configurable:!0}),t.prototype.registerHandlers=function(){var t,e=this.getPluginHandlers();(t=this.rootPlugins).push.apply(t,l(e))},t.prototype.getPluginHandlers=function(){return(this._pluginHandlers||[]).map((function(t){return t.handle?t.handle.bind(t):t}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:Array,decorators:[{type:e.Inject,args:[v]},{type:e.Optional}]}]},t}();var W=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(o.Subject),z=function(){function t(t,e,n,r,o,i){this._errorHandler=t,this._actions=e,this._actionResults=n,this._pluginManager=r,this._stateStream=o,this._ngxsExecutionStrategy=i}return t.prototype.dispatch=function(t){var e=this,n=this._ngxsExecutionStrategy.enter((function(){return e.dispatchByEvents(t)}));return n.subscribe({error:function(t){return e._ngxsExecutionStrategy.leave((function(){try{e._errorHandler.handleError(t)}catch(t){}}))}}),n.pipe(G(this._ngxsExecutionStrategy))},t.prototype.dispatchByEvents=function(t){var e=this;return Array.isArray(t)?0===t.length?o.of(this._stateStream.getValue()):o.forkJoin(t.map((function(t){return e.dispatchSingle(t)}))):this.dispatchSingle(t)},t.prototype.dispatchSingle=function(t){var e=this,n=this._stateStream.getValue(),r=this._pluginManager.plugins;return Z(l(r,[function(t,r){t!==n&&e._stateStream.next(t);var o=e.getActionResultStream(r);return o.subscribe((function(t){return e._actions.next(t)})),e._actions.next({action:r,status:"DISPATCHED"}),e.createDispatchObservable(o)}]))(n,t).pipe(i.shareReplay())},t.prototype.getActionResultStream=function(t){return this._actionResults.pipe(i.filter((function(e){return e.action===t&&"DISPATCHED"!==e.status})),i.take(1),i.shareReplay())},t.prototype.createDispatchObservable=function(t){var e=this;return t.pipe(i.exhaustMap((function(t){switch(t.status){case"SUCCESSFUL":return o.of(e._stateStream.getValue());case"ERRORED":return o.throwError(t.error);default:return o.EMPTY}}))).pipe(i.shareReplay())},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.ErrorHandler},{type:H},{type:W},{type:q},{type:X},{type:V}]},t}();var Q=function(t){Object.freeze(t);var e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach((function(r){!n.call(t,r)||e&&("caller"===r||"callee"===r||"arguments"===r)||null===t[r]||"object"!=typeof t[r]&&"function"!=typeof t[r]||Object.isFrozen(t[r])||Q(t[r])})),t},K=function(){function t(t,e){this.isDevMode=t,this.isTestMode=e}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[O]}]},{type:void 0,decorators:[{type:e.Inject,args:[_]}]}]},t}();var J=function(){function t(t,e){this._host=t,this._config=e}return Object.defineProperty(t.prototype,"isIncorrectProduction",{get:function(){return!this._host.isDevMode()&&this._config.developmentMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIncorrectDevelopment",{get:function(){return this._host.isDevMode()&&!this._config.developmentMode},enumerable:!0,configurable:!0}),t.prototype.verifyDevMode=function(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(y[h.INCORRECT_PRODUCTION]()):this.isIncorrectDevelopment&&console.warn(y[h.INCORRECT_DEVELOPMENT]()))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:K},{type:A}]},t}();var $=function(){function t(t,e,n,r){this._stateStream=t,this._dispatcher=e,this._config=n,r.verifyDevMode()}return t.prototype.getRootStateOperations=function(){var t=this,e={getState:function(){return t._stateStream.getValue()},setState:function(e){return t._stateStream.next(e)},dispatch:function(e){return t._dispatcher.dispatch(e)}};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(e):e},t.prototype.ensureStateAndActionsAreImmutable=function(t){return{getState:function(){return t.getState()},setState:function(e){var n=Q(e);return t.setState(n)},dispatch:function(e){return t.dispatch(e)}}},t.prototype.setStateToTheCurrentWithNew=function(t){var e=this.getRootStateOperations(),n=e.getState();e.setState(c({},n,t.defaults))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:X},{type:z},{type:A},{type:J}]},t}();var tt=function(){function t(t){this._internalStateOperations=t}return t.prototype.createStateContext=function(t){var e=this._internalStateOperations.getRootStateOperations();function n(e){return b(e,t.path)}function r(n,r){var o=C(n,t.path,r),i=t.instance;if(i.ngxsOnChanges){var a=D(t,{currentAppState:n,newAppState:o});i.ngxsOnChanges(a)}return e.setState(o),o}function o(t,e){return r(t,e(n(t)))}return{getState:function(){return n(e.getState())},patchState:function(t){return o(e.getState(),function(t){return function(e){if(Array.isArray(t))throw new Error(y[h.PATCHING_ARRAY]());if("object"!=typeof t)throw new Error(y[h.PATCHING_PRIMITIVE]());var n=c({},e);for(var r in t)n[r]=t[r];return(n)}}(t))},setState:function(t){var n=e.getState();return"function"==typeof t?o(n,t):r(n,t)},dispatch:function(t){return e.dispatch(t)}}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:$}]},t}();var et=function(){function t(){}return t.stateNameErrorMessage=function(t){return y[h.STATE_NAME](t)},t.checkCorrectStateName=function(t){if(!t)throw new Error(y[h.STATE_NAME_PROPERTY]());if(!this.stateNameRegex.test(t))throw new Error(this.stateNameErrorMessage(t))},t.checkStateNameIsUnique=function(t,e){var n=this.getValidStateMeta(t).name,r=e[n];if(r&&r!==t)throw new Error(y[h.STATE_UNIQUE](n,t.name,r.name));return n},t.getValidStateMeta=function(t){var e=P(t);if(!e)throw new Error(y[h.STATE_DECORATOR]());return e},t.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$"),t}();var nt=function(){function t(t,e,r,o,i,a,u){var s=this;this._injector=t,this._config=e,this._parentFactory=r,this._actions=o,this._actionResults=i,this._stateContextFactory=a,this._initialState=u,this._connected=!1,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=n.memoize((function(){var t=s;return s._parentFactory?s._parentFactory.getRuntimeSelectorContext():{getStateGetter:function(e){var n=t.statePaths[e];return n?M(n.split("."),t._config):function(){}},getSelectorOptions:function(e){var n=t._config.selectorOptions;return c({},n,e||{})}}}))}return Object.defineProperty(t.prototype,"states",{get:function(){return this._parentFactory?this._parentFactory.states:this._states},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statesByName",{get:function(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statePaths",{get:function(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths},enumerable:!0,configurable:!0}),t.cloneDefaults=function(t){var e,n={};return Array.isArray(t)?n=t.slice():n="object"==typeof(e=t)&&null!==e||"function"==typeof e?c({},t):void 0===t?{}:t,n},t.checkStatesAreValid=function(t){t.forEach(et.getValidStateMeta)},t.prototype.add=function(e){var n,r;t.checkStatesAreValid(e);var o=this.addToStatesMap(e).newStates;if(!o.length)return[];var i,a,u,s,c=function(t){var e=function(e){var n=t.find((function(t){return t===e}));if(!n)throw new Error("Child state not found: "+e+". \r\nYou may have forgotten to add states to module");return(n[E].name)};return t.reduce((function(t,n){var r=n[E],o=r.name,i=r.children;return t[o]=(i||[]).map(e),t}),{})}(o),f=(i=c,a=[],u={},s=function(t,e){void 0===e&&(e=[]),Array.isArray(e)||(e=[]),e.push(t),u[t]=!0,i[t].forEach((function(n){if(e.indexOf(n)>=0)throw new Error("Circular dependency '"+n+"' is required by '"+t+"': "+e.join(" -> "));u[n]||s(n,e.slice(0))})),a.indexOf(t)<0&&a.push(t)},Object.keys(i).forEach((function(t){return s(t)})),a.reverse()),l=function(t,e){void 0===e&&(e={});var n=function(t,e){for(var r in t)if(t.hasOwnProperty(r)&&t[r].indexOf(e)>=0){var o=n(t,r);return null!==o?o+"."+r:r}return null};for(var r in t)if(t.hasOwnProperty(r)){var o=n(t,r);e[r]=o?o+"."+r:r}return e}(c),h=o.reduce((function(t,e){return t[e[E].name]=e,t}),{}),y=[];try{for(var d=p(f),g=d.next();!g.done;g=d.next()){var S=g.value,v=h[S],_=l[S],O=v[E];this.addRuntimeInfoToMeta(O,_);var T={name:S,path:_,isInitialised:!1,actions:O.actions,instance:this._injector.get(v),defaults:t.cloneDefaults(O.defaults)};this.hasBeenMountedAndBootstrapped(S,_)||y.push(T),this.states.push(T)}}catch(t){n={error:t}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return y},t.prototype.addAndReturnDefaults=function(t){var e=t||[],n=this.add(e);return{defaults:n.reduce((function(t,e){return C(t,e.path,e.defaults)}),{}),states:n}},t.prototype.connectActionHandlers=function(){var t=this;this._connected||(this._actions.pipe(i.filter((function(t){return"DISPATCHED"===t.status})),i.mergeMap((function(e){var n=e.action;return t.invokeActions(t._actions,n).pipe(i.map((function(){return{action:n,status:"SUCCESSFUL"}})),i.defaultIfEmpty({action:n,status:"CANCELED"}),i.catchError((function(t){return o.of({action:n,status:"ERRORED",error:t})})))}))).subscribe((function(e){return t._actionResults.next(e)})),this._connected=!0)},t.prototype.invokeActions=function(t,e){var n,r,a,u,s=[];try{for(var c=p(this.states),f=c.next();!f.done;f=c.next()){var l=f.value,h=R(e),y=l.actions[h];if(y)try{for(var d=p(y),g=d.next();!g.done;g=d.next()){var S=g.value,v=this._stateContextFactory.createStateContext(l);try{var _=l.instance[S.fn](v,e);_ instanceof Promise&&(_=o.from(_)),_ instanceof o.Observable?S.options.cancelUncompleted&&(_=_.pipe(i.takeUntil(t.pipe(F(e))))):_=o.of({}).pipe(i.shareReplay()),s.push(_)}catch(t){s.push(o.throwError(t))}}}catch(t){a={error:t}}finally{try{g&&!g.done&&(u=d.return)&&u.call(d)}finally{if(a)throw a.error}}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return s.length||s.push(o.of({})),o.forkJoin(s)},t.prototype.addToStatesMap=function(t){var e,n,r=[],o=this.statesByName;try{for(var i=p(t),a=i.next();!a.done;a=i.next()){var u=a.value,s=et.checkStateNameIsUnique(u,o);!o[s]&&(r.push(u),o[s]=u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{newStates:r}},t.prototype.addRuntimeInfoToMeta=function(t,e){this.statePaths[t.name]=e,t.path=e},t.prototype.hasBeenMountedAndBootstrapped=function(t,e){var n=void 0!==b(this._initialState,e);return this.statesByName[t]&&n},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.Injector},{type:A},{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:H},{type:W},{type:tt},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var rt=function(){function t(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}return t.prototype.ngxsBootstrap=function(t,e){var n=this;this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(i.filter((function(){return!!e})),i.tap((function(){return n.invokeInit(e.states)})),i.mergeMap((function(){return n.bootstrapper.appBootstrapped$})),i.filter((function(t){return!!t}))).subscribe((function(){return n.invokeBootstrap(e.states)}))},t.prototype.invokeInit=function(t){var e,n;try{for(var r=p(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;if(a.ngxsOnChanges){var u=D(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});a.ngxsOnChanges(u)}a.ngxsOnInit&&a.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.invokeBootstrap=function(t){var e,n;try{for(var r=p(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;a.ngxsAfterBootstrap&&a.ngxsAfterBootstrap(this.getStateContext(i))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.getStateContext=function(t){return this.stateContextFactory.createStateContext(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:$},{type:tt},{type:n.NgxsBootstrapper}]},t}();var ot={getOptions:function(t){return t&&t.NGXS_SELECTOR_OPTIONS_META||{}},defineOptions:function(t,e){t&&(t.NGXS_SELECTOR_OPTIONS_META=e)}};function it(t,e,r){var o=r&&r.containerClass,i=n.memoize((function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(o,t);if(i instanceof Function){var a=n.memoize.apply(null,[i]);return a}return i}));Object.setPrototypeOf(i,e);var a=function(t,e){var n=w(t);n.originalFn=t;var r=function(){return{}};e&&(n.containerClass=e.containerClass,n.selectorName=e.selectorName,r=e.getSelectorOptions||r);var o=c({},n);return n.getSelectorOptions=function(){return function(t,e){return c({},ot.getOptions(t.containerClass)||{},ot.getOptions(t.originalFn)||{},t.getSelectorOptions()||{},e)}(o,r())},n}(e,r);return a.makeRootSelector=function(e){var n=function(t,e,n){void 0===n&&(n=[]);var r=e.getSelectorOptions(),o=t.getSelectorOptions(r),i=function(t,e,n){void 0===t&&(t=[]);var r=[],o=0===t.length||e.injectContainerState;if(n&&o){P(n)&&r.push(n)}t&&r.push.apply(r,l(t));return r}(n,o,e.containerClass).map((function(e){return at(e)(t)}));return{selectorOptions:o,argumentSelectorFunctions:i}}(e,a,t),r=n.argumentSelectorFunctions,o=n.selectorOptions;return(function(t){var e=r.map((function(e){return e(t)}));try{return i.apply(void 0,l(e))}catch(t){if(t instanceof TypeError&&o.suppressErrors)return;throw t}})},i}function at(t){var e=j(t)||P(t);return e&&e.makeRootSelector||function(){return t}}var ut=function(){function t(t,e,n,r,o,i){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=r,this._stateFactory=o,this.initStateStream(i)}return t.prototype.dispatch=function(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)},t.prototype.select=function(t){var e=this,n=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(i.map(n),i.catchError((function(t){var n=e._config.selectorOptions.suppressErrors;return t instanceof TypeError&&n?o.of(void 0):o.throwError(t)})),i.distinctUntilChanged(),G(this._internalExecutionStrategy))},t.prototype.selectOnce=function(t){return this.select(t).pipe(i.take(1))},t.prototype.selectSnapshot=function(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())},t.prototype.subscribe=function(t){return this._stateStream.pipe(G(this._internalExecutionStrategy)).subscribe(t)},t.prototype.snapshot=function(){return this._internalStateOperations.getRootStateOperations().getState()},t.prototype.reset=function(t){return this._internalStateOperations.getRootStateOperations().setState(t)},t.prototype.getStoreBoundSelectorFn=function(t){return at(t)(this._stateFactory.getRuntimeSelectorContext())},t.prototype.initStateStream=function(t){var e=this._stateStream.value;if(!e||0===Object.keys(e).length){var n=Object.keys(this._config.defaultsState).length>0?c({},this._config.defaultsState,t):t;this._stateStream.next(n)}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:X},{type:$},{type:A},{type:V},{type:nt},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var st=function(){function t(e,n){t.store=e,t.config=n}return t.store=null,t.config=null,t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:ut},{type:A}]},t}();var ct=function(){function t(){}return Object.defineProperty(t,"type",{get:function(){return"@@INIT"},enumerable:!0,configurable:!0}),t}(),pt=function(){function t(t){this.addedStates=t}return Object.defineProperty(t,"type",{get:function(){return"@@UPDATE_STATE"},enumerable:!0,configurable:!0}),t}();var ft=new o.ReplaySubject(1);var lt=function(){function t(t,n,r,o,i,a){void 0===i&&(i=[]),function(){try{var t=window.ng,n=!(!!t.probe&&!!t.coreTokens)&&e.isDevMode();ft.next(n)}catch(t){ft.next(!1)}finally{ft.complete()}}();var u=t.addAndReturnDefaults(i);n.setStateToTheCurrentWithNew(u),t.connectActionHandlers(),a.ngxsBootstrap(new ct,u)}return t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:nt},{type:$},{type:ut},{type:st},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[g]}]},{type:rt}]},t}(),ht=function(){function t(e,n,r,o,i){void 0===o&&(o=[]);var a=t.flattenStates(o),u=r.addAndReturnDefaults(a);u.states.length&&(n.setStateToTheCurrentWithNew(u),i.ngxsBootstrap(new pt(u.defaults),u))}return t.flattenStates=function(t){return void 0===t&&(t=[]),t.reduce((function(t,e){return t.concat(e)}),[])},t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:ut},{type:$},{type:nt},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[S]}]},{type:rt}]},t}(),yt=function(){function t(){}return t.forRoot=function(e,r){return void 0===e&&(e=[]),void 0===r&&(r={}),{ngModule:lt,providers:l([nt,tt,Y,H,n.NgxsBootstrapper,J,K,rt,z,W,$,V,ut,X,st,q],e,t.ngxsTokenProviders(e,r))}},t.forFeature=function(t){return void 0===t&&(t=[]),{ngModule:ht,providers:l([nt,q],t,[{provide:S,multi:!0,useValue:t}])}},t.ngxsTokenProviders=function(r,o){return[{provide:_,useValue:n.isAngularInTestMode},{provide:O,useValue:e.isDevMode},{provide:I,useClass:o.executionStrategy||d},{provide:g,useValue:r},{provide:t.ROOT_OPTIONS,useValue:o},{provide:A,useFactory:t.ngxsConfigFactory,deps:[t.ROOT_OPTIONS]},{provide:e.APP_BOOTSTRAP_LISTENER,useFactory:t.appBootstrapListenerFactory,multi:!0,deps:[n.NgxsBootstrapper]},{provide:n.INITIAL_STATE_TOKEN,useFactory:t.getInitialState},{provide:n.NGXS_STATE_CONTEXT_FACTORY,useExisting:tt},{provide:n.NGXS_STATE_FACTORY,useExisting:nt}]},t.ngxsConfigFactory=function(t){return Object.assign(new A,t)},t.appBootstrapListenerFactory=function(t){return function(){return t.bootstrap()}},t.getInitialState=function(){return n.InitialState.pop()},t.ROOT_OPTIONS=new e.InjectionToken("ROOT_OPTIONS"),t.decorators=[{type:e.NgModule}],t}();function dt(t){ft.asObservable().subscribe((function(e){e&&(t.ɵprov||console.warn(y[h.UNDECORATED_STATE_IN_IVY](t.name)))}))}var gt=36;function St(t,e,n){return void 0===n&&(n=[]),"string"==typeof(e=e||function(t){var e=t.length-1;return t.charCodeAt(e)===gt?t.slice(0,e):t}(t))?M(n.length?l([e],n):e.split("."),st.config):e}var vt=function(){function t(){}return t.prototype.enter=function(t){return t()},t.prototype.leave=function(t){return t()},t.decorators=[{type:e.Injectable}],t}(),_t=function(){function t(t){var e=this;this.name=t,w(this).makeRootSelector=function(t){return t.getStateGetter(e.name)}}return t.prototype.getName=function(){return this.name},t.prototype.toString=function(){return"StateToken["+this.name+"]"},t}();t.Action=function(t,e){return function(n,r){var o,i;if(n.hasOwnProperty("prototype"))throw new Error(y[h.ACTION_DECORATOR]());var a=x(n.constructor);Array.isArray(t)||(t=[t]);try{for(var u=p(t),s=u.next();!s.done;s=u.next()){var c=s.value.type;a.actions[c]||(a.actions[c]=[]),a.actions[c].push({fn:r,options:e||{},type:c})}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}},t.Actions=Y,t.InitState=ct,t.NGXS_PLUGINS=v,t.NgxsModule=yt,t.NgxsSimpleChange=N,t.NoopNgxsExecutionStrategy=vt,t.Select=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return(function(n,r){var o,i=r.toString(),a="__"+i+"__selector",u=St(i,t,e);Object.defineProperties(n,((o={})[a]={writable:!0,enumerable:!1,configurable:!0},o[i]={enumerable:!0,configurable:!0,get:function(){return this[a]||(this[a]=function(t){if(!st.store)throw new Error(y[h.SELECT_FACTORY_NOT_CONNECTED]());return st.store.select(t)}(u))}},o))})},t.Selector=function(t){return function(e,n,r){if(!(r&&null!==r.value))throw new Error(y[h.SELECTOR_DECORATOR]());var o=r.value,i=it(t,o,{containerClass:e,selectorName:n.toString(),getSelectorOptions:function(){return{}}}),a={configurable:!0,get:function(){return i}};return a.originalFn=o,a}},t.SelectorOptions=function(t){return function(e,n,r){if(n){var o=r.value||r.originalFn;o&&ot.defineOptions(o,t)}else ot.defineOptions(e,t)}},t.State=function(t){return function(e){dt(e);var n=e,r=x(n),o=Object.getPrototypeOf(n),i=function(e){var n=e[T]||{};return(c({},n,t))}(o);!function(t){var e=t.meta,n=t.inheritedStateClass,r=t.optionsWithInheritance,o=r.children,i=r.defaults,a=r.name,u="string"==typeof a?a:a&&a.getName()||null;if(et.checkCorrectStateName(u),n.hasOwnProperty(E)){var s=n[E]||{};e.actions=c({},e.actions,s.actions)}e.children=o,e.defaults=i,e.name=u}({meta:r,inheritedStateClass:o,optionsWithInheritance:i}),n[T]=i}},t.StateStream=X,t.StateToken=_t,t.Store=ut,t.UpdateState=pt,t.actionMatcher=function(t){var e=R(t);return(function(t){return e===R(t)})},t.createSelector=it,t.ensureSelectorMetadata=function(t){return w(t)},t.ensureStoreMetadata=function(t){return x(t)},t.getActionTypeFromInstance=R,t.getSelectorMetadata=function(t){return j(t)},t.getStoreMetadata=function(t){return P(t)},t.getValue=b,t.ofAction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t)},t.ofActionCanceled=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["CANCELED"])},t.ofActionCompleted=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["SUCCESSFUL","CANCELED","ERRORED"],U)},t.ofActionDispatched=F,t.ofActionErrored=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["ERRORED"])},t.ofActionSuccessful=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["SUCCESSFUL"])},t.setValue=C,t.ɵa=B,t.ɵb=H,t.ɵba=rt,t.ɵbb=ht,t.ɵbc=d,t.ɵc=g,t.ɵd=S,t.ɵe=_,t.ɵf=O,t.ɵg=m,t.ɵh=A,t.ɵi=I,t.ɵj=lt,t.ɵk=nt,t.ɵl=W,t.ɵm=z,t.ɵn=tt,t.ɵo=$,t.ɵp=q,t.ɵq=V,t.ɵr=J,t.ɵs=K,t.ɵv=x,t.ɵw=P,t.ɵx=w,t.ɵy=j,t.ɵz=st,Object.defineProperty(t,"__esModule",{value:!0})}));
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function u(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s,c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}var h={STATE_NAME:"STATE_NAME",STATE_UNIQUE:"STATE_UNIQUE",STATE_NAME_PROPERTY:"STATE_NAME_PROPERTY",STATE_DECORATOR:"STATE_DECORATOR",INCORRECT_PRODUCTION:"INCORRECT_PRODUCTION",INCORRECT_DEVELOPMENT:"INCORRECT_DEVELOPMENT",SELECT_FACTORY_NOT_CONNECTED:"SELECT_FACTORY_NOT_CONNECTED",ACTION_DECORATOR:"ACTION_DECORATOR",SELECTOR_DECORATOR:"SELECTOR_DECORATOR",ZONE_WARNING:"ZONE_WARNING",PATCHING_ARRAY:"PATCHING_ARRAY",PATCHING_PRIMITIVE:"PATCHING_PRIMITIVE",UNDECORATED_STATE_IN_IVY:"UNDECORATED_STATE_IN_IVY"},y=((s={})[h.STATE_NAME]=function(t){return t+" is not a valid state name. It needs to be a valid object property name."},s[h.STATE_NAME_PROPERTY]=function(){return"States must register a 'name' property"},s[h.STATE_UNIQUE]=function(t,e,n){return"State name '"+t+"' from "+e+" already exists in "+n},s[h.STATE_DECORATOR]=function(){return"States must be decorated with @State() decorator"},s[h.INCORRECT_PRODUCTION]=function(){return"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},s[h.INCORRECT_DEVELOPMENT]=function(){return"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},s[h.SELECT_FACTORY_NOT_CONNECTED]=function(){return"You have forgotten to import the NGXS module!"},s[h.ACTION_DECORATOR]=function(){return"@Action() decorator cannot be used with static methods"},s[h.SELECTOR_DECORATOR]=function(){return"Selectors only work on methods"},s[h.ZONE_WARNING]=function(){return"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })"},s[h.PATCHING_ARRAY]=function(){return"Patching arrays is not supported."},s[h.PATCHING_PRIMITIVE]=function(){return"Patching primitives is not supported."},s[h.UNDECORATED_STATE_IN_IVY]=function(t){return"'"+t+"' class should be decorated with @Injectable() right after the @State() decorator"},s),d=function(){function t(t,e){this._ngZone=t,this._platformId=e,this.verifyZoneIsNotNooped(this._ngZone)}return t.prototype.enter=function(t){return r.isPlatformServer(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)},t.prototype.leave=function(t){return this.runInsideAngular(t)},t.prototype.runInsideAngular=function(t){return e.NgZone.isInAngularZone()?t():this._ngZone.run(t)},t.prototype.runOutsideAngular=function(t){return e.NgZone.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()},t.prototype.verifyZoneIsNotNooped=function(t){t instanceof e.NgZone||console.warn(y[h.ZONE_WARNING]())},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.NgZone},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t}();var g=new e.InjectionToken("ROOT_STATE_TOKEN"),S=new e.InjectionToken("FEATURE_STATE_TOKEN"),v=new e.InjectionToken("NGXS_PLUGINS"),_=new e.InjectionToken("NG_TEST_MODE"),O=new e.InjectionToken("NG_DEV_MODE"),E="NGXS_META",T="NGXS_OPTIONS_META",m="NGXS_SELECTOR_META",A=function(){function t(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=d}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[]},t}();var N=function(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n};var I=new e.InjectionToken("NGXS_EXECUTION_STRATEGY");function R(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}var C=function(t,e,n){t=c({},t);var r=e.split("."),o=r.length-1;return r.reduce((function(t,e,r){return t[e]=r===o?n:Array.isArray(t[e])?t[e].slice():c({},t[e]),t&&t[e]}),t),t},b=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)};function x(t){if(!t.hasOwnProperty(E)){var e={name:null,actions:{},defaults:{},path:null,makeRootSelector:function(t){return t.getStateGetter(e.name)},children:[]};Object.defineProperty(t,E,{value:e})}return P(t)}function P(t){return t[E]}function w(t){if(!t.hasOwnProperty(m)){Object.defineProperty(t,m,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:function(){return{}}}})}return j(t)}function j(t){return t[m]}function M(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){var e=t.slice();return(function(t){return e.reduce((function(t,e){return t&&t[e]}),t)})}(t):function(t){for(var e=t,n="store."+e[0],r=0,o=e.length,i=n;++r<o;)i=i+" && "+(n=n+"."+e[r]);return new Function("store","return "+i+";")}(t)}function D(t,e){var n=b(e.currentAppState,t.path),r=b(e.newAppState,t.path);return new N(n,r,!t.isInitialised)}function F(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["DISPATCHED"])}function k(t,e,n){void 0===n&&(n=L);var r=t.reduce((function(t,e){return t[R(e)]=!0,t}),{}),o=e&&function(t){return t.reduce((function(t,e){return t[e]=!0,t}),{})}(e);return function(t){return t.pipe(function(t,e){return i.filter((function(n){var r=R(n.action),o=t[r],i=!e||e[n.status];return o&&i}))}(r,o),n())}}function U(){return i.map((function(t){var e=t.action,n=t.status;return({action:e,result:{successful:"SUCCESSFUL"===n,canceled:"CANCELED"===n,error:t.error}})}))}function L(){return i.map((function(t){return t.action}))}function G(t){return function(e){return new o.Observable((function(n){return e.subscribe({next:function(e){t.leave((function(){return n.next(e)}))},error:function(e){t.leave((function(){return n.error(e)}))},complete:function(){t.leave((function(){return n.complete()}))}})}))}}var V=function(){function t(t){this._executionStrategy=t}return t.prototype.enter=function(t){return this._executionStrategy.enter(t)},t.prototype.leave=function(t){return this._executionStrategy.leave(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[I]}]}]},t}();var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._itemQueue=[],e._busyPushingNext=!1,e}return u(e,t),e.prototype.next=function(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,t.prototype.next.call(this,e);this._itemQueue.length>0;){var n=this._itemQueue.pop();t.prototype.next.call(this,n)}this._busyPushingNext=!1}},e}(o.Subject);var H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(B),Y=function(t){function n(e,n){return t.call(this,(function(t){var r=e.pipe(G(n)).subscribe({next:function(e){return t.next(e)},error:function(e){return t.error(e)},complete:function(){return t.complete()}});t.add(r)}))||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[{type:H},{type:V}]},n}(o.Observable),Z=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.shift();return r.apply(void 0,l(e,[function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Z(t).apply(void 0,l(e))}]))}},X=function(t){function n(){return t.call(this,{})||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]},n}(o.BehaviorSubject),q=function(){function t(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}return Object.defineProperty(t.prototype,"rootPlugins",{get:function(){return this._parentManager&&this._parentManager.plugins||this.plugins},enumerable:!0,configurable:!0}),t.prototype.registerHandlers=function(){var t,e=this.getPluginHandlers();(t=this.rootPlugins).push.apply(t,l(e))},t.prototype.getPluginHandlers=function(){return(this._pluginHandlers||[]).map((function(t){return t.handle?t.handle.bind(t):t}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:Array,decorators:[{type:e.Inject,args:[v]},{type:e.Optional}]}]},t}();var W=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(o.Subject),z=function(){function t(t,e,n,r,o,i){this._errorHandler=t,this._actions=e,this._actionResults=n,this._pluginManager=r,this._stateStream=o,this._ngxsExecutionStrategy=i}return t.prototype.dispatch=function(t){var e=this,n=this._ngxsExecutionStrategy.enter((function(){return e.dispatchByEvents(t)}));return n.subscribe({error:function(t){return e._ngxsExecutionStrategy.leave((function(){try{e._errorHandler.handleError(t)}catch(t){}}))}}),n.pipe(G(this._ngxsExecutionStrategy))},t.prototype.dispatchByEvents=function(t){var e=this;return Array.isArray(t)?0===t.length?o.of(this._stateStream.getValue()):o.forkJoin(t.map((function(t){return e.dispatchSingle(t)}))):this.dispatchSingle(t)},t.prototype.dispatchSingle=function(t){var e=this;if(!R(t)){var n=new Error("This action doesn't have a type property: "+t.constructor.name);return o.throwError(n)}var r=this._stateStream.getValue(),a=this._pluginManager.plugins;return Z(l(a,[function(t,n){t!==r&&e._stateStream.next(t);var o=e.getActionResultStream(n);return o.subscribe((function(t){return e._actions.next(t)})),e._actions.next({action:n,status:"DISPATCHED"}),e.createDispatchObservable(o)}]))(r,t).pipe(i.shareReplay())},t.prototype.getActionResultStream=function(t){return this._actionResults.pipe(i.filter((function(e){return e.action===t&&"DISPATCHED"!==e.status})),i.take(1),i.shareReplay())},t.prototype.createDispatchObservable=function(t){var e=this;return t.pipe(i.exhaustMap((function(t){switch(t.status){case"SUCCESSFUL":return o.of(e._stateStream.getValue());case"ERRORED":return o.throwError(t.error);default:return o.EMPTY}}))).pipe(i.shareReplay())},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.ErrorHandler},{type:H},{type:W},{type:q},{type:X},{type:V}]},t}();var Q=function(t){Object.freeze(t);var e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach((function(r){!n.call(t,r)||e&&("caller"===r||"callee"===r||"arguments"===r)||null===t[r]||"object"!=typeof t[r]&&"function"!=typeof t[r]||Object.isFrozen(t[r])||Q(t[r])})),t},K=function(){function t(t,e){this.isDevMode=t,this.isTestMode=e}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[O]}]},{type:void 0,decorators:[{type:e.Inject,args:[_]}]}]},t}();var J=function(){function t(t,e){this._host=t,this._config=e}return Object.defineProperty(t.prototype,"isIncorrectProduction",{get:function(){return!this._host.isDevMode()&&this._config.developmentMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIncorrectDevelopment",{get:function(){return this._host.isDevMode()&&!this._config.developmentMode},enumerable:!0,configurable:!0}),t.prototype.verifyDevMode=function(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(y[h.INCORRECT_PRODUCTION]()):this.isIncorrectDevelopment&&console.warn(y[h.INCORRECT_DEVELOPMENT]()))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:K},{type:A}]},t}();var $=function(){function t(t,e,n,r){this._stateStream=t,this._dispatcher=e,this._config=n,r.verifyDevMode()}return t.prototype.getRootStateOperations=function(){var t=this,e={getState:function(){return t._stateStream.getValue()},setState:function(e){return t._stateStream.next(e)},dispatch:function(e){return t._dispatcher.dispatch(e)}};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(e):e},t.prototype.ensureStateAndActionsAreImmutable=function(t){return{getState:function(){return t.getState()},setState:function(e){var n=Q(e);return t.setState(n)},dispatch:function(e){return t.dispatch(e)}}},t.prototype.setStateToTheCurrentWithNew=function(t){var e=this.getRootStateOperations(),n=e.getState();e.setState(c({},n,t.defaults))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:X},{type:z},{type:A},{type:J}]},t}();var tt=function(){function t(t){this._internalStateOperations=t}return t.prototype.createStateContext=function(t){var e=this._internalStateOperations.getRootStateOperations();function n(e){return b(e,t.path)}function r(n,r){var o=C(n,t.path,r),i=t.instance;if(i.ngxsOnChanges){var a=D(t,{currentAppState:n,newAppState:o});i.ngxsOnChanges(a)}return e.setState(o),o}function o(t,e){return r(t,e(n(t)))}return{getState:function(){return n(e.getState())},patchState:function(t){return o(e.getState(),function(t){return function(e){if(Array.isArray(t))throw new Error(y[h.PATCHING_ARRAY]());if("object"!=typeof t)throw new Error(y[h.PATCHING_PRIMITIVE]());var n=c({},e);for(var r in t)n[r]=t[r];return(n)}}(t))},setState:function(t){var n=e.getState();return"function"==typeof t?o(n,t):r(n,t)},dispatch:function(t){return e.dispatch(t)}}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:$}]},t}();var et=function(){function t(){}return t.stateNameErrorMessage=function(t){return y[h.STATE_NAME](t)},t.checkCorrectStateName=function(t){if(!t)throw new Error(y[h.STATE_NAME_PROPERTY]());if(!this.stateNameRegex.test(t))throw new Error(this.stateNameErrorMessage(t))},t.checkStateNameIsUnique=function(t,e){var n=this.getValidStateMeta(t).name,r=e[n];if(r&&r!==t)throw new Error(y[h.STATE_UNIQUE](n,t.name,r.name));return n},t.getValidStateMeta=function(t){var e=P(t);if(!e)throw new Error(y[h.STATE_DECORATOR]());return e},t.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$"),t}();var nt=function(){function t(t,e,r,o,i,a,u){var s=this;this._injector=t,this._config=e,this._parentFactory=r,this._actions=o,this._actionResults=i,this._stateContextFactory=a,this._initialState=u,this._connected=!1,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=n.memoize((function(){var t=s;return s._parentFactory?s._parentFactory.getRuntimeSelectorContext():{getStateGetter:function(e){var n=t.statePaths[e];return n?M(n.split("."),t._config):function(){}},getSelectorOptions:function(e){var n=t._config.selectorOptions;return c({},n,e||{})}}}))}return Object.defineProperty(t.prototype,"states",{get:function(){return this._parentFactory?this._parentFactory.states:this._states},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statesByName",{get:function(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statePaths",{get:function(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths},enumerable:!0,configurable:!0}),t.cloneDefaults=function(t){var e,n={};return Array.isArray(t)?n=t.slice():n="object"==typeof(e=t)&&null!==e||"function"==typeof e?c({},t):void 0===t?{}:t,n},t.checkStatesAreValid=function(t){t.forEach(et.getValidStateMeta)},t.prototype.add=function(e){var n,r;t.checkStatesAreValid(e);var o=this.addToStatesMap(e).newStates;if(!o.length)return[];var i,a,u,s,c=function(t){var e=function(e){var n=t.find((function(t){return t===e}));if(!n)throw new Error("Child state not found: "+e+". \r\nYou may have forgotten to add states to module");return(n[E].name)};return t.reduce((function(t,n){var r=n[E],o=r.name,i=r.children;return t[o]=(i||[]).map(e),t}),{})}(o),f=(i=c,a=[],u={},s=function(t,e){void 0===e&&(e=[]),Array.isArray(e)||(e=[]),e.push(t),u[t]=!0,i[t].forEach((function(n){if(e.indexOf(n)>=0)throw new Error("Circular dependency '"+n+"' is required by '"+t+"': "+e.join(" -> "));u[n]||s(n,e.slice(0))})),a.indexOf(t)<0&&a.push(t)},Object.keys(i).forEach((function(t){return s(t)})),a.reverse()),l=function(t,e){void 0===e&&(e={});var n=function(t,e){for(var r in t)if(t.hasOwnProperty(r)&&t[r].indexOf(e)>=0){var o=n(t,r);return null!==o?o+"."+r:r}return null};for(var r in t)if(t.hasOwnProperty(r)){var o=n(t,r);e[r]=o?o+"."+r:r}return e}(c),h=o.reduce((function(t,e){return t[e[E].name]=e,t}),{}),y=[];try{for(var d=p(f),g=d.next();!g.done;g=d.next()){var S=g.value,v=h[S],_=l[S],O=v[E];this.addRuntimeInfoToMeta(O,_);var T={name:S,path:_,isInitialised:!1,actions:O.actions,instance:this._injector.get(v),defaults:t.cloneDefaults(O.defaults)};this.hasBeenMountedAndBootstrapped(S,_)||y.push(T),this.states.push(T)}}catch(t){n={error:t}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return y},t.prototype.addAndReturnDefaults=function(t){var e=t||[],n=this.add(e);return{defaults:n.reduce((function(t,e){return C(t,e.path,e.defaults)}),{}),states:n}},t.prototype.connectActionHandlers=function(){var t=this;this._connected||(this._actions.pipe(i.filter((function(t){return"DISPATCHED"===t.status})),i.mergeMap((function(e){var n=e.action;return t.invokeActions(t._actions,n).pipe(i.map((function(){return{action:n,status:"SUCCESSFUL"}})),i.defaultIfEmpty({action:n,status:"CANCELED"}),i.catchError((function(t){return o.of({action:n,status:"ERRORED",error:t})})))}))).subscribe((function(e){return t._actionResults.next(e)})),this._connected=!0)},t.prototype.invokeActions=function(t,e){var n,r,a,u,s=R(e),c=[];try{for(var f=p(this.states),l=f.next();!l.done;l=f.next()){var h=l.value,y=h.actions[s];if(y)try{for(var d=p(y),g=d.next();!g.done;g=d.next()){var S=g.value,v=this._stateContextFactory.createStateContext(h);try{var _=h.instance[S.fn](v,e);_ instanceof Promise&&(_=o.from(_)),_ instanceof o.Observable?(_=_.pipe(i.defaultIfEmpty({})),S.options.cancelUncompleted&&(_=_.pipe(i.takeUntil(t.pipe(F(e)))))):_=o.of({}).pipe(i.shareReplay()),c.push(_)}catch(t){c.push(o.throwError(t))}}}catch(t){a={error:t}}finally{try{g&&!g.done&&(u=d.return)&&u.call(d)}finally{if(a)throw a.error}}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return c.length||c.push(o.of({})),o.forkJoin(c)},t.prototype.addToStatesMap=function(t){var e,n,r=[],o=this.statesByName;try{for(var i=p(t),a=i.next();!a.done;a=i.next()){var u=a.value,s=et.checkStateNameIsUnique(u,o);!o[s]&&(r.push(u),o[s]=u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{newStates:r}},t.prototype.addRuntimeInfoToMeta=function(t,e){this.statePaths[t.name]=e,t.path=e},t.prototype.hasBeenMountedAndBootstrapped=function(t,e){var n=void 0!==b(this._initialState,e);return this.statesByName[t]&&n},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.Injector},{type:A},{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:H},{type:W},{type:tt},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var rt=function(){function t(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}return t.prototype.ngxsBootstrap=function(t,e){var n=this;this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(i.filter((function(){return!!e})),i.tap((function(){return n.invokeInit(e.states)})),i.mergeMap((function(){return n.bootstrapper.appBootstrapped$})),i.filter((function(t){return!!t}))).subscribe((function(){return n.invokeBootstrap(e.states)}))},t.prototype.invokeInit=function(t){var e,n;try{for(var r=p(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;if(a.ngxsOnChanges){var u=D(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});a.ngxsOnChanges(u)}a.ngxsOnInit&&a.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.invokeBootstrap=function(t){var e,n;try{for(var r=p(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;a.ngxsAfterBootstrap&&a.ngxsAfterBootstrap(this.getStateContext(i))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.getStateContext=function(t){return this.stateContextFactory.createStateContext(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:$},{type:tt},{type:n.NgxsBootstrapper}]},t}();var ot={getOptions:function(t){return t&&t.NGXS_SELECTOR_OPTIONS_META||{}},defineOptions:function(t,e){t&&(t.NGXS_SELECTOR_OPTIONS_META=e)}};function it(t,e,r){var o=r&&r.containerClass,i=n.memoize((function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(o,t);if(i instanceof Function){var a=n.memoize.apply(null,[i]);return a}return i}));Object.setPrototypeOf(i,e);var a=function(t,e){var n=w(t);n.originalFn=t;var r=function(){return{}};e&&(n.containerClass=e.containerClass,n.selectorName=e.selectorName,r=e.getSelectorOptions||r);var o=c({},n);return n.getSelectorOptions=function(){return function(t,e){return c({},ot.getOptions(t.containerClass)||{},ot.getOptions(t.originalFn)||{},t.getSelectorOptions()||{},e)}(o,r())},n}(e,r);return a.makeRootSelector=function(e){var n=function(t,e,n){void 0===n&&(n=[]);var r=e.getSelectorOptions(),o=t.getSelectorOptions(r),i=function(t,e,n){void 0===t&&(t=[]);var r=[],o=0===t.length||e.injectContainerState;if(n&&o){P(n)&&r.push(n)}t&&r.push.apply(r,l(t));return r}(n,o,e.containerClass).map((function(e){return at(e)(t)}));return{selectorOptions:o,argumentSelectorFunctions:i}}(e,a,t),r=n.argumentSelectorFunctions,o=n.selectorOptions;return(function(t){var e=r.map((function(e){return e(t)}));try{return i.apply(void 0,l(e))}catch(t){if(t instanceof TypeError&&o.suppressErrors)return;throw t}})},i}function at(t){var e=j(t)||P(t);return e&&e.makeRootSelector||function(){return t}}var ut=function(){function t(t,e,n,r,o,i){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=r,this._stateFactory=o,this.initStateStream(i)}return t.prototype.dispatch=function(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)},t.prototype.select=function(t){var e=this,n=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(i.map(n),i.catchError((function(t){var n=e._config.selectorOptions.suppressErrors;return t instanceof TypeError&&n?o.of(void 0):o.throwError(t)})),i.distinctUntilChanged(),G(this._internalExecutionStrategy))},t.prototype.selectOnce=function(t){return this.select(t).pipe(i.take(1))},t.prototype.selectSnapshot=function(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())},t.prototype.subscribe=function(t){return this._stateStream.pipe(G(this._internalExecutionStrategy)).subscribe(t)},t.prototype.snapshot=function(){return this._internalStateOperations.getRootStateOperations().getState()},t.prototype.reset=function(t){return this._internalStateOperations.getRootStateOperations().setState(t)},t.prototype.getStoreBoundSelectorFn=function(t){return at(t)(this._stateFactory.getRuntimeSelectorContext())},t.prototype.initStateStream=function(t){var e=this._stateStream.value;if(!e||0===Object.keys(e).length){var n=Object.keys(this._config.defaultsState).length>0?c({},this._config.defaultsState,t):t;this._stateStream.next(n)}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:X},{type:$},{type:A},{type:V},{type:nt},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var st=function(){function t(e,n){t.store=e,t.config=n}return t.store=null,t.config=null,t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:ut},{type:A}]},t}();var ct=function(){function t(){}return Object.defineProperty(t,"type",{get:function(){return"@@INIT"},enumerable:!0,configurable:!0}),t}(),pt=function(){function t(t){this.addedStates=t}return Object.defineProperty(t,"type",{get:function(){return"@@UPDATE_STATE"},enumerable:!0,configurable:!0}),t}();var ft=new o.ReplaySubject(1);var lt=function(){function t(t,n,r,o,i,a){void 0===i&&(i=[]),function(){try{var t=window.ng,n=!(!!t.probe&&!!t.coreTokens)&&e.isDevMode();ft.next(n)}catch(t){ft.next(!1)}finally{ft.complete()}}();var u=t.addAndReturnDefaults(i);n.setStateToTheCurrentWithNew(u),t.connectActionHandlers(),a.ngxsBootstrap(new ct,u)}return t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:nt},{type:$},{type:ut},{type:st},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[g]}]},{type:rt}]},t}(),ht=function(){function t(e,n,r,o,i){void 0===o&&(o=[]);var a=t.flattenStates(o),u=r.addAndReturnDefaults(a);u.states.length&&(n.setStateToTheCurrentWithNew(u),i.ngxsBootstrap(new pt(u.defaults),u))}return t.flattenStates=function(t){return void 0===t&&(t=[]),t.reduce((function(t,e){return t.concat(e)}),[])},t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:ut},{type:$},{type:nt},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[S]}]},{type:rt}]},t}(),yt=function(){function t(){}return t.forRoot=function(e,r){return void 0===e&&(e=[]),void 0===r&&(r={}),{ngModule:lt,providers:l([nt,tt,Y,H,n.NgxsBootstrapper,J,K,rt,z,W,$,V,ut,X,st,q],e,t.ngxsTokenProviders(e,r))}},t.forFeature=function(t){return void 0===t&&(t=[]),{ngModule:ht,providers:l([nt,q],t,[{provide:S,multi:!0,useValue:t}])}},t.ngxsTokenProviders=function(r,o){return[{provide:_,useValue:n.isAngularInTestMode},{provide:O,useValue:e.isDevMode},{provide:I,useClass:o.executionStrategy||d},{provide:g,useValue:r},{provide:t.ROOT_OPTIONS,useValue:o},{provide:A,useFactory:t.ngxsConfigFactory,deps:[t.ROOT_OPTIONS]},{provide:e.APP_BOOTSTRAP_LISTENER,useFactory:t.appBootstrapListenerFactory,multi:!0,deps:[n.NgxsBootstrapper]},{provide:n.INITIAL_STATE_TOKEN,useFactory:t.getInitialState},{provide:n.NGXS_STATE_CONTEXT_FACTORY,useExisting:tt},{provide:n.NGXS_STATE_FACTORY,useExisting:nt}]},t.ngxsConfigFactory=function(t){return Object.assign(new A,t)},t.appBootstrapListenerFactory=function(t){return function(){return t.bootstrap()}},t.getInitialState=function(){return n.InitialState.pop()},t.ROOT_OPTIONS=new e.InjectionToken("ROOT_OPTIONS"),t.decorators=[{type:e.NgModule}],t}();var dt=36;function gt(t,e,n){return void 0===n&&(n=[]),"string"==typeof(e=e||function(t){var e=t.length-1;return t.charCodeAt(e)===dt?t.slice(0,e):t}(t))?M(n.length?l([e],n):e.split("."),st.config):e}var St=function(){function t(){}return t.prototype.enter=function(t){return t()},t.prototype.leave=function(t){return t()},t.decorators=[{type:e.Injectable}],t}(),vt=function(){function t(t){var e=this;this.name=t,w(this).makeRootSelector=function(t){return t.getStateGetter(e.name)}}return t.prototype.getName=function(){return this.name},t.prototype.toString=function(){return"StateToken["+this.name+"]"},t}();t.Action=function(t,e){return function(n,r){var o,i;if(n.hasOwnProperty("prototype"))throw new Error(y[h.ACTION_DECORATOR]());var a=x(n.constructor);Array.isArray(t)||(t=[t]);try{for(var u=p(t),s=u.next();!s.done;s=u.next()){var c=s.value.type;a.actions[c]||(a.actions[c]=[]),a.actions[c].push({fn:r,options:e||{},type:c})}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}},t.Actions=Y,t.InitState=ct,t.NGXS_PLUGINS=v,t.NgxsModule=yt,t.NgxsSimpleChange=N,t.NoopNgxsExecutionStrategy=St,t.Select=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return(function(n,r){var o,i=r.toString(),a="__"+i+"__selector",u=gt(i,t,e);Object.defineProperties(n,((o={})[a]={writable:!0,enumerable:!1,configurable:!0},o[i]={enumerable:!0,configurable:!0,get:function(){return this[a]||(this[a]=function(t){if(!st.store)throw new Error(y[h.SELECT_FACTORY_NOT_CONNECTED]());return st.store.select(t)}(u))}},o))})},t.Selector=function(t){return function(e,n,r){if(!(r&&null!==r.value))throw new Error(y[h.SELECTOR_DECORATOR]());var o=r.value,i=it(t,o,{containerClass:e,selectorName:n.toString(),getSelectorOptions:function(){return{}}}),a={configurable:!0,get:function(){return i}};return a.originalFn=o,a}},t.SelectorOptions=function(t){return function(e,n,r){if(n){var o=r.value||r.originalFn;o&&ot.defineOptions(o,t)}else ot.defineOptions(e,t)}},t.State=function(t){return function(e){!function(t){ft.subscribe((function(e){e&&(t.ɵprov||console.warn(y[h.UNDECORATED_STATE_IN_IVY](t.name)))}))}(e);var n=e,r=x(n),o=Object.getPrototypeOf(n),i=function(e){var n=e[T]||{};return(c({},n,t))}(o);!function(t){var e=t.meta,n=t.inheritedStateClass,r=t.optionsWithInheritance,o=r.children,i=r.defaults,a=r.name,u="string"==typeof a?a:a&&a.getName()||null;if(et.checkCorrectStateName(u),n.hasOwnProperty(E)){var s=n[E]||{};e.actions=c({},e.actions,s.actions)}e.children=o,e.defaults=i,e.name=u}({meta:r,inheritedStateClass:o,optionsWithInheritance:i}),n[T]=i}},t.StateStream=X,t.StateToken=vt,t.Store=ut,t.UpdateState=pt,t.actionMatcher=function(t){var e=R(t);return(function(t){return e===R(t)})},t.createSelector=it,t.ensureSelectorMetadata=function(t){return w(t)},t.ensureStoreMetadata=function(t){return x(t)},t.getActionTypeFromInstance=R,t.getSelectorMetadata=function(t){return j(t)},t.getStoreMetadata=function(t){return P(t)},t.getValue=b,t.ofAction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t)},t.ofActionCanceled=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["CANCELED"])},t.ofActionCompleted=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["SUCCESSFUL","CANCELED","ERRORED"],U)},t.ofActionDispatched=F,t.ofActionErrored=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["ERRORED"])},t.ofActionSuccessful=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return k(t,["SUCCESSFUL"])},t.setValue=C,t.ɵa=B,t.ɵb=H,t.ɵba=rt,t.ɵbb=ht,t.ɵbc=d,t.ɵc=g,t.ɵd=S,t.ɵe=_,t.ɵf=O,t.ɵg=m,t.ɵh=A,t.ɵi=I,t.ɵj=lt,t.ɵk=nt,t.ɵl=W,t.ɵm=z,t.ɵn=tt,t.ɵo=$,t.ɵp=q,t.ɵq=V,t.ɵr=J,t.ɵs=K,t.ɵv=x,t.ɵw=P,t.ɵx=w,t.ɵy=j,t.ɵz=st,Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=ngxs-store.umd.min.js.map