/** MobX - (c) Michel Weststrate 2015, 2016 - MIT Licensed */
"use strict";function e(e,n,r,o){return 1===arguments.length&&"function"==typeof e?V(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof n?V(e,n):1===arguments.length&&"string"==typeof e?t(e):t(n).apply(null,arguments)}function t(e){return function(t,n,r){return r&&"function"==typeof r.value?(r.value=V(e,r.value),r.enumerable=!1,r.configurable=!0,r):Mt(e).apply(this,arguments)}}function n(e,t,n){var r="string"==typeof e?e:e.name||"<unnamed action>",o="function"==typeof e?e:t,i="function"==typeof e?t:n;return yt("function"==typeof o,"`runInAction` expects a function"),yt(0===o.length,"`runInAction` expects a function without arguments"),yt("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),M(r,o,i,void 0)}function r(e){return"function"==typeof e&&e.isMobxAction===!0}function o(e,t,n){function o(){s(u)}var i,s,a;"string"==typeof e?(i=e,s=t,a=n):"function"==typeof e&&(i=e.name||"Autorun@"+bt(),s=e,a=t),Fe(s,"autorun methods cannot have modifiers"),yt("function"==typeof s,"autorun expects a function"),yt(r(s)===!1,"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action."),a&&(s=s.bind(a));var u=new Yt(i,function(){this.track(o)});return u.schedule(),u.getDisposer()}function i(e,t,n,r){var i,s,a,u;"string"==typeof e?(i=e,s=t,a=n,u=r):"function"==typeof e&&(i="When@"+bt(),s=e,a=t,u=n);var c=o(i,function(e){if(s.call(u)){e.dispose();var t=q();a.call(u),Q(t)}});return c}function s(e,t,n){return mt("`autorunUntil` is deprecated, please use `when`."),i.apply(null,arguments)}function a(e,t,n,o){function i(){a(p)}var s,a,u,c;"string"==typeof e?(s=e,a=t,u=n,c=o):"function"==typeof e&&(s=e.name||"AutorunAsync@"+bt(),a=e,u=t,c=n),yt(r(a)===!1,"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action."),void 0===u&&(u=1),c&&(a=a.bind(c));var l=!1,p=new Yt(s,function(){l||(l=!0,setTimeout(function(){l=!1,p.isDisposed||p.track(i)},u))});return p.schedule(),p.getDisposer()}function u(t,n,r,o,i,s){function a(){if(!w.isDisposed){var e=!1;w.track(function(){var t=b(w);e=At(y,x,t),x=t}),m&&p&&l(x,w),m||e!==!0||l(x,w),m&&(m=!1)}}var u,c,l,p,f,h;"string"==typeof t?(u=t,c=n,l=r,p=o,f=i,h=s):(u=t.name||n.name||"Reaction@"+bt(),c=t,l=n,p=r,f=o,h=i),void 0===p&&(p=!1),void 0===f&&(f=0);var d=Ue(c,tn.Reference),v=d[0],b=d[1],y=v===tn.Structure;h&&(b=b.bind(h),l=e(u,l.bind(h)));var m=!0,g=!1,x=void 0,w=new Yt(u,function(){f<1?a():g||(g=!0,setTimeout(function(){g=!1,a()},f))});return w.schedule(),w.getDisposer()}function c(e,t,n,r){return("function"==typeof e||Be(e))&&arguments.length<3?"function"==typeof t?l(e,t,void 0):l(e,void 0,t):$t.apply(null,arguments)}function l(e,t,n){var r=Ue(e,tn.Recursive),o=r[0],i=r[1];return new Jt(i,n,o===tn.Structure,i.name,t)}function p(e,t){yt("function"==typeof e&&1===e.length,"createTransformer expects a function that accepts one argument");var n={},r=Xt.resetId,o=function(r){function o(t,n){r.call(this,function(){return e(n)},null,!1,"Transformer-"+e.name+"-"+t,void 0),this.sourceIdentifier=t,this.sourceObject=n}return Vt(o,r),o.prototype.onBecomeUnobserved=function(){var e=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],t&&t(e,this.sourceObject)},o}(Jt);return function(e){r!==Xt.resetId&&(n={},r=Xt.resetId);var t=f(e),i=n[t];return i?i.get():(i=n[t]=new o(t,e),i.get())}}function f(e){if(null===e||"object"!=typeof e)throw new Error("[mobx] transform expected some kind of object, got: "+e);var t=e.$transformId;return void 0===t&&(t=bt(),Tt(e,"$transformId",t)),t}function h(e,t){return J()||console.warn("[mobx.expr] 'expr' should only be used inside other reactive functions."),c(e,t).get()}function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return yt(arguments.length>=2,"extendObservable expected 2 or more arguments"),yt("object"==typeof e,"extendObservable expects an object as first argument"),yt(!fn(e),"extendObservable should not be used on maps, use map.merge instead"),t.forEach(function(t){yt("object"==typeof t,"all arguments of extendObservable should be objects"),yt(!O(t),"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540"),v(e,t,tn.Recursive,null)}),e}function v(e,t,n,r){var o=Qe(e,r,n);for(var i in t)if(Rt(t,i)){if(e===t&&!jt(e,i))continue;var s=Object.getOwnPropertyDescriptor(t,i);Ze(o,i,s)}return e}function b(e,t){return y(st(e,t))}function y(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=xt(e.observing).map(y)),t}function m(e,t){return g(st(e,t))}function g(e){var t={name:e.name};return ne(e)&&(t.observers=re(e).map(g)),t}function x(e,t,n){return"function"==typeof n?_(e,t,n):w(e,t)}function w(e,t){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),at(R(e)).intercept(t)):at(e).intercept(t)}function _(e,t,n){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),d(e,{property:e[t]}),_(e,t,n)):at(e,t).intercept(n)}function S(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(it(e)===!1)return!1;var n=st(e,t);return Gt(n)}return Gt(e)}function O(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(Ye(e)||fn(e))throw new Error("[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.");if(it(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return!!e.$mobx||Ft(e)||Zt(e)||Gt(e)}function A(e,t,n){return yt(arguments.length>=2&&arguments.length<=3,"Illegal decorator config",t),Et(e,t),yt(!n||!n.get,"@observable can not be used on getters, use @computed instead"),Ut.apply(null,arguments)}function R(e,t){if(void 0===e&&(e=void 0),"string"==typeof arguments[1])return A.apply(null,arguments);if(yt(arguments.length<3,"observable expects zero, one or two arguments"),O(e))return e;var n=Ue(e,tn.Recursive),r=n[0],o=n[1],i=r===tn.Reference?Nt.Reference:k(o);switch(i){case Nt.Array:case Nt.PlainObject:return ze(o,r);case Nt.Reference:case Nt.ComplexObject:return new mn(o,r);case Nt.ComplexFunction:throw new Error("[mobx.observable] To be able to make a function reactive it should not have arguments. If you need an observable reference to a function, use `observable(asReference(f))`");case Nt.ViewFunction:return mt("Use `computed(expr)` instead of `observable(expr)`"),c(e,t)}yt(!1,"Illegal State")}function k(e){return null===e||void 0===e?Nt.Reference:"function"==typeof e?e.length?Nt.ComplexFunction:Nt.ViewFunction:Dt(e)?Nt.Array:"object"==typeof e?St(e)?Nt.PlainObject:Nt.ComplexObject:Nt.Reference}function T(e,t,n,r){return"function"==typeof n?j(e,t,n,r):I(e,t,n)}function I(e,t,n){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),at(R(e)).observe(t,n)):at(e).observe(t,n)}function j(e,t,n,r){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),d(e,{property:e[t]}),j(e,t,n,r)):at(e,t).observe(n,r)}function E(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=null),O(e)){if(t&&null===n&&(n=[]),t&&null!==e&&"object"==typeof e)for(var o=0,i=n.length;o<i;o++)if(n[o][0]===e)return n[o][1];if(Ye(e)){var s=r([]),a=e.map(function(e){return E(e,t,n)});s.length=a.length;for(var o=0,i=a.length;o<i;o++)s[o]=a[o];return s}if(it(e)){var s=r({});for(var u in e)s[u]=E(e[u],t,n);return s}if(fn(e)){var c=r({});return e.forEach(function(e,r){return c[r]=E(e,t,n)}),c}if(gn(e))return E(e.get(),t,n)}return e}function L(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=null),mt("toJSlegacy is deprecated and will be removed in the next major. Use `toJS` instead. See #566"),e instanceof Date||e instanceof RegExp)return e;if(t&&null===n&&(n=[]),t&&null!==e&&"object"==typeof e)for(var o=0,i=n.length;o<i;o++)if(n[o][0]===e)return n[o][1];if(!e)return e;if(Dt(e)){var s=r([]),a=e.map(function(e){return L(e,t,n)});s.length=a.length;for(var o=0,i=a.length;o<i;o++)s[o]=a[o];return s}if(fn(e)){var u=r({});return e.forEach(function(e,r){return u[r]=L(e,t,n)}),u}if(gn(e))return L(e.get(),t,n);if("object"==typeof e){var s=r({});for(var c in e)s[c]=L(e[c],t,n);return s}return e}function C(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=null),mt("toJSON is deprecated. Use toJS instead"),L.apply(null,arguments)}function P(e){return console.log(e),e}function D(e,t){switch(arguments.length){case 0:if(e=Xt.trackingDerivation,!e)return P("whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested it's value.");break;case 2:e=st(e,t)}return e=st(e),Gt(e)?P(e.whyRun()):Zt(e)?P(e.whyRun()):void yt(!1,"whyRun can only be used on reactions and computed values")}function V(e,t){yt("function"==typeof t,"`action` can only be invoked on functions"),yt("string"==typeof e&&e.length>0,"actions should have valid names, got: '"+e+"'");var n=function(){return M(e,t,this,arguments)};return n.isMobxAction=!0,n}function M(e,t,n,r){yt(!Gt(Xt.trackingDerivation),"Computed values or transformers should not invoke actions or trigger other side effects");var o,i=me();if(i){o=Date.now();var s=r&&r.length||0,a=new Array(s);if(s>0)for(var u=0;u<s;u++)a[u]=r[u];xe({type:"action",name:e,fn:t,target:n,arguments:a})}var c=q();Ae(e,n,!1);var l=B(!0);try{return t.apply(n,r)}finally{z(l),Re(!1),Q(c),i&&we({time:Date.now()-o})}}function $(e){return 0===arguments.length?(mt("`useStrict` without arguments is deprecated, use `isStrictModeEnabled()` instead"),Xt.strictMode):(yt(null===Xt.trackingDerivation,"It is not allowed to set `useStrict` when a derivation is running"),Xt.strictMode=e,Xt.allowStateChanges=!e,void 0)}function U(){return Xt.strictMode}function N(e,t){var n=B(e),r=t();return z(n),r}function B(e){var t=Xt.allowStateChanges;return Xt.allowStateChanges=e,t}function z(e){Xt.allowStateChanges=e}function F(e){switch(e.dependenciesState){case Kt.UP_TO_DATE:return!1;case Kt.NOT_TRACKING:case Kt.STALE:return!0;case Kt.POSSIBLY_STALE:var t=!0,n=q();try{for(var r=e.observing,o=r.length,i=0;i<o;i++){var s=r[i];if(Gt(s)&&(s.get(),e.dependenciesState===Kt.STALE))return t=!1,Q(n),!0}return t=!1,Z(e),Q(n),!1}finally{t&&Z(e)}}}function J(){return null!==Xt.trackingDerivation}function G(){Xt.allowStateChanges||yt(!1,Xt.strictMode?"It is not allowed to create or change state outside an `action` when MobX is in strict mode. Wrap the current method in `action` if this state change is intended":"It is not allowed to change the state when a computed value or transformer is being evaluated. Use 'autorun' to create reactive functions with side-effects.")}function K(e,t){Z(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Xt.runId;var n=Xt.trackingDerivation;Xt.trackingDerivation=e;var r,o=!0;try{r=t.call(e),o=!1}finally{o?W(e):(Xt.trackingDerivation=n,H(e))}return r}function W(e){var t="[mobx] An uncaught exception occurred while calculating your computed value, autorun or transformer. Or inside the render() method of an observer based React component. These functions should never throw exceptions as MobX will not always be able to recover from them. "+("Please fix the error reported after this message or enable 'Pause on (caught) exceptions' in your debugger to find the root cause. In: '"+e.name+"'. ")+"For more details see https://github.com/mobxjs/mobx/issues/462";me()&&ge({type:"error",message:t}),console.warn(t),Z(e),e.newObserving=null,e.unboundDepsCount=0,e.recoverFromError(),ce(),te()}function H(e){var t=e.observing,n=e.observing=e.newObserving;e.newObserving=null;for(var r=0,o=e.unboundDepsCount,i=0;i<o;i++){var s=n[i];0===s.diffValue&&(s.diffValue=1,r!==i&&(n[r]=s),r++)}for(n.length=r,o=t.length;o--;){var s=t[o];0===s.diffValue&&se(s,e),s.diffValue=0}for(;r--;){var s=n[r];1===s.diffValue&&(s.diffValue=0,ie(s,e))}}function X(e){for(var t=e.observing,n=t.length;n--;)se(t[n],e);e.dependenciesState=Kt.NOT_TRACKING,t.length=0}function Y(e){var t=q(),n=e();return Q(t),n}function q(){var e=Xt.trackingDerivation;return Xt.trackingDerivation=null,e}function Q(e){Xt.trackingDerivation=e}function Z(e){if(e.dependenciesState!==Kt.UP_TO_DATE){e.dependenciesState=Kt.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=Kt.UP_TO_DATE}}function ee(){}function te(){Xt.resetId++;var e=new Ht;for(var t in e)Wt.indexOf(t)===-1&&(Xt[t]=e[t]);Xt.allowStateChanges=!Xt.strictMode}function ne(e){return e.observers&&e.observers.length>0}function re(e){return e.observers}function oe(e){for(var t=e.observers,n=e.observersIndexes,r=t.length,o=0;o<r;o++){var i=t[o].__mapid;o?yt(n[i]===o,"INTERNAL ERROR maps derivation.__mapid to index in list"):yt(!(i in n),"INTERNAL ERROR observer on index 0 shouldnt be held in map.")}yt(0===t.length||Object.keys(n).length===t.length-1,"INTERNAL ERROR there is no junk in map")}function ie(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 se(e,t){if(1===e.observers.length)e.observers.length=0,ae(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 ae(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,Xt.pendingUnobservations.push(e))}function ue(){Xt.inBatch++}function ce(){if(1===Xt.inBatch){for(var e=Xt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Xt.pendingUnobservations=[]}Xt.inBatch--}function le(e){var t=Xt.trackingDerivation;null!==t?t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e):0===e.observers.length&&ae(e)}function pe(e,t){var n=re(e).reduce(function(e,t){return Math.min(e,t.dependenciesState)},2);if(!(n>=e.lowestObserverState))throw new Error("lowestObserverState is wrong for "+t+" because "+n+" < "+e.lowestObserverState)}function fe(e){if(e.lowestObserverState!==Kt.STALE){e.lowestObserverState=Kt.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Kt.UP_TO_DATE&&r.onBecomeStale(),r.dependenciesState=Kt.STALE}}}function he(e){if(e.lowestObserverState!==Kt.STALE){e.lowestObserverState=Kt.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Kt.POSSIBLY_STALE?r.dependenciesState=Kt.STALE:r.dependenciesState===Kt.UP_TO_DATE&&(e.lowestObserverState=Kt.UP_TO_DATE)}}}function de(e){if(e.lowestObserverState===Kt.UP_TO_DATE){e.lowestObserverState=Kt.POSSIBLY_STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Kt.UP_TO_DATE&&(r.dependenciesState=Kt.POSSIBLY_STALE,r.onBecomeStale())}}}function ve(){Xt.isRunningReactions===!0||Xt.inTransaction>0||Qt(be)}function be(){Xt.isRunningReactions=!0;for(var e=Xt.pendingReactions,t=0;e.length>0;){if(++t===qt)throw te(),new Error("Reaction doesn't converge to a stable state after "+qt+" iterations. Probably there is a cycle in the reactive function: "+e[0]);for(var n=e.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}Xt.isRunningReactions=!1}function ye(e){var t=Qt;Qt=function(n){return e(function(){return t(n)})}}function me(){return!!Xt.spyListeners.length}function ge(e){if(!Xt.spyListeners.length)return!1;for(var t=Xt.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function xe(e){var t=Ot({},e,{spyReportStart:!0});ge(t)}function we(e){ge(e?Ot({},e,en):en)}function _e(e){return Xt.spyListeners.push(e),gt(function(){var t=Xt.spyListeners.indexOf(e);t!==-1&&Xt.spyListeners.splice(t,1)})}function Se(e){return mt("trackTransitions is deprecated. Use mobx.spy instead"),"boolean"==typeof e&&(mt("trackTransitions only takes a single callback function. If you are using the mobx-react-devtools, please update them first"),e=arguments[1]),e?_e(e):(mt("trackTransitions without callback has been deprecated and is a no-op now. If you are using the mobx-react-devtools, please update them first"),function(){})}function Oe(e,t,n){void 0===t&&(t=void 0),void 0===n&&(n=!0),Ae(e.name||"anonymous transaction",t,n);try{return e.call(t)}finally{Re(n)}}function Ae(e,t,n){void 0===t&&(t=void 0),void 0===n&&(n=!0),ue(),Xt.inTransaction+=1,n&&me()&&xe({type:"transaction",target:t,name:e})}function Re(e){void 0===e&&(e=!0),0===--Xt.inTransaction&&ve(),e&&me()&&we(),ce()}function ke(e){return e.interceptors&&e.interceptors.length>0}function Te(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),gt(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function Ie(e,t){var n=q();try{for(var r=e.interceptors,o=0,i=r.length;o<i&&(t=r[o](t),yt(!t||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{Q(n)}}function je(e){return e.changeListeners&&e.changeListeners.length>0}function Ee(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),gt(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function Le(e,t){var n=q(),r=e.changeListeners;if(r){r=r.slice();for(var o=0,i=r.length;o<i;o++)Array.isArray(t)?r[o].apply(null,t):r[o](t);Q(n)}}function Ce(e,t){return Fe(t,"Modifiers are not allowed to be nested"),{mobxModifier:e,value:t}}function Pe(e){return e?e.mobxModifier||null:null}function De(e){return Ce(tn.Reference,e)}function Ve(e){return Ce(tn.Structure,e)}function Me(e){return Ce(tn.Flat,e)}function $e(e,t){return qe(e,t)}function Ue(e,t){var n=Pe(e);return n?[n,e.value]:[t,e]}function Ne(e){if(void 0===e)return tn.Recursive;var t=Pe(e);return yt(null!==t,"Cannot determine value mode from function. Please pass in one of these: mobx.asReference, mobx.asStructure or mobx.asFlat, got: "+e),t}function Be(e){return void 0!==e.mobxModifier}function ze(e,t,n){var r;if(O(e))return e;switch(t){case tn.Reference:return e;case tn.Flat:Fe(e,"Items inside 'asFlat' cannot have modifiers"),r=tn.Reference;break;case tn.Structure:Fe(e,"Items inside 'asStructure' cannot have modifiers"),r=tn.Structure;break;case tn.Recursive:o=Ue(e,tn.Recursive),r=o[0],e=o[1];break;default:yt(!1,"Illegal State")}return Array.isArray(e)?He(e,r,n):St(e)&&Object.isExtensible(e)?v(e,e,r,n):e;var o}function Fe(e,t){if(null!==Pe(e))throw new Error("[mobx] asStructure / asReference / asFlat cannot be used here. "+t)}function Je(e){var t=Ge(e),n=Ke(e);Object.defineProperty(an.prototype,""+e,{enumerable:!1,configurable:!0,set:t,get:n})}function Ge(e){return function(t){var n=this.$mobx,r=n.values;if(Fe(t,"Modifiers cannot be used on array values. For non-reactive array values use makeReactive(asFlat(array))."),e<r.length){G();var o=r[e];if(ke(n)){var i=Ie(n,{type:"update",object:n.array,index:e,newValue:t});if(!i)return;t=i.newValue}t=n.makeReactiveArrayItem(t);var s=n.mode===tn.Structure?!Ct(o,t):o!==t;s&&(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])}}}function Ke(e){return function(){var t=this.$mobx;return t&&e<t.values.length?(t.atom.reportObserved(),t.values[e]):void 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")}}function We(e){for(var t=rn;t<e;t++)Je(t);rn=e}function He(e,t,n){return new an(e,t,n)}function Xe(e){return mt("fastArray is deprecated. Please use `observable(asFlat([]))`"),He(e,tn.Flat,null)}function Ye(e){return _t(e)&&cn(e.$mobx)}function qe(e,t){return new pn(e,t)}function Qe(e,t,n){if(void 0===n&&(n=tn.Recursive),it(e))return e.$mobx;St(e)||(t=e.constructor.name+"@"+bt()),t||(t="ObservableObject@"+bt());var r=new hn(e,t,n);return It(e,"$mobx",r),r}function Ze(e,t,n){e.values[t]?(yt("value"in n,"cannot redefine property "+t),e.target[t]=n.value):"value"in n?et(e,t,n.value,!0,void 0):et(e,t,n.get,!0,n.set)}function et(e,t,n,o,i){o&&Et(e.target,t);var s,a=e.name+"."+t,u=!0;if(Gt(n))s=n,n.name=a,n.scope||(n.scope=e.target);else if("function"!=typeof n||0!==n.length||r(n))if(Pe(n)===tn.Structure&&"function"==typeof n.value&&0===n.value.length)s=new Jt(n.value,e.target,(!0),a,i);else{if(u=!1,ke(e)){var c=Ie(e,{object:e.target,name:t,type:"add",newValue:n});if(!c)return;n=c.newValue}s=new mn(n,e.mode,a,(!1)),n=s.value}else s=new Jt(n,e.target,(!1),a,i);e.values[t]=s,o&&Object.defineProperty(e.target,t,u?nt(t):tt(t)),u||ot(e,e.target,t,n)}function tt(e){var t=dn[e];return t?t:dn[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[e].get()},set:function(t){rt(this,e,t)}}}function nt(e){var t=vn[e];return t?t:vn[e]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[e].get()},set:function(t){return this.$mobx.values[e].set(t)}}}function rt(e,t,n){var r=e.$mobx,o=r.values[t];if(ke(r)){var i=Ie(r,{type:"update",object:e,name:t,newValue:n});if(!i)return;n=i.newValue}if(n=o.prepareNewValue(n),n!==yn){var s=je(r),a=me(),i=s||a?{type:"update",object:e,oldValue:o.value,name:t,newValue:n}:null;a&&xe(i),o.setNewValue(n),s&&Le(r,i),a&&we()}}function ot(e,t,n,r){var o=je(e),i=me(),s=o||i?{type:"add",object:t,name:n,newValue:r}:null;i&&xe(s),o&&Le(e,s),i&&we()}function it(e){return!!_t(e)&&(pt(e),bn(e.$mobx))}function st(e,t){if("object"==typeof e&&null!==e){if(Ye(e))return yt(void 0===t,"It is not possible to get index atoms from arrays"),e.$mobx.atom;if(fn(e)){if(void 0===t)return st(e._keys);var n=e._data[t]||e._hasMap[t];return yt(!!n,"the entry '"+t+"' does not exist in the observable map '"+ut(e)+"'"),n}if(pt(e),it(e)){yt(!!t,"please specify a property");var r=e.$mobx.values[t];return yt(!!r,"no observable property '"+t+"' found on the observable object '"+ut(e)+"'"),r}if(Ft(e)||Gt(e)||Zt(e))return e}else if("function"==typeof e&&Zt(e.$mobx))return e.$mobx;yt(!1,"Cannot obtain atom from "+e)}function at(e,t){return yt(e,"Expecting some object"),void 0!==t?at(st(e,t)):Ft(e)||Gt(e)||Zt(e)?e:fn(e)?e:(pt(e),e.$mobx?e.$mobx:void yt(!1,"Cannot obtain administration from "+e))}function ut(e,t){var n;return n=void 0!==t?st(e,t):it(e)||fn(e)?at(e):st(e),n.name}function ct(e,t,n,r,o){function i(i,s,a,u,c){if(yt(o||ft(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),a){Rt(i,"__mobxLazyInitializers")||Tt(i,"__mobxLazyInitializers",i.__mobxLazyInitializers&&i.__mobxLazyInitializers.slice()||[]);var l=a.value,p=a.initializer;return i.__mobxLazyInitializers.push(function(t){e(t,s,p?p.call(t):l,u,a)}),{enumerable:r,configurable:!0,get:function(){return this.__mobxDidRunLazyInitializers!==!0&&pt(this),t.call(this,s)},set:function(e){this.__mobxDidRunLazyInitializers!==!0&&pt(this),n.call(this,s,e)}}}var f={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&this.__mobxInitializedProps[s]===!0||lt(this,s,void 0,e,u,a),t.call(this,s)},set:function(t){this.__mobxInitializedProps&&this.__mobxInitializedProps[s]===!0?n.call(this,s,t):lt(this,s,t,e,u,a)}};return(arguments.length<3||5===arguments.length&&c<3)&&Object.defineProperty(i,s,f),f}return o?function(){if(ft(arguments))return i.apply(null,arguments);var e=arguments,t=arguments.length;return function(n,r,o){return i(n,r,o,e,t)}}:i}function lt(e,t,n,r,o,i){Rt(e,"__mobxInitializedProps")||Tt(e,"__mobxInitializedProps",{}),e.__mobxInitializedProps[t]=!0,r(e,t,n,o,i)}function pt(e){e.__mobxDidRunLazyInitializers!==!0&&e.__mobxLazyInitializers&&(Tt(e,"__mobxDidRunLazyInitializers",!0),e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers.forEach(function(t){return t(e)}))}function ft(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]}function ht(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function dt(e){yt(e[xn]!==!0,"Illegal state: cannot recycle array as iterator"),It(e,xn,!0);var t=-1;return It(e,"next",function(){return t++,{done:t>=this.length,value:t<this.length?this[t]:void 0}}),e}function vt(e,t){It(e,ht(),t)}function bt(){return++Xt.mobxGuid}function yt(e,t,n){if(!e)throw new Error("[mobx] Invariant failed: "+t+(n?" in '"+n+"'":""))}function mt(e){Sn.indexOf(e)===-1&&(Sn.push(e),console.error("[mobx] Deprecated: "+e))}function gt(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function xt(e){var t=[];return e.forEach(function(e){t.indexOf(e)===-1&&t.push(e)}),t}function wt(e,t,n){if(void 0===t&&(t=100),void 0===n&&(n=" - "),!e)return"";var r=e.slice(0,t);return""+r.join(n)+(e.length>t?" (... and "+(e.length-t)+"more)":"")}function _t(e){return null!==e&&"object"==typeof e}function St(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Ot(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var o in r)Rt(r,o)&&(e[o]=r[o])}return e}function At(e,t,n){return e?!Ct(t,n):t!==n}function Rt(e,t){return An.call(e,t)}function kt(e,t){for(var n=0;n<t.length;n++)Tt(e,t[n],e[t[n]])}function Tt(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function It(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function jt(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n||n.configurable!==!1&&n.writable!==!1}function Et(e,t){yt(jt(e,t),"Cannot make property '"+t+"' observable, it is not configurable and writable in the target object")}function Lt(e){var t=[];for(var n in e)t.push(n);return t}function Ct(e,t){if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;var n=Dt(e);if(n!==Dt(t))return!1;if(n){if(e.length!==t.length)return!1;for(var r=e.length-1;r>=0;r--)if(!Ct(e[r],t[r]))return!1;return!0}if("object"==typeof e&&"object"==typeof t){if(null===e||null===t)return!1;if(Lt(e).length!==Lt(t).length)return!1;for(var o in e){if(!(o in t))return!1;if(!Ct(e[o],t[o]))return!1}return!0}return e===t}function Pt(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return _t(e)&&e[n]===!0}}function Dt(e){return Array.isArray(e)||Ye(e)}var Vt=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)};ee(),exports.extras={allowStateChanges:N,getAtom:st,getDebugName:ut,getDependencyTree:b,getObserverTree:m,isComputingDerivation:J,isSpyEnabled:me,resetGlobalState:te,spyReport:ge,spyReportEnd:we,spyReportStart:xe,trackTransitions:Se,setReactionScheduler:ye},exports._={getAdministration:at,resetGlobalState:te},"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(module.exports);var Mt=ct(function(t,n,r,o,i){var s=o&&1===o.length?o[0]:r.name||n||"<unnamed action>",a=e(s,r);Tt(t,n,a)},function(e){return this[e]},function(){yt(!1,"It is not allowed to assign new values to @action fields")},!1,!0);exports.action=e,exports.runInAction=n,exports.isAction=r,exports.autorun=o,exports.when=i,exports.autorunUntil=s,exports.autorunAsync=a,exports.reaction=u;var $t=ct(function(e,t,n,r,o){yt("undefined"!=typeof o,"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.");var i=o.get,s=o.set;yt("function"==typeof i,"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'");var a=!1;r&&1===r.length&&r[0].asStructure===!0&&(a=!0);var u=Qe(e,void 0,tn.Recursive);et(u,t,a?Ve(i):i,!1,s)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){this.$mobx.values[e].set(t)},!1,!0);exports.computed=c,exports.createTransformer=p,exports.expr=h,exports.extendObservable=d,exports.intercept=x,exports.isComputed=S,exports.isObservable=O;var Ut=ct(function(e,t,n){var r=B(!0);"function"==typeof n&&(n=De(n));var o=Qe(e,void 0,tn.Recursive);et(o,t,n,!0,void 0),z(r)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){rt(this,e,t)},!0,!1);exports.observable=R;var Nt;!function(e){e[e.Reference=0]="Reference",e[e.PlainObject=1]="PlainObject",e[e.ComplexObject=2]="ComplexObject",e[e.Array=3]="Array",e[e.ViewFunction=4]="ViewFunction",e[e.ComplexFunction=5]="ComplexFunction"}(Nt||(Nt={})),exports.observe=T,exports.toJS=E,exports.toJSlegacy=L,exports.toJSON=C,exports.whyRun=D,exports.useStrict=$,exports.isStrictModeEnabled=U;var Bt=function(){function e(e){void 0===e&&(e="Atom@"+bt()),this.name=e,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Kt.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.reportObserved=function(){le(this)},e.prototype.reportChanged=function(){Ae("propagatingAtomChange",null,!1),fe(this),Re(!1)},e.prototype.toString=function(){return this.name},e}();exports.BaseAtom=Bt;var zt=function(e){function t(t,n,r){void 0===t&&(t="Atom@"+bt()),void 0===n&&(n=On),void 0===r&&(r=On),e.call(this,t),this.name=t,this.onBecomeObservedHandler=n,this.onBecomeUnobservedHandler=r,this.isPendingUnobservation=!1,this.isBeingTracked=!1}return Vt(t,e),t.prototype.reportObserved=function(){return ue(),e.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),ce(),!!Xt.trackingDerivation},t.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},t}(Bt);exports.Atom=zt;var Ft=Pt("Atom",Bt),Jt=function(){function e(e,t,n,r,o){this.derivation=e,this.scope=t,this.compareStructural=n,this.dependenciesState=Kt.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Kt.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.value=void 0,this.isComputing=!1,this.isRunningSetter=!1,this.name=r||"ComputedValue@"+bt(),o&&(this.setter=V(r+"-setter",o))}return e.prototype.peek=function(){this.isComputing=!0;var e=B(!1),t=this.derivation.call(this.scope);return z(e),this.isComputing=!1,t},e.prototype.peekUntracked=function(){var e=!0;try{var t=this.peek();return e=!1,t}finally{e&&W(this)}},e.prototype.onBecomeStale=function(){de(this)},e.prototype.onBecomeUnobserved=function(){yt(this.dependenciesState!==Kt.NOT_TRACKING,"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row"),X(this),this.value=void 0},e.prototype.get=function(){yt(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),ue(),1===Xt.inBatch?F(this)&&(this.value=this.peekUntracked()):(le(this),F(this)&&this.trackAndCompute()&&he(this));var e=this.value;return ce(),e},e.prototype.recoverFromError=function(){this.isComputing=!1},e.prototype.set=function(e){if(this.setter){yt(!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 yt(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){me()&&ge({object:this,type:"compute",fn:this.derivation,target:this.scope});var e=this.value,t=this.value=K(this,this.peek);return At(this.compareStructural,t,e)},e.prototype.observe=function(e,t){var n=this,r=!0,i=void 0;return o(function(){var o=n.get();if(!r||t){var s=q();e(o,i),Q(s)}r=!1,i=o})},e.prototype.toJSON=function(){
return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.whyRun=function(){var e=Boolean(Xt.trackingDerivation),t=xt(this.isComputing?this.newObserving:this.observing).map(function(e){return e.name}),n=xt(re(this).map(function(e){return e.name}));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(e?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===Kt.NOT_TRACKING?" * This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t  1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t  2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).\n":" * This computation will re-run if any of the following observables changes:\n    "+wt(t)+"\n    "+(this.isComputing&&e?" (... or any observable accessed during the remainder of the current run)":"")+"\n\tMissing items in this list?\n\t  1. Check whether all used values are properly marked as observable (use isObservable to verify)\n\t  2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n  * If the outcome of this computation changes, the following observers will be re-run:\n    "+wt(n)+"\n")},e}(),Gt=Pt("ComputedValue",Jt),Kt;!function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(Kt||(Kt={})),exports.IDerivationState=Kt,exports.untracked=Y;var Wt=["mobxGuid","resetId","spyListeners","strictMode","runId"],Ht=function(){function e(){this.version=4,this.trackingDerivation=null,this.runId=0,this.mobxGuid=0,this.inTransaction=0,this.isRunningReactions=!1,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.allowStateChanges=!0,this.strictMode=!1,this.resetId=0,this.spyListeners=[]}return e}(),Xt=function(){var e=new Ht;if(global.__mobservableTrackingStack||global.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(global.__mobxGlobal&&global.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");return global.__mobxGlobal?global.__mobxGlobal:global.__mobxGlobal=e}(),Yt=function(){function e(e,t){void 0===e&&(e="Reaction@"+bt()),this.name=e,this.onInvalidate=t,this.observing=[],this.newObserving=[],this.dependenciesState=Kt.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Xt.pendingReactions.push(this),ue(),ve(),ce())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){this.isDisposed||(this._isScheduled=!1,F(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&me()&&ge({object:this,type:"scheduled-reaction"})))},e.prototype.track=function(e){ue();var t,n=me();n&&(t=Date.now(),xe({object:this,type:"reaction",fn:e})),this._isRunning=!0,K(this,e),this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&X(this),n&&we({time:Date.now()-t}),ce()},e.prototype.recoverFromError=function(){this._isRunning=!1,this._isTrackPending=!1},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(ue(),X(this),ce()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.whyRun=function(){var e=xt(this._isRunning?this.newObserving:this.observing).map(function(e){return e.name});return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n    "+wt(e)+"\n    "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\tMissing items in this list?\n\t  1. Check whether all used values are properly marked as observable (use isObservable to verify)\n\t  2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"},e}();exports.Reaction=Yt;var qt=100,Qt=function(e){return e()},Zt=Pt("Reaction",Yt),en={spyReportEnd:!0};exports.spy=_e,exports.transaction=Oe;var tn;!function(e){e[e.Recursive=0]="Recursive",e[e.Reference=1]="Reference",e[e.Structure=2]="Structure",e[e.Flat=3]="Flat"}(tn||(tn={})),exports.ValueMode=tn,exports.asReference=De,De.mobxModifier=tn.Reference,exports.asStructure=Ve,Ve.mobxModifier=tn.Structure,exports.asFlat=Me,Me.mobxModifier=tn.Flat,exports.asMap=$e;var nn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),rn=0,on=function(){function e(){}return e}();on.prototype=[];var sn=function(){function e(e,t,n,r){this.mode=t,this.array=n,this.owned=r,this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new Bt(e||"ObservableArray@"+bt())}return e.prototype.makeReactiveArrayItem=function(e){return Fe(e,"Array values cannot have modifiers"),this.mode===tn.Flat||this.mode===tn.Reference?e:ze(e,this.mode,this.atom.name+"[..]")},e.prototype.intercept=function(e){return Te(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}),Ee(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;e!==t&&(e>t?this.spliceWithArray(t,0,new Array(e-t)):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>rn&&We(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){G();var r=this.values.length;if(void 0===e?e=0:e>r?e=r:e<0&&(e=Math.max(0,r+e)),t=1===arguments.length?r-e:void 0===t||null===t?0:Math.max(0,Math.min(t,r-e)),void 0===n&&(n=[]),ke(this)){var o=Ie(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!o)return _n;t=o.removedCount,n=o.added}n=n.map(this.makeReactiveArrayItem,this);var i=n.length-t;this.updateArrayLength(r,i);var s=(a=this.values).splice.apply(a,[e,t].concat(n));return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),s;var a},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&me(),o=je(this),i=o||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&xe(i),this.atom.reportChanged(),o&&Le(this,i),r&&we()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&me(),o=je(this),i=o||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&xe(i),this.atom.reportChanged(),o&&Le(this,i),r&&we()},e}(),an=function(e){function t(t,n,r,o){void 0===o&&(o=!1),e.call(this);var i=new sn(r,n,this,o);It(this,"$mobx",i),t&&t.length?(i.updateArrayLength(0,t.length),i.values=t.map(i.makeReactiveArrayItem,i),i.notifyArraySplice(0,i.values.slice(),_n)):i.values=[],nn&&Object.defineProperty(i.array,"0",un)}return Vt(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-0]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.slice(),e.map(function(e){return Ye(e)?e.slice():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.values},t.prototype.find=function(e,t,n){void 0===n&&(n=0),this.$mobx.atom.reportObserved();for(var r=this.$mobx.values,o=r.length,i=n;i<o;i++)if(e.call(t,r[i],i,this))return r[i]},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.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=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-0]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){this.$mobx.atom.reportObserved();var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){this.$mobx.atom.reportObserved();var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.values.indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.toString=function(){return"[mobx.array] "+Array.prototype.toString.apply(this.$mobx.values,arguments)},t.prototype.toLocaleString=function(){return"[mobx.array] "+Array.prototype.toLocaleString.apply(this.$mobx.values,arguments)},t}(on);vt(an.prototype,function(){return dt(this.slice())}),kt(an.prototype,["constructor","intercept","observe","clear","concat","replace","toJS","toJSON","peek","find","splice","push","pop","shift","unshift","reverse","sort","remove","toString","toLocaleString"]),Object.defineProperty(an.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some"].forEach(function(e){var t=Array.prototype[e];yt("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),Tt(an.prototype,e,function(){return this.$mobx.atom.reportObserved(),t.apply(this.$mobx.values,arguments)})});var un={configurable:!0,enumerable:!1,set:Ge(0),get:Ke(0)};We(1e3),exports.fastArray=Xe;var cn=Pt("ObservableArrayAdministration",sn);exports.isObservableArray=Ye;var ln={},pn=function(){function e(e,t){var n=this;this.$mobx=ln,this._data={},this._hasMap={},this.name="ObservableMap@"+bt(),this._keys=new an(null,tn.Reference,this.name+".keys()",(!0)),this.interceptors=null,this.changeListeners=null,this._valueMode=Ne(t),this._valueMode===tn.Flat&&(this._valueMode=tn.Reference),N(!0,function(){St(e)?n.merge(e):Array.isArray(e)&&e.forEach(function(e){var t=e[0],r=e[1];return n.set(t,r)})})}return e.prototype._has=function(e){return"undefined"!=typeof this._data[e]},e.prototype.has=function(e){return!!this.isValidKey(e)&&(e=""+e,this._hasMap[e]?this._hasMap[e].get():this._updateHasMapEntry(e,!1).get())},e.prototype.set=function(e,t){this.assertValidKey(e),e=""+e;var n=this._has(e);if(Fe(t,"[mobx.map.set] Expected unwrapped value to be inserted to key '"+e+"'. If you need to use modifiers pass them as second argument to the constructor"),ke(this)){var r=Ie(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return;t=r.newValue}n?this._updateValue(e,t):this._addValue(e,t)},e.prototype.delete=function(e){var t=this;if(this.assertValidKey(e),e=""+e,ke(this)){var n=Ie(this,{type:"delete",object:this,name:e});if(!n)return!1}if(this._has(e)){var r=me(),o=je(this),n=o||r?{type:"delete",object:this,oldValue:this._data[e].value,name:e}:null;return r&&xe(n),Oe(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1);var n=t._data[e];n.setNewValue(void 0),t._data[e]=void 0},void 0,!1),o&&Le(this,n),r&&we(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap[e];return n?n.setNewValue(t):n=this._hasMap[e]=new mn(t,tn.Reference,this.name+"."+e+"?",(!1)),n},e.prototype._updateValue=function(e,t){var n=this._data[e];if(t=n.prepareNewValue(t),t!==yn){var r=me(),o=je(this),i=o||r?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;r&&xe(i),n.setNewValue(t),o&&Le(this,i),r&&we()}},e.prototype._addValue=function(e,t){var n=this;Oe(function(){var r=n._data[e]=new mn(t,n._valueMode,n.name+"."+e,(!1));t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)},void 0,!1);var r=me(),o=je(this),i=o||r?{type:"add",object:this,name:e,newValue:t}:null;r&&xe(i),o&&Le(this,i),r&&we()},e.prototype.get=function(e){if(e=""+e,this.has(e))return this._data[e].get()},e.prototype.keys=function(){return dt(this._keys.slice())},e.prototype.values=function(){return dt(this._keys.map(this.get,this))},e.prototype.entries=function(){var e=this;return dt(this._keys.map(function(t){return[t,e.get(t)]}))},e.prototype.forEach=function(e,t){var n=this;this.keys().forEach(function(r){return e.call(t,n.get(r),r)})},e.prototype.merge=function(e){var t=this;return Oe(function(){fn(e)?e.keys().forEach(function(n){return t.set(n,e.get(n))}):Object.keys(e).forEach(function(n){return t.set(n,e[n])})},void 0,!1),this},e.prototype.clear=function(){var e=this;Oe(function(){Y(function(){e.keys().forEach(e.delete,e)})},void 0,!1)},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toJS=function(){var e=this,t={};return this.keys().forEach(function(n){return t[n]=e.get(n)}),t},e.prototype.toJs=function(){return mt("toJs is deprecated, use toJS instead"),this.toJS()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.isValidKey=function(e){return null!==e&&void 0!==e&&("string"==typeof e||"number"==typeof e||"boolean"==typeof e)},e.prototype.assertValidKey=function(e){if(!this.isValidKey(e))throw new Error("[mobx.map] Invalid key: '"+e+"'")},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this.keys().map(function(t){return t+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return yt(t!==!0,"`observe` doesn't support the fire immediately property for observable maps."),Ee(this,e)},e.prototype.intercept=function(e){return Te(this,e)},e}();exports.ObservableMap=pn,vt(pn.prototype,function(){return this.entries()}),exports.map=qe;var fn=Pt("ObservableMap",pn);exports.isObservableMap=fn;var hn=function(){function e(e,t,n){this.target=e,this.name=t,this.mode=n,this.values={},this.changeListeners=null,this.interceptors=null}return e.prototype.observe=function(e,t){return yt(t!==!0,"`observe` doesn't support the fire immediately property for observable objects."),Ee(this,e)},e.prototype.intercept=function(e){return Te(this,e)},e}(),dn={},vn={},bn=Pt("ObservableObjectAdministration",hn);exports.isObservableObject=it;var yn={},mn=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableValue@"+bt()),void 0===o&&(o=!0),e.call(this,r),this.mode=n,this.hasUnreportedChange=!1,this.value=void 0;var i=Ue(t,tn.Recursive),s=i[0],a=i[1];this.mode===tn.Recursive&&(this.mode=s),this.value=ze(a,this.mode,this.name),o&&me()&&ge({type:"create",object:this,newValue:this.value})}return Vt(t,e),t.prototype.set=function(e){var t=this.value;if(e=this.prepareNewValue(e),e!==yn){var n=me();n&&xe({type:"update",object:this,newValue:e,oldValue:t}),this.setNewValue(e),n&&we()}},t.prototype.prepareNewValue=function(e){if(Fe(e,"Modifiers cannot be used on non-initial values."),G(),ke(this)){var t=Ie(this,{object:this,type:"update",newValue:e});if(!t)return yn;e=t.newValue}var n=At(this.mode===tn.Structure,this.value,e);return n?ze(e,this.mode,this.name):yn},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),je(this)&&Le(this,[e,t])},t.prototype.get=function(){return this.reportObserved(),this.value},t.prototype.intercept=function(e){return Te(this,e)},t.prototype.observe=function(e,t){return t&&e(this.value,void 0),Ee(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t}(Bt),gn=Pt("ObservableValue",mn),xn="__$$iterating",wn=function(){function e(){this.listeners=[],mt("extras.SimpleEventEmitter is deprecated and will be removed in the next major release")}return e.prototype.emit=function(){for(var e=this.listeners.slice(),t=0,n=e.length;t<n;t++)e[t].apply(null,arguments)},e.prototype.on=function(e){var t=this;return this.listeners.push(e),gt(function(){var n=t.listeners.indexOf(e);n!==-1&&t.listeners.splice(n,1)})},e.prototype.once=function(e){var t=this.on(function(){t(),e.apply(this,arguments)});return t},e}();exports.SimpleEventEmitter=wn;var _n=[];Object.freeze(_n);var Sn=[],On=function(){},An=Object.prototype.hasOwnProperty;exports.isArrayLike=Dt;
//# sourceMappingURL=lib/mobx.min.js.map