text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@ngrx/store"),require("rxjs/ReplaySubject"),require("rxjs/operator/map"),require("rxjs/operator/merge"),require("rxjs/operator/observeOn"),require("rxjs/operator/scan"),require("rxjs/operator/skip"),require("rxjs/operator/withLatestFrom"),require("rxjs/scheduler/queue"),require("rxjs/Observable"),require("rxjs/observable/empty"),require("rxjs/operator/filter"),require("rxjs/operator/share"),require("rxjs/operator/switchMap"),require("rxjs/operator/takeUntil")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@ngrx/store","rxjs/ReplaySubject","rxjs/operator/map","rxjs/operator/merge","rxjs/operator/observeOn","rxjs/operator/scan","rxjs/operator/skip","rxjs/operator/withLatestFrom","rxjs/scheduler/queue","rxjs/Observable","rxjs/observable/empty","rxjs/operator/filter","rxjs/operator/share","rxjs/operator/switchMap","rxjs/operator/takeUntil"],e):e((t.ngrx=t.ngrx||{},t.ngrx.storeDevtools={}),t.ng.core,t.ngrx.store,t.Rx,t.Rx.Observable.prototype,t.Rx.Observable.prototype,t.Rx.Observable.prototype,t.Rx.Observable.prototype,t.Rx.Observable.prototype,t.Rx.Observable.prototype,t.Rx.Scheduler,t.Rx,t.Rx.Observable,t.Rx.Observable.prototype,t.Rx.Observable.prototype,t.Rx.Observable.prototype,t.Rx.Observable.prototype)}(this,function(exports,core,store,ReplaySubject,map,merge,observeOn,scan,skip,withLatestFrom,queue,Observable,empty,filter,share,switchMap,takeUntil){"use strict";function difference(t,e){return t.filter(function(t){return e.indexOf(t)<0})}function unliftState(t){return t.computedStates[t.currentStateIndex].state}function liftAction(t){return new PerformAction(t)}function applyOperators(t,e){return e.reduce(function(t,e){var o=e[0],r=e.slice(1);return o.apply(t,r)},t)}function computeNextEntry(t,e,o,r){if(r)return{state:o,error:"Interrupted by an error up the chain"};var n,i=o;try{i=t(o,e)}catch(t){n=t.toString(),console.error(t.stack||t)}return{state:i,error:n}}function recomputeStates(t,e,o,r,n,i,s,a){if(e>=t.length&&t.length===i.length)return t;for(var c=t.slice(0,e),p=e;p<i.length;p++){var u=i[p],l=n[u].action,f=c[p-1],O=f?f.state:r,d=f?f.error:void 0,S=s.indexOf(u)>-1?f:computeNextEntry(o,l,O,d);if(a){var T=Object.assign({},S,{sanitizedState:a(S.state,u)});c.push(T)}else c.push(S)}return c}function liftInitialState(t,e){return{monitorState:e(void 0,{}),nextActionId:1,actionsById:{0:liftAction(INIT_ACTION)},sanitizedActionsById:{0:liftAction(INIT_ACTION)},stagedActionIds:[0],skippedActionIds:[],committedState:t,currentStateIndex:0,computedStates:[]}}function liftReducerWith(t,e,o,r){return void 0===r&&(r={}),function(n){return function(i,s){function a(t){for(var e=t,o=O.slice(1,e+1),r=0;r<o.length;r++){if(I[r+1].error){e=r,o=O.slice(1,e+1);break}delete u[o[r]],delete l[o[r]]}d=d.filter(function(t){return-1===o.indexOf(t)}),O=[0].concat(O.slice(e+1)),S=I[e].state,I=I.slice(e),T=T>e?T-e:0}var c=i||e,p=c.monitorState,u=c.actionsById,l=c.sanitizedActionsById,f=c.nextActionId,O=c.stagedActionIds,d=c.skippedActionIds,S=c.committedState,T=c.currentStateIndex,I=c.computedStates;i||(u=Object.create(u),l=Object.create(l));var x=0;switch(s.type){case RESET:u={0:liftAction(INIT_ACTION)},l={0:liftAction(INIT_ACTION)},f=1,O=[0],d=[],S=t,T=0,I=[];break;case COMMIT:u={0:liftAction(INIT_ACTION)},l={0:liftAction(INIT_ACTION)},f=1,O=[0],d=[],S=I[T].state,T=0,I=[];break;case ROLLBACK:u={0:liftAction(INIT_ACTION)},l={0:liftAction(INIT_ACTION)},f=1,O=[0],d=[],T=0,I=[];break;case TOGGLE_ACTION:var A=s.id,v=d.indexOf(A);d=-1===v?[A].concat(d):d.filter(function(t){return t!==A}),x=O.indexOf(A);break;case SET_ACTIONS_ACTIVE:for(var E=s.start,h=s.end,m=s.active,y=[],_=E;_<h;_++)y.push(_);d=m?difference(d,y):d.concat(y),x=O.indexOf(E);break;case JUMP_TO_STATE:T=s.index,x=1/0;break;case JUMP_TO_ACTION:-1!==(v=O.indexOf(s.actionId))&&(T=v),x=1/0;break;case SWEEP:O=difference(O,d),d=[],T=Math.min(T,O.length-1);break;case PERFORM_ACTION:r.maxAge&&O.length===r.maxAge&&a(1),T===O.length-1&&T++;b=f++;u[b]=s,l[b]=r.actionSanitizer?liftAction(r.actionSanitizer(s.action,b)):s,x=(O=O.concat([b])).length-1;break;case IMPORT_STATE:p=(g=s.nextLiftedState).monitorState,u=g.actionsById,l=g.sanitizedActionsById,f=g.nextActionId,O=g.stagedActionIds,d=g.skippedActionIds,S=g.committedState,T=g.currentStateIndex,I=g.computedStates;break;case store.INIT:x=0,r.maxAge&&O.length>r.maxAge&&(I=recomputeStates(I,x,n,S,u,O,d,r.stateSanitizer),a(O.length-r.maxAge),x=1/0);break;case store.UPDATE:if(I.filter(function(t){return t.error}).length>0)x=0,r.maxAge&&O.length>r.maxAge&&(I=recomputeStates(I,x,n,S,u,O,d,r.stateSanitizer),a(O.length-r.maxAge),x=1/0);else{T===O.length-1&&T++;var b=f++;u[b]=new PerformAction(s),l[b]=new PerformAction(s),x=(O=O.concat([b])).length-1,I=recomputeStates(I,x,n,S,u,O,d,r.stateSanitizer),T=x,r.maxAge&&O.length>r.maxAge&&a(O.length-r.maxAge),x=1/0}break;default:x=1/0}return I=recomputeStates(I,x,n,S,u,O,d,r.stateSanitizer),p=o(p,s),{monitorState:p,actionsById:u,sanitizedActionsById:l,nextActionId:f,stagedActionIds:O,skippedActionIds:d,committedState:S,currentStateIndex:T,computedStates:I};var g}}}function createIsExtensionOrMonitorPresent(t,e){return Boolean(t)||e.monitor!==noMonitor}function createReduxDevtoolsExtension(){return"object"==typeof window&&void 0!==window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:null}function createStateObservable(t){return t.state}function noMonitor(){return null}function createConfig(t){var e={maxAge:!1,monitor:noMonitor,actionSanitizer:void 0,stateSanitizer:void 0,name:DEFAULT_NAME,serialize:!1,logOnly:!1,features:!1},o="function"==typeof t?t():t,r=!!o.logOnly&&{pause:!0,export:!0,test:!0},n=o.features||r,i=Object.assign({},e,{features:n},o);if(i.maxAge&&i.maxAge<2)throw new Error("Devtools 'maxAge' cannot be less than 2, got "+i.maxAge);return i}var __extends=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),StoreDevtoolsConfig=function(){return function(){}}(),STORE_DEVTOOLS_CONFIG=new core.InjectionToken("@ngrx/devtools Options"),INITIAL_OPTIONS=new core.InjectionToken("@ngrx/devtools Initial Config"),PERFORM_ACTION="PERFORM_ACTION",RESET="RESET",ROLLBACK="ROLLBACK",COMMIT="COMMIT",SWEEP="SWEEP",TOGGLE_ACTION="TOGGLE_ACTION",SET_ACTIONS_ACTIVE="SET_ACTIONS_ACTIVE",JUMP_TO_STATE="JUMP_TO_STATE",JUMP_TO_ACTION="JUMP_TO_ACTION",IMPORT_STATE="IMPORT_STATE",PerformAction=function(){return function(t,e){if(this.action=t,this.timestamp=e,this.type=PERFORM_ACTION,void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?')}}(),Reset=function(){return function(t){this.timestamp=t,this.type=RESET}}(),Rollback=function(){return function(t){this.timestamp=t,this.type=ROLLBACK}}(),Commit=function(){return function(t){this.timestamp=t,this.type=COMMIT}}(),Sweep=function(){return function(){this.type=SWEEP}}(),ToggleAction=function(){return function(t){this.id=t,this.type=TOGGLE_ACTION}}(),JumpToState=function(){return function(t){this.index=t,this.type=JUMP_TO_STATE}}(),JumpToAction=function(){return function(t){this.actionId=t,this.type=JUMP_TO_ACTION}}(),ImportState=function(){return function(t){this.nextLiftedState=t,this.type=IMPORT_STATE}}(),ExtensionActionTypes={START:"START",DISPATCH:"DISPATCH",STOP:"STOP",ACTION:"ACTION"},REDUX_DEVTOOLS_EXTENSION=new core.InjectionToken("Redux Devtools Extension"),DevtoolsExtension=function(){function DevtoolsExtension(t,e){this.config=e,this.instanceId="ngrx-store-"+Date.now(),this.devtoolsExtension=t,this.createActionStreams()}return DevtoolsExtension.prototype.notify=function(t,e){if(this.devtoolsExtension)if(t instanceof PerformAction){var o=unliftState(e);this.extensionConnection.send(t.action,o)}else this.devtoolsExtension.send(null,e,this.config,this.instanceId)},DevtoolsExtension.prototype.createChangesObservable=function(){var t=this;return this.devtoolsExtension?new Observable.Observable(function(e){var o={instanceId:t.instanceId,name:t.config.name,features:t.config.features,actionSanitizer:t.config.actionSanitizer};!1!==t.config.maxAge&&(o.maxAge=t.config.maxAge);var r=t.devtoolsExtension.connect(o);return t.extensionConnection=r,r.init(),r.subscribe(function(t){return e.next(t)}),r.unsubscribe}):empty.empty()},DevtoolsExtension.prototype.createActionStreams=function(){var t=this,e=share.share.call(this.createChangesObservable()),o=filter.filter.call(e,function(t){return t.type===ExtensionActionTypes.START}),r=filter.filter.call(e,function(t){return t.type===ExtensionActionTypes.STOP}),n=applyOperators(e,[[filter.filter,function(t){return t.type===ExtensionActionTypes.DISPATCH}],[map.map,function(e){return t.unwrapAction(e.payload)}]]),i=applyOperators(e,[[filter.filter,function(t){return t.type===ExtensionActionTypes.ACTION}],[map.map,function(e){return t.unwrapAction(e.payload)}]]),s=takeUntil.takeUntil.call(i,r),a=takeUntil.takeUntil.call(n,r);this.actions$=switchMap.switchMap.call(o,function(){return s}),this.liftedActions$=switchMap.switchMap.call(o,function(){return a})},DevtoolsExtension.prototype.unwrapAction=function(action){return"string"==typeof action?eval("("+action+")"):action},DevtoolsExtension}();DevtoolsExtension.decorators=[{type:core.Injectable}],DevtoolsExtension.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[REDUX_DEVTOOLS_EXTENSION]}]},{type:StoreDevtoolsConfig,decorators:[{type:core.Inject,args:[STORE_DEVTOOLS_CONFIG]}]}]};var INIT_ACTION={type:store.INIT},DevtoolsDispatcher=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(store.ActionsSubject);DevtoolsDispatcher.decorators=[{type:core.Injectable}],DevtoolsDispatcher.ctorParameters=function(){return[]};var StoreDevtools=function(){function t(t,e,o,r,n,i,s){var a=this,c=liftInitialState(i,s.monitor),p=liftReducerWith(i,c,s.monitor,s),u=applyOperators(e.asObservable(),[[skip.skip,1],[merge.merge,r.actions$],[map.map,liftAction],[merge.merge,t,r.liftedActions$],[observeOn.observeOn,queue.queue]]),l=map.map.call(o,p),f=new ReplaySubject.ReplaySubject(1),O=applyOperators(u,[[withLatestFrom.withLatestFrom,l],[scan.scan,function(t,e){var o=t.state,n=e[0],i=(0,e[1])(o,n);return r.notify(n,a.getSanitizedState(i,s.stateSanitizer)),{state:i,action:n}},{state:c,action:null}]]).subscribe(function(t){var e=t.state,o=t.action;if(f.next(e),o.type===PERFORM_ACTION){var r=o.action;n.next(r)}}),d=f.asObservable(),S=map.map.call(d,unliftState);this.stateSubscription=O,this.dispatcher=t,this.liftedState=d,this.state=S}return t.prototype.getSanitizedState=function(t,e){var o=e?t.computedStates.map(function(t){return{state:t.sanitizedState,error:t.error}}):t.computedStates;return Object.assign({},t,{actionsById:t.sanitizedActionsById,computedStates:o})},t.prototype.dispatch=function(t){this.dispatcher.next(t)},t.prototype.next=function(t){this.dispatcher.next(t)},t.prototype.error=function(t){},t.prototype.complete=function(){},t.prototype.performAction=function(t){this.dispatch(new PerformAction(t))},t.prototype.reset=function(){this.dispatch(new Reset)},t.prototype.rollback=function(){this.dispatch(new Rollback)},t.prototype.commit=function(){this.dispatch(new Commit)},t.prototype.sweep=function(){this.dispatch(new Sweep)},t.prototype.toggleAction=function(t){this.dispatch(new ToggleAction(t))},t.prototype.jumpToAction=function(t){this.dispatch(new JumpToAction(t))},t.prototype.jumpToState=function(t){this.dispatch(new JumpToState(t))},t.prototype.importState=function(t){this.dispatch(new ImportState(t))},t}();StoreDevtools.decorators=[{type:core.Injectable}],StoreDevtools.ctorParameters=function(){return[{type:DevtoolsDispatcher},{type:store.ActionsSubject},{type:store.ReducerObservable},{type:DevtoolsExtension},{type:store.ScannedActionsSubject},{type:void 0,decorators:[{type:core.Inject,args:[store.INITIAL_STATE]}]},{type:StoreDevtoolsConfig,decorators:[{type:core.Inject,args:[STORE_DEVTOOLS_CONFIG]}]}]};var IS_EXTENSION_OR_MONITOR_PRESENT=new core.InjectionToken("Is Devtools Extension or Monitor Present"),DEFAULT_NAME="NgRx Store DevTools",StoreDevtoolsModule=function(){function t(){}return t.instrument=function(e){return void 0===e&&(e={}),{ngModule:t,providers:[DevtoolsExtension,DevtoolsDispatcher,StoreDevtools,{provide:INITIAL_OPTIONS,useValue:e},{provide:IS_EXTENSION_OR_MONITOR_PRESENT,deps:[REDUX_DEVTOOLS_EXTENSION,STORE_DEVTOOLS_CONFIG],useFactory:createIsExtensionOrMonitorPresent},{provide:REDUX_DEVTOOLS_EXTENSION,useFactory:createReduxDevtoolsExtension},{provide:STORE_DEVTOOLS_CONFIG,deps:[INITIAL_OPTIONS],useFactory:createConfig},{provide:store.StateObservable,deps:[StoreDevtools],useFactory:createStateObservable},{provide:store.ReducerManagerDispatcher,useExisting:DevtoolsDispatcher}]}},t}();StoreDevtoolsModule.decorators=[{type:core.NgModule,args:[{}]}],StoreDevtoolsModule.ctorParameters=function(){return[]},exports.StoreDevtoolsModule=StoreDevtoolsModule,exports.StoreDevtools=StoreDevtools,exports.StoreDevtoolsConfig=StoreDevtoolsConfig,exports.ɵi=INITIAL_OPTIONS,exports.ɵh=STORE_DEVTOOLS_CONFIG,exports.ɵg=DevtoolsDispatcher,exports.ɵk=DevtoolsExtension,exports.ɵj=REDUX_DEVTOOLS_EXTENSION,exports.ɵa=IS_EXTENSION_OR_MONITOR_PRESENT,exports.ɵf=createConfig,exports.ɵb=createIsExtensionOrMonitorPresent,exports.ɵc=createReduxDevtoolsExtension,exports.ɵd=createStateObservable,exports.ɵe=noMonitor,Object.defineProperty(exports,"__esModule",{value:!0})});