mobx.umd.min.js 54 KB

1
  1. !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).mobx={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}var a="An invariant failed, however the error is obfuscated because this is an production build.",s=[];Object.freeze(s);var u={};Object.freeze(u);var c={};function l(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:c}function f(){return++Ce.mobxGuid}function p(e){throw h(!1,e),"X"}function h(e,t){if(!e)throw new Error("[mobx] "+(t||a))}function v(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var d=function(){};function y(e){return null!==e&&"object"==typeof e}function b(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function m(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function _(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return y(e)&&!0===e[n]}}function w(e){return void 0!==l().Map&&e instanceof l().Map}function O(e){return e instanceof Set}function S(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function A(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function x(e){return null===e?null:"object"==typeof e?""+e:e}function E(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function D(e,t){g(e,E(),t)}function j(e){return e[E()]=I,e}function k(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function I(){return this}var R=function(){function t(t){void 0===t&&(t="Atom@"+f()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.reportObserved=function(){return $e(this)},t.prototype.reportChanged=function(){Le(),function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.isTracing!==te.NONE&&Me(o,t),o.onBecomeStale()),o.dependenciesState=e.IDerivationState.STALE}}(this),Be()},t.prototype.toString=function(){return this.name},t}(),T=_("Atom",R);function C(e,t,n){void 0===t&&(t=d),void 0===n&&(n=d);var r=new R(e);return st(r,t),ut(r,n),r}function V(e,t){return e===t}var N={identity:V,structural:function(e,t){return vn(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||V(e,t)},shallow:function(e,t){return vn(e,t,1)}},P={},L={};function B(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in m(e,"__mobxDidRunLazyInitializers",!0),t){var r=t[n];r.propertyCreator(e,r.prop,r.descriptor,r.decoratorTarget,r.decoratorArguments)}}}function $(e,t){return function(){var n,o,i=function(o,i,a,s){if(!0===s)return t(o,i,a,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,"__mobxDecorators")){var u=o.__mobxDecorators;m(o,"__mobxDecorators",r({},u))}return o.__mobxDecorators[i]={prop:i,propertyCreator:t,descriptor:a,decoratorTarget:o,decoratorArguments:n},function(e,t){var n=t?P:L;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return B(this),this[e]},set:function(t){B(this),this[e]=t}})}(i,e)};return(2===(o=arguments).length||3===o.length)&&"string"==typeof o[1]||4===o.length&&!0===o[3]?(n=s,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function M(e,t,n){return gt(e)?e:Array.isArray(e)?Q.array(e,{name:n}):b(e)?Q.object(e,void 0,{name:n}):w(e)?Q.map(e,{name:n}):O(e)?Q.set(e,{name:n}):e}function U(e){return e}function G(e){var t=$(!0,function(t,n,r,o,i){rn(t,n,r?r.initializer?r.initializer.call(t):r.value:void 0,e)}),n=("undefined"!=typeof process&&process.env,t);return n.enhancer=e,n}var q={deep:!0,name:void 0,defaultDecorator:void 0},H={deep:!1,name:void 0,defaultDecorator:void 0};function z(e){return null==e?q:"string"==typeof e?{name:e,deep:!0}:e}function K(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?U:M}Object.freeze(q),Object.freeze(H);var W=G(M),J=G(function(e,t,n){return null==e?e:cn(e)||Wt(e)||Ft(e)||en(e)?e:Array.isArray(e)?Q.array(e,{name:n,deep:!1}):b(e)?Q.object(e,void 0,{name:n,deep:!1}):w(e)?Q.map(e,{name:n,deep:!1}):O(e)?Q.set(e,{name:n,deep:!1}):p(!1)}),X=G(U),Y=G(function(e,t,n){return vn(e,t)?t:e});var F={box:function(e,t){arguments.length>2&&Z("box");var n=z(t);return new xe(e,K(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&Z("shallowBox"),Q.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&Z("array");var n=z(t);return new Ut(e,K(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&Z("shallowArray"),Q.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&Z("map");var n=z(t);return new Xt(e,K(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&Z("shallowMap"),Q.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&Z("set");var n=z(t);return new Zt(e,K(n),n.name)},object:function(e,t,n){return"string"==typeof arguments[1]&&Z("object"),lt({},e,t,z(n))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&Z("shallowObject"),Q.object(e,{},{name:t,deep:!1})},ref:X,shallow:J,deep:W,struct:Y},Q=function(e,t,n){if("string"==typeof arguments[1])return W.apply(null,arguments);if(gt(e))return e;var r=b(e)?Q.object(e,t,n):Array.isArray(e)?Q.array(e,t):w(e)?Q.map(e,t):O(e)?Q.set(e,t):e;if(r!==e)return r;p(!1)};function Z(e){p("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(F).forEach(function(e){return Q[e]=F[e]});var ee,te,ne=$(!1,function(e,t,n,o,i){var a=n.get,s=n.set,u=i[0]||{};!function(e,t,n){var r=nn(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new De(n),Object.defineProperty(e,t,function(e){return an[e]||(an[e]={configurable:Ce.computedConfigurable,enumerable:!1,get:function(){return sn(this).read(this,e)},set:function(t){sn(this).write(this,e,t)}})}(t))}(e,t,r({get:a,set:s},u))}),re=ne({equals:N.structural}),oe=function(e,t,n){if("string"==typeof t)return ne.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return ne.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new De(r)};oe.struct=re,(ee=e.IDerivationState||(e.IDerivationState={}))[ee.NOT_TRACKING=-1]="NOT_TRACKING",ee[ee.UP_TO_DATE=0]="UP_TO_DATE",ee[ee.POSSIBLY_STALE=1]="POSSIBLY_STALE",ee[ee.STALE=2]="STALE",function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(te||(te={}));var ie=function(){return function(e){this.cause=e}}();function ae(e){return e instanceof ie}function se(t){switch(t.dependenciesState){case e.IDerivationState.UP_TO_DATE:return!1;case e.IDerivationState.NOT_TRACKING:case e.IDerivationState.STALE:return!0;case e.IDerivationState.POSSIBLY_STALE:for(var n=pe(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(je(a)){if(Ce.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return he(n),!0}if(t.dependenciesState===e.IDerivationState.STALE)return he(n),!0}}return ye(t),he(n),!1}}function ue(e){var t=e.observers.length>0;Ce.computationDepth>0&&t&&p(!1),Ce.allowStateChanges||!t&&"strict"!==Ce.enforceActions||p(!1)}function ce(t,n,r){var o=ve(!0);ye(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++Ce.runId;var i,a=Ce.trackingDerivation;if(Ce.trackingDerivation=t,!0===Ce.disableErrorBoundaries)i=n.call(r);else try{i=n.call(r)}catch(e){i=new ie(e)}return Ce.trackingDerivation=a,function(t){for(var n=t.observing,r=t.observing=t.newObserving,o=e.IDerivationState.UP_TO_DATE,i=0,a=t.unboundDepsCount,s=0;s<a;s++){var u=r[s];0===u.diffValue&&(u.diffValue=1,i!==s&&(r[i]=u),i++),u.dependenciesState>o&&(o=u.dependenciesState)}r.length=i,t.newObserving=null,a=n.length;for(;a--;){var u=n[a];0===u.diffValue&&Ne(u,t),u.diffValue=0}for(;i--;){var u=r[i];1===u.diffValue&&(u.diffValue=0,Ve(u,t))}o!==e.IDerivationState.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),t.observing.length,de(o),i}function le(t){var n=t.observing;t.observing=[];for(var r=n.length;r--;)Ne(n[r],t);t.dependenciesState=e.IDerivationState.NOT_TRACKING}function fe(e){var t=pe(),n=e();return he(t),n}function pe(){var e=Ce.trackingDerivation;return Ce.trackingDerivation=null,e}function he(e){Ce.trackingDerivation=e}function ve(e){var t=Ce.allowStateReads;return Ce.allowStateReads=e,t}function de(e){Ce.allowStateReads=e}function ye(t){if(t.dependenciesState!==e.IDerivationState.UP_TO_DATE){t.dependenciesState=e.IDerivationState.UP_TO_DATE;for(var n=t.observing,r=n.length;r--;)n[r].lowestObserverState=e.IDerivationState.UP_TO_DATE}}var be=0,me=1;function ge(e,t){var n=function(){return _e(e,t,this,arguments)};return n.isMobxAction=!0,n}function _e(e,t,n,r){var o=we(e,n,r);try{return t.apply(n,r)}catch(e){throw o.error=e,e}finally{Oe(o)}}function we(e,t,n){var r=Je()&&!!e,o=0;if(r){o=Date.now();var i=n&&n.length||0,a=new Array(i);if(i>0)for(var s=0;s<i;s++)a[s]=n[s];Ye({type:"action",name:e,object:t,arguments:a})}var u=pe();Le();var c={prevDerivation:u,prevAllowStateChanges:Se(!0),prevAllowStateReads:ve(!0),notifySpy:r,startTime:o,actionId:me++,parentActionId:be};return be=c.actionId,c}function Oe(e){be!==e.actionId&&p("invalid action stack. did you forget to finish an action?"),be=e.parentActionId,void 0!==e.error&&(Ce.suppressReactionErrors=!0),Ae(e.prevAllowStateChanges),de(e.prevAllowStateReads),Be(),he(e.prevDerivation),e.notifySpy&&Qe({time:Date.now()-e.startTime}),Ce.suppressReactionErrors=!1}function Se(e){var t=Ce.allowStateChanges;return Ce.allowStateChanges=e,t}function Ae(e){Ce.allowStateChanges=e}var xe=function(e){function t(t,n,r,o,i){void 0===r&&(r="ObservableValue@"+f()),void 0===o&&(o=!0),void 0===i&&(i=N.default);var a=e.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(t,void 0,r),o&&Je()&&Xe({type:"create",name:a.name,newValue:""+a.value}),a}return n(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==Ce.UNCHANGED){var n=Je();n&&Ye({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),n&&Qe()}},t.prototype.prepareNewValue=function(e){if(ue(this),Dt(this)){var t=kt(this,{object:this,type:"update",newValue:e});if(!t)return Ce.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?Ce.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),It(this)&&Tt(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return jt(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),Rt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return x(this.get())},t}(R);xe.prototype[A()]=xe.prototype.valueOf;var Ee=_("ObservableValue",xe),De=function(){function t(t){this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+f(),this.value=new ie(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=te.NONE,this.derivation=t.get,this.name=t.name||"ComputedValue@"+f(),t.set&&(this.setter=ge(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?N.structural:N.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==e.IDerivationState.UP_TO_DATE)return;t.lowestObserverState=e.IDerivationState.POSSIBLY_STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.dependenciesState=e.IDerivationState.POSSIBLY_STALE,o.isTracing!==te.NONE&&Me(o,t),o.onBecomeStale())}}(this)},t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.get=function(){this.isComputing&&p("Cycle detected in computation "+this.name+": "+this.derivation),0!==Ce.inBatch||0!==this.observers.length||this.keepAlive?($e(this),se(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.POSSIBLY_STALE?o.dependenciesState=e.IDerivationState.STALE:o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(t.lowestObserverState=e.IDerivationState.UP_TO_DATE)}}(this)):se(this)&&(this.warnAboutUntrackedRead(),Le(),this.value=this.computeValue(!1),Be());var t=this.value;if(ae(t))throw t.cause;return t},t.prototype.peek=function(){var e=this.computeValue(!1);if(ae(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){h(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else h(!1,!1)},t.prototype.trackAndCompute=function(){Je()&&Xe({object:this.scope,type:"compute",name:this.name});var t=this.value,n=this.dependenciesState===e.IDerivationState.NOT_TRACKING,r=this.computeValue(!0),o=n||ae(t)||ae(r)||!this.equals(t,r);return o&&(this.value=r),o},t.prototype.computeValue=function(e){var t;if(this.isComputing=!0,Ce.computationDepth++,e)t=ce(this,this.derivation,this.scope);else if(!0===Ce.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new ie(e)}return Ce.computationDepth--,this.isComputing=!1,t},t.prototype.suspend=function(){this.keepAlive||(le(this),this.value=void 0)},t.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return ot(function(){var i=n.get();if(!r||t){var a=pe();e({type:"update",object:n,newValue:i,oldValue:o}),he(a)}r=!1,o=i})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return x(this.get())},t}();De.prototype[A()]=De.prototype.valueOf;var je=_("ComputedValue",De),ke=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Ie=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}}(),Re=!0,Te=!1,Ce=function(){var e=l();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Re=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Ie).version&&(Re=!1),Re?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Ie):(setTimeout(function(){Te||p("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Ie)}();function Ve(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Ne(e,t){if(1===e.observers.length)e.observers.length=0,Pe(e);else{var n=e.observers,r=e.observersIndexes,o=n.pop();if(o!==t){var i=r[t.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[t.__mapid]}}function Pe(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,Ce.pendingUnobservations.push(e))}function Le(){Ce.inBatch++}function Be(){if(0==--Ce.inBatch){He();for(var e=Ce.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof De&&n.suspend())}Ce.pendingUnobservations=[]}}function $e(e){var t=Ce.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&Ce.inBatch>0&&Pe(e),!1)}function Me(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===te.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name);t.dependencies&&t.dependencies.forEach(function(t){return e(t,n,r+1)})}(ft(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof De?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var Ue=function(){function t(t,n,r,o){void 0===t&&(t="Reaction@"+f()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=n,this.errorHandler=r,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=te.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Ce.pendingReactions.push(this),He())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Le(),this._isScheduled=!1,se(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Je()&&Xe({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Be()}},t.prototype.track=function(e){Le();var t,n=Je();n&&(t=Date.now(),Ye({name:this.name,type:"reaction"})),this._isRunning=!0;var r=ce(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&le(this),ae(r)&&this.reportExceptionInDerivation(r.cause),n&&Qe({time:Date.now()-t}),Be()},t.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(Ce.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Ce.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Je()&&Xe({type:"error",name:this.name,message:n,error:""+e}),Ce.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Le(),le(this),Be()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){void 0===e&&(e=!1),At(this,e)},t}();var Ge=100,qe=function(e){return e()};function He(){Ce.inBatch>0||Ce.isRunningReactions||qe(ze)}function ze(){Ce.isRunningReactions=!0;for(var e=Ce.pendingReactions,t=0;e.length>0;){++t===Ge&&(console.error("Reaction doesn't converge to a stable state after "+Ge+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}Ce.isRunningReactions=!1}var Ke=_("Reaction",Ue);function We(e){var t=qe;qe=function(n){return e(function(){return t(n)})}}function Je(){return!!Ce.spyListeners.length}function Xe(e){if(Ce.spyListeners.length)for(var t=Ce.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function Ye(e){Xe(r(r({},e),{spyReportStart:!0}))}var Fe={spyReportEnd:!0};function Qe(e){Xe(e?r(r({},e),{spyReportEnd:!0}):Fe)}function Ze(e){return Ce.spyListeners.push(e),v(function(){Ce.spyListeners=Ce.spyListeners.filter(function(t){return t!==e})})}function et(){p(!1)}function tt(e){return function(t,n,r){if(r){if(r.value)return{value:ge(e,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return ge(e,o.call(this))}}}return function(e){return function(t,n,r){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){m(this,n,nt(e,t))}})}}(e).apply(this,arguments)}}var nt=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?ge(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?ge(e,t):1===arguments.length&&"string"==typeof e?tt(e):!0!==r?tt(t).apply(null,arguments):void(e[t]=ge(e.name||t,n.value))};function rt(e,t,n){m(e,t,ge(t,n.bind(e)))}function ot(e,t){void 0===t&&(t=u);var n,r=t&&t.name||e.name||"Autorun@"+f();if(!t.scheduler&&!t.delay)n=new Ue(r,function(){this.track(a)},t.onError,t.requiresObservable);else{var o=at(t),i=!1;n=new Ue(r,function(){i||(i=!0,o(function(){i=!1,n.isDisposed||n.track(a)}))},t.onError,t.requiresObservable)}function a(){e(n)}return n.schedule(),n.getDisposer()}nt.bound=function(e,t,n,r){return!0===r?(rt(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return rt(this,t,n.value||n.initializer.call(this)),this[t]},set:et}:{enumerable:!1,configurable:!0,set:function(e){rt(this,t,e)},get:function(){}}};var it=function(e){return e()};function at(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:it}function st(e,t,n){return ct("onBecomeObserved",e,t,n)}function ut(e,t,n){return ct("onBecomeUnobserved",e,t,n)}function ct(e,t,n,r){var o="function"==typeof r?ln(t,n):ln(t),i="function"==typeof r?r:n,a=o[e];return"function"!=typeof a?p(!1):(o[e]=function(){a.call(this),i.call(this)},function(){o[e]=a})}function lt(e,t,n,r){var o=(r=z(r)).defaultDecorator||(!1===r.deep?X:W);B(e),nn(e,r.name,o.enhancer),Le();try{for(var i in t){var a=Object.getOwnPropertyDescriptor(t,i),s=(n&&i in n?n[i]:a.get?ne:o)(e,i,a,!0);s&&Object.defineProperty(e,i,s)}}finally{Be()}return e}function ft(e,t){return pt(ln(e,t))}function pt(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n).map(pt)),r}function ht(e){var t,n={name:e.name};return(t=e).observers&&t.observers.length>0&&(n.observers=function(e){return e.observers}(e).map(ht)),n}var vt=0;function dt(){this.message="FLOW_CANCELLED"}function yt(e){"function"==typeof e.cancel&&e.cancel()}function bt(e,t){if(null==e)return!1;if(void 0!==t){if(!1===cn(e))return!1;if(!e.$mobx.values[t])return!1;var n=ln(e,t);return je(n)}return je(e)}function mt(e,t){if(null==e)return!1;if(void 0!==t){if(cn(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return cn(e)||!!e.$mobx||T(e)||Ke(e)||je(e)}function gt(e){return 1!==arguments.length&&p(!1),mt(e)}function _t(e){return cn(e)?e.$mobx.getKeys():Ft(e)?e._keys.slice():en(e)?S(e.keys()):Wt(e)?e.map(function(e,t){return t}):p(!1)}function wt(e,t){if(cn(e)){var n=fn(e);return n.getKeys(),!!n.values[t]}return Ft(e)?e.has(t):en(e)?e.has(t):Wt(e)?t>=0&&t<e.length:p(!1)}dt.prototype=Object.create(Error.prototype);var Ot={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function St(e,t,n,r){return r.detectCycles&&e.set(t,n),n}function At(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;"boolean"==typeof e[e.length-1]&&(n=e.pop());var r=function(e){switch(e.length){case 0:return Ce.trackingDerivation;case 1:return ln(e[0]);case 2:return ln(e[0],e[1])}}(e);if(!r)return p(!1);r.isTracing===te.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?te.BREAK:te.LOG}function xt(e,t){void 0===t&&(t=void 0),Le();try{return e.apply(t)}finally{Be()}}function Et(e,t,n){var r;"number"==typeof n.timeout&&(r=setTimeout(function(){if(!i.$mobx.isDisposed){i();var e=new Error("WHEN_TIMEOUT");if(!n.onError)throw e;n.onError(e)}},n.timeout)),n.name=n.name||"When@"+f();var o=ge(n.name+"-effect",t),i=ot(function(t){e()&&(t.dispose(),r&&clearTimeout(r),o())},n);return i}function Dt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function jt(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function kt(e,t){var n=pe();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o<i&&(h(!(t=r[o](t))||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{he(n)}}function It(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function Rt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),v(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Tt(e,t){var n=pe(),r=e.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](t);he(n)}}var Ct,Vt,Nt,Pt,Lt=(Ct=!1,Vt={},Object.defineProperty(Vt,"0",{set:function(){Ct=!0}}),Object.create(Vt)[0]=1,!1===Ct),Bt=0,$t=function(){return function(){}}();Nt=$t,Pt=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(Nt.prototype,Pt):void 0!==Nt.prototype.__proto__?Nt.prototype.__proto__=Pt:Nt.prototype=Pt,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty($t.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var Mt=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.atom=new R(e||"ObservableArray@"+f()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return jt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Rt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>Bt&&zt(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;ue(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=s),Dt(this)){var i=kt(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!i)return s;t=i.removedCount,n=i.added}var a=(n=0===n.length?n:n.map(function(e){return r.enhancer(e,void 0)})).length-t;this.updateArrayLength(o,a);var u=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,i([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var o=!this.owned&&Je(),i=It(this),a=i||o?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;o&&Ye(r(r({},a),{name:this.atom.name})),this.atom.reportChanged(),i&&Tt(this,a),o&&Qe()},e.prototype.notifyArraySplice=function(e,t,n){var o=!this.owned&&Je(),i=It(this),a=i||o?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;o&&Ye(r(r({},a),{name:this.atom.name})),this.atom.reportChanged(),i&&Tt(this,a),o&&Qe()},e}(),Ut=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableArray@"+f()),void 0===o&&(o=!1);var i=e.call(this)||this,a=new Mt(r,n,i,o);if(g(i,"$mobx",a),t&&t.length){var s=Se(!0);i.spliceWithArray(0,0,t),Ae(s)}return Lt&&Object.defineProperty(a.array,"0",Gt),i}return n(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return Wt(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,n){void 0===n&&(n=0),arguments.length;var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0),arguments.length;for(var r=this.peek(),o=r.length,i=n;i<o;i++)if(e.call(t,r[i],i,this))return i;return-1},t.prototype.splice=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,o=this.$mobx.values;r=e<t?i(o.slice(0,e),o.slice(e+1,t+1),[o[e]],o.slice(t+1)):i(o.slice(0,t),[o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,r=n.values;if(e<r.length){ue(n.atom);var o=r[e];if(Dt(n)){var i=kt(n,{type:"update",object:this,index:e,newValue:t});if(!i)return;t=i.newValue}(t=n.enhancer(t,o))!==o&&(r[e]=t,n.notifyArrayChildUpdate(e,t,o))}else{if(e!==r.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+r.length);n.spliceWithArray(e,0,[t])}},t}($t);D(Ut.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return j({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(Ut.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),m(Ut.prototype,k(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];h("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),m(Ut.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)m(e,t[n],e[t[n]])}(Ut.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var Gt=qt(0);function qt(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function Ht(e){Object.defineProperty(Ut.prototype,""+e,qt(e))}function zt(e){for(var t=Bt;t<e;t++)Ht(t);Bt=e}zt(1e3);var Kt=_("ObservableArrayAdministration",Mt);function Wt(e){return y(e)&&Kt(e.$mobx)}var Jt={},Xt=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableMap@"+f()),this.enhancer=t,this.name=n,this.$mobx=Jt,this._keys=new Ut(void 0,U,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!Ce.trackingDerivation)return this._has(e);var n=this._hasMap.get(e);if(!n){var r=n=new xe(this._has(e),U,this.name+"."+Yt(e)+"?",!1);this._hasMap.set(e,r),ut(r,function(){return t._hasMap.delete(e)})}return n.get()},e.prototype.set=function(e,t){var n=this._has(e);if(Dt(this)){var r=kt(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(Dt(this)&&!(i=kt(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var n=Je(),o=It(this),i=o||n?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return n&&Ye(r(r({},i),{name:this.name,key:e})),xt(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),o&&Tt(this,i),n&&Qe(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap.get(e);n&&n.setNewValue(t)},e.prototype._updateValue=function(e,t){var n=this._data.get(e);if((t=n.prepareNewValue(t))!==Ce.UNCHANGED){var o=Je(),i=It(this),a=i||o?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;o&&Ye(r(r({},a),{name:this.name,key:e})),n.setNewValue(t),i&&Tt(this,a),o&&Qe()}},e.prototype._addValue=function(e,t){var n=this;xt(function(){var r=new xe(t,n.enhancer,n.name+"."+Yt(e),!1);n._data.set(e,r),t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var o=Je(),i=It(this),a=i||o?{type:"add",object:this,name:e,newValue:t}:null;o&&Ye(r(r({},a),{name:this.name,key:e})),i&&Tt(this,a),o&&Qe()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[E()]()},e.prototype.values=function(){var e=this,t=0;return j({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return j({next:function(){if(t<e._keys.length){var n=e._keys[t++];return{value:[n,e.get(n)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var n=this;this._keys.forEach(function(r){return e.call(t,n.get(r),r,n)})},e.prototype.merge=function(e){var t=this;return Ft(e)&&(e=e.toJS()),xt(function(){b(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=o(e,2),r=n[0],i=n[1];return t.set(r,i)}):w(e)?e.constructor!==Map?p("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,n){return t.set(n,e)}):null!=e&&p("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;xt(function(){fe(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return xt(function(){for(var n,r=w(n=e)||Ft(n)?n:Array.isArray(n)?new Map(n):b(n)?new Map(Object.entries(n)):p("Cannot convert to map from '"+n+"'"),o=t._keys,i=Array.from(r.keys()),a=!1,s=0;s<o.length;s++){var u=o[s];o.length===i.length&&u!==i[s]&&(a=!0),r.has(u)||(a=!0,t.delete(u))}r.forEach(function(e,n){t._data.has(n)||(a=!0),t.set(n,e)}),a&&t._keys.replace(i)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(n){return t["symbol"==typeof n?n:Yt(n)]=e.get(n)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(n){return t.set(n,e.get(n))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return Yt(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return Rt(this,e)},e.prototype.intercept=function(e){return jt(this,e)},e}();function Yt(e){return e&&e.toString?e.toString():new String(e).toString()}D(Xt.prototype,function(){return this.entries()}),g(Xt.prototype,k(),"Map");var Ft=_("ObservableMap",Xt),Qt={},Zt=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableSet@"+f()),this.name=n,this.$mobx=Qt,this._data=new Set,this._atom=C(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,r){return t(e,r,n)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;xt(function(){fe(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var n=this;this._data.forEach(function(r){e.call(t,r,r,n)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if((ue(this._atom),Dt(this))&&!(o=kt(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){xt(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var n=Je(),r=It(this),o=r||n?{type:"add",object:this,newValue:e}:null;0,r&&Tt(this,o)}return this},e.prototype.delete=function(e){var t=this;if(Dt(this)&&!(o=kt(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var n=Je(),r=It(this),o=r||n?{type:"delete",object:this,oldValue:e}:null;return xt(function(){t._atom.reportChanged(),t._data.delete(e)}),r&&Tt(this,o),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=S(this.keys()),n=S(this.values());return j({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,n=0;return void 0!==this._data.values?e=S(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),j({next:function(){return n<e.length?{value:t.dehanceValue(e[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return en(e)&&(e=e.toJS()),xt(function(){Array.isArray(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):O(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!=e&&p("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return Rt(this,e)},e.prototype.intercept=function(e){return jt(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+S(this.keys()).join(", ")+" ]"},e}();D(Zt.prototype,function(){return this.values()}),g(Zt.prototype,k(),"Set");var en=_("ObservableSet",Zt),tn=function(){function e(e,t,n){this.target=e,this.name=t,this.defaultEnhancer=n,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,n){var o=this.target;o!==e&&this.illegalAccess(e,t);var i=this.values[t];if(i instanceof De)i.set(n);else{if(Dt(this)){if(!(u=kt(this,{type:"update",object:o,name:t,newValue:n})))return;n=u.newValue}if((n=i.prepareNewValue(n))!==Ce.UNCHANGED){var a=It(this),s=Je(),u=a||s?{type:"update",object:o,oldValue:i.value,name:t,newValue:n}:null;s&&Ye(r(r({},u),{name:this.name,key:t})),i.setNewValue(n),a&&Tt(this,u),s&&Qe()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(Dt(this))if(!(a=kt(this,{object:t,name:e,type:"remove"})))return;try{Le();var n=It(this),o=Je(),i=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var a=n||o?{type:"remove",object:t,oldValue:i,name:e}:null;o&&Ye(r(r({},a),{name:this.name,key:e})),n&&Tt(this,a),o&&Qe()}finally{Be()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return Rt(this,e)},e.prototype.intercept=function(e){return jt(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new Ut(Object.keys(this.values).filter(function(t){return e.values[t]instanceof xe}),U,"keys("+this.name+")",!0)),this.keys.slice()},e}();function nn(e,t,n){void 0===t&&(t=""),void 0===n&&(n=M);var r=e.$mobx;return r||(b(e)||(t=(e.constructor.name||"ObservableObject")+"@"+f()),t||(t="ObservableObject@"+f()),g(e,"$mobx",r=new tn(e,t,n)),r)}function rn(e,t,n,o){var i=nn(e);if(Dt(i)){var a=kt(i,{object:e,name:t,type:"add",newValue:n});if(!a)return;n=a.newValue}n=(i.values[t]=new xe(n,o,i.name+"."+t,!1)).value,Object.defineProperty(e,t,function(e){return on[e]||(on[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}(t)),i.keys&&i.keys.push(t),function(e,t,n,o){var i=It(e),a=Je(),s=i||a?{type:"add",object:t,name:n,newValue:o}:null;a&&Ye(r(r({},s),{name:e.name,key:n}));i&&Tt(e,s);a&&Qe()}(i,e,t,n)}var on=Object.create(null),an=Object.create(null);function sn(e){var t=e.$mobx;return t||(B(e),e.$mobx)}var un=_("ObservableObjectAdministration",tn);function cn(e){return!!y(e)&&(B(e),un(e.$mobx))}function ln(e,t){if("object"==typeof e&&null!==e){if(Wt(e))return void 0!==t&&p(!1),e.$mobx.atom;if(en(e))return e.$mobx;if(Ft(e)){var n=e;return void 0===t?ln(n._keys):((r=n._data.get(t)||n._hasMap.get(t))||p(!1),r)}var r;if(B(e),t&&!e.$mobx&&e[t],cn(e))return t?((r=e.$mobx.values[t])||p(!1),r):p(!1);if(T(e)||je(e)||Ke(e))return e}else if("function"==typeof e&&Ke(e.$mobx))return e.$mobx;return p(!1)}function fn(e,t){return e||p("Expecting some object"),void 0!==t?fn(ln(e,t)):T(e)||je(e)||Ke(e)?e:Ft(e)||en(e)?e:(B(e),e.$mobx?e.$mobx:void p(!1))}function pn(e,t){return(void 0!==t?ln(e,t):cn(e)||Ft(e)||en(e)?fn(e):ln(e)).name}var hn=Object.prototype.toString;function vn(e,t,n){return void 0===n&&(n=-1),function e(t,n,r,o,i){if(t===n)return 0!==t||1/t==1/n;if(null==t||null==n)return!1;if(t!=t)return n!=n;var a=typeof t;if("function"!==a&&"object"!==a&&"object"!=typeof n)return!1;t=dn(t);n=dn(n);var s=hn.call(t);if(s!==hn.call(n))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0==+t?1/+t==1/n:+t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(n)}var u="[object Array]"===s;if(!u){if("object"!=typeof t||"object"!=typeof n)return!1;var c=t.constructor,l=n.constructor;if(c!==l&&!("function"==typeof c&&c instanceof c&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in n)return!1}if(0===r)return!1;r<0&&(r=-1);o=o||[];i=i||[];var f=o.length;for(;f--;)if(o[f]===t)return i[f]===n;o.push(t);i.push(n);if(u){if((f=t.length)!==n.length)return!1;for(;f--;)if(!e(t[f],n[f],r-1,o,i))return!1}else{var p=Object.keys(t),h=void 0;if(f=p.length,Object.keys(n).length!==f)return!1;for(;f--;)if(h=p[f],!yn(n,h)||!e(t[h],n[h],r-1,o,i))return!1}o.pop();i.pop();return!0}(e,t,n)}function dn(e){return Wt(e)?e.peek():w(e)||Ft(e)?S(e.entries()):O(e)||en(e)?S(e.entries()):e}function yn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Ze,extras:{getDebugName:pn},$mobx:"$mobx"}),e.$mobx="$mobx",e.FlowCancellationError=dt,e.ObservableMap=Xt,e.ObservableSet=Zt,e.Reaction=Ue,e._allowStateChanges=function(e,t){var n,r=Se(e);try{n=t()}finally{Ae(r)}return n},e._allowStateChangesInsideComputed=function(e){var t,n=Ce.computationDepth;Ce.computationDepth=0;try{t=e()}finally{Ce.computationDepth=n}return t},e._endAction=Oe,e._getAdministration=fn,e._getGlobalState=function(){return Ce},e._interceptReads=function(e,t,n){var r;if(Ft(e)||Wt(e)||Ee(e))r=fn(e);else{if(!cn(e))return p(!1);if("string"!=typeof t)return p(!1);r=fn(e,t)}return void 0!==r.dehancer?p(!1):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})},e._isComputingDerivation=function(){return null!==Ce.trackingDerivation},e._resetGlobalState=function(){var e=new Ie;for(var t in e)-1===ke.indexOf(t)&&(Ce[t]=e[t]);Ce.allowStateChanges=!Ce.enforceActions},e._startAction=we,e.action=nt,e.autorun=ot,e.comparer=N,e.computed=oe,e.configure=function(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,o=e.disableErrorBoundaries,i=e.arrayBuffer,a=e.reactionScheduler,s=e.reactionRequiresObservable,u=e.observableRequiresReaction;if(!0===e.isolateGlobalState&&((Ce.pendingReactions.length||Ce.inBatch||Ce.isRunningReactions)&&p("isolateGlobalState should be called before MobX is running any reactions"),Te=!0,Re&&(0==--l().__mobxInstanceCount&&(l().__mobxGlobals=void 0),Ce=new Ie)),void 0!==t){var c=void 0;switch(t){case!0:case"observed":c=!0;break;case!1:case"never":c=!1;break;case"strict":case"always":c="strict";break;default:p("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}Ce.enforceActions=c,Ce.allowStateChanges=!0!==c&&"strict"!==c}void 0!==n&&(Ce.computedRequiresReaction=!!n),void 0!==s&&(Ce.reactionRequiresObservable=!!s),void 0!==u&&(Ce.observableRequiresReaction=!!u,Ce.allowStateReads=!Ce.observableRequiresReaction),void 0!==r&&(Ce.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors if this is on."),Ce.disableErrorBoundaries=!!o),"number"==typeof i&&zt(i),a&&We(a)},e.createAtom=C,e.decorate=function(e,t){var n="function"==typeof e?e.prototype:e,r=function(e){var r=t[e];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,e),i=r.reduce(function(t,r){return r(n,e,t)},o);i&&Object.defineProperty(n,e,i)};for(var o in t)r(o);return e},e.entries=function(e){return cn(e)?_t(e).map(function(t){return[t,e[t]]}):Ft(e)?_t(e).map(function(t){return[t,e.get(t)]}):en(e)?S(e.entries()):Wt(e)?e.map(function(e,t){return[t,e]}):p(!1)},e.extendObservable=lt,e.extendShallowObservable=function(e,t,n){return lt(e,t,n,H)},e.flow=function(e){1!==arguments.length&&p("Flow expects one 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var n,r=arguments,o=++vt,i=nt(t+" - runid: "+o+" - init",e).apply(this,r),a=void 0,s=new Promise(function(e,r){var s=0;function u(e){var n;a=void 0;try{n=nt(t+" - runid: "+o+" - yield "+s++,i.next).call(i,e)}catch(e){return r(e)}l(n)}function c(e){var n;a=void 0;try{n=nt(t+" - runid: "+o+" - yield "+s++,i.throw).call(i,e)}catch(e){return r(e)}l(n)}function l(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(a=Promise.resolve(t.value)).then(u,c);t.then(l,r)}n=r,u(void 0)});return s.cancel=nt(t+" - runid: "+o+" - cancel",function(){try{a&&yt(a);var e=i.return(),t=Promise.resolve(e.value);t.then(d,d),yt(t),n(new dt)}catch(e){n(e)}}),s}},e.get=function(e,t){if(wt(e,t))return cn(e)?e[t]:Ft(e)?e.get(t):Wt(e)?e[t]:p(!1)},e.getAtom=ln,e.getDebugName=pn,e.getDependencyTree=ft,e.getObserverTree=function(e,t){return ht(ln(e,t))},e.has=wt,e.intercept=function(e,t,n){return"function"==typeof n?function(e,t,n){return fn(e,t).intercept(n)}(e,t,n):function(e,t){return fn(e).intercept(t)}(e,t)},e.isAction=function(e){return"function"==typeof e&&!0===e.isMobxAction},e.isArrayLike=function(e){return Array.isArray(e)||Wt(e)},e.isBoxedObservable=Ee,e.isComputed=function(e){return arguments.length>1?p(!1):bt(e)},e.isComputedProp=function(e,t){return"string"!=typeof t?p(!1):bt(e,t)},e.isFlowCancellationError=function(e){return e instanceof dt},e.isObservable=gt,e.isObservableArray=Wt,e.isObservableMap=Ft,e.isObservableObject=cn,e.isObservableProp=function(e,t){return"string"!=typeof t?p(!1):mt(e,t)},e.isObservableSet=en,e.keys=_t,e.observable=Q,e.observe=function(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return fn(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return fn(e).observe(t,n)}(e,t,n)},e.onBecomeObserved=st,e.onBecomeUnobserved=ut,e.onReactionError=function(e){return Ce.globalReactionErrorHandlers.push(e),function(){var t=Ce.globalReactionErrorHandlers.indexOf(e);t>=0&&Ce.globalReactionErrorHandlers.splice(t,1)}},e.reaction=function(e,t,n){void 0===n&&(n=u),"boolean"==typeof n&&(n={fireImmediately:n});var r,o,i,a=n.name||"Reaction@"+f(),s=nt(a,n.onError?(r=n.onError,o=t,function(){try{return o.apply(this,arguments)}catch(e){r.call(this,e)}}):t),c=!n.scheduler&&!n.delay,l=at(n),p=!0,h=!1,v=n.compareStructural?N.structural:n.equals||N.default,d=new Ue(a,function(){p||c?y():h||(h=!0,l(y))},n.onError,n.requiresObservable);function y(){if(h=!1,!d.isDisposed){var t=!1;d.track(function(){var n=e(d);t=p||!v(i,n),i=n}),p&&n.fireImmediately&&s(i,d),p||!0!==t||s(i,d),p&&(p=!1)}}return d.schedule(),d.getDisposer()},e.remove=function(e,t){if(cn(e))e.$mobx.remove(t);else if(Ft(e))e.delete(t);else if(en(e))e.delete(t);else{if(!Wt(e))return p(!1);"number"!=typeof t&&(t=parseInt(t,10)),h(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}},e.runInAction=function(e,t){return _e("string"==typeof e?e:e.name||"<unnamed action>","function"==typeof e?e:t,this,void 0)},e.set=function e(t,n,r){if(2!==arguments.length||en(t))if(cn(t)){var o=t.$mobx;o.values[n]?o.write(t,n,r):rn(t,n,r,o.defaultEnhancer)}else if(Ft(t))t.set(n,r);else if(en(t))t.add(n);else{if(!Wt(t))return p(!1);"number"!=typeof n&&(n=parseInt(n,10)),h(n>=0,"Not a valid index: '"+n+"'"),Le(),n>=t.length&&(t.length=n+1),t[n]=r,Be()}else{Le();var i=n;try{for(var a in i)e(t,a,i[a])}finally{Be()}}},e.spy=Ze,e.toJS=function(e,t){var n;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=Ot),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(n=new Map),function e(t,n,r){if(!n.recurseEverything&&!gt(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Ee(t))return e(t.get(),n,r);if(gt(t)&&_t(t),!0===n.detectCycles&&null!==t&&r.has(t))return r.get(t);if(Wt(t)||Array.isArray(t)){var o=St(r,t,[],n),i=t.map(function(t){return e(t,n,r)});o.length=i.length;for(var a=0,s=i.length;a<s;a++)o[a]=i[a];return o}if(en(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===n.exportMapsAsObjects){var u=St(r,t,new Set,n);return t.forEach(function(t){u.add(e(t,n,r))}),u}var c=St(r,t,[],n);return t.forEach(function(t){c.push(e(t,n,r))}),c}if(Ft(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===n.exportMapsAsObjects){var l=St(r,t,new Map,n);return t.forEach(function(t,o){l.set(o,e(t,n,r))}),l}var f=St(r,t,{},n);return t.forEach(function(t,o){f[o]=e(t,n,r)}),f}var p=St(r,t,{},n);for(var h in t)p[h]=e(t[h],n,r);return p}(e,t,n)},e.trace=At,e.transaction=xt,e.untracked=fe,e.values=function(e){return cn(e)?_t(e).map(function(t){return e[t]}):Ft(e)?_t(e).map(function(t){return e.get(t)}):en(e)?S(e.values()):Wt(e)?e.slice():p(!1)},e.when=function(e,t,n){return 1===arguments.length||t&&"object"==typeof t?function(e,t){var n,o=new Promise(function(o,i){var a=Et(e,o,r(r({},t),{onError:i}));n=function(){a(),i("WHEN_CANCELLED")}});return o.cancel=n,o}(e,t):Et(e,t,n||{})},Object.defineProperty(e,"__esModule",{value:!0})});