mobx 3.6.1 → 3.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,7 @@ function __extends(d, b) {
31
31
  * 1) detect when they are being _used_ and report this (using reportObserved). This allows mobx to make the connection between running functions and the data they used
32
32
  * 2) they should notify mobx whenever they have _changed_. This way mobx can re-run any functions (derivations) that are using this atom.
33
33
  */
34
- var BaseAtom = (function () {
34
+ var BaseAtom = /** @class */ (function () {
35
35
  /**
36
36
  * Create a new atom. For debugging purposes it is recommended to give it a name.
37
37
  * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.
@@ -68,7 +68,7 @@ var BaseAtom = (function () {
68
68
  };
69
69
  return BaseAtom;
70
70
  }());
71
- var Atom = (function (_super) {
71
+ var Atom = /** @class */ (function (_super) {
72
72
  __extends(Atom, _super);
73
73
  /**
74
74
  * Create a new atom. For debugging purposes it is recommended to give it a name.
@@ -234,7 +234,7 @@ var safariPrototypeSetterInheritanceBug = (function () {
234
234
  */
235
235
  var OBSERVABLE_ARRAY_BUFFER_SIZE = 0;
236
236
  // Typescript workaround to make sure ObservableArray extends Array
237
- var StubArray = (function () {
237
+ var StubArray = /** @class */ (function () {
238
238
  function StubArray() {
239
239
  }
240
240
  return StubArray;
@@ -277,7 +277,7 @@ if (Object.isFrozen(Array)) {
277
277
  });
278
278
  });
279
279
  }
280
- var ObservableArrayAdministration = (function () {
280
+ var ObservableArrayAdministration = /** @class */ (function () {
281
281
  function ObservableArrayAdministration(name, enhancer, array, owned) {
282
282
  this.array = array;
283
283
  this.owned = owned;
@@ -440,7 +440,7 @@ var ObservableArrayAdministration = (function () {
440
440
  };
441
441
  return ObservableArrayAdministration;
442
442
  }());
443
- var ObservableArray = (function (_super) {
443
+ var ObservableArray = /** @class */ (function (_super) {
444
444
  __extends(ObservableArray, _super);
445
445
  function ObservableArray(initialValues, enhancer, name, owned) {
446
446
  if (name === void 0) { name = "ObservableArray@" + getNextId(); }
@@ -753,7 +753,7 @@ function isObservableArray(thing) {
753
753
  }
754
754
 
755
755
  var UNCHANGED = {};
756
- var ObservableValue = (function (_super) {
756
+ var ObservableValue = /** @class */ (function (_super) {
757
757
  __extends(ObservableValue, _super);
758
758
  function ObservableValue(value, enhancer, name, notifySpy) {
759
759
  if (name === void 0) { name = "ObservableValue@" + getNextId(); }
@@ -994,18 +994,18 @@ function allowStateChangesEnd(prev) {
994
994
  * This means that these properties despite being enumerable might not show up in Object.keys() (but they will show up in for...in loops).
995
995
  */
996
996
  function createClassPropertyDecorator(
997
- /**
998
- * This function is invoked once, when the property is added to a new instance.
999
- * When this happens is not strictly determined due to differences in TS and Babel:
1000
- * Typescript: Usually when constructing the new instance
1001
- * Babel, sometimes Typescript: during the first get / set
1002
- * Both: when calling `runLazyInitializers(instance)`
1003
- */
1004
- onInitialize, get, set, enumerable,
1005
- /**
1006
- * Can this decorator invoked with arguments? e.g. @decorator(args)
1007
- */
1008
- allowCustomArguments) {
997
+ /**
998
+ * This function is invoked once, when the property is added to a new instance.
999
+ * When this happens is not strictly determined due to differences in TS and Babel:
1000
+ * Typescript: Usually when constructing the new instance
1001
+ * Babel, sometimes Typescript: during the first get / set
1002
+ * Both: when calling `runLazyInitializers(instance)`
1003
+ */
1004
+ onInitialize, get, set, enumerable,
1005
+ /**
1006
+ * Can this decorator invoked with arguments? e.g. @decorator(args)
1007
+ */
1008
+ allowCustomArguments) {
1009
1009
  function classPropertyDecorator(target, key, descriptor, customArgs, argLen) {
1010
1010
  if (argLen === void 0) { argLen = 0; }
1011
1011
  invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator");
@@ -1167,10 +1167,11 @@ function defineBoundAction(target, propertyName, fn) {
1167
1167
  addHiddenProp(target, propertyName, res);
1168
1168
  }
1169
1169
 
1170
- // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
1170
+ var toString = Object.prototype.toString;
1171
1171
  function deepEqual(a, b) {
1172
1172
  return eq(a, b);
1173
1173
  }
1174
+ // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
1174
1175
  // Internal recursive comparison function for `isEqual`.
1175
1176
  function eq(a, b, aStack, bStack) {
1176
1177
  // Identical objects are equal. `0 === -0`, but they aren't identical.
@@ -1189,7 +1190,6 @@ function eq(a, b, aStack, bStack) {
1189
1190
  return false;
1190
1191
  return deepEq(a, b, aStack, bStack);
1191
1192
  }
1192
- var toString = Object.prototype.toString;
1193
1193
  // Internal recursive comparison function for `isEqual`.
1194
1194
  function deepEq(a, b, aStack, bStack) {
1195
1195
  // Unwrap any wrapped objects.
@@ -1480,7 +1480,7 @@ function reaction(expression, effect, arg3) {
1480
1480
  *
1481
1481
  * If at any point it's outside batch and it isn't observed: reset everything and go to 1.
1482
1482
  */
1483
- var ComputedValue = (function () {
1483
+ var ComputedValue = /** @class */ (function () {
1484
1484
  /**
1485
1485
  * Create a new computed value based on a function expression.
1486
1486
  *
@@ -1662,7 +1662,7 @@ var ComputedValue = (function () {
1662
1662
  ComputedValue.prototype[primitiveSymbol()] = ComputedValue.prototype.valueOf;
1663
1663
  var isComputedValue = createInstanceofPredicate("ComputedValue", ComputedValue);
1664
1664
 
1665
- var ObservableObjectAdministration = (function () {
1665
+ var ObservableObjectAdministration = /** @class */ (function () {
1666
1666
  function ObservableObjectAdministration(target, name) {
1667
1667
  this.target = target;
1668
1668
  this.name = name;
@@ -2162,7 +2162,7 @@ function transaction(action, thisArg) {
2162
2162
  }
2163
2163
 
2164
2164
  var ObservableMapMarker = {};
2165
- var ObservableMap = (function () {
2165
+ var ObservableMap = /** @class */ (function () {
2166
2166
  function ObservableMap(initialData, enhancer, name) {
2167
2167
  if (enhancer === void 0) { enhancer = deepEnhancer; }
2168
2168
  if (name === void 0) { name = "ObservableMap@" + getNextId(); }
@@ -2611,7 +2611,7 @@ function toPrimitive(value) {
2611
2611
  * These values will persist if global state is reset
2612
2612
  */
2613
2613
  var persistentKeys = ["mobxGuid", "resetId", "spyListeners", "strictMode", "runId"];
2614
- var MobXGlobals = (function () {
2614
+ var MobXGlobals = /** @class */ (function () {
2615
2615
  function MobXGlobals() {
2616
2616
  /**
2617
2617
  * MobXGlobals version.
@@ -2695,7 +2695,7 @@ var warnedAboutMultipleInstances = false;
2695
2695
  warnedAboutMultipleInstances = true;
2696
2696
  console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details.");
2697
2697
  }
2698
- });
2698
+ }, 1);
2699
2699
  }
2700
2700
  }
2701
2701
  function isolateGlobalState() {
@@ -3033,7 +3033,7 @@ var TraceMode;
3033
3033
  TraceMode[TraceMode["LOG"] = 1] = "LOG";
3034
3034
  TraceMode[TraceMode["BREAK"] = 2] = "BREAK";
3035
3035
  })(TraceMode || (TraceMode = {}));
3036
- var CaughtException = (function () {
3036
+ var CaughtException = /** @class */ (function () {
3037
3037
  function CaughtException(cause) {
3038
3038
  this.cause = cause;
3039
3039
  // Empty
@@ -3262,7 +3262,7 @@ function getAtomFromArgs(args) {
3262
3262
  }
3263
3263
  }
3264
3264
 
3265
- var Reaction = (function () {
3265
+ var Reaction = /** @class */ (function () {
3266
3266
  function Reaction(name, onInvalidate) {
3267
3267
  if (name === void 0) { name = "Reaction@" + getNextId(); }
3268
3268
  this.name = name;
@@ -3615,7 +3615,7 @@ function createTransformer(transformer, onCleanup) {
3615
3615
  // This construction is used to avoid leaking refs to the objectCache directly
3616
3616
  var resetId = globalState.resetId;
3617
3617
  // Local transformer class specifically for this transformer
3618
- var Transformer = (function (_super) {
3618
+ var Transformer = /** @class */ (function (_super) {
3619
3619
  __extends(Transformer, _super);
3620
3620
  function Transformer(sourceIdentifier, sourceObject) {
3621
3621
  var _this = _super.call(this, function () { return transformer(sourceObject); }, undefined, comparer.default, "Transformer-" + transformer.name + "-" + sourceIdentifier, undefined) || this;
package/lib/mobx.umd.js CHANGED
@@ -37,7 +37,7 @@ function __extends(d, b) {
37
37
  * 1) detect when they are being _used_ and report this (using reportObserved). This allows mobx to make the connection between running functions and the data they used
38
38
  * 2) they should notify mobx whenever they have _changed_. This way mobx can re-run any functions (derivations) that are using this atom.
39
39
  */
40
- var BaseAtom = (function () {
40
+ var BaseAtom = /** @class */ (function () {
41
41
  /**
42
42
  * Create a new atom. For debugging purposes it is recommended to give it a name.
43
43
  * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.
@@ -74,7 +74,7 @@ var BaseAtom = (function () {
74
74
  };
75
75
  return BaseAtom;
76
76
  }());
77
- var Atom = (function (_super) {
77
+ var Atom = /** @class */ (function (_super) {
78
78
  __extends(Atom, _super);
79
79
  /**
80
80
  * Create a new atom. For debugging purposes it is recommended to give it a name.
@@ -240,7 +240,7 @@ var safariPrototypeSetterInheritanceBug = (function () {
240
240
  */
241
241
  var OBSERVABLE_ARRAY_BUFFER_SIZE = 0;
242
242
  // Typescript workaround to make sure ObservableArray extends Array
243
- var StubArray = (function () {
243
+ var StubArray = /** @class */ (function () {
244
244
  function StubArray() {
245
245
  }
246
246
  return StubArray;
@@ -283,7 +283,7 @@ if (Object.isFrozen(Array)) {
283
283
  });
284
284
  });
285
285
  }
286
- var ObservableArrayAdministration = (function () {
286
+ var ObservableArrayAdministration = /** @class */ (function () {
287
287
  function ObservableArrayAdministration(name, enhancer, array, owned) {
288
288
  this.array = array;
289
289
  this.owned = owned;
@@ -446,7 +446,7 @@ var ObservableArrayAdministration = (function () {
446
446
  };
447
447
  return ObservableArrayAdministration;
448
448
  }());
449
- var ObservableArray = (function (_super) {
449
+ var ObservableArray = /** @class */ (function (_super) {
450
450
  __extends(ObservableArray, _super);
451
451
  function ObservableArray(initialValues, enhancer, name, owned) {
452
452
  if (name === void 0) { name = "ObservableArray@" + getNextId(); }
@@ -759,7 +759,7 @@ function isObservableArray(thing) {
759
759
  }
760
760
 
761
761
  var UNCHANGED = {};
762
- var ObservableValue = (function (_super) {
762
+ var ObservableValue = /** @class */ (function (_super) {
763
763
  __extends(ObservableValue, _super);
764
764
  function ObservableValue(value, enhancer, name, notifySpy) {
765
765
  if (name === void 0) { name = "ObservableValue@" + getNextId(); }
@@ -1000,18 +1000,18 @@ function allowStateChangesEnd(prev) {
1000
1000
  * This means that these properties despite being enumerable might not show up in Object.keys() (but they will show up in for...in loops).
1001
1001
  */
1002
1002
  function createClassPropertyDecorator(
1003
- /**
1004
- * This function is invoked once, when the property is added to a new instance.
1005
- * When this happens is not strictly determined due to differences in TS and Babel:
1006
- * Typescript: Usually when constructing the new instance
1007
- * Babel, sometimes Typescript: during the first get / set
1008
- * Both: when calling `runLazyInitializers(instance)`
1009
- */
1010
- onInitialize, get, set, enumerable,
1011
- /**
1012
- * Can this decorator invoked with arguments? e.g. @decorator(args)
1013
- */
1014
- allowCustomArguments) {
1003
+ /**
1004
+ * This function is invoked once, when the property is added to a new instance.
1005
+ * When this happens is not strictly determined due to differences in TS and Babel:
1006
+ * Typescript: Usually when constructing the new instance
1007
+ * Babel, sometimes Typescript: during the first get / set
1008
+ * Both: when calling `runLazyInitializers(instance)`
1009
+ */
1010
+ onInitialize, get, set, enumerable,
1011
+ /**
1012
+ * Can this decorator invoked with arguments? e.g. @decorator(args)
1013
+ */
1014
+ allowCustomArguments) {
1015
1015
  function classPropertyDecorator(target, key, descriptor, customArgs, argLen) {
1016
1016
  if (argLen === void 0) { argLen = 0; }
1017
1017
  invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator");
@@ -1173,10 +1173,11 @@ function defineBoundAction(target, propertyName, fn) {
1173
1173
  addHiddenProp(target, propertyName, res);
1174
1174
  }
1175
1175
 
1176
- // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
1176
+ var toString = Object.prototype.toString;
1177
1177
  function deepEqual(a, b) {
1178
1178
  return eq(a, b);
1179
1179
  }
1180
+ // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289
1180
1181
  // Internal recursive comparison function for `isEqual`.
1181
1182
  function eq(a, b, aStack, bStack) {
1182
1183
  // Identical objects are equal. `0 === -0`, but they aren't identical.
@@ -1195,7 +1196,6 @@ function eq(a, b, aStack, bStack) {
1195
1196
  return false;
1196
1197
  return deepEq(a, b, aStack, bStack);
1197
1198
  }
1198
- var toString = Object.prototype.toString;
1199
1199
  // Internal recursive comparison function for `isEqual`.
1200
1200
  function deepEq(a, b, aStack, bStack) {
1201
1201
  // Unwrap any wrapped objects.
@@ -1486,7 +1486,7 @@ function reaction(expression, effect, arg3) {
1486
1486
  *
1487
1487
  * If at any point it's outside batch and it isn't observed: reset everything and go to 1.
1488
1488
  */
1489
- var ComputedValue = (function () {
1489
+ var ComputedValue = /** @class */ (function () {
1490
1490
  /**
1491
1491
  * Create a new computed value based on a function expression.
1492
1492
  *
@@ -1668,7 +1668,7 @@ var ComputedValue = (function () {
1668
1668
  ComputedValue.prototype[primitiveSymbol()] = ComputedValue.prototype.valueOf;
1669
1669
  var isComputedValue = createInstanceofPredicate("ComputedValue", ComputedValue);
1670
1670
 
1671
- var ObservableObjectAdministration = (function () {
1671
+ var ObservableObjectAdministration = /** @class */ (function () {
1672
1672
  function ObservableObjectAdministration(target, name) {
1673
1673
  this.target = target;
1674
1674
  this.name = name;
@@ -2168,7 +2168,7 @@ function transaction(action, thisArg) {
2168
2168
  }
2169
2169
 
2170
2170
  var ObservableMapMarker = {};
2171
- var ObservableMap = (function () {
2171
+ var ObservableMap = /** @class */ (function () {
2172
2172
  function ObservableMap(initialData, enhancer, name) {
2173
2173
  if (enhancer === void 0) { enhancer = deepEnhancer; }
2174
2174
  if (name === void 0) { name = "ObservableMap@" + getNextId(); }
@@ -2617,7 +2617,7 @@ function toPrimitive(value) {
2617
2617
  * These values will persist if global state is reset
2618
2618
  */
2619
2619
  var persistentKeys = ["mobxGuid", "resetId", "spyListeners", "strictMode", "runId"];
2620
- var MobXGlobals = (function () {
2620
+ var MobXGlobals = /** @class */ (function () {
2621
2621
  function MobXGlobals() {
2622
2622
  /**
2623
2623
  * MobXGlobals version.
@@ -2701,7 +2701,7 @@ var warnedAboutMultipleInstances = false;
2701
2701
  warnedAboutMultipleInstances = true;
2702
2702
  console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details.");
2703
2703
  }
2704
- });
2704
+ }, 1);
2705
2705
  }
2706
2706
  }
2707
2707
  function isolateGlobalState() {
@@ -3038,7 +3038,7 @@ var TraceMode;
3038
3038
  TraceMode[TraceMode["LOG"] = 1] = "LOG";
3039
3039
  TraceMode[TraceMode["BREAK"] = 2] = "BREAK";
3040
3040
  })(TraceMode || (TraceMode = {}));
3041
- var CaughtException = (function () {
3041
+ var CaughtException = /** @class */ (function () {
3042
3042
  function CaughtException(cause) {
3043
3043
  this.cause = cause;
3044
3044
  // Empty
@@ -3267,7 +3267,7 @@ function getAtomFromArgs(args) {
3267
3267
  }
3268
3268
  }
3269
3269
 
3270
- var Reaction = (function () {
3270
+ var Reaction = /** @class */ (function () {
3271
3271
  function Reaction(name, onInvalidate) {
3272
3272
  if (name === void 0) { name = "Reaction@" + getNextId(); }
3273
3273
  this.name = name;
@@ -3620,7 +3620,7 @@ function createTransformer(transformer, onCleanup) {
3620
3620
  // This construction is used to avoid leaking refs to the objectCache directly
3621
3621
  var resetId = globalState.resetId;
3622
3622
  // Local transformer class specifically for this transformer
3623
- var Transformer = (function (_super) {
3623
+ var Transformer = /** @class */ (function (_super) {
3624
3624
  __extends(Transformer, _super);
3625
3625
  function Transformer(sourceIdentifier, sourceObject) {
3626
3626
  var _this = _super.call(this, function () { return transformer(sourceObject); }, undefined, comparer.default, "Transformer-" + transformer.name + "-" + sourceIdentifier, undefined) || this;
@@ -1,4 +1,4 @@
1
1
  /** MobX - (c) Michel Weststrate 2015, 2016 - MIT Licensed */
2
2
  !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.mobx=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n||e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){(function(e){"use strict";function t(e,t){function n(){this.constructor=e}en(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function r(e){return e.interceptors&&e.interceptors.length>0}function o(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),De(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function i(e,t){var n=At();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o<i&&(t=r[o](t),Ie(!t||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{It(n)}}function a(e){return e.changeListeners&&e.changeListeners.length>0}function s(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),De(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function u(e,t){var n=At(),r=e.changeListeners;if(r){r=r.slice();for(var o=0,i=r.length;o<i;o++)r[o](t);It(n)}}function c(){return!!Hn.spyListeners.length}function l(e){if(Hn.spyListeners.length)for(var t=Hn.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function p(e){l(Ve({},e,{spyReportStart:!0}))}function f(e){l(e?Ve({},e,on):on)}function h(e){return Hn.spyListeners.push(e),De(function(){var t=Hn.spyListeners.indexOf(e);-1!==t&&Hn.spyListeners.splice(t,1)})}function d(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function v(e){Ie(!0!==e[an],"Illegal state: cannot recycle array as iterator"),Ce(e,an,!0);var t=-1;return Ce(e,"next",function(){return t++,{done:t>=this.length,value:t<this.length?this[t]:void 0}}),e}function b(e,t){Ce(e,d(),t)}function m(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function y(e){Object.defineProperty(pn.prototype,""+e,m(e))}function g(e){for(var t=un;t<e;t++)y(t);un=e}function w(e){return Ee(e)&&hn(e.$mobx)}function x(e){return mn[e]}function O(e,t){Ie("function"==typeof t,x("m026")),Ie("string"==typeof e&&e.length>0,"actions should have valid names, got: '"+e+"'");var n=function(){return _(e,t,this,arguments)};return n.originalFn=t,n.isMobxAction=!0,n}function _(e,t,n,r){var o=S(e,t,n,r);try{return t.apply(n,r)}finally{A(o)}}function S(e,t,n,r){var o=c()&&!!e,i=0;if(o){i=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];p({type:"action",name:e,fn:t,object:n,arguments:s})}var l=At();return ct(),{prevDerivation:l,prevAllowStateChanges:k(!0),notifySpy:o,startTime:i}}function A(e){T(e.prevAllowStateChanges),lt(),It(e.prevDerivation),e.notifySpy&&f({time:Date.now()-e.startTime})}function I(e){Ie(null===Hn.trackingDerivation,x("m028")),Hn.strictMode=e,Hn.allowStateChanges=!e}function j(){return Hn.strictMode}function D(e,t){var n,r=k(e);try{n=t()}finally{T(r)}return n}function k(e){var t=Hn.allowStateChanges;return Hn.allowStateChanges=e,t}function T(e){Hn.allowStateChanges=e}function E(e,t,n,r,o){function i(i,a,s,u,c){if(void 0===c&&(c=0),Ie(o||L(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){Le(i,"__mobxLazyInitializers")||Pe(i,"__mobxLazyInitializers",i.__mobxLazyInitializers&&i.__mobxLazyInitializers.slice()||[]);var l=s.value,p=s.initializer;return i.__mobxLazyInitializers.push(function(t){e(t,a,p?p.call(t):l,u,s)}),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&V(this),t.call(this,a)},set:function(e){!0!==this.__mobxDidRunLazyInitializers&&V(this),n.call(this,a,e)}}}var f={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||R(this,a,void 0,e,u,s),t.call(this,a)},set:function(t){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]?n.call(this,a,t):R(this,a,t,e,u,s)}};return(arguments.length<3||5===arguments.length&&c<3)&&Object.defineProperty(i,a,f),f}return o?function(){if(L(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 R(e,t,n,r,o,i){Le(e,"__mobxInitializedProps")||Pe(e,"__mobxInitializedProps",{}),e.__mobxInitializedProps[t]=!0,r(e,t,n,o,i)}function V(e){!0!==e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers&&(Pe(e,"__mobxDidRunLazyInitializers",!0),e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers.forEach(function(t){return t(e)}))}function L(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]}function P(e){return function(t,n,r){if(r&&"function"==typeof r.value)return r.value=O(e,r.value),r.enumerable=!1,r.configurable=!0,r;if(void 0!==r&&void 0!==r.get)throw new Error("[mobx] action is not expected to be used with getters");return yn(e).apply(this,arguments)}}function C(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 Ie("function"==typeof o,x("m002")),Ie(0===o.length,x("m003")),Ie("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),_(r,o,i,void 0)}function M(e){return"function"==typeof e&&!0===e.isMobxAction}function N(e,t,n){var r=function(){return _(t,n,e,arguments)};r.isMobxAction=!0,Pe(e,t,r)}function $(e,t){return B(e,t)}function B(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!==e)return t!==t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&U(e,t,n,r)}function U(e,t,n,r){e=z(e),t=z(t);var o=xn.call(e);if(o!==xn.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),i){if((u=e.length)!==t.length)return!1;for(;u--;)if(!B(e[u],t[u],n,r))return!1}else{var c,l=Object.keys(e);if(u=l.length,Object.keys(t).length!==u)return!1;for(;u--;)if(c=l[u],!G(t,c)||!B(e[c],t[c],n,r))return!1}return n.pop(),r.pop(),!0}function z(e){return w(e)?e.peek():Nn(e)?e.entries():ze(e)?Ke(e.entries()):e}function G(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function K(e,t){return e===t}function H(e,t){return $(e,t)}function W(e,t){return Be(e,t)||K(e,t)}function J(e,t,n){function r(){i(s)}var o,i,a;"string"==typeof e?(o=e,i=t,a=n):(o=e.name||"Autorun@"+Se(),i=e,a=t),Ie("function"==typeof i,x("m004")),Ie(!1===M(i),x("m005")),a&&(i=i.bind(a));var s=new Qn(o,function(){this.track(r)});return s.schedule(),s.getDisposer()}function q(e,t,n,r){var o,i,a,s;return"string"==typeof e?(o=e,i=t,a=n,s=r):(o="When@"+Se(),i=e,a=t,s=n),J(o,function(e){if(i.call(s)){e.dispose();var t=At();a.call(s),It(t)}})}function Y(e,t,n,r){function o(){a(l)}var i,a,s,u;"string"==typeof e?(i=e,a=t,s=n,u=r):(i=e.name||"AutorunAsync@"+Se(),a=e,s=t,u=n),Ie(!1===M(a),x("m006")),void 0===s&&(s=1),u&&(a=a.bind(u));var c=!1,l=new Qn(i,function(){c||(c=!0,setTimeout(function(){c=!1,l.isDisposed||l.track(o)},s))});return l.schedule(),l.getDisposer()}function F(e,t,n){function r(){if(!c.isDisposed){var n=!1;c.track(function(){var t=e(c);n=a||!u(i,t),i=t}),a&&o.fireImmediately&&t(i,c),a||!0!==n||t(i,c),a&&(a=!1)}}arguments.length>3&&Ae(x("m007")),de(e)&&Ae(x("m008"));var o;o="object"==typeof n?n:{},o.name=o.name||e.name||t.name||"Reaction@"+Se(),o.fireImmediately=!0===n||!0===o.fireImmediately,o.delay=o.delay||0,o.compareStructural=o.compareStructural||o.struct||!1,t=wn(o.name,o.context?t.bind(o.context):t),o.context&&(e=e.bind(o.context));var i,a=!0,s=!1,u=o.equals?o.equals:o.compareStructural||o.struct?On.structural:On.default,c=new Qn(o.name,function(){a||o.delay<1?r():s||(s=!0,setTimeout(function(){s=!1,r()},o.delay))});return c.schedule(),c.getDisposer()}function X(e,t){if(ae(e)&&e.hasOwnProperty("$mobx"))return e.$mobx;Ie(Object.isExtensible(e),x("m035")),Re(e)||(t=(e.constructor.name||"ObservableObject")+"@"+Se()),t||(t="ObservableObject@"+Se());var n=new An(e,t);return Ce(e,"$mobx",n),n}function Q(e,t,n,r){if(e.values[t]&&!Sn(e.values[t]))return Ie("value"in n,"The property "+t+" in "+e.name+" is already observable, cannot redefine it as computed property"),void(e.target[t]=n.value);if("value"in n)if(de(n.value)){var o=n.value;Z(e,t,o.initialValue,o.enhancer)}else M(n.value)&&!0===n.value.autoBind?N(e.target,t,n.value.originalFn):Sn(n.value)?te(e,t,n.value):Z(e,t,n.value,r);else ee(e,t,n.get,n.set,On.default,!0)}function Z(e,t,n,o){if(Ne(e.target,t),r(e)){var a=i(e,{object:e.target,name:t,type:"add",newValue:n});if(!a)return;n=a.newValue}n=(e.values[t]=new vn(n,o,e.name+"."+t,!1)).value,Object.defineProperty(e.target,t,ne(t)),ie(e,e.target,t,n)}function ee(e,t,n,r,o,i){i&&Ne(e.target,t),e.values[t]=new _n(n,e.target,o,e.name+"."+t,r),i&&Object.defineProperty(e.target,t,re(t))}function te(e,t,n){var r=e.name+"."+t;n.name=r,n.scope||(n.scope=e.target),e.values[t]=n,Object.defineProperty(e.target,t,re(t))}function ne(e){return In[e]||(In[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[e].get()},set:function(t){oe(this,e,t)}})}function re(e){return jn[e]||(jn[e]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[e].get()},set:function(t){return this.$mobx.values[e].set(t)}})}function oe(e,t,n){var o=e.$mobx,s=o.values[t];if(r(o)){var l=i(o,{type:"update",object:e,name:t,newValue:n});if(!l)return;n=l.newValue}if((n=s.prepareNewValue(n))!==dn){var h=a(o),d=c(),l=h||d?{type:"update",object:e,oldValue:s.value,name:t,newValue:n}:null;d&&p(l),s.setNewValue(n),h&&u(o,l),d&&f()}}function ie(e,t,n,r){var o=a(e),i=c(),s=o||i?{type:"add",object:t,name:n,newValue:r}:null;i&&p(s),o&&u(e,s),i&&f()}function ae(e){return!!Ee(e)&&(V(e),Dn(e.$mobx))}function se(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(w(e)||Nn(e))throw new Error(x("m019"));if(ae(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return ae(e)||!!e.$mobx||rn(e)||tr(e)||Sn(e)}function ue(e){return Ie(!!e,":("),E(function(t,n,r,o,i){Ne(t,n),Ie(!i||!i.get,x("m022")),Z(X(t,void 0),n,r,e)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){oe(this,e,t)},!0,!1)}function ce(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return pe(e,be,t)}function le(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return pe(e,ye,t)}function pe(e,t,n){Ie(arguments.length>=2,x("m014")),Ie("object"==typeof e,x("m015")),Ie(!Nn(e),x("m016")),n.forEach(function(e){Ie("object"==typeof e,x("m017")),Ie(!se(e),x("m018"))});for(var r=X(e),o={},i=n.length-1;i>=0;i--){var a=n[i];for(var s in a)if(!0!==o[s]&&Le(a,s)){if(o[s]=!0,e===a&&!Me(e,s))continue;var u=Object.getOwnPropertyDescriptor(a,s);Q(r,s,u,t)}}return e}function fe(e){if(void 0===e&&(e=void 0),"string"==typeof arguments[1])return kn.apply(null,arguments);if(Ie(arguments.length<=1,x("m021")),Ie(!de(e),x("m020")),se(e))return e;var t=be(e,void 0,void 0);return t!==e?t:Pn.box(e)}function he(e){Ae("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}function de(e){return"object"==typeof e&&null!==e&&!0===e.isMobxModifierDescriptor}function ve(e,t){return Ie(!de(t),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:t,enhancer:e}}function be(e,t,n){return de(e)&&Ae("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),se(e)?e:Array.isArray(e)?Pn.array(e,n):Re(e)?Pn.object(e,n):ze(e)?Pn.map(e,n):e}function me(e,t,n){return de(e)&&Ae("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),void 0===e||null===e?e:ae(e)||w(e)||Nn(e)?e:Array.isArray(e)?Pn.shallowArray(e,n):Re(e)?Pn.shallowObject(e,n):ze(e)?Pn.shallowMap(e,n):Ae("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function ye(e){return e}function ge(e,t,n){if($(e,t))return t;if(se(e))return e;if(Array.isArray(e))return new pn(e,ge,n);if(ze(e))return new Mn(e,ge,n);if(Re(e)){var r={};return X(r,n),pe(r,ge,[e]),r}return e}function we(e,t,n){return $(e,t)?t:e}function xe(e,t){void 0===t&&(t=void 0),ct();try{return e.apply(t)}finally{lt()}}function Oe(e){return je("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),Pn.map(e)}function _e(){return"undefined"!=typeof window?window:e}function Se(){return++Hn.mobxGuid}function Ae(e,t){throw Ie(!1,e,t),"X"}function Ie(e,t,n){if(!e)throw new Error("[mobx] Invariant failed: "+t+(n?" in '"+n+"'":""))}function je(e){return-1===Bn.indexOf(e)&&(Bn.push(e),console.error("[mobx] Deprecated: "+e),!0)}function De(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function ke(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}function Te(e,t,n){return void 0===t&&(t=100),void 0===n&&(n=" - "),e?e.slice(0,t).join(n)+(e.length>t?" (... and "+(e.length-t)+"more)":""):""}function Ee(e){return null!==e&&"object"==typeof e}function Re(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Ve(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var o in r)Le(r,o)&&(e[o]=r[o])}return e}function Le(e,t){return zn.call(e,t)}function Pe(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Ce(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Me(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n||!1!==n.configurable&&!1!==n.writable}function Ne(e,t){Ie(Me(e,t),"Cannot make property '"+t+"' observable, it is not configurable and writable in the target object")}function $e(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return Ee(e)&&!0===e[n]}}function Be(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function Ue(e){return Array.isArray(e)||w(e)}function ze(e){return void 0!==_e().Map&&e instanceof _e().Map}function Ge(e){return Re(e)?Object.keys(e):Array.isArray(e)?e.map(function(e){return e[0]}):ze(e)?Array.from(e.keys()):Nn(e)?e.keys():Ae("Cannot get keys from "+e)}function Ke(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function He(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function We(e){return null===e?null:"object"==typeof e?""+e:e}function Je(){Jn=!0,_e().__mobxInstanceCount--}function qe(){je("Using `shareGlobalState` is not recommended, use peer dependencies instead. See https://github.com/mobxjs/mobx/issues/1082 for details."),Wn=!0;var e=_e(),t=Hn;if(e.__mobservableTrackingStack||e.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(e.__mobxGlobal&&e.__mobxGlobal.version!==t.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");e.__mobxGlobal?Hn=e.__mobxGlobal:e.__mobxGlobal=t}function Ye(){return Hn}function Fe(){Hn.resetId++;var e=new Kn;for(var t in e)-1===Gn.indexOf(t)&&(Hn[t]=e[t]);Hn.allowStateChanges=!Hn.strictMode}function Xe(e,t){if("object"==typeof e&&null!==e){if(w(e))return Ie(void 0===t,x("m036")),e.$mobx.atom;if(Nn(e)){var n=e;if(void 0===t)return Xe(n._keys);var r=n._data[t]||n._hasMap[t];return Ie(!!r,"the entry '"+t+"' does not exist in the observable map '"+Ze(e)+"'"),r}if(V(e),t&&!e.$mobx&&e[t],ae(e)){if(!t)return Ae("please specify a property");var r=e.$mobx.values[t];return Ie(!!r,"no observable property '"+t+"' found on the observable object '"+Ze(e)+"'"),r}if(rn(e)||Sn(e)||tr(e))return e}else if("function"==typeof e&&tr(e.$mobx))return e.$mobx;return Ae("Cannot obtain atom from "+e)}function Qe(e,t){return Ie(e,"Expecting some object"),void 0!==t?Qe(Xe(e,t)):rn(e)||Sn(e)||tr(e)?e:Nn(e)?e:(V(e),e.$mobx?e.$mobx:void Ie(!1,"Cannot obtain administration from "+e))}function Ze(e,t){var n;return n=void 0!==t?Xe(e,t):ae(e)||Nn(e)?Qe(e):Xe(e),n.name}function et(e,t){return tt(Xe(e,t))}function tt(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=ke(e.observing).map(tt)),t}function nt(e,t){return rt(Xe(e,t))}function rt(e){var t={name:e.name};return ot(e)&&(t.observers=it(e).map(rt)),t}function ot(e){return e.observers&&e.observers.length>0}function it(e){return e.observers}function at(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 st(e,t){if(1===e.observers.length)e.observers.length=0,ut(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 ut(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,Hn.pendingUnobservations.push(e))}function ct(){Hn.inBatch++}function lt(){if(0==--Hn.inBatch){Lt();for(var e=Hn.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Hn.pendingUnobservations=[]}}function pt(e){var t=Hn.trackingDerivation;null!==t?t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e):0===e.observers.length&&ut(e)}function ft(e){if(e.lowestObserverState!==n.IDerivationState.STALE){e.lowestObserverState=n.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var o=t[r];o.dependenciesState===n.IDerivationState.UP_TO_DATE&&(o.isTracing!==Fn.NONE&&vt(o,e),o.onBecomeStale()),o.dependenciesState=n.IDerivationState.STALE}}}function ht(e){if(e.lowestObserverState!==n.IDerivationState.STALE){e.lowestObserverState=n.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var o=t[r];o.dependenciesState===n.IDerivationState.POSSIBLY_STALE?o.dependenciesState=n.IDerivationState.STALE:o.dependenciesState===n.IDerivationState.UP_TO_DATE&&(e.lowestObserverState=n.IDerivationState.UP_TO_DATE)}}}function dt(e){if(e.lowestObserverState===n.IDerivationState.UP_TO_DATE){e.lowestObserverState=n.IDerivationState.POSSIBLY_STALE;for(var t=e.observers,r=t.length;r--;){var o=t[r];o.dependenciesState===n.IDerivationState.UP_TO_DATE&&(o.dependenciesState=n.IDerivationState.POSSIBLY_STALE,o.isTracing!==Fn.NONE&&vt(o,e),o.onBecomeStale())}}}function vt(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===Fn.BREAK){var n=[];bt(et(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 _n?e.derivation.toString():"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function bt(e,t,n){if(t.length>=1e3)return void t.push("(and many more)");t.push(""+new Array(n).join("\t")+e.name),e.dependencies&&e.dependencies.forEach(function(e){return bt(e,t,n+1)})}function mt(e){return e instanceof Xn}function yt(e){switch(e.dependenciesState){case n.IDerivationState.UP_TO_DATE:return!1;case n.IDerivationState.NOT_TRACKING:case n.IDerivationState.STALE:return!0;case n.IDerivationState.POSSIBLY_STALE:for(var t=At(),r=e.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Sn(a)){try{a.get()}catch(e){return It(t),!0}if(e.dependenciesState===n.IDerivationState.STALE)return It(t),!0}}return jt(e),It(t),!1}}function gt(){return null!==Hn.trackingDerivation}function wt(e){var t=e.observers.length>0;Hn.computationDepth>0&&t&&Ae(x("m031")+e.name),!Hn.allowStateChanges&&t&&Ae(x(Hn.strictMode?"m030a":"m030b")+e.name)}function xt(e,t,n){jt(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Hn.runId;var r=Hn.trackingDerivation;Hn.trackingDerivation=e;var o;try{o=t.call(n)}catch(e){o=new Xn(e)}return Hn.trackingDerivation=r,Ot(e),o}function Ot(e){for(var t=e.observing,r=e.observing=e.newObserving,o=n.IDerivationState.UP_TO_DATE,i=0,a=e.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)}for(r.length=i,e.newObserving=null,a=t.length;a--;){var u=t[a];0===u.diffValue&&st(u,e),u.diffValue=0}for(;i--;){var u=r[i];1===u.diffValue&&(u.diffValue=0,at(u,e))}o!==n.IDerivationState.UP_TO_DATE&&(e.dependenciesState=o,e.onBecomeStale())}function _t(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)st(t[r],e);e.dependenciesState=n.IDerivationState.NOT_TRACKING}function St(e){var t=At(),n=e();return It(t),n}function At(){var e=Hn.trackingDerivation;return Hn.trackingDerivation=null,e}function It(e){Hn.trackingDerivation=e}function jt(e){if(e.dependenciesState!==n.IDerivationState.UP_TO_DATE){e.dependenciesState=n.IDerivationState.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=n.IDerivationState.UP_TO_DATE}}function Dt(e){return console.log(e),e}function kt(e,t){return je("`whyRun` is deprecated in favor of `trace`"),e=Et(arguments),e?Sn(e)||tr(e)?Dt(e.whyRun()):Ae(x("m025")):Dt(x("m024"))}function Tt(){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=Et(e);if(!r)return Ae("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===Fn.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Fn.BREAK:Fn.LOG}function Et(e){switch(e.length){case 0:return Hn.trackingDerivation;case 1:return Xe(e[0]);case 2:return Xe(e[0],e[1])}}function Rt(e){Ie(this&&this.$mobx&&tr(this.$mobx),"Invalid `this`"),Ie(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=e}function Vt(e){return Hn.globalReactionErrorHandlers.push(e),function(){var t=Hn.globalReactionErrorHandlers.indexOf(e);t>=0&&Hn.globalReactionErrorHandlers.splice(t,1)}}function Lt(){Hn.inBatch>0||Hn.isRunningReactions||er(Pt)}function Pt(){Hn.isRunningReactions=!0;for(var e=Hn.pendingReactions,t=0;e.length>0;){++t===Zn&&(console.error("Reaction doesn't converge to a stable state after "+Zn+" 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()}Hn.isRunningReactions=!1}function Ct(e){var t=er;er=function(n){return e(function(){return t(n)})}}function Mt(e){return je("asReference is deprecated, use observable.ref instead"),Pn.ref(e)}function Nt(e){return je("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),Pn.struct(e)}function $t(e){return je("asFlat is deprecated, use observable.shallow instead"),Pn.shallow(e)}function Bt(e){return je("asMap is deprecated, use observable.map or observable.shallowMap instead"),Pn.map(e||{})}function Ut(e){return E(function(t,n,r,o,i){Ie(void 0!==i,x("m009")),Ie("function"==typeof i.get,x("m010")),ee(X(t,""),n,i.get,i.set,e,!1)},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,!1)}function zt(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(!1===ae(e))return!1;if(!e.$mobx.values[t])return!1;var n=Xe(e,t);return Sn(n)}return Sn(e)}function Gt(e,t,n,r){return"function"==typeof n?Ht(e,t,n,r):Kt(e,t,n)}function Kt(e,t,n){return Qe(e).observe(t,n)}function Ht(e,t,n,r){return Qe(e,t).observe(n,r)}function Wt(e,t,n){return"function"==typeof n?qt(e,t,n):Jt(e,t)}function Jt(e,t){return Qe(e).intercept(t)}function qt(e,t,n){return Qe(e,t).intercept(n)}function Yt(e,t){return gt()||console.warn(x("m013")),or(e,{context:t}).get()}function Ft(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=[]),se(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(w(e)){var a=r([]),s=e.map(function(e){return Ft(e,t,n)});a.length=s.length;for(var o=0,i=s.length;o<i;o++)a[o]=s[o];return a}if(ae(e)){var a=r({});for(var u in e)a[u]=Ft(e[u],t,n);return a}if(Nn(e)){var c=r({});return e.forEach(function(e,r){return c[r]=Ft(e,t,n)}),c}if(bn(e))return Ft(e.get(),t,n)}return e}function Xt(e,n){Ie("function"==typeof e&&e.length<2,"createTransformer expects a function that accepts one argument");var r={},o=Hn.resetId,i=function(o){function i(t,n){var r=o.call(this,function(){return e(n)},void 0,On.default,"Transformer-"+e.name+"-"+t,void 0)||this;return r.sourceIdentifier=t,r.sourceObject=n,r}return t(i,o),i.prototype.onBecomeUnobserved=function(){var e=this.value;o.prototype.onBecomeUnobserved.call(this),delete r[this.sourceIdentifier],n&&n(e,this.sourceObject)},i}(_n);return function(e){o!==Hn.resetId&&(r={},o=Hn.resetId);var t=Qt(e),n=r[t];return n?n.get():(n=r[t]=new i(t,e),n.get())}}function Qt(e){if("string"==typeof e||"number"==typeof e)return e;if(null===e||"object"!=typeof e)throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+e);var t=e.$transformId;return void 0===t&&(t=Se(),Pe(e,"$transformId",t)),t}function Zt(e,t,n){var r;if(Nn(e)||w(e)||bn(e))r=Qe(e);else{if(!ae(e))return Ae("Expected observable map, object or array as first array");if("string"!=typeof t)return Ae("InterceptReads can only be used with a specific property, not with an object in general");r=Qe(e,t)}return void 0!==r.dehancer?Ae("An intercept reader was already established"):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})}Object.defineProperty(n,"__esModule",{value:!0});var en=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])},tn=function(){function e(e){void 0===e&&(e="Atom@"+Se()),this.name=e,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=n.IDerivationState.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.reportObserved=function(){pt(this)},e.prototype.reportChanged=function(){ct(),ft(this),lt()},e.prototype.toString=function(){return this.name},e}(),nn=function(e){function n(t,n,r){void 0===t&&(t="Atom@"+Se()),void 0===n&&(n=Un),void 0===r&&(r=Un);var o=e.call(this,t)||this;return o.name=t,o.onBecomeObservedHandler=n,o.onBecomeUnobservedHandler=r,o.isPendingUnobservation=!1,o.isBeingTracked=!1,o}return t(n,e),n.prototype.reportObserved=function(){return ct(),e.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),lt(),!!Hn.trackingDerivation},n.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},n}(tn),rn=$e("Atom",tn),on={spyReportEnd:!0},an="__$$iterating",sn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),un=0,cn=function(){function e(){}return e}();!function(e,t){void 0!==Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):void 0!==e.prototype.__proto__?e.prototype.__proto__=t:e.prototype=t}(cn,Array.prototype),Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(cn.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var ln=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new tn(e||"ObservableArray@"+Se()),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.map(this.dehancer):e},e.prototype.intercept=function(e){return o(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}),s(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>un&&g(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var o=this;wt(this.atom);var a=this.values.length;if(void 0===e?e=0:e>a?e=a:e<0&&(e=Math.max(0,a+e)),t=1===arguments.length?a-e:void 0===t||null===t?0:Math.max(0,Math.min(t,a-e)),void 0===n&&(n=[]),r(this)){var s=i(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!s)return $n;t=s.removedCount,n=s.added}n=n.map(function(e){return o.enhancer(e,void 0)});var u=n.length-t;this.updateArrayLength(a,u);var c=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,c),this.dehanceValues(c)},e.prototype.spliceItemsIntoValues=function(e,t,n){if(n.length<1e4)return(o=this.values).splice.apply(o,[e,t].concat(n));var r=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),r;var o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&c(),o=a(this),i=o||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&p(i),this.atom.reportChanged(),o&&u(this,i),r&&f()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&c(),o=a(this),i=o||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&p(i),this.atom.reportChanged(),o&&u(this,i),r&&f()},e}(),pn=function(e){function n(t,n,r,o){void 0===r&&(r="ObservableArray@"+Se()),void 0===o&&(o=!1);var i=e.call(this)||this,a=new ln(r,n,i,o);return Ce(i,"$mobx",a),t&&t.length&&i.spliceWithArray(0,0,t),sn&&Object.defineProperty(a.array,"0",fn),i}return t(n,e),n.prototype.intercept=function(e){return this.$mobx.intercept(e)},n.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},n.prototype.clear=function(){return this.splice(0)},n.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 w(e)?e.peek():e}))},n.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},n.prototype.toJS=function(){return this.slice()},n.prototype.toJSON=function(){
3
- return this.toJS()},n.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},n.prototype.find=function(e,t,n){void 0===n&&(n=0);var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},n.prototype.findIndex=function(e,t,n){void 0===n&&(n=0);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},n.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)},n.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},n.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},n.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},n.prototype.shift=function(){return this.splice(0,1)[0]},n.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},n.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},n.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},n.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},n.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?o.slice(0,e).concat(o.slice(e+1,t+1),[o[e]],o.slice(t+1)):o.slice(0,t).concat([o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},n.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")}},n.prototype.set=function(e,t){var n=this.$mobx,o=n.values;if(e<o.length){wt(n.atom);var a=o[e];if(r(n)){var s=i(n,{type:"update",object:this,index:e,newValue:t});if(!s)return;t=s.newValue}t=n.enhancer(t,a);t!==a&&(o[e]=t,n.notifyArrayChildUpdate(e,t,a))}else{if(e!==o.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+o.length);n.spliceWithArray(e,0,[t])}},n}(cn);b(pn.prototype,function(){return v(this.slice())}),Object.defineProperty(pn.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","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];Ie("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),Pe(pn.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)Pe(e,t[n],e[t[n]])}(pn.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 fn=m(0);g(1e3);var hn=$e("ObservableArrayAdministration",ln),dn={},vn=function(e){function n(t,n,r,o){void 0===r&&(r="ObservableValue@"+Se()),void 0===o&&(o=!0);var i=e.call(this,r)||this;return i.enhancer=n,i.hasUnreportedChange=!1,i.dehancer=void 0,i.value=n(t,void 0,r),o&&c()&&l({type:"create",object:i,newValue:i.value}),i}return t(n,e),n.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},n.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==dn){var n=c();n&&p({type:"update",object:this,newValue:e,oldValue:t}),this.setNewValue(e),n&&f()}},n.prototype.prepareNewValue=function(e){if(wt(this),r(this)){var t=i(this,{object:this,type:"update",newValue:e});if(!t)return dn;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.value!==e?e:dn},n.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),a(this)&&u(this,{type:"update",object:this,newValue:e,oldValue:t})},n.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},n.prototype.intercept=function(e){return o(this,e)},n.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),s(this,e)},n.prototype.toJSON=function(){return this.get()},n.prototype.toString=function(){return this.name+"["+this.value+"]"},n.prototype.valueOf=function(){return We(this.get())},n}(tn);vn.prototype[He()]=vn.prototype.valueOf;var bn=$e("ObservableValue",vn),mn={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"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.",m006:"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.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m024:"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 its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* 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).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 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"},yn=E(function(e,t,n,r,o){var i=r&&1===r.length?r[0]:n.name||t||"<unnamed action>";Pe(e,t,wn(i,n))},function(e){return this[e]},function(){Ie(!1,x("m001"))},!1,!0),gn=E(function(e,t,n){N(e,t,n)},function(e){return this[e]},function(){Ie(!1,x("m001"))},!1,!1),wn=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?O(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?O(e,t):1===arguments.length&&"string"==typeof e?P(e):P(t).apply(null,arguments)};wn.bound=function(e,t,n){if("function"==typeof e){var r=O("<not yet bound action>",e);return r.autoBind=!0,r}return gn.apply(null,arguments)};var xn=Object.prototype.toString,On={identity:K,structural:H,default:W},_n=function(){function e(e,t,r,o,i){this.derivation=e,this.scope=t,this.equals=r,this.dependenciesState=n.IDerivationState.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=n.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Se(),this.value=new Xn(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Fn.NONE,this.name=o||"ComputedValue@"+Se(),i&&(this.setter=O(o+"-setter",i))}return e.prototype.onBecomeStale=function(){dt(this)},e.prototype.onBecomeUnobserved=function(){_t(this),this.value=void 0},e.prototype.get=function(){Ie(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===Hn.inBatch?(ct(),yt(this)&&(this.isTracing!==Fn.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context and doing a full recompute"),this.value=this.computeValue(!1)),lt()):(pt(this),yt(this)&&this.trackAndCompute()&&ht(this));var e=this.value;if(mt(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(mt(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){Ie(!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 Ie(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){c()&&l({object:this.scope,type:"compute",fn:this.derivation});var e=this.value,t=this.dependenciesState===n.IDerivationState.NOT_TRACKING,r=this.value=this.computeValue(!0);return t||mt(e)||mt(r)||!this.equals(e,r)},e.prototype.computeValue=function(e){this.isComputing=!0,Hn.computationDepth++;var t;if(e)t=xt(this,this.derivation,this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new Xn(e)}return Hn.computationDepth--,this.isComputing=!1,t},e.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return J(function(){var i=n.get();if(!r||t){var a=At();e({type:"update",object:n,newValue:i,oldValue:o}),It(a)}r=!1,o=i})},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return We(this.get())},e.prototype.whyRun=function(){var e=Boolean(Hn.trackingDerivation),t=ke(this.isComputing?this.newObserving:this.observing).map(function(e){return e.name}),r=ke(it(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===n.IDerivationState.NOT_TRACKING?x("m032"):" * This computation will re-run if any of the following observables changes:\n "+Te(t)+"\n "+(this.isComputing&&e?" (... or any observable accessed during the remainder of the current run)":"")+"\n "+x("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+Te(r)+"\n")},e}();_n.prototype[He()]=_n.prototype.valueOf;var Sn=$e("ComputedValue",_n),An=function(){function e(e,t){this.target=e,this.name=t,this.values={},this.changeListeners=null,this.interceptors=null}return e.prototype.observe=function(e,t){return Ie(!0!==t,"`observe` doesn't support the fire immediately property for observable objects."),s(this,e)},e.prototype.intercept=function(e){return o(this,e)},e}(),In={},jn={},Dn=$e("ObservableObjectAdministration",An),kn=ue(be),Tn=ue(me),En=ue(ye),Rn=ue(ge),Vn=ue(we),Ln={box:function(e,t){return arguments.length>2&&he("box"),new vn(e,be,t)},shallowBox:function(e,t){return arguments.length>2&&he("shallowBox"),new vn(e,ye,t)},array:function(e,t){return arguments.length>2&&he("array"),new pn(e,be,t)},shallowArray:function(e,t){return arguments.length>2&&he("shallowArray"),new pn(e,ye,t)},map:function(e,t){return arguments.length>2&&he("map"),new Mn(e,be,t)},shallowMap:function(e,t){return arguments.length>2&&he("shallowMap"),new Mn(e,ye,t)},object:function(e,t){arguments.length>2&&he("object");var n={};return X(n,t),ce(n,e),n},shallowObject:function(e,t){arguments.length>2&&he("shallowObject");var n={};return X(n,t),le(n,e),n},ref:function(){return arguments.length<2?ve(ye,arguments[0]):En.apply(null,arguments)},shallow:function(){return arguments.length<2?ve(me,arguments[0]):Tn.apply(null,arguments)},deep:function(){return arguments.length<2?ve(be,arguments[0]):kn.apply(null,arguments)},struct:function(){return arguments.length<2?ve(ge,arguments[0]):Rn.apply(null,arguments)}},Pn=fe;Object.keys(Ln).forEach(function(e){return Pn[e]=Ln[e]}),Pn.deep.struct=Pn.struct,Pn.ref.struct=function(){return arguments.length<2?ve(we,arguments[0]):Vn.apply(null,arguments)};var Cn={},Mn=function(){function e(e,t,n){void 0===t&&(t=be),void 0===n&&(n="ObservableMap@"+Se()),this.enhancer=t,this.name=n,this.$mobx=Cn,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new pn(void 0,ye,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.dehancer=void 0,this.merge(e)}return e.prototype._has=function(e){return void 0!==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(r(this)){var o=i(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!o)return this;t=o.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(this.assertValidKey(e),e=""+e,r(this)){var n=i(this,{type:"delete",object:this,name:e});if(!n)return!1}if(this._has(e)){var o=c(),s=a(this),n=s||o?{type:"delete",object:this,oldValue:this._data[e].value,name:e}:null;return o&&p(n),xe(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data[e].setNewValue(void 0),t._data[e]=void 0}),s&&u(this,n),o&&f(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap[e];return n?n.setNewValue(t):n=this._hasMap[e]=new vn(t,ye,this.name+"."+e+"?",!1),n},e.prototype._updateValue=function(e,t){var n=this._data[e];if((t=n.prepareNewValue(t))!==dn){var r=c(),o=a(this),i=o||r?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;r&&p(i),n.setNewValue(t),o&&u(this,i),r&&f()}},e.prototype._addValue=function(e,t){var n=this;xe(function(){var r=n._data[e]=new vn(t,n.enhancer,n.name+"."+e,!1);t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var r=c(),o=a(this),i=o||r?{type:"add",object:this,name:e,newValue:t}:null;r&&p(i),o&&u(this,i),r&&f()},e.prototype.get=function(e){return e=""+e,this.has(e)?this.dehanceValue(this._data[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 v(this._keys.slice())},e.prototype.values=function(){return v(this._keys.map(this.get,this))},e.prototype.entries=function(){var e=this;return v(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,n)})},e.prototype.merge=function(e){var t=this;return Nn(e)&&(e=e.toJS()),xe(function(){Re(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):ze(e)?e.forEach(function(e,n){return t.set(n,e)}):null!==e&&void 0!==e&&Ae("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;xe(function(){St(function(){e.keys().forEach(e.delete,e)})})},e.prototype.replace=function(e){var t=this;return xe(function(){var n=Ge(e);t.keys().filter(function(e){return-1===n.indexOf(e)}).forEach(function(e){return t.delete(e)}),t.merge(e)}),this},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.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+"', only strings, numbers and booleans are accepted as key in observable maps.")},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 Ie(!0!==t,x("m033")),s(this,e)},e.prototype.intercept=function(e){return o(this,e)},e}();b(Mn.prototype,function(){return this.entries()});var Nn=$e("ObservableMap",Mn),$n=[];Object.freeze($n);var Bn=[],Un=function(){},zn=Object.prototype.hasOwnProperty,Gn=["mobxGuid","resetId","spyListeners","strictMode","runId"],Kn=function(){function e(){this.version=5,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.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]}return e}(),Hn=new Kn,Wn=!1,Jn=!1,qn=!1,Yn=_e();Yn.__mobxInstanceCount?(Yn.__mobxInstanceCount++,setTimeout(function(){Wn||Jn||qn||(qn=!0,console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details."))})):Yn.__mobxInstanceCount=1,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"}(n.IDerivationState||(n.IDerivationState={}));var Fn;!function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(Fn||(Fn={}));var Xn=function(){function e(e){this.cause=e}return e}(),Qn=function(){function e(e,t){void 0===e&&(e="Reaction@"+Se()),this.name=e,this.onInvalidate=t,this.observing=[],this.newObserving=[],this.dependenciesState=n.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Se(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Fn.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Hn.pendingReactions.push(this),Lt())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){this.isDisposed||(ct(),this._isScheduled=!1,yt(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&c()&&l({object:this,type:"scheduled-reaction"})),lt())},e.prototype.track=function(e){ct();var t,n=c();n&&(t=Date.now(),p({object:this,type:"reaction",fn:e})),this._isRunning=!0;var r=xt(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&_t(this),mt(r)&&this.reportExceptionInDerivation(r.cause),n&&f({time:Date.now()-t}),lt()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)return void this.errorHandler(e,this);var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=x("m037");console.error(n||r,e),c()&&l({type:"error",message:n,error:e,object:this}),Hn.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(ct(),_t(this),lt()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e.onError=Rt,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.whyRun=function(){var e=ke(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 "+Te(e)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+x("m038")+"\n"},e.prototype.trace=function(e){void 0===e&&(e=!1),Tt(this,e)},e}(),Zn=100,er=function(e){return e()},tr=$e("Reaction",Qn),nr=Ut(On.default),rr=Ut(On.structural),or=function(e,t,n){if("string"==typeof t)return nr.apply(null,arguments);Ie("function"==typeof e,x("m011")),Ie(arguments.length<3,x("m012"));var r="object"==typeof t?t:{};r.setter="function"==typeof t?t:r.setter;var o=r.equals?r.equals:r.compareStructural||r.struct?On.structural:On.default;return new _n(e,r.context,o,r.name||e.name||"",r.setter)};or.struct=rr,or.equals=Ut;var ir={allowStateChanges:D,deepEqual:$,getAtom:Xe,getDebugName:Ze,getDependencyTree:et,getAdministration:Qe,getGlobalState:Ye,getObserverTree:nt,interceptReads:Zt,isComputingDerivation:gt,isSpyEnabled:c,onReactionError:Vt,reserveArrayBuffer:g,resetGlobalState:Fe,isolateGlobalState:Je,shareGlobalState:qe,spyReport:l,spyReportEnd:f,spyReportStart:p,setReactionScheduler:Ct},ar={Reaction:Qn,untracked:St,Atom:nn,BaseAtom:tn,useStrict:I,isStrictModeEnabled:j,spy:h,comparer:On,asReference:Mt,asFlat:$t,asStructure:Nt,asMap:Bt,isModifierDescriptor:de,isObservableObject:ae,isBoxedObservable:bn,isObservableArray:w,ObservableMap:Mn,isObservableMap:Nn,map:Oe,transaction:xe,observable:Pn,computed:or,isObservable:se,isComputed:zt,extendObservable:ce,extendShallowObservable:le,observe:Gt,intercept:Wt,autorun:J,autorunAsync:Y,when:q,reaction:F,action:wn,isAction:M,runInAction:C,expr:Yt,toJS:Ft,createTransformer:Xt,whyRun:kt,isArrayLike:Ue,extras:ir},sr=!1;for(var ur in ar)!function(e){var t=ar[e];Object.defineProperty(ar,e,{get:function(){return sr||(sr=!0,console.warn("Using default export (`import mobx from 'mobx'`) is deprecated and won’t work in mobx@4.0.0\nUse `import * as mobx from 'mobx'` instead")),t}})}(ur);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:h,extras:ir}),n.extras=ir,n.default=ar,n.Reaction=Qn,n.untracked=St,n.Atom=nn,n.BaseAtom=tn,n.useStrict=I,n.isStrictModeEnabled=j,n.spy=h,n.comparer=On,n.asReference=Mt,n.asFlat=$t,n.asStructure=Nt,n.asMap=Bt,n.isModifierDescriptor=de,n.isObservableObject=ae,n.isBoxedObservable=bn,n.isObservableArray=w,n.ObservableMap=Mn,n.isObservableMap=Nn,n.map=Oe,n.transaction=xe,n.observable=Pn,n.computed=or,n.isObservable=se,n.isComputed=zt,n.extendObservable=ce,n.extendShallowObservable=le,n.observe=Gt,n.intercept=Wt,n.autorun=J,n.autorunAsync=Y,n.when=q,n.reaction=F,n.action=wn,n.isAction=M,n.runInAction=C,n.expr=Yt,n.toJS=Ft,n.createTransformer=Xt,n.whyRun=kt,n.trace=Tt,n.isArrayLike=Ue}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
3
+ return this.toJS()},n.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},n.prototype.find=function(e,t,n){void 0===n&&(n=0);var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},n.prototype.findIndex=function(e,t,n){void 0===n&&(n=0);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},n.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)},n.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},n.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},n.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},n.prototype.shift=function(){return this.splice(0,1)[0]},n.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},n.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},n.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},n.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},n.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?o.slice(0,e).concat(o.slice(e+1,t+1),[o[e]],o.slice(t+1)):o.slice(0,t).concat([o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},n.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")}},n.prototype.set=function(e,t){var n=this.$mobx,o=n.values;if(e<o.length){wt(n.atom);var a=o[e];if(r(n)){var s=i(n,{type:"update",object:this,index:e,newValue:t});if(!s)return;t=s.newValue}t=n.enhancer(t,a);t!==a&&(o[e]=t,n.notifyArrayChildUpdate(e,t,a))}else{if(e!==o.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+o.length);n.spliceWithArray(e,0,[t])}},n}(cn);b(pn.prototype,function(){return v(this.slice())}),Object.defineProperty(pn.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","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];Ie("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),Pe(pn.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)Pe(e,t[n],e[t[n]])}(pn.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 fn=m(0);g(1e3);var hn=$e("ObservableArrayAdministration",ln),dn={},vn=function(e){function n(t,n,r,o){void 0===r&&(r="ObservableValue@"+Se()),void 0===o&&(o=!0);var i=e.call(this,r)||this;return i.enhancer=n,i.hasUnreportedChange=!1,i.dehancer=void 0,i.value=n(t,void 0,r),o&&c()&&l({type:"create",object:i,newValue:i.value}),i}return t(n,e),n.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},n.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==dn){var n=c();n&&p({type:"update",object:this,newValue:e,oldValue:t}),this.setNewValue(e),n&&f()}},n.prototype.prepareNewValue=function(e){if(wt(this),r(this)){var t=i(this,{object:this,type:"update",newValue:e});if(!t)return dn;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.value!==e?e:dn},n.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),a(this)&&u(this,{type:"update",object:this,newValue:e,oldValue:t})},n.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},n.prototype.intercept=function(e){return o(this,e)},n.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),s(this,e)},n.prototype.toJSON=function(){return this.get()},n.prototype.toString=function(){return this.name+"["+this.value+"]"},n.prototype.valueOf=function(){return We(this.get())},n}(tn);vn.prototype[He()]=vn.prototype.valueOf;var bn=$e("ObservableValue",vn),mn={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"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.",m006:"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.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m024:"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 its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* 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).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 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"},yn=E(function(e,t,n,r,o){var i=r&&1===r.length?r[0]:n.name||t||"<unnamed action>";Pe(e,t,wn(i,n))},function(e){return this[e]},function(){Ie(!1,x("m001"))},!1,!0),gn=E(function(e,t,n){N(e,t,n)},function(e){return this[e]},function(){Ie(!1,x("m001"))},!1,!1),wn=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?O(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?O(e,t):1===arguments.length&&"string"==typeof e?P(e):P(t).apply(null,arguments)};wn.bound=function(e,t,n){if("function"==typeof e){var r=O("<not yet bound action>",e);return r.autoBind=!0,r}return gn.apply(null,arguments)};var xn=Object.prototype.toString,On={identity:K,structural:H,default:W},_n=function(){function e(e,t,r,o,i){this.derivation=e,this.scope=t,this.equals=r,this.dependenciesState=n.IDerivationState.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=n.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Se(),this.value=new Xn(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Fn.NONE,this.name=o||"ComputedValue@"+Se(),i&&(this.setter=O(o+"-setter",i))}return e.prototype.onBecomeStale=function(){dt(this)},e.prototype.onBecomeUnobserved=function(){_t(this),this.value=void 0},e.prototype.get=function(){Ie(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===Hn.inBatch?(ct(),yt(this)&&(this.isTracing!==Fn.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context and doing a full recompute"),this.value=this.computeValue(!1)),lt()):(pt(this),yt(this)&&this.trackAndCompute()&&ht(this));var e=this.value;if(mt(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(mt(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){Ie(!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 Ie(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){c()&&l({object:this.scope,type:"compute",fn:this.derivation});var e=this.value,t=this.dependenciesState===n.IDerivationState.NOT_TRACKING,r=this.value=this.computeValue(!0);return t||mt(e)||mt(r)||!this.equals(e,r)},e.prototype.computeValue=function(e){this.isComputing=!0,Hn.computationDepth++;var t;if(e)t=xt(this,this.derivation,this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new Xn(e)}return Hn.computationDepth--,this.isComputing=!1,t},e.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return J(function(){var i=n.get();if(!r||t){var a=At();e({type:"update",object:n,newValue:i,oldValue:o}),It(a)}r=!1,o=i})},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return We(this.get())},e.prototype.whyRun=function(){var e=Boolean(Hn.trackingDerivation),t=ke(this.isComputing?this.newObserving:this.observing).map(function(e){return e.name}),r=ke(it(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===n.IDerivationState.NOT_TRACKING?x("m032"):" * This computation will re-run if any of the following observables changes:\n "+Te(t)+"\n "+(this.isComputing&&e?" (... or any observable accessed during the remainder of the current run)":"")+"\n "+x("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+Te(r)+"\n")},e}();_n.prototype[He()]=_n.prototype.valueOf;var Sn=$e("ComputedValue",_n),An=function(){function e(e,t){this.target=e,this.name=t,this.values={},this.changeListeners=null,this.interceptors=null}return e.prototype.observe=function(e,t){return Ie(!0!==t,"`observe` doesn't support the fire immediately property for observable objects."),s(this,e)},e.prototype.intercept=function(e){return o(this,e)},e}(),In={},jn={},Dn=$e("ObservableObjectAdministration",An),kn=ue(be),Tn=ue(me),En=ue(ye),Rn=ue(ge),Vn=ue(we),Ln={box:function(e,t){return arguments.length>2&&he("box"),new vn(e,be,t)},shallowBox:function(e,t){return arguments.length>2&&he("shallowBox"),new vn(e,ye,t)},array:function(e,t){return arguments.length>2&&he("array"),new pn(e,be,t)},shallowArray:function(e,t){return arguments.length>2&&he("shallowArray"),new pn(e,ye,t)},map:function(e,t){return arguments.length>2&&he("map"),new Mn(e,be,t)},shallowMap:function(e,t){return arguments.length>2&&he("shallowMap"),new Mn(e,ye,t)},object:function(e,t){arguments.length>2&&he("object");var n={};return X(n,t),ce(n,e),n},shallowObject:function(e,t){arguments.length>2&&he("shallowObject");var n={};return X(n,t),le(n,e),n},ref:function(){return arguments.length<2?ve(ye,arguments[0]):En.apply(null,arguments)},shallow:function(){return arguments.length<2?ve(me,arguments[0]):Tn.apply(null,arguments)},deep:function(){return arguments.length<2?ve(be,arguments[0]):kn.apply(null,arguments)},struct:function(){return arguments.length<2?ve(ge,arguments[0]):Rn.apply(null,arguments)}},Pn=fe;Object.keys(Ln).forEach(function(e){return Pn[e]=Ln[e]}),Pn.deep.struct=Pn.struct,Pn.ref.struct=function(){return arguments.length<2?ve(we,arguments[0]):Vn.apply(null,arguments)};var Cn={},Mn=function(){function e(e,t,n){void 0===t&&(t=be),void 0===n&&(n="ObservableMap@"+Se()),this.enhancer=t,this.name=n,this.$mobx=Cn,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new pn(void 0,ye,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.dehancer=void 0,this.merge(e)}return e.prototype._has=function(e){return void 0!==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(r(this)){var o=i(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!o)return this;t=o.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(this.assertValidKey(e),e=""+e,r(this)){var n=i(this,{type:"delete",object:this,name:e});if(!n)return!1}if(this._has(e)){var o=c(),s=a(this),n=s||o?{type:"delete",object:this,oldValue:this._data[e].value,name:e}:null;return o&&p(n),xe(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data[e].setNewValue(void 0),t._data[e]=void 0}),s&&u(this,n),o&&f(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap[e];return n?n.setNewValue(t):n=this._hasMap[e]=new vn(t,ye,this.name+"."+e+"?",!1),n},e.prototype._updateValue=function(e,t){var n=this._data[e];if((t=n.prepareNewValue(t))!==dn){var r=c(),o=a(this),i=o||r?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;r&&p(i),n.setNewValue(t),o&&u(this,i),r&&f()}},e.prototype._addValue=function(e,t){var n=this;xe(function(){var r=n._data[e]=new vn(t,n.enhancer,n.name+"."+e,!1);t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var r=c(),o=a(this),i=o||r?{type:"add",object:this,name:e,newValue:t}:null;r&&p(i),o&&u(this,i),r&&f()},e.prototype.get=function(e){return e=""+e,this.has(e)?this.dehanceValue(this._data[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 v(this._keys.slice())},e.prototype.values=function(){return v(this._keys.map(this.get,this))},e.prototype.entries=function(){var e=this;return v(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,n)})},e.prototype.merge=function(e){var t=this;return Nn(e)&&(e=e.toJS()),xe(function(){Re(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):ze(e)?e.forEach(function(e,n){return t.set(n,e)}):null!==e&&void 0!==e&&Ae("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;xe(function(){St(function(){e.keys().forEach(e.delete,e)})})},e.prototype.replace=function(e){var t=this;return xe(function(){var n=Ge(e);t.keys().filter(function(e){return-1===n.indexOf(e)}).forEach(function(e){return t.delete(e)}),t.merge(e)}),this},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.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+"', only strings, numbers and booleans are accepted as key in observable maps.")},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 Ie(!0!==t,x("m033")),s(this,e)},e.prototype.intercept=function(e){return o(this,e)},e}();b(Mn.prototype,function(){return this.entries()});var Nn=$e("ObservableMap",Mn),$n=[];Object.freeze($n);var Bn=[],Un=function(){},zn=Object.prototype.hasOwnProperty,Gn=["mobxGuid","resetId","spyListeners","strictMode","runId"],Kn=function(){function e(){this.version=5,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.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]}return e}(),Hn=new Kn,Wn=!1,Jn=!1,qn=!1,Yn=_e();Yn.__mobxInstanceCount?(Yn.__mobxInstanceCount++,setTimeout(function(){Wn||Jn||qn||(qn=!0,console.warn("[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See https://github.com/mobxjs/mobx/issues/1082 for details."))},1)):Yn.__mobxInstanceCount=1,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"}(n.IDerivationState||(n.IDerivationState={}));var Fn;!function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(Fn||(Fn={}));var Xn=function(){function e(e){this.cause=e}return e}(),Qn=function(){function e(e,t){void 0===e&&(e="Reaction@"+Se()),this.name=e,this.onInvalidate=t,this.observing=[],this.newObserving=[],this.dependenciesState=n.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Se(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Fn.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Hn.pendingReactions.push(this),Lt())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){this.isDisposed||(ct(),this._isScheduled=!1,yt(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&c()&&l({object:this,type:"scheduled-reaction"})),lt())},e.prototype.track=function(e){ct();var t,n=c();n&&(t=Date.now(),p({object:this,type:"reaction",fn:e})),this._isRunning=!0;var r=xt(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&_t(this),mt(r)&&this.reportExceptionInDerivation(r.cause),n&&f({time:Date.now()-t}),lt()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)return void this.errorHandler(e,this);var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this,r=x("m037");console.error(n||r,e),c()&&l({type:"error",message:n,error:e,object:this}),Hn.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(ct(),_t(this),lt()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e.onError=Rt,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.whyRun=function(){var e=ke(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 "+Te(e)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+x("m038")+"\n"},e.prototype.trace=function(e){void 0===e&&(e=!1),Tt(this,e)},e}(),Zn=100,er=function(e){return e()},tr=$e("Reaction",Qn),nr=Ut(On.default),rr=Ut(On.structural),or=function(e,t,n){if("string"==typeof t)return nr.apply(null,arguments);Ie("function"==typeof e,x("m011")),Ie(arguments.length<3,x("m012"));var r="object"==typeof t?t:{};r.setter="function"==typeof t?t:r.setter;var o=r.equals?r.equals:r.compareStructural||r.struct?On.structural:On.default;return new _n(e,r.context,o,r.name||e.name||"",r.setter)};or.struct=rr,or.equals=Ut;var ir={allowStateChanges:D,deepEqual:$,getAtom:Xe,getDebugName:Ze,getDependencyTree:et,getAdministration:Qe,getGlobalState:Ye,getObserverTree:nt,interceptReads:Zt,isComputingDerivation:gt,isSpyEnabled:c,onReactionError:Vt,reserveArrayBuffer:g,resetGlobalState:Fe,isolateGlobalState:Je,shareGlobalState:qe,spyReport:l,spyReportEnd:f,spyReportStart:p,setReactionScheduler:Ct},ar={Reaction:Qn,untracked:St,Atom:nn,BaseAtom:tn,useStrict:I,isStrictModeEnabled:j,spy:h,comparer:On,asReference:Mt,asFlat:$t,asStructure:Nt,asMap:Bt,isModifierDescriptor:de,isObservableObject:ae,isBoxedObservable:bn,isObservableArray:w,ObservableMap:Mn,isObservableMap:Nn,map:Oe,transaction:xe,observable:Pn,computed:or,isObservable:se,isComputed:zt,extendObservable:ce,extendShallowObservable:le,observe:Gt,intercept:Wt,autorun:J,autorunAsync:Y,when:q,reaction:F,action:wn,isAction:M,runInAction:C,expr:Yt,toJS:Ft,createTransformer:Xt,whyRun:kt,isArrayLike:Ue,extras:ir},sr=!1;for(var ur in ar)!function(e){var t=ar[e];Object.defineProperty(ar,e,{get:function(){return sr||(sr=!0,console.warn("Using default export (`import mobx from 'mobx'`) is deprecated and won’t work in mobx@4.0.0\nUse `import * as mobx from 'mobx'` instead")),t}})}(ur);"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:h,extras:ir}),n.extras=ir,n.default=ar,n.Reaction=Qn,n.untracked=St,n.Atom=nn,n.BaseAtom=tn,n.useStrict=I,n.isStrictModeEnabled=j,n.spy=h,n.comparer=On,n.asReference=Mt,n.asFlat=$t,n.asStructure=Nt,n.asMap=Bt,n.isModifierDescriptor=de,n.isObservableObject=ae,n.isBoxedObservable=bn,n.isObservableArray=w,n.ObservableMap=Mn,n.isObservableMap=Nn,n.map=Oe,n.transaction=xe,n.observable=Pn,n.computed=or,n.isObservable=se,n.isComputed=zt,n.extendObservable=ce,n.extendShallowObservable=le,n.observe=Gt,n.intercept=Wt,n.autorun=J,n.autorunAsync=Y,n.when=q,n.reaction=F,n.action=wn,n.isAction=M,n.runInAction=C,n.expr=Yt,n.toJS=Ft,n.createTransformer=Xt,n.whyRun=kt,n.trace=Tt,n.isArrayLike=Ue}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});
4
4
  //# sourceMappingURL=lib/mobx.umd.min.js.map