@k8slens/extensions 5.3.1-git.93a60caf40.0 → 5.3.1-git.a6763391ee.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22393,7 +22393,7 @@ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ?
22393
22393
  /***/ (function(module, exports, __webpack_require__) {
22394
22394
 
22395
22395
  "use strict";
22396
- eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableHistory = exports.createObservableHistory = void 0;\nconst mobx_1 = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\nconst history_1 = __webpack_require__(/*! history */ \"./node_modules/history/esm/history.js\");\nconst observable_search_params_1 = __webpack_require__(/*! ./observable-search-params */ \"./node_modules/mobx-observable-history/lib/observable-search-params.js\");\nfunction createObservableHistory(history, opts) {\n return new ObservableHistory(history, opts);\n}\nexports.createObservableHistory = createObservableHistory;\nclass ObservableHistory {\n constructor(history = history_1.createBrowserHistory(), opts = {}) {\n Object.defineProperty(this, \"opts\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: opts\n });\n Object.defineProperty(this, \"history\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"unbindEvents\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"action\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"location\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"searchParams\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n mobx_1.makeObservable(this);\n this.history = history;\n this.action = this.history.action;\n this.location = this.history.location;\n this.searchParams = new observable_search_params_1.ObservableSearchParams(this.location.search, opts.searchParams);\n this.unbindEvents = this.bindEvents();\n return new Proxy(this, {\n get: (target, prop, context) => {\n let fieldRef = Reflect.get(target, prop, context);\n if (!(prop in target)) {\n return Reflect.get(this.history, prop, context); // handle history.js native apis\n }\n return fieldRef;\n },\n });\n }\n bindEvents() {\n const disposers = [\n // normalize direct updates of `history.location = string | LocationDescriptor`\n mobx_1.intercept(this, change => {\n if (change.type === \"update\") {\n switch (change.name) {\n case \"location\":\n change.newValue = this.normalize(change.newValue);\n break;\n }\n }\n return change;\n }),\n // normalize partial updates of `history.location.(search|hash|pathname) = string`\n mobx_1.intercept(this.location, change => {\n if (change.type === \"update\") {\n switch (change.name) {\n case \"search\":\n change.newValue = this.normalize(change.newValue).search;\n break;\n case \"hash\":\n change.newValue = this.normalize(change.newValue).hash;\n break;\n }\n }\n return change;\n }),\n // sync location.search with URLSearchParams()-helper\n mobx_1.reaction(() => this.location.search, search => {\n const params = this.searchParams.toString({ withPrefix: true });\n if (search !== params) {\n this.searchParams.replace(search);\n }\n }),\n // sync from URLSearchParams()-api updates\n mobx_1.reaction(() => this.searchParams.toString({ withPrefix: true }), search => {\n if (this.location.search !== search) {\n this.location.search = search;\n }\n }),\n // update history.js state from observable location changes\n mobx_1.reaction(() => history_1.createPath(this.location), path => {\n let currentPath = history_1.createPath(this.history.location);\n if (currentPath !== path) {\n this.history.push(path);\n }\n }),\n // sync state updates from history.js native apis\n this.history.listen(mobx_1.action((location, action) => {\n this.action = action;\n this.location = this.normalize(location);\n })),\n ];\n return () => {\n disposers.forEach(dispose => dispose());\n };\n }\n normalize(location, { skipEmpty = false } = {}) {\n if (typeof location === \"string\")\n location = history_1.parsePath(location);\n if (location.search == \"?\")\n location.search = \"\";\n if (location.hash == \"#\")\n location.hash = \"\";\n if (skipEmpty) {\n location = Object.fromEntries(Object.entries(location).filter(([chunk, value]) => !!value));\n }\n return location;\n }\n merge(location, replace = false) {\n location = Object.assign(Object.assign({}, this.location), this.normalize(location));\n if (replace) {\n this.history.replace(location);\n }\n else {\n this.history.push(location);\n }\n }\n destroy() {\n var _a;\n (_a = this.unbindEvents) === null || _a === void 0 ? void 0 : _a.call(this);\n return this.history;\n }\n toString() {\n return history_1.createPath(this.location);\n }\n}\n__decorate([\n mobx_1.observable\n], ObservableHistory.prototype, \"action\", void 0);\n__decorate([\n mobx_1.observable\n], ObservableHistory.prototype, \"location\", void 0);\n__decorate([\n mobx_1.observable.ref\n], ObservableHistory.prototype, \"searchParams\", void 0);\nexports.ObservableHistory = ObservableHistory;\n\n\n//# sourceURL=webpack:///./node_modules/mobx-observable-history/lib/observable-history.js?");
22396
+ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableHistory = exports.createObservableHistory = void 0;\nconst mobx_1 = __webpack_require__(/*! mobx */ \"./node_modules/mobx-observable-history/node_modules/mobx/dist/mobx.esm.js\");\nconst history_1 = __webpack_require__(/*! history */ \"./node_modules/history/esm/history.js\");\nconst observable_search_params_1 = __webpack_require__(/*! ./observable-search-params */ \"./node_modules/mobx-observable-history/lib/observable-search-params.js\");\nfunction createObservableHistory(history, opts) {\n return new ObservableHistory(history, opts);\n}\nexports.createObservableHistory = createObservableHistory;\nclass ObservableHistory {\n constructor(history = history_1.createBrowserHistory(), opts = {}) {\n Object.defineProperty(this, \"opts\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: opts\n });\n Object.defineProperty(this, \"history\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"unbindEvents\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"action\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"location\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"searchParams\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n mobx_1.makeObservable(this);\n this.history = history;\n this.action = this.history.action;\n this.location = this.history.location;\n this.searchParams = new observable_search_params_1.ObservableSearchParams(this.location.search, opts.searchParams);\n this.unbindEvents = this.bindEvents();\n return new Proxy(this, {\n get: (target, prop, context) => {\n let fieldRef = Reflect.get(target, prop, context);\n if (!(prop in target)) {\n return Reflect.get(this.history, prop, context); // handle history.js native apis\n }\n return fieldRef;\n },\n });\n }\n bindEvents() {\n const disposers = [\n // normalize direct updates of `history.location = string | LocationDescriptor`\n mobx_1.intercept(this, change => {\n if (change.type === \"update\") {\n switch (change.name) {\n case \"location\":\n change.newValue = this.normalize(change.newValue);\n break;\n }\n }\n return change;\n }),\n // normalize partial updates of `history.location.(search|hash|pathname) = string`\n mobx_1.intercept(this.location, change => {\n if (change.type === \"update\") {\n switch (change.name) {\n case \"search\":\n change.newValue = this.normalize(change.newValue).search;\n break;\n case \"hash\":\n change.newValue = this.normalize(change.newValue).hash;\n break;\n }\n }\n return change;\n }),\n // sync location.search with URLSearchParams()-helper\n mobx_1.reaction(() => this.location.search, search => {\n const params = this.searchParams.toString({ withPrefix: true });\n if (search !== params) {\n this.searchParams.replace(search);\n }\n }),\n // sync from URLSearchParams()-api updates\n mobx_1.reaction(() => this.searchParams.toString({ withPrefix: true }), search => {\n if (this.location.search !== search) {\n this.location.search = search;\n }\n }),\n // update history.js state from observable location changes\n mobx_1.reaction(() => history_1.createPath(this.location), path => {\n let currentPath = history_1.createPath(this.history.location);\n if (currentPath !== path) {\n this.history.push(path);\n }\n }),\n // sync state updates from history.js native apis\n this.history.listen(mobx_1.action((location, action) => {\n this.action = action;\n this.location = this.normalize(location);\n })),\n ];\n return () => {\n disposers.forEach(dispose => dispose());\n };\n }\n normalize(location, { skipEmpty = false } = {}) {\n if (typeof location === \"string\")\n location = history_1.parsePath(location);\n if (location.search == \"?\")\n location.search = \"\";\n if (location.hash == \"#\")\n location.hash = \"\";\n if (skipEmpty) {\n location = Object.fromEntries(Object.entries(location).filter(([chunk, value]) => !!value));\n }\n return location;\n }\n merge(location, replace = false) {\n location = Object.assign(Object.assign({}, this.location), this.normalize(location));\n if (replace) {\n this.history.replace(location);\n }\n else {\n this.history.push(location);\n }\n }\n destroy() {\n var _a;\n (_a = this.unbindEvents) === null || _a === void 0 ? void 0 : _a.call(this);\n return this.history;\n }\n toString() {\n return history_1.createPath(this.location);\n }\n}\n__decorate([\n mobx_1.observable\n], ObservableHistory.prototype, \"action\", void 0);\n__decorate([\n mobx_1.observable\n], ObservableHistory.prototype, \"location\", void 0);\n__decorate([\n mobx_1.observable.ref\n], ObservableHistory.prototype, \"searchParams\", void 0);\nexports.ObservableHistory = ObservableHistory;\n\n\n//# sourceURL=webpack:///./node_modules/mobx-observable-history/lib/observable-history.js?");
22397
22397
 
22398
22398
  /***/ }),
22399
22399
 
@@ -22405,7 +22405,19 @@ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, targ
22405
22405
  /***/ (function(module, exports, __webpack_require__) {
22406
22406
 
22407
22407
  "use strict";
22408
- eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableSearchParams = void 0;\nconst mobx_1 = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\nclass ObservableSearchParams {\n constructor(init, opts = {}) {\n Object.defineProperty(this, \"opts\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: opts\n });\n Object.defineProperty(this, \"search\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"\"\n });\n Object.defineProperty(this, \"searchParams\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n mobx_1.makeObservable(this);\n this.opts = Object.assign({ skipEmpty: true, joinArrays: false, joinArraysWith: \",\" }, opts);\n this.search = this.normalize(init);\n this.searchParams = new URLSearchParams(init);\n return new Proxy(this, {\n getPrototypeOf(target) {\n return URLSearchParams.prototype;\n },\n get: (target, prop, context) => {\n let fieldRef = Reflect.get(target, prop, context);\n // handle native URLSearchParams()-api updates via proxy-object\n if (!(prop in target)) {\n fieldRef = Reflect.get(this.searchParams, prop, context);\n if (typeof fieldRef === \"function\") {\n return (...args) => {\n let oldValue = this.searchParams.toString();\n let result = Reflect.apply(fieldRef, this.searchParams, args);\n let newValue = this.searchParams.toString();\n let isChanged = oldValue !== newValue;\n if (isChanged) {\n this.replace(newValue);\n }\n return result;\n };\n }\n }\n return fieldRef;\n },\n });\n }\n normalize(search = \"\") {\n const { joinArrays, joinArraysWith, skipEmpty } = this.opts;\n const params = {};\n const normalizedParams = [];\n Array.from(new URLSearchParams(search)).forEach(([param, value]) => {\n var _a;\n if (skipEmpty && !value)\n return;\n const values = joinArraysWith ? value.split(joinArraysWith) : [value];\n (_a = params[param]) !== null && _a !== void 0 ? _a : (params[param] = []);\n params[param].push(...values);\n });\n Object.entries(params).forEach(([name, values]) => {\n if (joinArrays) {\n normalizedParams.push([name, values.join(joinArraysWith)]);\n }\n else {\n const multiParamsWithSameKey = values.map(value => [name, value]);\n normalizedParams.push(...multiParamsWithSameKey);\n }\n });\n return new URLSearchParams(normalizedParams).toString();\n }\n replace(search) {\n search = this.normalize(search);\n if (this.search !== search) {\n this.search = search;\n this.searchParams = new URLSearchParams(search);\n }\n }\n merge(search) {\n search = this.normalize(search);\n this.replace(`${this.search}&${search}`);\n }\n deleteAll() {\n this.search = \"\";\n Array.from(this.searchParams.keys()).forEach(key => {\n this.searchParams.delete(key);\n });\n }\n getAll(param) {\n const values = this.searchParams.getAll(param);\n const { joinArrays, joinArraysWith } = this.opts;\n if (joinArrays) {\n return values.flatMap(param => param.split(joinArraysWith));\n }\n return values;\n }\n toString({ withPrefix = false } = {}) {\n if (!this.search)\n return \"\";\n return `${withPrefix ? \"?\" : \"\"}${this.search}`;\n }\n}\n__decorate([\n mobx_1.observable\n], ObservableSearchParams.prototype, \"search\", void 0);\n__decorate([\n mobx_1.observable.ref\n], ObservableSearchParams.prototype, \"searchParams\", void 0);\n__decorate([\n mobx_1.action\n], ObservableSearchParams.prototype, \"replace\", null);\n__decorate([\n mobx_1.action\n], ObservableSearchParams.prototype, \"deleteAll\", null);\nexports.ObservableSearchParams = ObservableSearchParams;\n\n\n//# sourceURL=webpack:///./node_modules/mobx-observable-history/lib/observable-search-params.js?");
22408
+ eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableSearchParams = void 0;\nconst mobx_1 = __webpack_require__(/*! mobx */ \"./node_modules/mobx-observable-history/node_modules/mobx/dist/mobx.esm.js\");\nclass ObservableSearchParams {\n constructor(init, opts = {}) {\n Object.defineProperty(this, \"opts\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: opts\n });\n Object.defineProperty(this, \"search\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"\"\n });\n Object.defineProperty(this, \"searchParams\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n mobx_1.makeObservable(this);\n this.opts = Object.assign({ skipEmpty: true, joinArrays: false, joinArraysWith: \",\" }, opts);\n this.search = this.normalize(init);\n this.searchParams = new URLSearchParams(init);\n return new Proxy(this, {\n getPrototypeOf(target) {\n return URLSearchParams.prototype;\n },\n get: (target, prop, context) => {\n let fieldRef = Reflect.get(target, prop, context);\n // handle native URLSearchParams()-api updates via proxy-object\n if (!(prop in target)) {\n fieldRef = Reflect.get(this.searchParams, prop, context);\n if (typeof fieldRef === \"function\") {\n return (...args) => {\n let oldValue = this.searchParams.toString();\n let result = Reflect.apply(fieldRef, this.searchParams, args);\n let newValue = this.searchParams.toString();\n let isChanged = oldValue !== newValue;\n if (isChanged) {\n this.replace(newValue);\n }\n return result;\n };\n }\n }\n return fieldRef;\n },\n });\n }\n normalize(search = \"\") {\n const { joinArrays, joinArraysWith, skipEmpty } = this.opts;\n const params = {};\n const normalizedParams = [];\n Array.from(new URLSearchParams(search)).forEach(([param, value]) => {\n var _a;\n if (skipEmpty && !value)\n return;\n const values = joinArrays ? value.split(joinArraysWith) : [value];\n (_a = params[param]) !== null && _a !== void 0 ? _a : (params[param] = []);\n params[param].push(...values);\n });\n Object.entries(params).forEach(([name, values]) => {\n if (joinArrays) {\n normalizedParams.push([name, values.join(joinArraysWith)]);\n }\n else {\n const multiParamsWithSameKey = values.map(value => [name, value]);\n normalizedParams.push(...multiParamsWithSameKey);\n }\n });\n return new URLSearchParams(normalizedParams).toString();\n }\n replace(search) {\n search = this.normalize(search);\n if (this.search !== search) {\n this.search = search;\n this.searchParams = new URLSearchParams(search);\n }\n }\n merge(search) {\n search = this.normalize(search);\n this.replace(`${this.search}&${search}`);\n }\n deleteAll() {\n this.search = \"\";\n Array.from(this.searchParams.keys()).forEach(key => {\n this.searchParams.delete(key);\n });\n }\n getAll(param) {\n const values = this.searchParams.getAll(param);\n const { joinArrays, joinArraysWith } = this.opts;\n if (joinArrays) {\n return values.flatMap(param => param.split(joinArraysWith));\n }\n return values;\n }\n toString({ withPrefix = false } = {}) {\n if (!this.search)\n return \"\";\n return `${withPrefix ? \"?\" : \"\"}${this.search}`;\n }\n}\n__decorate([\n mobx_1.observable\n], ObservableSearchParams.prototype, \"search\", void 0);\n__decorate([\n mobx_1.observable.ref\n], ObservableSearchParams.prototype, \"searchParams\", void 0);\n__decorate([\n mobx_1.action\n], ObservableSearchParams.prototype, \"replace\", null);\n__decorate([\n mobx_1.action\n], ObservableSearchParams.prototype, \"deleteAll\", null);\nexports.ObservableSearchParams = ObservableSearchParams;\n\n\n//# sourceURL=webpack:///./node_modules/mobx-observable-history/lib/observable-search-params.js?");
22409
+
22410
+ /***/ }),
22411
+
22412
+ /***/ "./node_modules/mobx-observable-history/node_modules/mobx/dist/mobx.esm.js":
22413
+ /*!*********************************************************************************!*\
22414
+ !*** ./node_modules/mobx-observable-history/node_modules/mobx/dist/mobx.esm.js ***!
22415
+ \*********************************************************************************/
22416
+ /*! exports provided: $mobx, FlowCancellationError, ObservableMap, ObservableSet, Reaction, _allowStateChanges, _allowStateChangesInsideComputed, _allowStateReadsEnd, _allowStateReadsStart, _autoAction, _endAction, _getAdministration, _getGlobalState, _interceptReads, _isComputingDerivation, _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, defineProperty, entries, extendObservable, flow, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, ownKeys, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when */
22417
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
22418
+
22419
+ "use strict";
22420
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) return;\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n var _proto$constructor;\n\n if (!isObject(value)) return false;\n var proto = Object.getPrototypeOf(value);\n if (proto == null) return true;\n return ((_proto$constructor = proto.constructor) == null ? void 0 : _proto$constructor.toString()) === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) return false;\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) return true;\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) return keys;\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) return keys;\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") return key;\n if (typeof key === \"symbol\") return key.toString();\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it;\n\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n it = o[Symbol.iterator]();\n return it.next.bind(it);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overriden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n return Object.is(a, b);\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) return v; // something that can be converted and mutated?\n\n if (Array.isArray(v)) return observable.array(v, {\n name: name\n });\n if (isPlainObject(v)) return observable.object(v, undefined, {\n name: name\n });\n if (isES6Map(v)) return observable.map(v, {\n name: name\n });\n if (isES6Set(v)) return observable.set(v, {\n name: name\n });\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) return v;\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) return v;\n if (Array.isArray(v)) return observable.array(v, {\n name: name,\n deep: false\n });\n if (isPlainObject(v)) return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n if (isES6Map(v)) return observable.map(v, {\n name: name,\n deep: false\n });\n if (isES6Set(v)) return observable.set(v, {\n name: name,\n deep: false\n });\n if (true) die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) die(\"observable.struct should not be used with observable values\");\n if (deepEqual(v, oldValue)) return oldValue;\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) == null ? void 0 : _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if (((_this$options_ = this.options_) == null ? void 0 : _this$options_.bound) && !isFlow(adm.target_[key])) {\n if (this.extend_(adm, key, descriptor, false) === null) return 0\n /* Cancel */\n ;\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: flow(value),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_2, _this$options_3;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_;\n\n if (isGenerator(descriptor.value)) {\n return flow.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = ((_this$options_ = this.options_) == null ? void 0 : _this$options_.autoBind) ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_2 = this.options_) == null ? void 0 : _this$options_2.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.autoBind)) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_4, _this$options_5;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && ((_this$options_4 = this.options_) == null ? void 0 : _this$options_4.autoBind)) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_5 = this.options_) == null ? void 0 : _this$options_5.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable\");\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable.ref\", {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable.shallow\", {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable.struct\", {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) return v; // plain object\n\n if (isPlainObject(v)) return observable.object(v, arg2, arg3); // Array\n\n if (Array.isArray(v)) return observable.array(v, arg2); // Map\n\n if (isES6Map(v)) return observable.map(v, arg2); // Set\n\n if (isES6Set(v)) return observable.set(v, arg2); // other object - ignore\n\n if (typeof v === \"object\" && v !== null) return v; // anything else\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) die(\"First argument to `computed` should be an expression.\");\n if (isFunction(arg2)) die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) die(\"`action` can only be invoked on functions\");\n if (typeof actionName !== \"string\" || !actionName) die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) untrackedEnd(runInfo.prevDerivation_);\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) return this.dehancer(value);\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n if ( true && notifySpy) spyReportEnd();\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) return globalState.UNCHANGED;\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) die(31);\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = !!options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) die(32, this.name_, this.derivation);\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) globalState.trackingContext = this;\n if (this.trackAndCompute()) propagateChangeConfirmed(this);\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n if (isCaughtException(result)) throw result.cause;\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) die(33, this.name_);\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else die(34, this.name_);\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: this.value_,\n newValue: newValue\n });\n }\n\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.requiresReaction_ === true) {\n die(\"[mobx] Computed value \" + this.name_ + \" is read outside a reactive context\");\n }\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute\");\n }\n\n if (globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value \" + this.name_ + \" is being read outside a reactive context. Doing a full recompute\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable \" + observable.name_ + \" being read outside a reactive context\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) return;\n\n if (globalState.reactionRequiresObservable || derivation.requiresObservable_) {\n console.warn(\"[mobx] Derivation \" + derivation.name_ + \" is created/updated without reading any observable value\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) observing[i0] = dep;\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) return;\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) canMergeGlobalState = false;\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) canMergeGlobalState = false;\n\n if (!canMergeGlobalState) {\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) global.__mobxGlobals.UNCHANGED = {}; // make merge backward compatible\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) die(36);\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) global.__mobxGlobals = undefined;\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key];\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) observable.lowestObserverState_ = node.dependenciesState_; // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return true;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) return;\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) return;\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) return;\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.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\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + new Array(depth).join(\"\\t\") + tree.name); // MWE: not the fastest, but the easiest way :)\n\n if (tree.dependencies) tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n if (requiresObservable_ === void 0) {\n requiresObservable_ = false;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) this.reportExceptionInDerivation_(result.cause);\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) throw error;\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\"); // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) globalState.globalReactionErrorHandlers.splice(idx, 1);\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) return;\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n if (!globalState.spyListeners.length) return;\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));else spyReport(END_EVENT);\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"<unnamed action>\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction); // action(\"name\", fn() {})\n\n if (isFunction(arg2)) return createAction(arg1, arg2, autoAction); // @action\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) die(\"Invalid arguments for `action`\");\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) die(\"Autorun expects a function as first argument\");\n if (isAction(view)) die(\"Autorun does not accept actions since actions are untrackable\");\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) reaction.track(reactionRunner);\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) die(\"First and second argument to reaction should be functions\");\n if (!isPlainObject(opts)) die(\"Third argument of reactions should be an object\");\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue = undefined; // only an issue with fireImmediately\n\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) return;\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) effectAction(value, oldValue, r);else if (!firstTime && changed) effectAction(value, oldValue, r);\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") globalState.verifyProxies = true;\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) globalState[key] = !!options[key];\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) die(\"'extendObservable' expected 2-4 arguments\");\n if (typeof target !== \"object\") die(\"'extendObservable' expects an object as first argument\");\n if (isObservableMap(target)) die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n if (!isPlainObject(properties)) die(\"'extendObservabe' only accepts plain objects as second argument\");\n if (isObservable(properties) || isObservable(annotations)) die(\"Extending an object with another observable (object) is not supported\");\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) die(\"Flow expects single argument with generator function\");\n var generator = arg1;\n var name = generator.name || \"<unnamed flow>\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) return resolve(ret.value);\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) cancelPromise(pendingPromise); // Finally block can return (or yield) stuff..\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) promise.cancel();\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) return die(\"An intercept reader was already established\");\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) return interceptProperty(thing, propOrHandler, handler);else return interceptInterceptable(thing, propOrHandler);\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property !== undefined) {\n if (isObservableObject(value) === false) return false;\n if (!value[$mobx].values_.has(property)) return false;\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n }\n\n return isComputedValue(value);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) return die(\"isComputed expected a property name as second argument\");\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) return false;\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) return die(\"expected a property name as second argument\");\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") key = parseInt(key, 10);\n if (key < 0) die(\"Invalid index: '\" + key + \"'\");\n startBatch();\n if (key >= obj.length) obj.length = key + 1;\n obj[key] = value;\n endBatch();\n } else die(8);\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") key = parseInt(key, 10);\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) return undefined;\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);else return observeObservable(thing, propOrCb, cbOrFire);\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) return source;\n if (isObservableValue(source) || isComputedValue(source)) return toJSHelper(source.get(), __alreadySeen);\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Basically, a deep clone, so that no reactive property will exist anymore.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) die(\"toJS no longer supports options\");\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") enterBreakPoint = args.pop();\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") return whenPromise(predicate, arg1);\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n var error = new Error(\"WHEN_TIMEOUT\");\n if (opts.onError) opts.onError(error);else throw error;\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n if (timeoutHandle) clearTimeout(timeoutHandle);\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n if ( true && opts && opts.onError) return die(\"the options 'onError' and 'promise' cannot be combined\");\n var cancel;\n var res = new Promise(function (resolve, reject) {\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(\"WHEN_CANCELLED\");\n };\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) return false;\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) return false; // null (intercepted) -> true (success)\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) interceptors.splice(idx, 1);\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) die(14);\n if (!change) break;\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) listeners.splice(idx, 1);\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) return;\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set<PropertyKey>()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n if (isObservableObject(target)) die(\"makeAutoObservable can only be used on objects not already made observable\");\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) return adm;\n if (name === \"length\") return adm.getArrayLength_();\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) return this.dehancer(value);\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) return values.map(this.dehancer);\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || newLength < 0) die(\"Out of range: \" + newLength);\n var currentLength = this.values_.length;\n if (newLength === currentLength) return;else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else this.spliceWithArray_(newLength, currentLength - newLength);\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) die(16);\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) reserveArrayBuffer(oldLength + delta + 1);\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) index = 0;else if (index > length) index = length;else if (index < 0) index = Math.max(0, length + index);\n if (arguments.length === 1) deleteCount = length - index;else if (deleteCount === undefined || deleteCount === null) deleteCount = 0;else deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n if (newItems === undefined) newItems = EMPTY_ARRAY;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) return EMPTY_ARRAY;\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) this.notifyArraySplice_(index, newItems, res);\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n var res = this.values_.slice(index, index + deleteCount);\n var oldItems = this.values_.slice(index + deleteCount);\n this.values_.length = index + newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) spyReportStart(change);\n this.atom_.reportChanged();\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.get_ = function get_(index) {\n if (index < this.values_.length) {\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n }\n\n console.warn( true ? \"[mobx] Out of bounds read: \" + index : undefined);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) return;\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else if (index === values.length) {\n // add a new item\n this.spliceWithArray_(index, 0, [newValue]);\n } else {\n // out of bounds\n die(17, index, values.length);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n this.merge(initialData);\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this = this;\n\n if (!globalState.trackingDerivation) return this.has_(key);\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) return this;\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) return false;\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) spyReportStart(_change);\n transaction(function () {\n _this2.keysAtom_.reportChanged();\n\n _this2.updateHasMapEntry_(key, false);\n\n var observable = _this2.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this2.data_[\"delete\"](key);\n });\n if (notify) notifyListeners(this, _change);\n if ( true && notifySpy) spyReportEnd();\n return true;\n }\n\n return false;\n };\n\n _proto.updateHasMapEntry_ = function updateHasMapEntry_(key, value) {\n var entry = this.hasMap_.get(key);\n\n if (entry) {\n entry.setNewValue_(value);\n }\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n observable.setNewValue_(newValue);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var observable = new ObservableValue(newValue, _this3.enhancer_, true ? _this3.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this3.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n _this3.updateHasMapEntry_(key, true);\n\n _this3.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) return this.dehanceValue_(this.data_.get(key).get());\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this4 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) getPlainObjectKeys(other).forEach(function (key) {\n return _this4.set(key, other[key]);\n });else if (Array.isArray(other)) other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this4.set(key, value);\n });else if (isES6Map(other)) {\n if (other.constructor !== Map) die(19, other);\n other.forEach(function (value, key) {\n return _this4.set(key, value);\n });\n } else if (other !== null && other !== undefined) die(20, other);\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this5 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this5.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this5[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this6 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this6.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this6[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this6.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this6.data_.has(_key); // Add or update value\n\n\n _this6.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this6.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this6.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this6.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this6.keysAtom_.reportChanged();\n } else {\n var iter1 = _this6.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this6.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this6.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) return this; // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") spyReportStart(_change);\n if (notify) notifyListeners(this, _change);\n if (notifySpy && \"development\" !== \"production\") spyReportEnd();\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) return false;\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") spyReportStart(_change2);\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n if (notify) notifyListeners(this, _change2);\n if (notifySpy && \"development\" !== \"production\") spyReportEnd();\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) return null;\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) spyReportStart(_change);\n observable.setNewValue_(newValue);\n if (notify) notifyListeners(this, _change);\n if ( true && notifySpy) spyReportEnd();\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) == null ? void 0 : _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0\n /* Cancel */\n ) return;\n if (outcome === 1\n /* Break */\n ) break;\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) return null;\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) return null;\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) return null;\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) return null;\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) spyReportStart(_change2);\n if (notify) notifyListeners(this, _change2);\n if ( true && notifySpy) spyReportEnd();\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) die(\"Cannot make the designated object observable; it is not extensible\");\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overriden by subclass.\");\n }\n}\n\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[Symbol.iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n // @ts-ignore\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: Symbol.toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) die(23);\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) return thing.keysAtom_;\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) die(25, property, getDebugName(thing));\n return observable;\n }\n\n if (isObservableObject(thing)) {\n if (!property) return die(26);\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) die(27, property, getDebugName(thing));\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) die(29);\n if (property !== undefined) return getAdministration(getAtom(thing, property));\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) return thing;\n if (isObservableMap(thing) || isObservableSet(thing)) return thing;\n if (thing[$mobx]) return thing[$mobx];\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b; // `null` or `undefined` only equal to itself (strict comparison).\n\n if (a == null || b == null) return false; // `NaN`s are equivalent, but non-reflexive.\n\n if (a !== a) return b !== b; // Exhaust primitive checks\n\n var type = typeof a;\n if (!isFunction(type) && type !== \"object\" && typeof b != \"object\") return false; // Compare `[[Class]]` names.\n\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values.\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties.\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) return false;\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) return false;\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) return a.slice();\n if (isES6Map(a) || isObservableMap(a)) return Array.from(a.entries());\n if (isES6Set(a) || isObservableSet(a)) return Array.from(a.entries());\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get an global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\", \"Symbol\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n\n//# sourceURL=webpack:///./node_modules/mobx-observable-history/node_modules/mobx/dist/mobx.esm.js?");
22409
22421
 
22410
22422
  /***/ }),
22411
22423
 
@@ -22645,7 +22657,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
22645
22657
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
22646
22658
 
22647
22659
  "use strict";
22648
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) return;\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n var _proto$constructor;\n\n if (!isObject(value)) return false;\n var proto = Object.getPrototypeOf(value);\n if (proto == null) return true;\n return ((_proto$constructor = proto.constructor) == null ? void 0 : _proto$constructor.toString()) === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) return false;\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) return true;\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) return keys;\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) return keys;\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") return key;\n if (typeof key === \"symbol\") return key.toString();\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it;\n\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n it = o[Symbol.iterator]();\n return it.next.bind(it);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overriden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n return Object.is(a, b);\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) return v; // something that can be converted and mutated?\n\n if (Array.isArray(v)) return observable.array(v, {\n name: name\n });\n if (isPlainObject(v)) return observable.object(v, undefined, {\n name: name\n });\n if (isES6Map(v)) return observable.map(v, {\n name: name\n });\n if (isES6Set(v)) return observable.set(v, {\n name: name\n });\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) return v;\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) return v;\n if (Array.isArray(v)) return observable.array(v, {\n name: name,\n deep: false\n });\n if (isPlainObject(v)) return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n if (isES6Map(v)) return observable.map(v, {\n name: name,\n deep: false\n });\n if (isES6Set(v)) return observable.set(v, {\n name: name,\n deep: false\n });\n if (true) die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) die(\"observable.struct should not be used with observable values\");\n if (deepEqual(v, oldValue)) return oldValue;\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) == null ? void 0 : _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if (((_this$options_ = this.options_) == null ? void 0 : _this$options_.bound) && !isFlow(adm.target_[key])) {\n if (this.extend_(adm, key, descriptor, false) === null) return 0\n /* Cancel */\n ;\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: flow(value),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_2, _this$options_3;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_;\n\n if (isGenerator(descriptor.value)) {\n return flow.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = ((_this$options_ = this.options_) == null ? void 0 : _this$options_.autoBind) ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_2 = this.options_) == null ? void 0 : _this$options_2.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.autoBind)) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_4, _this$options_5;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && ((_this$options_4 = this.options_) == null ? void 0 : _this$options_4.autoBind)) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_5 = this.options_) == null ? void 0 : _this$options_5.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable\");\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable.ref\", {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable.shallow\", {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(\"observable.struct\", {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) return v; // plain object\n\n if (isPlainObject(v)) return observable.object(v, arg2, arg3); // Array\n\n if (Array.isArray(v)) return observable.array(v, arg2); // Map\n\n if (isES6Map(v)) return observable.map(v, arg2); // Set\n\n if (isES6Set(v)) return observable.set(v, arg2); // other object - ignore\n\n if (typeof v === \"object\" && v !== null) return v; // anything else\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) die(\"First argument to `computed` should be an expression.\");\n if (isFunction(arg2)) die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) die(\"`action` can only be invoked on functions\");\n if (typeof actionName !== \"string\" || !actionName) die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) untrackedEnd(runInfo.prevDerivation_);\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) return this.dehancer(value);\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n if ( true && notifySpy) spyReportEnd();\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) return globalState.UNCHANGED;\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) die(31);\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = !!options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) die(32, this.name_, this.derivation);\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) globalState.trackingContext = this;\n if (this.trackAndCompute()) propagateChangeConfirmed(this);\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n if (isCaughtException(result)) throw result.cause;\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) die(33, this.name_);\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else die(34, this.name_);\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: this.value_,\n newValue: newValue\n });\n }\n\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.requiresReaction_ === true) {\n die(\"[mobx] Computed value \" + this.name_ + \" is read outside a reactive context\");\n }\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute\");\n }\n\n if (globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value \" + this.name_ + \" is being read outside a reactive context. Doing a full recompute\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable \" + observable.name_ + \" being read outside a reactive context\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) return;\n\n if (globalState.reactionRequiresObservable || derivation.requiresObservable_) {\n console.warn(\"[mobx] Derivation \" + derivation.name_ + \" is created/updated without reading any observable value\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) observing[i0] = dep;\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) return;\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) canMergeGlobalState = false;\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) canMergeGlobalState = false;\n\n if (!canMergeGlobalState) {\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) global.__mobxGlobals.UNCHANGED = {}; // make merge backward compatible\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) die(36);\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) global.__mobxGlobals = undefined;\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key];\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) observable.lowestObserverState_ = node.dependenciesState_; // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return true;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) return;\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) return;\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) return;\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.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\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + new Array(depth).join(\"\\t\") + tree.name); // MWE: not the fastest, but the easiest way :)\n\n if (tree.dependencies) tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n if (requiresObservable_ === void 0) {\n requiresObservable_ = false;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) this.reportExceptionInDerivation_(result.cause);\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) throw error;\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\"); // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) globalState.globalReactionErrorHandlers.splice(idx, 1);\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) return;\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n if (!globalState.spyListeners.length) return;\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));else spyReport(END_EVENT);\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"<unnamed action>\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction); // action(\"name\", fn() {})\n\n if (isFunction(arg2)) return createAction(arg1, arg2, autoAction); // @action\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) die(\"Invalid arguments for `action`\");\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) die(\"Autorun expects a function as first argument\");\n if (isAction(view)) die(\"Autorun does not accept actions since actions are untrackable\");\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) reaction.track(reactionRunner);\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) die(\"First and second argument to reaction should be functions\");\n if (!isPlainObject(opts)) die(\"Third argument of reactions should be an object\");\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue = undefined; // only an issue with fireImmediately\n\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) return;\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) effectAction(value, oldValue, r);else if (!firstTime && changed) effectAction(value, oldValue, r);\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") globalState.verifyProxies = true;\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) globalState[key] = !!options[key];\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) die(\"'extendObservable' expected 2-4 arguments\");\n if (typeof target !== \"object\") die(\"'extendObservable' expects an object as first argument\");\n if (isObservableMap(target)) die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n if (!isPlainObject(properties)) die(\"'extendObservabe' only accepts plain objects as second argument\");\n if (isObservable(properties) || isObservable(annotations)) die(\"Extending an object with another observable (object) is not supported\");\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) die(\"Flow expects single argument with generator function\");\n var generator = arg1;\n var name = generator.name || \"<unnamed flow>\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) return resolve(ret.value);\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) cancelPromise(pendingPromise); // Finally block can return (or yield) stuff..\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) promise.cancel();\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) return die(\"An intercept reader was already established\");\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) return interceptProperty(thing, propOrHandler, handler);else return interceptInterceptable(thing, propOrHandler);\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property !== undefined) {\n if (isObservableObject(value) === false) return false;\n if (!value[$mobx].values_.has(property)) return false;\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n }\n\n return isComputedValue(value);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) return die(\"isComputed expected a property name as second argument\");\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) return false;\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) return die(\"expected a property name as second argument\");\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") key = parseInt(key, 10);\n if (key < 0) die(\"Invalid index: '\" + key + \"'\");\n startBatch();\n if (key >= obj.length) obj.length = key + 1;\n obj[key] = value;\n endBatch();\n } else die(8);\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") key = parseInt(key, 10);\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) return undefined;\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);else return observeObservable(thing, propOrCb, cbOrFire);\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) return source;\n if (isObservableValue(source) || isComputedValue(source)) return toJSHelper(source.get(), __alreadySeen);\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Basically, a deep clone, so that no reactive property will exist anymore.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) die(\"toJS no longer supports options\");\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") enterBreakPoint = args.pop();\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") return whenPromise(predicate, arg1);\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n var error = new Error(\"WHEN_TIMEOUT\");\n if (opts.onError) opts.onError(error);else throw error;\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n if (timeoutHandle) clearTimeout(timeoutHandle);\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n if ( true && opts && opts.onError) return die(\"the options 'onError' and 'promise' cannot be combined\");\n var cancel;\n var res = new Promise(function (resolve, reject) {\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(\"WHEN_CANCELLED\");\n };\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) return false;\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) return false; // null (intercepted) -> true (success)\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) interceptors.splice(idx, 1);\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) die(14);\n if (!change) break;\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) listeners.splice(idx, 1);\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) return;\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set<PropertyKey>()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n if (isObservableObject(target)) die(\"makeAutoObservable can only be used on objects not already made observable\");\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) return adm;\n if (name === \"length\") return adm.getArrayLength_();\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) return this.dehancer(value);\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) return values.map(this.dehancer);\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || newLength < 0) die(\"Out of range: \" + newLength);\n var currentLength = this.values_.length;\n if (newLength === currentLength) return;else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else this.spliceWithArray_(newLength, currentLength - newLength);\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) die(16);\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) reserveArrayBuffer(oldLength + delta + 1);\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) index = 0;else if (index > length) index = length;else if (index < 0) index = Math.max(0, length + index);\n if (arguments.length === 1) deleteCount = length - index;else if (deleteCount === undefined || deleteCount === null) deleteCount = 0;else deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n if (newItems === undefined) newItems = EMPTY_ARRAY;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) return EMPTY_ARRAY;\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) this.notifyArraySplice_(index, newItems, res);\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n var res = this.values_.slice(index, index + deleteCount);\n var oldItems = this.values_.slice(index + deleteCount);\n this.values_.length = index + newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) spyReportStart(change);\n this.atom_.reportChanged();\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.get_ = function get_(index) {\n if (index < this.values_.length) {\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n }\n\n console.warn( true ? \"[mobx] Out of bounds read: \" + index : undefined);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) return;\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else if (index === values.length) {\n // add a new item\n this.spliceWithArray_(index, 0, [newValue]);\n } else {\n // out of bounds\n die(17, index, values.length);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n this.merge(initialData);\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this = this;\n\n if (!globalState.trackingDerivation) return this.has_(key);\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) return this;\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) return false;\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) spyReportStart(_change);\n transaction(function () {\n _this2.keysAtom_.reportChanged();\n\n _this2.updateHasMapEntry_(key, false);\n\n var observable = _this2.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this2.data_[\"delete\"](key);\n });\n if (notify) notifyListeners(this, _change);\n if ( true && notifySpy) spyReportEnd();\n return true;\n }\n\n return false;\n };\n\n _proto.updateHasMapEntry_ = function updateHasMapEntry_(key, value) {\n var entry = this.hasMap_.get(key);\n\n if (entry) {\n entry.setNewValue_(value);\n }\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n observable.setNewValue_(newValue);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var observable = new ObservableValue(newValue, _this3.enhancer_, true ? _this3.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this3.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n _this3.updateHasMapEntry_(key, true);\n\n _this3.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) return this.dehanceValue_(this.data_.get(key).get());\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this4 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) getPlainObjectKeys(other).forEach(function (key) {\n return _this4.set(key, other[key]);\n });else if (Array.isArray(other)) other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this4.set(key, value);\n });else if (isES6Map(other)) {\n if (other.constructor !== Map) die(19, other);\n other.forEach(function (value, key) {\n return _this4.set(key, value);\n });\n } else if (other !== null && other !== undefined) die(20, other);\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this5 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this5.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this5[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this6 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this6.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this6[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this6.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this6.data_.has(_key); // Add or update value\n\n\n _this6.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this6.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this6.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this6.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this6.keysAtom_.reportChanged();\n } else {\n var iter1 = _this6.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this6.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this6.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) return this; // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") spyReportStart(_change);\n if (notify) notifyListeners(this, _change);\n if (notifySpy && \"development\" !== \"production\") spyReportEnd();\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) return false;\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") spyReportStart(_change2);\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n if (notify) notifyListeners(this, _change2);\n if (notifySpy && \"development\" !== \"production\") spyReportEnd();\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) return null;\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) spyReportStart(_change);\n observable.setNewValue_(newValue);\n if (notify) notifyListeners(this, _change);\n if ( true && notifySpy) spyReportEnd();\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) == null ? void 0 : _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0\n /* Cancel */\n ) return;\n if (outcome === 1\n /* Break */\n ) break;\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) return null;\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) return null;\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) return null;\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) return null;\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) spyReportStart(_change2);\n if (notify) notifyListeners(this, _change2);\n if ( true && notifySpy) spyReportEnd();\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) die(\"Cannot make the designated object observable; it is not extensible\");\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overriden by subclass.\");\n }\n}\n\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[Symbol.iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n // @ts-ignore\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: Symbol.toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) die(23);\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) return thing.keysAtom_;\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) die(25, property, getDebugName(thing));\n return observable;\n }\n\n if (isObservableObject(thing)) {\n if (!property) return die(26);\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) die(27, property, getDebugName(thing));\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) die(29);\n if (property !== undefined) return getAdministration(getAtom(thing, property));\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) return thing;\n if (isObservableMap(thing) || isObservableSet(thing)) return thing;\n if (thing[$mobx]) return thing[$mobx];\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b; // `null` or `undefined` only equal to itself (strict comparison).\n\n if (a == null || b == null) return false; // `NaN`s are equivalent, but non-reflexive.\n\n if (a !== a) return b !== b; // Exhaust primitive checks\n\n var type = typeof a;\n if (!isFunction(type) && type !== \"object\" && typeof b != \"object\") return false; // Compare `[[Class]]` names.\n\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values.\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties.\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) return false;\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) return false;\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) return a.slice();\n if (isES6Map(a) || isObservableMap(a)) return Array.from(a.entries());\n if (isES6Set(a) || isObservableSet(a)) return Array.from(a.entries());\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get an global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\", \"Symbol\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?");
22660
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"$mobx\", function() { return $mobx; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FlowCancellationError\", function() { return FlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableMap\", function() { return ObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ObservableSet\", function() { return ObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Reaction\", function() { return Reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChanges\", function() { return allowStateChanges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateChangesInsideComputed\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsEnd\", function() { return allowStateReadsEnd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_allowStateReadsStart\", function() { return allowStateReadsStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_autoAction\", function() { return autoAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_endAction\", function() { return _endAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getAdministration\", function() { return getAdministration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_getGlobalState\", function() { return getGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_interceptReads\", function() { return interceptReads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_isComputingDerivation\", function() { return isComputingDerivation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_resetGlobalState\", function() { return resetGlobalState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_startAction\", function() { return _startAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"action\", function() { return action; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autorun\", function() { return autorun; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"comparer\", function() { return comparer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"computed\", function() { return computed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"configure\", function() { return configure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createAtom\", function() { return createAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defineProperty\", function() { return apiDefineProperty; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"entries\", function() { return entries; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extendObservable\", function() { return extendObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flow\", function() { return flow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flowResult\", function() { return flowResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAtom\", function() { return getAtom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDebugName\", function() { return getDebugName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDependencyTree\", function() { return getDependencyTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getObserverTree\", function() { return getObserverTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intercept\", function() { return intercept; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAction\", function() { return isAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoxedObservable\", function() { return isObservableValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputed\", function() { return isComputed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isComputedProp\", function() { return isComputedProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlow\", function() { return isFlow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFlowCancellationError\", function() { return isFlowCancellationError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservable\", function() { return isObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableArray\", function() { return isObservableArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableMap\", function() { return isObservableMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableObject\", function() { return isObservableObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableProp\", function() { return isObservableProp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObservableSet\", function() { return isObservableSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return keys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeAutoObservable\", function() { return makeAutoObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"makeObservable\", function() { return makeObservable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observable\", function() { return observable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"observe\", function() { return observe; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeObserved\", function() { return onBecomeObserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onBecomeUnobserved\", function() { return onBecomeUnobserved; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"onReactionError\", function() { return onReactionError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"override\", function() { return override; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ownKeys\", function() { return apiOwnKeys; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reaction\", function() { return reaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return remove; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"runInAction\", function() { return runInAction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"spy\", function() { return spy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toJS\", function() { return toJS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trace\", function() { return trace; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transaction\", function() { return transaction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"untracked\", function() { return untracked; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"when\", function() { return when; });\nvar niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = true ? niceErrors : undefined;\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (true) {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die( true ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : undefined);\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if ( true && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) return;\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n var _proto$constructor;\n\n if (!isObject(value)) return false;\n var proto = Object.getPrototypeOf(value);\n if (proto == null) return true;\n return ((_proto$constructor = proto.constructor) == null ? void 0 : _proto$constructor.toString()) === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) return false;\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) return true;\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) return keys;\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) return keys;\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") return key;\n if (typeof key === \"symbol\") return key.toString();\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it;\n\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n it = o[Symbol.iterator]();\n return it.next.bind(it);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if ( true && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if ( true && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overriden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if ( true && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = true ? \"Atom@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) return Object.is(a, b);\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) return v; // something that can be converted and mutated?\n\n if (Array.isArray(v)) return observable.array(v, {\n name: name\n });\n if (isPlainObject(v)) return observable.object(v, undefined, {\n name: name\n });\n if (isES6Map(v)) return observable.map(v, {\n name: name\n });\n if (isES6Set(v)) return observable.set(v, {\n name: name\n });\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) return v;\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) return v;\n if (Array.isArray(v)) return observable.array(v, {\n name: name,\n deep: false\n });\n if (isPlainObject(v)) return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n if (isES6Map(v)) return observable.map(v, {\n name: name,\n deep: false\n });\n if (isES6Set(v)) return observable.set(v, {\n name: name,\n deep: false\n });\n if (true) die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if ( true && isObservable(v)) die(\"observable.struct should not be used with observable values\");\n if (deepEqual(v, oldValue)) return oldValue;\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if ( true && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if ( true && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) == null ? void 0 : _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n ((_annotation$options_4 = annotation.options_) == null ? void 0 : _annotation$options_4.bound) ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if (((_this$options_ = this.options_) == null ? void 0 : _this$options_.bound) && !isFlow(adm.target_[key])) {\n if (this.extend_(adm, key, descriptor, false) === null) return 0\n /* Cancel */\n ;\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if ( true && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if (bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: flow(value),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if ( true && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if ( true && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = ((_this$options_ = this.options_) == null ? void 0 : _this$options_.autoBind) ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = ((_this$options_2 = this.options_) == null ? void 0 : _this$options_2.autoBind) ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && ((_this$options_4 = this.options_) == null ? void 0 : _this$options_4.autoBind)) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && ((_this$options_5 = this.options_) == null ? void 0 : _this$options_5.autoBind)) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) return v; // plain object\n\n if (isPlainObject(v)) return observable.object(v, arg2, arg3); // Array\n\n if (Array.isArray(v)) return observable.array(v, arg2); // Map\n\n if (isES6Map(v)) return observable.map(v, arg2); // Set\n\n if (isES6Set(v)) return observable.set(v, arg2); // other object - ignore\n\n if (typeof v === \"object\" && v !== null) return v; // anything else\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (true) {\n if (!isFunction(arg1)) die(\"First argument to `computed` should be an expression.\");\n if (isFunction(arg2)) die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (true) {\n if (!isFunction(fn)) die(\"`action` can only be invoked on functions\");\n if (typeof actionName !== \"string\" || !actionName) die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = true && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if ( true && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) untrackedEnd(runInfo.prevDerivation_);\n\n if ( true && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableValue@\" + getNextId() : undefined;\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if ( true && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) return this.dehancer(value);\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if ( true && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n if ( true && notifySpy) spyReportEnd();\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) return globalState.UNCHANGED;\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) die(31);\n this.derivation = options.get;\n this.name_ = options.name || ( true ? \"ComputedValue@\" + getNextId() : undefined);\n\n if (options.set) {\n this.setter_ = createAction( true ? this.name_ + \"-setter\" : undefined, options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = !!options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) die(32, this.name_, this.derivation);\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) globalState.trackingContext = this;\n if (this.trackAndCompute()) propagateChangeConfirmed(this);\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n if (isCaughtException(result)) throw result.cause;\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) die(33, this.name_);\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else die(34, this.name_);\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if ( true && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if ( true && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (false) {}\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (globalState.computedRequiresReaction || this.requiresReaction_) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (false) {}\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if ( true && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (false) {}\n if (derivation.observing_.length !== 0) return;\n\n if (globalState.reactionRequiresObservable || derivation.requiresObservable_) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) observing[i0] = dep;\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) return;\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) canMergeGlobalState = false;\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) canMergeGlobalState = false;\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) global.__mobxGlobals.UNCHANGED = {}; // make merge backward compatible\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) die(36);\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) global.__mobxGlobals = undefined;\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key];\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) observable.lowestObserverState_ = node.dependenciesState_; // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return true;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) return;\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) return;\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if ( true && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) return;\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.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\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = true ? \"Reaction@\" + getNextId() : undefined;\n }\n\n if (requiresObservable_ === void 0) {\n requiresObservable_ = false;\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if ( true && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if ( true && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) this.reportExceptionInDerivation_(result.cause);\n\n if ( true && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) throw error;\n var message = true ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : undefined;\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (true) console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\"); // prettier-ignore\n\n\n if ( true && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) globalState.globalReactionErrorHandlers.splice(idx, 1);\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) return;\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error( true ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : undefined);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return true && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (false) {} // dead code elimination can do the rest\n\n if (!globalState.spyListeners.length) return;\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (false) {}\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (false) {}\n if (change) spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));else spyReport(END_EVENT);\n}\nfunction spy(listener) {\n if (false) {} else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"<unnamed action>\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction); // action(\"name\", fn() {})\n\n if (isFunction(arg2)) return createAction(arg1, arg2, autoAction); // @action\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (true) die(\"Invalid arguments for `action`\");\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(view)) die(\"Autorun expects a function as first argument\");\n if (isAction(view)) die(\"Autorun does not accept actions since actions are untrackable\");\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : true ? view.name || \"Autorun@\" + getNextId() : undefined;\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) reaction.track(reactionRunner);\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (true) {\n if (!isFunction(expression) || !isFunction(effect)) die(\"First and second argument to reaction should be functions\");\n if (!isPlainObject(opts)) die(\"Third argument of reactions should be an object\");\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : true ? \"Reaction@\" + getNextId() : undefined;\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) return;\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) effectAction(value, oldValue, r);else if (!firstTime && changed) effectAction(value, oldValue, r);\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") globalState.verifyProxies = true;\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) globalState[key] = !!options[key];\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if ( true && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (true) {\n if (arguments.length > 4) die(\"'extendObservable' expected 2-4 arguments\");\n if (typeof target !== \"object\") die(\"'extendObservable' expects an object as first argument\");\n if (isObservableMap(target)) die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n if (!isPlainObject(properties)) die(\"'extendObservable' only accepts plain objects as second argument\");\n if (isObservable(properties) || isObservable(annotations)) die(\"Extending an object with another observable (object) is not supported\");\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if ( true && arguments.length !== 1) die(\"Flow expects single argument with generator function\");\n var generator = arg1;\n var name = generator.name || \"<unnamed flow>\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) return resolve(ret.value);\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) cancelPromise(pendingPromise); // Finally block can return (or yield) stuff..\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) promise.cancel();\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if ( true && !isStringish(propOrHandler)) return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n target = getAdministration(thing, propOrHandler);\n } else if (true) {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if ( true && target.dehancer !== undefined) return die(\"An intercept reader was already established\");\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) return interceptProperty(thing, propOrHandler, handler);else return interceptInterceptable(thing, propOrHandler);\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) return false;\n if (!value[$mobx].values_.has(property)) return false;\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if ( true && arguments.length > 1) return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if ( true && !isStringish(propName)) return die(\"isComputed expected a property name as second argument\");\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) return false;\n\n if (property !== undefined) {\n if ( true && (isObservableMap(value) || isObservableArray(value))) return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if ( true && arguments.length !== 1) die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if ( true && !isStringish(propName)) return die(\"expected a property name as second argument\");\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") key = parseInt(key, 10);\n if (key < 0) die(\"Invalid index: '\" + key + \"'\");\n startBatch();\n if (key >= obj.length) obj.length = key + 1;\n obj[key] = value;\n endBatch();\n } else die(8);\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") key = parseInt(key, 10);\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) return undefined;\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);else return observeObservable(thing, propOrCb, cbOrFire);\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) return source;\n if (isObservableValue(source) || isComputedValue(source)) return toJSHelper(source.get(), __alreadySeen);\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Basically, a deep clone, so that no reactive property will exist anymore.\r\n */\n\n\nfunction toJS(source, options) {\n if ( true && options) die(\"toJS no longer supports options\");\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (false) {}\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") enterBreakPoint = args.pop();\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") return whenPromise(predicate, arg1);\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) opts.onError(error);else throw error;\n }\n }, opts.timeout);\n }\n\n opts.name = true ? opts.name || \"When@\" + getNextId() : undefined;\n var effectAction = createAction( true ? opts.name + \"-effect\" : undefined, effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n if (timeoutHandle) clearTimeout(timeoutHandle);\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n if ( true && opts && opts.onError) return die(\"the options 'onError' and 'promise' cannot be combined\");\n var cancel;\n var res = new Promise(function (resolve, reject) {\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if ( true && globalState.trackingDerivation) warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) return false;\n\n if ( true && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (true) {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) return false; // null (intercepted) -> true (success)\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (true) {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if ( true && globalState.trackingDerivation) warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) interceptors.splice(idx, 1);\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) die(14);\n if (!change) break;\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) listeners.splice(idx, 1);\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) return;\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if ( true && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set<PropertyKey>()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (true) {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n if (isObservableObject(target)) die(\"makeAutoObservable can only be used on objects not already made observable\");\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) return adm;\n if (name === \"length\") return adm.getArrayLength_();\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, true ? name + \"[..]\" : undefined);\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) return this.dehancer(value);\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) return values.map(this.dehancer);\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) die(\"Out of range: \" + newLength);\n var currentLength = this.values_.length;\n if (newLength === currentLength) return;else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else this.spliceWithArray_(newLength, currentLength - newLength);\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) die(16);\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) reserveArrayBuffer(oldLength + delta + 1);\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) index = 0;else if (index > length) index = length;else if (index < 0) index = Math.max(0, length + index);\n if (arguments.length === 1) deleteCount = length - index;else if (deleteCount === undefined || deleteCount === null) deleteCount = 0;else deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n if (newItems === undefined) newItems = EMPTY_ARRAY;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) return EMPTY_ARRAY;\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || \"development\" !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) this.notifyArraySplice_(index, newItems, res);\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n var res = this.values_.slice(index, index + deleteCount);\n var oldItems = this.values_.slice(index + deleteCount);\n this.values_.length = index + newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if ( true && notifySpy) spyReportStart(change);\n this.atom_.reportChanged();\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.get_ = function get_(index) {\n if (index < this.values_.length) {\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n }\n\n console.warn( true ? \"[mobx] Out of bounds read: \" + index : undefined);\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) return;\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else if (index === values.length) {\n // add a new item\n this.spliceWithArray_(index, 0, [newValue]);\n } else {\n // out of bounds\n die(17, index, values.length);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableMap@\" + getNextId() : undefined;\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom( true ? this.name_ + \".keys()\" : undefined);\n this.data_ = new Map();\n this.hasMap_ = new Map();\n this.merge(initialData);\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this = this;\n\n if (!globalState.trackingDerivation) return this.has_(key);\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) return this;\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) return false;\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if ( true && notifySpy) spyReportStart(_change);\n transaction(function () {\n var _this2$hasMap_$get;\n\n _this2.keysAtom_.reportChanged();\n\n (_this2$hasMap_$get = _this2.hasMap_.get(key)) == null ? void 0 : _this2$hasMap_$get.setNewValue_(false);\n\n var observable = _this2.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this2.data_[\"delete\"](key);\n });\n if (notify) notifyListeners(this, _change);\n if ( true && notifySpy) spyReportEnd();\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n observable.setNewValue_(newValue);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this3$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this3.enhancer_, true ? _this3.name_ + \".\" + stringifyKey(key) : undefined, false);\n\n _this3.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(true);\n\n _this3.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) return this.dehanceValue_(this.data_.get(key).get());\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this4 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) getPlainObjectKeys(other).forEach(function (key) {\n return _this4.set(key, other[key]);\n });else if (Array.isArray(other)) other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this4.set(key, value);\n });else if (isES6Map(other)) {\n if (other.constructor !== Map) die(19, other);\n other.forEach(function (value, key) {\n return _this4.set(key, value);\n });\n } else if (other !== null && other !== undefined) die(20, other);\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this5 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this5.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this5[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this6 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this6.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this6[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this6.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this6.data_.has(_key); // Add or update value\n\n\n _this6.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this6.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this6.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this6.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this6.keysAtom_.reportChanged();\n } else {\n var iter1 = _this6.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this6.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this6.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if ( true && fireImmediately === true) die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = true ? \"ObservableSet@\" + getNextId() : undefined;\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) return this; // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") spyReportStart(_change);\n if (notify) notifyListeners(this, _change);\n if (notifySpy && \"development\" !== \"production\") spyReportEnd();\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) return false;\n }\n\n if (this.has(value)) {\n var notifySpy = true && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && \"development\" !== \"production\") spyReportStart(_change2);\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n if (notify) notifyListeners(this, _change2);\n if (notifySpy && \"development\" !== \"production\") spyReportEnd();\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if ( true && fireImmediately === true) die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom( true ? this.name_ + \".keys\" : undefined); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if ( true && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (true) {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) return null;\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if ( true && notifySpy) spyReportStart(_change);\n observable.setNewValue_(newValue);\n if (notify) notifyListeners(this, _change);\n if ( true && notifySpy) spyReportEnd();\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, true ? this.name_ + \".\" + stringifyKey(key) + \"?\" : undefined, false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) == null ? void 0 : _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0\n /* Cancel */\n ) return;\n if (outcome === 1\n /* Break */\n ) break;\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) return null;\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) return null;\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, true ? this.name_ + \".\" + key.toString() : undefined, false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) return null;\n }\n\n options.name || (options.name = true ? this.name_ + \".\" + key.toString() : undefined);\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) return null;\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (true) {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if ( true && notifySpy) spyReportStart(_change2);\n if (notify) notifyListeners(this, _change2);\n if ( true && notifySpy) spyReportEnd();\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if ( true && fireImmediately === true) die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = true && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if ( true && notifySpy) spyReportStart(change);\n if (notify) notifyListeners(this, change);\n if ( true && notifySpy) spyReportEnd();\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if ( true && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if ( true && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if ( true && !Object.isExtensible(target)) die(\"Cannot make the designated object observable; it is not extensible\");\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : true ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : undefined;\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (true) {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if ( true && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if ( true && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overriden by subclass.\");\n }\n}\n\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = true ? \"ObservableArray@\" + getNextId() : undefined;\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[Symbol.iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n // @ts-ignore\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: Symbol.toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) die(23);\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) return thing.keysAtom_;\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) die(25, property, getDebugName(thing));\n return observable;\n }\n\n if (isObservableObject(thing)) {\n if (!property) return die(26);\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) die(27, property, getDebugName(thing));\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) die(29);\n if (property !== undefined) return getAdministration(getAtom(thing, property));\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) return thing;\n if (isObservableMap(thing) || isObservableSet(thing)) return thing;\n if (thing[$mobx]) return thing[$mobx];\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b; // `null` or `undefined` only equal to itself (strict comparison).\n\n if (a == null || b == null) return false; // `NaN`s are equivalent, but non-reflexive.\n\n if (a !== a) return b !== b; // Exhaust primitive checks\n\n var type = typeof a;\n if (!isFunction(type) && type !== \"object\" && typeof b != \"object\") return false; // Compare `[[Class]]` names.\n\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values.\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties.\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) return false;\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) return false;\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) return a.slice();\n if (isES6Map(a) || isObservableMap(a)) return Array.from(a.entries());\n if (isES6Set(a) || isObservableSet(a)) return Array.from(a.entries());\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get an global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\n\n//# sourceMappingURL=mobx.esm.js.map\n\n\n//# sourceURL=webpack:///./node_modules/mobx/dist/mobx.esm.js?");
22649
22661
 
22650
22662
  /***/ }),
22651
22663
 
@@ -39758,7 +39770,7 @@ eval("class Node {\n\t/// value;\n\t/// next;\n\n\tconstructor(value) {\n\t\tthi
39758
39770
  /*! exports provided: name, productName, description, homepage, version, main, copyright, license, author, scripts, config, engines, jest, build, dependencies, devDependencies, default */
39759
39771
  /***/ (function(module) {
39760
39772
 
39761
- eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"open-lens\\\",\\\"productName\\\":\\\"OpenLens\\\",\\\"description\\\":\\\"OpenLens - Open Source IDE for Kubernetes\\\",\\\"homepage\\\":\\\"https://github.com/lensapp/lens\\\",\\\"version\\\":\\\"5.3.0\\\",\\\"main\\\":\\\"static/build/main.js\\\",\\\"copyright\\\":\\\"© 2021 OpenLens Authors\\\",\\\"license\\\":\\\"MIT\\\",\\\"author\\\":{\\\"name\\\":\\\"OpenLens Authors\\\",\\\"email\\\":\\\"info@k8slens.dev\\\"},\\\"scripts\\\":{\\\"dev\\\":\\\"concurrently -i -k \\\\\\\"yarn run dev-run -C\\\\\\\" yarn:dev:*\\\",\\\"dev-build\\\":\\\"concurrently yarn:compile:*\\\",\\\"debug-build\\\":\\\"concurrently yarn:compile:main yarn:compile:extension-types\\\",\\\"dev-run\\\":\\\"nodemon --watch static/build/main.js --exec \\\\\\\"electron --remote-debugging-port=9223 --inspect .\\\\\\\"\\\",\\\"dev:main\\\":\\\"yarn run compile:main --watch\\\",\\\"dev:renderer\\\":\\\"yarn run webpack-dev-server --config webpack.renderer.ts\\\",\\\"dev:extension-types\\\":\\\"yarn run compile:extension-types --watch\\\",\\\"compile\\\":\\\"env NODE_ENV=production concurrently yarn:compile:*\\\",\\\"compile:main\\\":\\\"yarn run webpack --config webpack.main.ts\\\",\\\"compile:renderer\\\":\\\"yarn run webpack --config webpack.renderer.ts\\\",\\\"compile:extension-types\\\":\\\"yarn run webpack --config webpack.extensions.ts\\\",\\\"npm:fix-build-version\\\":\\\"yarn run ts-node build/set_build_version.ts\\\",\\\"npm:fix-package-version\\\":\\\"yarn run ts-node build/set_npm_version.ts\\\",\\\"build:linux\\\":\\\"yarn run compile && electron-builder --linux --dir\\\",\\\"build:mac\\\":\\\"yarn run compile && electron-builder --mac --dir\\\",\\\"build:win\\\":\\\"yarn run compile && electron-builder --win --dir\\\",\\\"integration\\\":\\\"jest --runInBand --detectOpenHandles --forceExit integration\\\",\\\"dist\\\":\\\"yarn run compile && electron-builder --publish onTag\\\",\\\"dist:dir\\\":\\\"yarn run dist --dir -c.compression=store -c.mac.identity=null\\\",\\\"download-bins\\\":\\\"concurrently yarn:download:*\\\",\\\"download:kubectl\\\":\\\"yarn run ts-node build/download_kubectl.ts\\\",\\\"download:helm\\\":\\\"yarn run ts-node build/download_helm.ts\\\",\\\"build:tray-icons\\\":\\\"yarn run ts-node build/build_tray_icon.ts\\\",\\\"build:theme-vars\\\":\\\"yarn run ts-node build/build_theme_vars.ts\\\",\\\"lint\\\":\\\"PROD=true yarn run eslint --ext js,ts,tsx --max-warnings=0 .\\\",\\\"lint:fix\\\":\\\"yarn run lint --fix\\\",\\\"mkdocs-serve-local\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest\\\",\\\"verify-docs\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict\\\",\\\"typedocs-extensions-api\\\":\\\"yarn run typedoc src/extensions/extension-api.ts\\\",\\\"version-checkout\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release/v%s\\\\\\\" | xargs git checkout -b\\\",\\\"version-commit\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release v%s\\\\\\\" | git commit --no-edit -s -F -\\\",\\\"version\\\":\\\"yarn run version-checkout && git add package.json && yarn run version-commit\\\",\\\"postversion\\\":\\\"git push --set-upstream ${GIT_REMOTE:-origin} release/v$npm_package_version\\\"},\\\"config\\\":{\\\"bundledKubectlVersion\\\":\\\"1.21.2\\\",\\\"bundledHelmVersion\\\":\\\"3.6.3\\\",\\\"sentryDsn\\\":\\\"\\\"},\\\"engines\\\":{\\\"node\\\":\\\">=14 <15\\\"},\\\"jest\\\":{\\\"collectCoverage\\\":false,\\\"verbose\\\":true,\\\"transform\\\":{\\\"^.+\\\\\\\\.tsx?$\\\":\\\"ts-jest\\\"},\\\"moduleNameMapper\\\":{\\\"\\\\\\\\.(css|scss)$\\\":\\\"<rootDir>/__mocks__/styleMock.ts\\\",\\\"\\\\\\\\.(svg)$\\\":\\\"<rootDir>/__mocks__/imageMock.ts\\\",\\\"src/(.*)\\\":\\\"<rootDir>/__mocks__/windowMock.ts\\\"},\\\"modulePathIgnorePatterns\\\":[\\\"<rootDir>/dist\\\",\\\"<rootDir>/src/extensions/npm\\\"],\\\"setupFiles\\\":[\\\"<rootDir>/src/jest.setup.ts\\\",\\\"jest-canvas-mock\\\"]},\\\"build\\\":{\\\"generateUpdatesFilesForAllChannels\\\":true,\\\"files\\\":[\\\"static/build/main.js\\\"],\\\"afterSign\\\":\\\"build/notarize.js\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"locales/\\\",\\\"to\\\":\\\"locales/\\\",\\\"filter\\\":\\\"**/*.js\\\"},{\\\"from\\\":\\\"static/\\\",\\\"to\\\":\\\"static/\\\",\\\"filter\\\":\\\"!**/main.js\\\"},{\\\"from\\\":\\\"build/tray\\\",\\\"to\\\":\\\"static/icons\\\",\\\"filter\\\":\\\"*.png\\\"},{\\\"from\\\":\\\"extensions/\\\",\\\"to\\\":\\\"./extensions/\\\",\\\"filter\\\":[\\\"**/*.tgz\\\",\\\"**/package.json\\\",\\\"!**/node_modules\\\"]},{\\\"from\\\":\\\"templates/\\\",\\\"to\\\":\\\"./templates/\\\",\\\"filter\\\":\\\"**/*.yaml\\\"},\\\"LICENSE\\\"],\\\"linux\\\":{\\\"category\\\":\\\"Network\\\",\\\"artifactName\\\":\\\"${productName}-${version}.${arch}.${ext}\\\",\\\"target\\\":[\\\"deb\\\",\\\"rpm\\\",\\\"AppImage\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/linux/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"mac\\\":{\\\"hardenedRuntime\\\":true,\\\"gatekeeperAssess\\\":false,\\\"entitlements\\\":\\\"build/entitlements.mac.plist\\\",\\\"entitlementsInherit\\\":\\\"build/entitlements.mac.plist\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/darwin/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"win\\\":{\\\"target\\\":[\\\"nsis\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/windows/x64/kubectl.exe\\\",\\\"to\\\":\\\"./x64/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/windows/ia32/kubectl.exe\\\",\\\"to\\\":\\\"./ia32/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/x64/helm3/helm3.exe\\\",\\\"to\\\":\\\"./helm3/helm3.exe\\\"}]},\\\"nsis\\\":{\\\"include\\\":\\\"build/installer.nsh\\\",\\\"oneClick\\\":false,\\\"allowElevation\\\":true,\\\"createStartMenuShortcut\\\":true,\\\"allowToChangeInstallationDirectory\\\":true},\\\"protocols\\\":{\\\"name\\\":\\\"Lens Protocol Handler\\\",\\\"schemes\\\":[\\\"lens\\\"],\\\"role\\\":\\\"Viewer\\\"}},\\\"dependencies\\\":{\\\"@electron/remote\\\":\\\"^1.2.2\\\",\\\"@hapi/call\\\":\\\"^8.0.1\\\",\\\"@hapi/subtext\\\":\\\"^7.0.3\\\",\\\"@kubernetes/client-node\\\":\\\"^0.15.1\\\",\\\"@sentry/electron\\\":\\\"^2.5.4\\\",\\\"@sentry/integrations\\\":\\\"^6.13.3\\\",\\\"abort-controller\\\":\\\"^3.0.0\\\",\\\"auto-bind\\\":\\\"^4.0.0\\\",\\\"autobind-decorator\\\":\\\"^2.4.0\\\",\\\"await-lock\\\":\\\"^2.1.0\\\",\\\"byline\\\":\\\"^5.0.0\\\",\\\"chokidar\\\":\\\"^3.4.3\\\",\\\"conf\\\":\\\"^7.1.2\\\",\\\"crypto-js\\\":\\\"^4.1.1\\\",\\\"electron-devtools-installer\\\":\\\"^3.2.0\\\",\\\"electron-updater\\\":\\\"^4.6.1\\\",\\\"electron-window-state\\\":\\\"^5.0.3\\\",\\\"filehound\\\":\\\"^1.17.5\\\",\\\"fs-extra\\\":\\\"^9.0.1\\\",\\\"glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"got\\\":\\\"^11.8.2\\\",\\\"grapheme-splitter\\\":\\\"^1.0.4\\\",\\\"handlebars\\\":\\\"^4.7.7\\\",\\\"http-proxy\\\":\\\"^1.18.1\\\",\\\"immer\\\":\\\"^9.0.6\\\",\\\"joi\\\":\\\"^17.4.2\\\",\\\"js-yaml\\\":\\\"^4.1.0\\\",\\\"jsdom\\\":\\\"^16.7.0\\\",\\\"jsonpath\\\":\\\"^1.1.1\\\",\\\"lodash\\\":\\\"^4.17.15\\\",\\\"mac-ca\\\":\\\"^1.0.6\\\",\\\"marked\\\":\\\"^2.1.3\\\",\\\"md5-file\\\":\\\"^5.0.0\\\",\\\"mobx\\\":\\\"^6.3.0\\\",\\\"mobx-observable-history\\\":\\\"^2.0.1\\\",\\\"mobx-react\\\":\\\"^7.2.1\\\",\\\"mock-fs\\\":\\\"^4.14.0\\\",\\\"moment\\\":\\\"^2.29.1\\\",\\\"moment-timezone\\\":\\\"^0.5.33\\\",\\\"monaco-editor\\\":\\\"^0.29.1\\\",\\\"monaco-editor-webpack-plugin\\\":\\\"^5.0.0\\\",\\\"node-fetch\\\":\\\"lensapp/node-fetch#2.x\\\",\\\"node-pty\\\":\\\"^0.10.1\\\",\\\"npm\\\":\\\"^6.14.15\\\",\\\"p-limit\\\":\\\"^3.1.0\\\",\\\"path-to-regexp\\\":\\\"^6.2.0\\\",\\\"proper-lockfile\\\":\\\"^4.1.2\\\",\\\"react\\\":\\\"^17.0.2\\\",\\\"react-dom\\\":\\\"^17.0.2\\\",\\\"react-material-ui-carousel\\\":\\\"^2.3.5\\\",\\\"react-router\\\":\\\"^5.2.0\\\",\\\"react-virtualized-auto-sizer\\\":\\\"^1.0.6\\\",\\\"readable-stream\\\":\\\"^3.6.0\\\",\\\"request\\\":\\\"^2.88.2\\\",\\\"request-promise-native\\\":\\\"^1.0.9\\\",\\\"rfc6902\\\":\\\"^4.0.2\\\",\\\"semver\\\":\\\"^7.3.2\\\",\\\"shell-env\\\":\\\"^3.0.1\\\",\\\"spdy\\\":\\\"^4.0.2\\\",\\\"tar\\\":\\\"^6.1.11\\\",\\\"tcp-port-used\\\":\\\"^1.0.2\\\",\\\"tempy\\\":\\\"1.0.1\\\",\\\"url-parse\\\":\\\"^1.5.3\\\",\\\"uuid\\\":\\\"^8.3.2\\\",\\\"win-ca\\\":\\\"^3.4.5\\\",\\\"winston\\\":\\\"^3.3.3\\\",\\\"winston-console-format\\\":\\\"^1.0.8\\\",\\\"winston-transport-browserconsole\\\":\\\"^1.0.5\\\",\\\"ws\\\":\\\"^7.5.5\\\"},\\\"devDependencies\\\":{\\\"@material-ui/core\\\":\\\"^4.12.3\\\",\\\"@material-ui/icons\\\":\\\"^4.11.2\\\",\\\"@material-ui/lab\\\":\\\"^4.0.0-alpha.60\\\",\\\"@pmmmwh/react-refresh-webpack-plugin\\\":\\\"^0.4.3\\\",\\\"@sentry/types\\\":\\\"^6.14.1\\\",\\\"@testing-library/jest-dom\\\":\\\"^5.15.0\\\",\\\"@testing-library/react\\\":\\\"^11.2.7\\\",\\\"@testing-library/user-event\\\":\\\"^13.5.0\\\",\\\"@types/byline\\\":\\\"^4.2.33\\\",\\\"@types/chart.js\\\":\\\"^2.9.34\\\",\\\"@types/color\\\":\\\"^3.0.2\\\",\\\"@types/crypto-js\\\":\\\"^3.1.47\\\",\\\"@types/dompurify\\\":\\\"^2.3.1\\\",\\\"@types/electron-devtools-installer\\\":\\\"^2.2.0\\\",\\\"@types/fs-extra\\\":\\\"^9.0.1\\\",\\\"@types/glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"@types/hoist-non-react-statics\\\":\\\"^3.3.1\\\",\\\"@types/html-webpack-plugin\\\":\\\"^3.2.6\\\",\\\"@types/http-proxy\\\":\\\"^1.17.7\\\",\\\"@types/jest\\\":\\\"^26.0.24\\\",\\\"@types/js-yaml\\\":\\\"^4.0.4\\\",\\\"@types/jsdom\\\":\\\"^16.2.13\\\",\\\"@types/jsonpath\\\":\\\"^0.2.0\\\",\\\"@types/lodash\\\":\\\"^4.14.176\\\",\\\"@types/marked\\\":\\\"^2.0.5\\\",\\\"@types/md5-file\\\":\\\"^4.0.2\\\",\\\"@types/mini-css-extract-plugin\\\":\\\"^0.9.1\\\",\\\"@types/mock-fs\\\":\\\"^4.13.1\\\",\\\"@types/node\\\":\\\"14.17.33\\\",\\\"@types/node-fetch\\\":\\\"^2.5.12\\\",\\\"@types/npm\\\":\\\"^2.0.32\\\",\\\"@types/progress-bar-webpack-plugin\\\":\\\"^2.1.2\\\",\\\"@types/proper-lockfile\\\":\\\"^4.1.2\\\",\\\"@types/randomcolor\\\":\\\"^0.5.6\\\",\\\"@types/react\\\":\\\"^17.0.34\\\",\\\"@types/react-beautiful-dnd\\\":\\\"^13.1.2\\\",\\\"@types/react-dom\\\":\\\"^17.0.9\\\",\\\"@types/react-router-dom\\\":\\\"^5.3.2\\\",\\\"@types/react-select\\\":\\\"3.1.2\\\",\\\"@types/react-table\\\":\\\"^7.7.7\\\",\\\"@types/react-virtualized-auto-sizer\\\":\\\"^1.0.1\\\",\\\"@types/react-window\\\":\\\"^1.8.5\\\",\\\"@types/readable-stream\\\":\\\"^2.3.11\\\",\\\"@types/request\\\":\\\"^2.48.7\\\",\\\"@types/request-promise-native\\\":\\\"^1.0.18\\\",\\\"@types/semver\\\":\\\"^7.3.9\\\",\\\"@types/sharp\\\":\\\"^0.29.2\\\",\\\"@types/spdy\\\":\\\"^3.4.5\\\",\\\"@types/tar\\\":\\\"^4.0.5\\\",\\\"@types/tcp-port-used\\\":\\\"^1.0.0\\\",\\\"@types/tempy\\\":\\\"^0.3.0\\\",\\\"@types/triple-beam\\\":\\\"^1.3.2\\\",\\\"@types/url-parse\\\":\\\"^1.4.4\\\",\\\"@types/uuid\\\":\\\"^8.3.1\\\",\\\"@types/webpack\\\":\\\"^4.41.31\\\",\\\"@types/webpack-dev-server\\\":\\\"^3.11.6\\\",\\\"@types/webpack-env\\\":\\\"^1.16.3\\\",\\\"@types/webpack-node-externals\\\":\\\"^1.7.1\\\",\\\"@typescript-eslint/eslint-plugin\\\":\\\"^4.33.0\\\",\\\"@typescript-eslint/parser\\\":\\\"^4.33.0\\\",\\\"ansi_up\\\":\\\"^5.0.1\\\",\\\"chart.js\\\":\\\"^2.9.4\\\",\\\"circular-dependency-plugin\\\":\\\"^5.2.2\\\",\\\"color\\\":\\\"^3.1.2\\\",\\\"concurrently\\\":\\\"^5.3.0\\\",\\\"css-loader\\\":\\\"^5.2.7\\\",\\\"deepdash\\\":\\\"^5.3.9\\\",\\\"dompurify\\\":\\\"^2.3.3\\\",\\\"electron\\\":\\\"^13.6.1\\\",\\\"electron-builder\\\":\\\"^22.11.11\\\",\\\"electron-notarize\\\":\\\"^0.3.0\\\",\\\"esbuild\\\":\\\"^0.13.8\\\",\\\"esbuild-loader\\\":\\\"^2.16.0\\\",\\\"eslint\\\":\\\"^7.32.0\\\",\\\"eslint-plugin-header\\\":\\\"^3.1.1\\\",\\\"eslint-plugin-react\\\":\\\"^7.26.1\\\",\\\"eslint-plugin-react-hooks\\\":\\\"^4.2.0\\\",\\\"eslint-plugin-unused-imports\\\":\\\"^1.1.5\\\",\\\"file-loader\\\":\\\"^6.2.0\\\",\\\"flex.box\\\":\\\"^3.4.4\\\",\\\"fork-ts-checker-webpack-plugin\\\":\\\"^5.2.1\\\",\\\"hoist-non-react-statics\\\":\\\"^3.3.2\\\",\\\"html-webpack-plugin\\\":\\\"^4.5.2\\\",\\\"include-media\\\":\\\"^1.4.9\\\",\\\"jest\\\":\\\"26.6.3\\\",\\\"jest-canvas-mock\\\":\\\"^2.3.1\\\",\\\"jest-fetch-mock\\\":\\\"^3.0.3\\\",\\\"jest-mock-extended\\\":\\\"^1.0.18\\\",\\\"make-plural\\\":\\\"^6.2.2\\\",\\\"mini-css-extract-plugin\\\":\\\"^1.6.2\\\",\\\"node-gyp\\\":\\\"7.1.2\\\",\\\"node-loader\\\":\\\"^1.0.3\\\",\\\"nodemon\\\":\\\"^2.0.14\\\",\\\"playwright\\\":\\\"^1.15.2\\\",\\\"postcss\\\":\\\"^8.3.11\\\",\\\"postcss-loader\\\":\\\"4.3.0\\\",\\\"postinstall-postinstall\\\":\\\"^2.1.0\\\",\\\"progress-bar-webpack-plugin\\\":\\\"^2.1.0\\\",\\\"randomcolor\\\":\\\"^0.6.2\\\",\\\"raw-loader\\\":\\\"^4.0.2\\\",\\\"react-beautiful-dnd\\\":\\\"^13.1.0\\\",\\\"react-refresh\\\":\\\"^0.9.0\\\",\\\"react-router-dom\\\":\\\"^5.3.0\\\",\\\"react-select\\\":\\\"3.2.0\\\",\\\"react-select-event\\\":\\\"^5.1.0\\\",\\\"react-table\\\":\\\"^7.7.0\\\",\\\"react-window\\\":\\\"^1.8.6\\\",\\\"sass\\\":\\\"^1.43.4\\\",\\\"sass-loader\\\":\\\"^8.0.2\\\",\\\"sharp\\\":\\\"^0.29.2\\\",\\\"style-loader\\\":\\\"^2.0.0\\\",\\\"tailwindcss\\\":\\\"^2.2.19\\\",\\\"ts-jest\\\":\\\"26.5.6\\\",\\\"ts-loader\\\":\\\"^7.0.5\\\",\\\"ts-node\\\":\\\"^10.4.0\\\",\\\"type-fest\\\":\\\"^1.0.2\\\",\\\"typed-emitter\\\":\\\"^1.4.0\\\",\\\"typedoc\\\":\\\"0.22.7\\\",\\\"typedoc-plugin-markdown\\\":\\\"^3.11.3\\\",\\\"typeface-roboto\\\":\\\"^1.1.13\\\",\\\"typescript\\\":\\\"^4.5.2\\\",\\\"typescript-plugin-css-modules\\\":\\\"^3.4.0\\\",\\\"url-loader\\\":\\\"^4.1.1\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^3.3.12\\\",\\\"webpack-dev-server\\\":\\\"^3.11.2\\\",\\\"webpack-node-externals\\\":\\\"^1.7.2\\\",\\\"what-input\\\":\\\"^5.2.10\\\",\\\"xterm\\\":\\\"^4.14.1\\\",\\\"xterm-addon-fit\\\":\\\"^0.5.0\\\"}}\");\n\n//# sourceURL=webpack:///./package.json?");
39773
+ eval("module.exports = JSON.parse(\"{\\\"name\\\":\\\"open-lens\\\",\\\"productName\\\":\\\"OpenLens\\\",\\\"description\\\":\\\"OpenLens - Open Source IDE for Kubernetes\\\",\\\"homepage\\\":\\\"https://github.com/lensapp/lens\\\",\\\"version\\\":\\\"5.3.0\\\",\\\"main\\\":\\\"static/build/main.js\\\",\\\"copyright\\\":\\\"© 2021 OpenLens Authors\\\",\\\"license\\\":\\\"MIT\\\",\\\"author\\\":{\\\"name\\\":\\\"OpenLens Authors\\\",\\\"email\\\":\\\"info@k8slens.dev\\\"},\\\"scripts\\\":{\\\"dev\\\":\\\"concurrently -i -k \\\\\\\"yarn run dev-run -C\\\\\\\" yarn:dev:*\\\",\\\"dev-build\\\":\\\"concurrently yarn:compile:*\\\",\\\"debug-build\\\":\\\"concurrently yarn:compile:main yarn:compile:extension-types\\\",\\\"dev-run\\\":\\\"nodemon --watch static/build/main.js --exec \\\\\\\"electron --remote-debugging-port=9223 --inspect .\\\\\\\"\\\",\\\"dev:main\\\":\\\"yarn run compile:main --watch\\\",\\\"dev:renderer\\\":\\\"yarn run webpack-dev-server --config webpack.renderer.ts\\\",\\\"dev:extension-types\\\":\\\"yarn run compile:extension-types --watch\\\",\\\"compile\\\":\\\"env NODE_ENV=production concurrently yarn:compile:*\\\",\\\"compile:main\\\":\\\"yarn run webpack --config webpack.main.ts\\\",\\\"compile:renderer\\\":\\\"yarn run webpack --config webpack.renderer.ts\\\",\\\"compile:extension-types\\\":\\\"yarn run webpack --config webpack.extensions.ts\\\",\\\"npm:fix-build-version\\\":\\\"yarn run ts-node build/set_build_version.ts\\\",\\\"npm:fix-package-version\\\":\\\"yarn run ts-node build/set_npm_version.ts\\\",\\\"build:linux\\\":\\\"yarn run compile && electron-builder --linux --dir\\\",\\\"build:mac\\\":\\\"yarn run compile && electron-builder --mac --dir\\\",\\\"build:win\\\":\\\"yarn run compile && electron-builder --win --dir\\\",\\\"integration\\\":\\\"jest --runInBand --detectOpenHandles --forceExit integration\\\",\\\"dist\\\":\\\"yarn run compile && electron-builder --publish onTag\\\",\\\"dist:dir\\\":\\\"yarn run dist --dir -c.compression=store -c.mac.identity=null\\\",\\\"download-bins\\\":\\\"concurrently yarn:download:*\\\",\\\"download:kubectl\\\":\\\"yarn run ts-node build/download_kubectl.ts\\\",\\\"download:helm\\\":\\\"yarn run ts-node build/download_helm.ts\\\",\\\"build:tray-icons\\\":\\\"yarn run ts-node build/build_tray_icon.ts\\\",\\\"build:theme-vars\\\":\\\"yarn run ts-node build/build_theme_vars.ts\\\",\\\"lint\\\":\\\"PROD=true yarn run eslint --ext js,ts,tsx --max-warnings=0 .\\\",\\\"lint:fix\\\":\\\"yarn run lint --fix\\\",\\\"mkdocs-serve-local\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest\\\",\\\"verify-docs\\\":\\\"docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict\\\",\\\"typedocs-extensions-api\\\":\\\"yarn run typedoc src/extensions/extension-api.ts\\\",\\\"version-checkout\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release/v%s\\\\\\\" | xargs git checkout -b\\\",\\\"version-commit\\\":\\\"cat package.json | jq '.version' -r | xargs printf \\\\\\\"release v%s\\\\\\\" | git commit --no-edit -s -F -\\\",\\\"version\\\":\\\"yarn run version-checkout && git add package.json && yarn run version-commit\\\",\\\"postversion\\\":\\\"git push --set-upstream ${GIT_REMOTE:-origin} release/v$npm_package_version\\\"},\\\"config\\\":{\\\"bundledKubectlVersion\\\":\\\"1.21.2\\\",\\\"bundledHelmVersion\\\":\\\"3.6.3\\\",\\\"sentryDsn\\\":\\\"\\\"},\\\"engines\\\":{\\\"node\\\":\\\">=14 <15\\\"},\\\"jest\\\":{\\\"collectCoverage\\\":false,\\\"verbose\\\":true,\\\"transform\\\":{\\\"^.+\\\\\\\\.tsx?$\\\":\\\"ts-jest\\\"},\\\"moduleNameMapper\\\":{\\\"\\\\\\\\.(css|scss)$\\\":\\\"<rootDir>/__mocks__/styleMock.ts\\\",\\\"\\\\\\\\.(svg)$\\\":\\\"<rootDir>/__mocks__/imageMock.ts\\\",\\\"src/(.*)\\\":\\\"<rootDir>/__mocks__/windowMock.ts\\\"},\\\"modulePathIgnorePatterns\\\":[\\\"<rootDir>/dist\\\",\\\"<rootDir>/src/extensions/npm\\\"],\\\"setupFiles\\\":[\\\"<rootDir>/src/jest.setup.ts\\\",\\\"jest-canvas-mock\\\"]},\\\"build\\\":{\\\"generateUpdatesFilesForAllChannels\\\":true,\\\"files\\\":[\\\"static/build/main.js\\\"],\\\"afterSign\\\":\\\"build/notarize.js\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"locales/\\\",\\\"to\\\":\\\"locales/\\\",\\\"filter\\\":\\\"**/*.js\\\"},{\\\"from\\\":\\\"static/\\\",\\\"to\\\":\\\"static/\\\",\\\"filter\\\":\\\"!**/main.js\\\"},{\\\"from\\\":\\\"build/tray\\\",\\\"to\\\":\\\"static/icons\\\",\\\"filter\\\":\\\"*.png\\\"},{\\\"from\\\":\\\"extensions/\\\",\\\"to\\\":\\\"./extensions/\\\",\\\"filter\\\":[\\\"**/*.tgz\\\",\\\"**/package.json\\\",\\\"!**/node_modules\\\"]},{\\\"from\\\":\\\"templates/\\\",\\\"to\\\":\\\"./templates/\\\",\\\"filter\\\":\\\"**/*.yaml\\\"},\\\"LICENSE\\\"],\\\"linux\\\":{\\\"category\\\":\\\"Network\\\",\\\"artifactName\\\":\\\"${productName}-${version}.${arch}.${ext}\\\",\\\"target\\\":[\\\"deb\\\",\\\"rpm\\\",\\\"AppImage\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/linux/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"mac\\\":{\\\"hardenedRuntime\\\":true,\\\"gatekeeperAssess\\\":false,\\\"entitlements\\\":\\\"build/entitlements.mac.plist\\\",\\\"entitlementsInherit\\\":\\\"build/entitlements.mac.plist\\\",\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/darwin/${arch}/kubectl\\\",\\\"to\\\":\\\"./${arch}/kubectl\\\"},{\\\"from\\\":\\\"binaries/client/${arch}/helm3/helm3\\\",\\\"to\\\":\\\"./helm3/helm3\\\"}]},\\\"win\\\":{\\\"target\\\":[\\\"nsis\\\"],\\\"extraResources\\\":[{\\\"from\\\":\\\"binaries/client/windows/x64/kubectl.exe\\\",\\\"to\\\":\\\"./x64/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/windows/ia32/kubectl.exe\\\",\\\"to\\\":\\\"./ia32/kubectl.exe\\\"},{\\\"from\\\":\\\"binaries/client/x64/helm3/helm3.exe\\\",\\\"to\\\":\\\"./helm3/helm3.exe\\\"}]},\\\"nsis\\\":{\\\"include\\\":\\\"build/installer.nsh\\\",\\\"oneClick\\\":false,\\\"allowElevation\\\":true,\\\"createStartMenuShortcut\\\":true,\\\"allowToChangeInstallationDirectory\\\":true},\\\"protocols\\\":{\\\"name\\\":\\\"Lens Protocol Handler\\\",\\\"schemes\\\":[\\\"lens\\\"],\\\"role\\\":\\\"Viewer\\\"}},\\\"dependencies\\\":{\\\"@electron/remote\\\":\\\"^1.2.2\\\",\\\"@hapi/call\\\":\\\"^8.0.1\\\",\\\"@hapi/subtext\\\":\\\"^7.0.3\\\",\\\"@kubernetes/client-node\\\":\\\"^0.15.1\\\",\\\"@sentry/electron\\\":\\\"^2.5.4\\\",\\\"@sentry/integrations\\\":\\\"^6.13.3\\\",\\\"abort-controller\\\":\\\"^3.0.0\\\",\\\"auto-bind\\\":\\\"^4.0.0\\\",\\\"autobind-decorator\\\":\\\"^2.4.0\\\",\\\"await-lock\\\":\\\"^2.1.0\\\",\\\"byline\\\":\\\"^5.0.0\\\",\\\"chokidar\\\":\\\"^3.4.3\\\",\\\"conf\\\":\\\"^7.1.2\\\",\\\"crypto-js\\\":\\\"^4.1.1\\\",\\\"electron-devtools-installer\\\":\\\"^3.2.0\\\",\\\"electron-updater\\\":\\\"^4.6.1\\\",\\\"electron-window-state\\\":\\\"^5.0.3\\\",\\\"filehound\\\":\\\"^1.17.5\\\",\\\"fs-extra\\\":\\\"^9.0.1\\\",\\\"glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"got\\\":\\\"^11.8.2\\\",\\\"grapheme-splitter\\\":\\\"^1.0.4\\\",\\\"handlebars\\\":\\\"^4.7.7\\\",\\\"http-proxy\\\":\\\"^1.18.1\\\",\\\"immer\\\":\\\"^9.0.6\\\",\\\"joi\\\":\\\"^17.4.2\\\",\\\"js-yaml\\\":\\\"^4.1.0\\\",\\\"jsdom\\\":\\\"^16.7.0\\\",\\\"jsonpath\\\":\\\"^1.1.1\\\",\\\"lodash\\\":\\\"^4.17.15\\\",\\\"mac-ca\\\":\\\"^1.0.6\\\",\\\"marked\\\":\\\"^2.1.3\\\",\\\"md5-file\\\":\\\"^5.0.0\\\",\\\"mobx\\\":\\\"^6.3.7\\\",\\\"mobx-observable-history\\\":\\\"^2.0.3\\\",\\\"mobx-react\\\":\\\"^7.2.1\\\",\\\"mock-fs\\\":\\\"^4.14.0\\\",\\\"moment\\\":\\\"^2.29.1\\\",\\\"moment-timezone\\\":\\\"^0.5.33\\\",\\\"monaco-editor\\\":\\\"^0.29.1\\\",\\\"monaco-editor-webpack-plugin\\\":\\\"^5.0.0\\\",\\\"node-fetch\\\":\\\"lensapp/node-fetch#2.x\\\",\\\"node-pty\\\":\\\"^0.10.1\\\",\\\"npm\\\":\\\"^6.14.15\\\",\\\"p-limit\\\":\\\"^3.1.0\\\",\\\"path-to-regexp\\\":\\\"^6.2.0\\\",\\\"proper-lockfile\\\":\\\"^4.1.2\\\",\\\"react\\\":\\\"^17.0.2\\\",\\\"react-dom\\\":\\\"^17.0.2\\\",\\\"react-material-ui-carousel\\\":\\\"^2.3.5\\\",\\\"react-router\\\":\\\"^5.2.0\\\",\\\"react-virtualized-auto-sizer\\\":\\\"^1.0.6\\\",\\\"readable-stream\\\":\\\"^3.6.0\\\",\\\"request\\\":\\\"^2.88.2\\\",\\\"request-promise-native\\\":\\\"^1.0.9\\\",\\\"rfc6902\\\":\\\"^4.0.2\\\",\\\"semver\\\":\\\"^7.3.2\\\",\\\"shell-env\\\":\\\"^3.0.1\\\",\\\"spdy\\\":\\\"^4.0.2\\\",\\\"tar\\\":\\\"^6.1.11\\\",\\\"tcp-port-used\\\":\\\"^1.0.2\\\",\\\"tempy\\\":\\\"1.0.1\\\",\\\"url-parse\\\":\\\"^1.5.3\\\",\\\"uuid\\\":\\\"^8.3.2\\\",\\\"win-ca\\\":\\\"^3.4.5\\\",\\\"winston\\\":\\\"^3.3.3\\\",\\\"winston-console-format\\\":\\\"^1.0.8\\\",\\\"winston-transport-browserconsole\\\":\\\"^1.0.5\\\",\\\"ws\\\":\\\"^7.5.5\\\"},\\\"devDependencies\\\":{\\\"@material-ui/core\\\":\\\"^4.12.3\\\",\\\"@material-ui/icons\\\":\\\"^4.11.2\\\",\\\"@material-ui/lab\\\":\\\"^4.0.0-alpha.60\\\",\\\"@pmmmwh/react-refresh-webpack-plugin\\\":\\\"^0.4.3\\\",\\\"@sentry/types\\\":\\\"^6.14.1\\\",\\\"@testing-library/jest-dom\\\":\\\"^5.15.0\\\",\\\"@testing-library/react\\\":\\\"^11.2.7\\\",\\\"@testing-library/user-event\\\":\\\"^13.5.0\\\",\\\"@types/byline\\\":\\\"^4.2.33\\\",\\\"@types/chart.js\\\":\\\"^2.9.34\\\",\\\"@types/color\\\":\\\"^3.0.2\\\",\\\"@types/crypto-js\\\":\\\"^3.1.47\\\",\\\"@types/dompurify\\\":\\\"^2.3.1\\\",\\\"@types/electron-devtools-installer\\\":\\\"^2.2.0\\\",\\\"@types/fs-extra\\\":\\\"^9.0.1\\\",\\\"@types/glob-to-regexp\\\":\\\"^0.4.1\\\",\\\"@types/hoist-non-react-statics\\\":\\\"^3.3.1\\\",\\\"@types/html-webpack-plugin\\\":\\\"^3.2.6\\\",\\\"@types/http-proxy\\\":\\\"^1.17.7\\\",\\\"@types/jest\\\":\\\"^26.0.24\\\",\\\"@types/js-yaml\\\":\\\"^4.0.4\\\",\\\"@types/jsdom\\\":\\\"^16.2.13\\\",\\\"@types/jsonpath\\\":\\\"^0.2.0\\\",\\\"@types/lodash\\\":\\\"^4.14.176\\\",\\\"@types/marked\\\":\\\"^2.0.5\\\",\\\"@types/md5-file\\\":\\\"^4.0.2\\\",\\\"@types/mini-css-extract-plugin\\\":\\\"^0.9.1\\\",\\\"@types/mock-fs\\\":\\\"^4.13.1\\\",\\\"@types/node\\\":\\\"14.17.33\\\",\\\"@types/node-fetch\\\":\\\"^2.5.12\\\",\\\"@types/npm\\\":\\\"^2.0.32\\\",\\\"@types/progress-bar-webpack-plugin\\\":\\\"^2.1.2\\\",\\\"@types/proper-lockfile\\\":\\\"^4.1.2\\\",\\\"@types/randomcolor\\\":\\\"^0.5.6\\\",\\\"@types/react\\\":\\\"^17.0.34\\\",\\\"@types/react-beautiful-dnd\\\":\\\"^13.1.2\\\",\\\"@types/react-dom\\\":\\\"^17.0.11\\\",\\\"@types/react-router-dom\\\":\\\"^5.3.2\\\",\\\"@types/react-select\\\":\\\"3.1.2\\\",\\\"@types/react-table\\\":\\\"^7.7.7\\\",\\\"@types/react-virtualized-auto-sizer\\\":\\\"^1.0.1\\\",\\\"@types/react-window\\\":\\\"^1.8.5\\\",\\\"@types/readable-stream\\\":\\\"^2.3.11\\\",\\\"@types/request\\\":\\\"^2.48.7\\\",\\\"@types/request-promise-native\\\":\\\"^1.0.18\\\",\\\"@types/semver\\\":\\\"^7.3.9\\\",\\\"@types/sharp\\\":\\\"^0.29.2\\\",\\\"@types/spdy\\\":\\\"^3.4.5\\\",\\\"@types/tar\\\":\\\"^4.0.5\\\",\\\"@types/tcp-port-used\\\":\\\"^1.0.0\\\",\\\"@types/tempy\\\":\\\"^0.3.0\\\",\\\"@types/triple-beam\\\":\\\"^1.3.2\\\",\\\"@types/url-parse\\\":\\\"^1.4.4\\\",\\\"@types/uuid\\\":\\\"^8.3.1\\\",\\\"@types/webpack\\\":\\\"^4.41.31\\\",\\\"@types/webpack-dev-server\\\":\\\"^3.11.6\\\",\\\"@types/webpack-env\\\":\\\"^1.16.3\\\",\\\"@types/webpack-node-externals\\\":\\\"^1.7.1\\\",\\\"@typescript-eslint/eslint-plugin\\\":\\\"^4.33.0\\\",\\\"@typescript-eslint/parser\\\":\\\"^4.33.0\\\",\\\"ansi_up\\\":\\\"^5.0.1\\\",\\\"chart.js\\\":\\\"^2.9.4\\\",\\\"circular-dependency-plugin\\\":\\\"^5.2.2\\\",\\\"color\\\":\\\"^3.1.2\\\",\\\"concurrently\\\":\\\"^5.3.0\\\",\\\"css-loader\\\":\\\"^5.2.7\\\",\\\"deepdash\\\":\\\"^5.3.9\\\",\\\"dompurify\\\":\\\"^2.3.3\\\",\\\"electron\\\":\\\"^13.6.1\\\",\\\"electron-builder\\\":\\\"^22.11.11\\\",\\\"electron-notarize\\\":\\\"^0.3.0\\\",\\\"esbuild\\\":\\\"^0.13.8\\\",\\\"esbuild-loader\\\":\\\"^2.16.0\\\",\\\"eslint\\\":\\\"^7.32.0\\\",\\\"eslint-plugin-header\\\":\\\"^3.1.1\\\",\\\"eslint-plugin-react\\\":\\\"^7.26.1\\\",\\\"eslint-plugin-react-hooks\\\":\\\"^4.2.0\\\",\\\"eslint-plugin-unused-imports\\\":\\\"^1.1.5\\\",\\\"file-loader\\\":\\\"^6.2.0\\\",\\\"flex.box\\\":\\\"^3.4.4\\\",\\\"fork-ts-checker-webpack-plugin\\\":\\\"^5.2.1\\\",\\\"hoist-non-react-statics\\\":\\\"^3.3.2\\\",\\\"html-webpack-plugin\\\":\\\"^4.5.2\\\",\\\"include-media\\\":\\\"^1.4.9\\\",\\\"jest\\\":\\\"26.6.3\\\",\\\"jest-canvas-mock\\\":\\\"^2.3.1\\\",\\\"jest-fetch-mock\\\":\\\"^3.0.3\\\",\\\"jest-mock-extended\\\":\\\"^1.0.18\\\",\\\"make-plural\\\":\\\"^6.2.2\\\",\\\"mini-css-extract-plugin\\\":\\\"^1.6.2\\\",\\\"node-gyp\\\":\\\"7.1.2\\\",\\\"node-loader\\\":\\\"^1.0.3\\\",\\\"nodemon\\\":\\\"^2.0.14\\\",\\\"playwright\\\":\\\"^1.15.2\\\",\\\"postcss\\\":\\\"^8.3.11\\\",\\\"postcss-loader\\\":\\\"4.3.0\\\",\\\"postinstall-postinstall\\\":\\\"^2.1.0\\\",\\\"progress-bar-webpack-plugin\\\":\\\"^2.1.0\\\",\\\"randomcolor\\\":\\\"^0.6.2\\\",\\\"raw-loader\\\":\\\"^4.0.2\\\",\\\"react-beautiful-dnd\\\":\\\"^13.1.0\\\",\\\"react-refresh\\\":\\\"^0.9.0\\\",\\\"react-router-dom\\\":\\\"^5.3.0\\\",\\\"react-select\\\":\\\"3.2.0\\\",\\\"react-select-event\\\":\\\"^5.1.0\\\",\\\"react-table\\\":\\\"^7.7.0\\\",\\\"react-window\\\":\\\"^1.8.6\\\",\\\"sass\\\":\\\"^1.43.4\\\",\\\"sass-loader\\\":\\\"^8.0.2\\\",\\\"sharp\\\":\\\"^0.29.2\\\",\\\"style-loader\\\":\\\"^2.0.0\\\",\\\"tailwindcss\\\":\\\"^2.2.19\\\",\\\"ts-jest\\\":\\\"26.5.6\\\",\\\"ts-loader\\\":\\\"^7.0.5\\\",\\\"ts-node\\\":\\\"^10.4.0\\\",\\\"type-fest\\\":\\\"^1.0.2\\\",\\\"typed-emitter\\\":\\\"^1.4.0\\\",\\\"typedoc\\\":\\\"0.22.7\\\",\\\"typedoc-plugin-markdown\\\":\\\"^3.11.3\\\",\\\"typeface-roboto\\\":\\\"^1.1.13\\\",\\\"typescript\\\":\\\"^4.5.2\\\",\\\"typescript-plugin-css-modules\\\":\\\"^3.4.0\\\",\\\"url-loader\\\":\\\"^4.1.1\\\",\\\"webpack\\\":\\\"^4.46.0\\\",\\\"webpack-cli\\\":\\\"^3.3.12\\\",\\\"webpack-dev-server\\\":\\\"^3.11.2\\\",\\\"webpack-node-externals\\\":\\\"^1.7.2\\\",\\\"what-input\\\":\\\"^5.2.10\\\",\\\"xterm\\\":\\\"^4.14.1\\\",\\\"xterm-addon-fit\\\":\\\"^0.5.0\\\"}}\");\n\n//# sourceURL=webpack:///./package.json?");
39762
39774
 
39763
39775
  /***/ }),
39764
39776
 
@@ -40058,7 +40070,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
40058
40070
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
40059
40071
 
40060
40072
  "use strict";
40061
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ApiManager\", function() { return ApiManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiManager\", function() { return apiManager; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\nclass ApiManager {\n constructor() {\n Object.defineProperty(this, \"apis\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object.defineProperty(this, \"stores\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n }\n getApi(pathOrCallback) {\n if (typeof pathOrCallback === \"string\") {\n return this.apis.get(pathOrCallback) || this.apis.get(Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"parseKubeApi\"])(pathOrCallback).apiBase);\n }\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), pathOrCallback !== null && pathOrCallback !== void 0 ? pathOrCallback : (() => true));\n }\n getApiByKind(kind, apiVersion) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), api => api.kind === kind && api.apiVersionWithGroup === apiVersion);\n }\n registerApi(apiBase, api) {\n if (!api.apiBase)\n return;\n if (!this.apis.has(apiBase)) {\n this.stores.forEach((store) => {\n if (store.api === api) {\n this.stores.set(apiBase, store);\n }\n });\n this.apis.set(apiBase, api);\n }\n }\n resolveApi(api) {\n if (!api) {\n return undefined;\n }\n if (typeof api === \"string\") {\n return this.getApi(api);\n }\n return api;\n }\n unregisterApi(api) {\n if (typeof api === \"string\")\n this.apis.delete(api);\n else {\n const apis = Array.from(this.apis.entries());\n const entry = apis.find(entry => entry[1] === api);\n if (entry)\n this.unregisterApi(entry[0]);\n }\n }\n registerStore(store, apis = [store.api]) {\n apis.filter(Boolean).forEach(api => {\n if (api.apiBase)\n this.stores.set(api.apiBase, store);\n });\n }\n getStore(api) {\n var _a;\n return this.stores.get((_a = this.resolveApi(api)) === null || _a === void 0 ? void 0 : _a.apiBase);\n }\n lookupApiLink(ref, parentObject) {\n const { kind, apiVersion, name, namespace = parentObject.getNs(), } = ref;\n if (!kind)\n return \"\";\n // search in registered apis by 'kind' & 'apiVersion'\n const api = this.getApi(api => api.kind === kind && api.apiVersionWithGroup == apiVersion);\n if (api) {\n return api.getUrl({ namespace, name });\n }\n // lookup api by generated resource link\n const apiPrefixes = [\"/apis\", \"/api\"];\n const resource = kind.endsWith(\"s\") ? `${kind.toLowerCase()}es` : `${kind.toLowerCase()}s`;\n for (const apiPrefix of apiPrefixes) {\n const apiLink = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiPrefix, apiVersion, name, namespace, resource });\n if (this.getApi(apiLink)) {\n return apiLink;\n }\n }\n // resolve by kind only (hpa's might use refs to older versions of resources for example)\n const apiByKind = this.getApi(api => api.kind === kind);\n if (apiByKind) {\n return apiByKind.getUrl({ name, namespace });\n }\n // otherwise generate link with default prefix\n // resource still might exists in k8s, but api is not registered in the app\n return Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiVersion, name, namespace, resource });\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function, Array]),\n __metadata(\"design:returntype\", void 0)\n], ApiManager.prototype, \"registerStore\", null);\nconst apiManager = new ApiManager();\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/api-manager.ts?");
40073
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ApiManager\", function() { return ApiManager; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"apiManager\", function() { return apiManager; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _kube_api_parse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./kube-api-parse */ \"./src/common/k8s-api/kube-api-parse.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\nclass ApiManager {\n constructor() {\n Object.defineProperty(this, \"apis\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object.defineProperty(this, \"stores\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_0__[\"observable\"].map()\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n }\n getApi(pathOrCallback) {\n if (typeof pathOrCallback === \"string\") {\n return this.apis.get(pathOrCallback) || this.apis.get(Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"parseKubeApi\"])(pathOrCallback).apiBase);\n }\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), pathOrCallback !== null && pathOrCallback !== void 0 ? pathOrCallback : (() => true));\n }\n getApiByKind(kind, apiVersion) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"iter\"].find(this.apis.values(), api => api.kind === kind && api.apiVersionWithGroup === apiVersion);\n }\n registerApi(apiBase, api) {\n if (!api.apiBase)\n return;\n if (!this.apis.has(apiBase)) {\n this.stores.forEach((store) => {\n if (store.api === api) {\n this.stores.set(apiBase, store);\n }\n });\n this.apis.set(apiBase, api);\n }\n }\n resolveApi(api) {\n if (!api) {\n return undefined;\n }\n if (typeof api === \"string\") {\n return this.getApi(api);\n }\n return api;\n }\n unregisterApi(api) {\n if (typeof api === \"string\")\n this.apis.delete(api);\n else {\n const apis = Array.from(this.apis.entries());\n const entry = apis.find(entry => entry[1] === api);\n if (entry)\n this.unregisterApi(entry[0]);\n }\n }\n registerStore(store, apis = [store.api]) {\n apis.filter(Boolean).forEach(api => {\n if (api.apiBase)\n this.stores.set(api.apiBase, store);\n });\n }\n getStore(api) {\n var _a;\n return this.stores.get((_a = this.resolveApi(api)) === null || _a === void 0 ? void 0 : _a.apiBase);\n }\n lookupApiLink(ref, parentObject) {\n const { kind, apiVersion, name, namespace = parentObject === null || parentObject === void 0 ? void 0 : parentObject.getNs(), } = ref;\n if (!kind)\n return \"\";\n // search in registered apis by 'kind' & 'apiVersion'\n const api = this.getApi(api => api.kind === kind && api.apiVersionWithGroup == apiVersion);\n if (api) {\n return api.getUrl({ namespace, name });\n }\n // lookup api by generated resource link\n const apiPrefixes = [\"/apis\", \"/api\"];\n const resource = kind.endsWith(\"s\") ? `${kind.toLowerCase()}es` : `${kind.toLowerCase()}s`;\n for (const apiPrefix of apiPrefixes) {\n const apiLink = Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiPrefix, apiVersion, name, namespace, resource });\n if (this.getApi(apiLink)) {\n return apiLink;\n }\n }\n // resolve by kind only (hpa's might use refs to older versions of resources for example)\n const apiByKind = this.getApi(api => api.kind === kind);\n if (apiByKind) {\n return apiByKind.getUrl({ name, namespace });\n }\n // otherwise generate link with default prefix\n // resource still might exists in k8s, but api is not registered in the app\n return Object(_kube_api_parse__WEBPACK_IMPORTED_MODULE_2__[\"createKubeApiURL\"])({ apiVersion, name, namespace, resource });\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Function, Array]),\n __metadata(\"design:returntype\", void 0)\n], ApiManager.prototype, \"registerStore\", null);\nconst apiManager = new ApiManager();\n\n\n//# sourceURL=webpack:///./src/common/k8s-api/api-manager.ts?");
40062
40074
 
40063
40075
  /***/ }),
40064
40076
 
@@ -42962,7 +42974,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
42962
42974
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
42963
42975
 
42964
42976
  "use strict";
42965
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NamespaceStore\", function() { return NamespaceStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"namespaceStore\", function() { return namespaceStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDummyNamespace\", function() { return getDummyNamespace; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object.store */ \"./src/common/k8s-api/kube-object.store.ts\");\n/* harmony import */ var _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/k8s-api/endpoints/namespaces.api */ \"./src/common/k8s-api/endpoints/namespaces.api.ts\");\n/* harmony import */ var _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\nclass NamespaceStore extends _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_2__[\"KubeObjectStore\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"namespacesApi\"]\n });\n Object.defineProperty(this, \"storage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"createStorage\"])(\"selected_namespaces\", undefined)\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n this.init();\n }\n async init() {\n await this.contextReady;\n await this.storage.whenReady;\n this.selectNamespaces(this.initialNamespaces);\n this.autoLoadAllowedNamespaces();\n }\n onContextChange(callback, opts = {}) {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => Array.from(this.contextNamespaces), callback, Object.assign({ equals: mobx__WEBPACK_IMPORTED_MODULE_0__[\"comparer\"].shallow }, opts));\n }\n autoLoadAllowedNamespaces() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.allowedNamespaces, namespaces => this.loadAll({ namespaces }), {\n fireImmediately: true,\n equals: mobx__WEBPACK_IMPORTED_MODULE_0__[\"comparer\"].shallow,\n });\n }\n get initialNamespaces() {\n const { allowedNamespaces } = this;\n const selectedNamespaces = this.storage.get(); // raw namespaces, undefined on first load\n // return previously saved namespaces from local-storage (if any)\n if (Array.isArray(selectedNamespaces)) {\n return selectedNamespaces.filter(namespace => allowedNamespaces.includes(namespace));\n }\n // otherwise select \"default\" or first allowed namespace\n if (allowedNamespaces.includes(\"default\")) {\n return [\"default\"];\n }\n else if (allowedNamespaces.length) {\n return [allowedNamespaces[0]];\n }\n return [];\n }\n /**\n * @private\n * The current value (list of namespaces names) in the storage layer\n */\n get selectedNamespaces() {\n var _a;\n return (_a = this.storage.get()) !== null && _a !== void 0 ? _a : [];\n }\n get allowedNamespaces() {\n var _a, _b;\n return Array.from(new Set([\n ...((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.allNamespaces) !== null && _b !== void 0 ? _b : []),\n ...this.items.map(item => item.getName()), // loaded namespaces from k8s api\n ].flat()));\n }\n /**\n * The list of selected namespace names (for filtering)\n */\n get contextNamespaces() {\n if (!this.selectedNamespaces.length) {\n return this.allowedNamespaces; // show all namespaces when nothing selected\n }\n return this.selectedNamespaces;\n }\n /**\n * The set of select namespace names (for filtering)\n */\n get selectedNames() {\n return new Set(this.contextNamespaces);\n }\n /**\n * Is true when the the set of namespace names selected is implicitly all\n *\n * Namely, this will be true if the user has deselected all namespaces from\n * the filter or if the user has clicked the \"All Namespaces\" option\n */\n get areAllSelectedImplicitly() {\n return this.selectedNamespaces.length === 0;\n }\n subscribe() {\n var _a;\n /**\n * if user has given static list of namespaces let's not start watches\n * because watch adds stuff that's not wanted or will just fail\n */\n if (((_a = this.context) === null || _a === void 0 ? void 0 : _a.cluster.accessibleNamespaces.length) > 0) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"noop\"];\n }\n return super.subscribe();\n }\n async loadItems(params) {\n const { allowedNamespaces } = this;\n let namespaces = await super.loadItems(params).catch(() => []);\n namespaces = namespaces.filter(namespace => allowedNamespaces.includes(namespace.getName()));\n if (!namespaces.length && allowedNamespaces.length > 0) {\n return allowedNamespaces.map(getDummyNamespace);\n }\n return namespaces;\n }\n selectNamespaces(namespace) {\n const namespaces = Array.from(new Set([namespace].flat()));\n this.storage.set(namespaces);\n }\n clearSelected(namespaces) {\n if (namespaces) {\n const resettingNamespaces = [namespaces].flat();\n const newNamespaces = this.storage.get().filter(ns => !resettingNamespaces.includes(ns));\n this.storage.set(newNamespaces);\n }\n else {\n this.storage.reset();\n }\n }\n /**\n * Checks if namespace names are selected for filtering\n * @param namespaces One or several names of namespaces to check if they are selected\n * @returns `true` if all the provided names are selected\n */\n hasContext(namespaces) {\n return [namespaces]\n .flat()\n .every(namespace => this.selectedNames.has(namespace));\n }\n /**\n * Is `true` if all available namespaces are selected, otherwise `false`\n */\n get hasAllContexts() {\n return this.contextNamespaces.length === this.allowedNamespaces.length;\n }\n /**\n * Acts like `toggleSingle` but can work on several at a time\n * @param namespaces One or many names of namespaces to select\n */\n toggleContext(namespaces) {\n const nextState = new _utils__WEBPACK_IMPORTED_MODULE_1__[\"ToggleSet\"](this.contextNamespaces);\n for (const namespace of [namespaces].flat()) {\n nextState.toggle(namespace);\n }\n this.storage.set([...nextState]);\n }\n /**\n * Toggles the selection state of `namespace`. Namely, if it was previously\n * specifically or implicitly selected then after this call it will be\n * explicitly deselected.\n * @param namespace The name of a namespace\n */\n toggleSingle(namespace) {\n const nextState = new _utils__WEBPACK_IMPORTED_MODULE_1__[\"ToggleSet\"](this.contextNamespaces);\n nextState.toggle(namespace);\n this.storage.set([...nextState]);\n }\n /**\n * Makes the given namespace the sole selected namespace\n */\n selectSingle(namespace) {\n this.storage.set([namespace]);\n }\n /**\n * Selects all available namespaces.\n *\n * Note: If new namespaces appear in the future those will be selected too\n */\n selectAll() {\n this.selectNamespaces([]);\n }\n /**\n * This function selects all namespaces implicitly.\n *\n * NOTE: does not toggle any namespaces\n * @param selectAll NOT USED\n * @deprecated Use `NamespaceStore.selectAll` instead.\n */\n toggleAll(selectAll) {\n void selectAll;\n this.selectAll();\n }\n async remove(item) {\n await super.remove(item);\n this.clearSelected(item.getName());\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"selectedNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"allowedNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"contextNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Set),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"selectedNames\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Boolean),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"areAllSelectedImplicitly\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], NamespaceStore.prototype, \"selectNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], NamespaceStore.prototype, \"clearSelected\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Boolean),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"hasAllContexts\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], NamespaceStore.prototype, \"toggleContext\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [_common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"Namespace\"]]),\n __metadata(\"design:returntype\", Promise)\n], NamespaceStore.prototype, \"remove\", null);\nconst namespaceStore = new NamespaceStore();\n_common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerStore(namespaceStore);\nfunction getDummyNamespace(name) {\n return new _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"Namespace\"]({\n kind: _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"Namespace\"].kind,\n apiVersion: \"v1\",\n metadata: {\n name,\n uid: \"\",\n resourceVersion: \"\",\n selfLink: `/api/v1/namespaces/${name}`,\n },\n });\n}\n\n\n//# sourceURL=webpack:///./src/renderer/components/+namespaces/namespace.store.ts?");
42977
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NamespaceStore\", function() { return NamespaceStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"namespaceStore\", function() { return namespaceStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDummyNamespace\", function() { return getDummyNamespace; });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object.store */ \"./src/common/k8s-api/kube-object.store.ts\");\n/* harmony import */ var _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/k8s-api/endpoints/namespaces.api */ \"./src/common/k8s-api/endpoints/namespaces.api.ts\");\n/* harmony import */ var _common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager */ \"./src/common/k8s-api/api-manager.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\nclass NamespaceStore extends _common_k8s_api_kube_object_store__WEBPACK_IMPORTED_MODULE_2__[\"KubeObjectStore\"] {\n constructor() {\n super();\n Object.defineProperty(this, \"api\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"namespacesApi\"]\n });\n Object.defineProperty(this, \"storage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"createStorage\"])(\"selected_namespaces\", undefined)\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_1__[\"autoBind\"])(this);\n this.init();\n }\n async init() {\n await this.contextReady;\n await this.storage.whenReady;\n this.selectNamespaces(this.initialNamespaces);\n this.autoLoadAllowedNamespaces();\n }\n onContextChange(callback, opts = {}) {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => Array.from(this.contextNamespaces), callback, {\n fireImmediately: opts.fireImmediately,\n equals: mobx__WEBPACK_IMPORTED_MODULE_0__[\"comparer\"].shallow,\n });\n }\n autoLoadAllowedNamespaces() {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_0__[\"reaction\"])(() => this.allowedNamespaces, namespaces => this.loadAll({ namespaces }), {\n fireImmediately: true,\n equals: mobx__WEBPACK_IMPORTED_MODULE_0__[\"comparer\"].shallow,\n });\n }\n get initialNamespaces() {\n const { allowedNamespaces } = this;\n const selectedNamespaces = this.storage.get(); // raw namespaces, undefined on first load\n // return previously saved namespaces from local-storage (if any)\n if (Array.isArray(selectedNamespaces)) {\n return selectedNamespaces.filter(namespace => allowedNamespaces.includes(namespace));\n }\n // otherwise select \"default\" or first allowed namespace\n if (allowedNamespaces.includes(\"default\")) {\n return [\"default\"];\n }\n else if (allowedNamespaces.length) {\n return [allowedNamespaces[0]];\n }\n return [];\n }\n /**\n * @private\n * The current value (list of namespaces names) in the storage layer\n */\n get selectedNamespaces() {\n var _a;\n return (_a = this.storage.get()) !== null && _a !== void 0 ? _a : [];\n }\n get allowedNamespaces() {\n var _a, _b;\n return Array.from(new Set([\n ...((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.allNamespaces) !== null && _b !== void 0 ? _b : []),\n ...this.items.map(item => item.getName()), // loaded namespaces from k8s api\n ].flat()));\n }\n /**\n * The list of selected namespace names (for filtering)\n */\n get contextNamespaces() {\n if (!this.selectedNamespaces.length) {\n return this.allowedNamespaces; // show all namespaces when nothing selected\n }\n return this.selectedNamespaces;\n }\n /**\n * The set of select namespace names (for filtering)\n */\n get selectedNames() {\n return new Set(this.contextNamespaces);\n }\n /**\n * Is true when the the set of namespace names selected is implicitly all\n *\n * Namely, this will be true if the user has deselected all namespaces from\n * the filter or if the user has clicked the \"All Namespaces\" option\n */\n get areAllSelectedImplicitly() {\n return this.selectedNamespaces.length === 0;\n }\n subscribe() {\n var _a;\n /**\n * if user has given static list of namespaces let's not start watches\n * because watch adds stuff that's not wanted or will just fail\n */\n if (((_a = this.context) === null || _a === void 0 ? void 0 : _a.cluster.accessibleNamespaces.length) > 0) {\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"noop\"];\n }\n return super.subscribe();\n }\n async loadItems(params) {\n const { allowedNamespaces } = this;\n let namespaces = await super.loadItems(params).catch(() => []);\n namespaces = namespaces.filter(namespace => allowedNamespaces.includes(namespace.getName()));\n if (!namespaces.length && allowedNamespaces.length > 0) {\n return allowedNamespaces.map(getDummyNamespace);\n }\n return namespaces;\n }\n selectNamespaces(namespace) {\n const namespaces = Array.from(new Set([namespace].flat()));\n this.storage.set(namespaces);\n }\n clearSelected(namespaces) {\n if (namespaces) {\n const resettingNamespaces = [namespaces].flat();\n const newNamespaces = this.storage.get().filter(ns => !resettingNamespaces.includes(ns));\n this.storage.set(newNamespaces);\n }\n else {\n this.storage.reset();\n }\n }\n /**\n * Checks if namespace names are selected for filtering\n * @param namespaces One or several names of namespaces to check if they are selected\n * @returns `true` if all the provided names are selected\n */\n hasContext(namespaces) {\n return [namespaces]\n .flat()\n .every(namespace => this.selectedNames.has(namespace));\n }\n /**\n * Is `true` if all available namespaces are selected, otherwise `false`\n */\n get hasAllContexts() {\n return this.contextNamespaces.length === this.allowedNamespaces.length;\n }\n /**\n * Acts like `toggleSingle` but can work on several at a time\n * @param namespaces One or many names of namespaces to select\n */\n toggleContext(namespaces) {\n const nextState = new _utils__WEBPACK_IMPORTED_MODULE_1__[\"ToggleSet\"](this.contextNamespaces);\n for (const namespace of [namespaces].flat()) {\n nextState.toggle(namespace);\n }\n this.storage.set([...nextState]);\n }\n /**\n * Toggles the selection state of `namespace`. Namely, if it was previously\n * specifically or implicitly selected then after this call it will be\n * explicitly deselected.\n * @param namespace The name of a namespace\n */\n toggleSingle(namespace) {\n const nextState = new _utils__WEBPACK_IMPORTED_MODULE_1__[\"ToggleSet\"](this.contextNamespaces);\n nextState.toggle(namespace);\n this.storage.set([...nextState]);\n }\n /**\n * Makes the given namespace the sole selected namespace\n */\n selectSingle(namespace) {\n this.storage.set([namespace]);\n }\n /**\n * Selects all available namespaces.\n *\n * Note: If new namespaces appear in the future those will be selected too\n */\n selectAll() {\n this.selectNamespaces([]);\n }\n /**\n * This function selects all namespaces implicitly.\n *\n * NOTE: does not toggle any namespaces\n * @param selectAll NOT USED\n * @deprecated Use `NamespaceStore.selectAll` instead.\n */\n toggleAll(selectAll) {\n void selectAll;\n this.selectAll();\n }\n async remove(item) {\n await super.remove(item);\n this.clearSelected(item.getName());\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"selectedNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"allowedNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Array),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"contextNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Set),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"selectedNames\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Boolean),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"areAllSelectedImplicitly\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], NamespaceStore.prototype, \"selectNamespaces\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], NamespaceStore.prototype, \"clearSelected\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"computed\"],\n __metadata(\"design:type\", Boolean),\n __metadata(\"design:paramtypes\", [])\n], NamespaceStore.prototype, \"hasAllContexts\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], NamespaceStore.prototype, \"toggleContext\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_0__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [_common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"Namespace\"]]),\n __metadata(\"design:returntype\", Promise)\n], NamespaceStore.prototype, \"remove\", null);\nconst namespaceStore = new NamespaceStore();\n_common_k8s_api_api_manager__WEBPACK_IMPORTED_MODULE_4__[\"apiManager\"].registerStore(namespaceStore);\nfunction getDummyNamespace(name) {\n return new _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"Namespace\"]({\n kind: _common_k8s_api_endpoints_namespaces_api__WEBPACK_IMPORTED_MODULE_3__[\"Namespace\"].kind,\n apiVersion: \"v1\",\n metadata: {\n name,\n uid: \"\",\n resourceVersion: \"\",\n selfLink: `/api/v1/namespaces/${name}`,\n },\n });\n}\n\n\n//# sourceURL=webpack:///./src/renderer/components/+namespaces/namespace.store.ts?");
42966
42978
 
42967
42979
  /***/ }),
42968
42980
 
@@ -43418,7 +43430,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
43418
43430
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
43419
43431
 
43420
43432
  "use strict";
43421
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TabKind\", function() { return TabKind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DockStore\", function() { return DockStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dockStore\", function() { return dockStore; });\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/index.js\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/throttle */ \"./node_modules/lodash/throttle.js\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_3__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nvar TabKind;\n(function (TabKind) {\n TabKind[\"TERMINAL\"] = \"terminal\";\n TabKind[\"CREATE_RESOURCE\"] = \"create-resource\";\n TabKind[\"EDIT_RESOURCE\"] = \"edit-resource\";\n TabKind[\"INSTALL_CHART\"] = \"install-chart\";\n TabKind[\"UPGRADE_CHART\"] = \"upgrade-chart\";\n TabKind[\"POD_LOGS\"] = \"pod-logs\";\n})(TabKind || (TabKind = {}));\nclass DockStore {\n constructor() {\n Object.defineProperty(this, \"minHeight\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 100\n });\n Object.defineProperty(this, \"fullSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"storage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"createStorage\"])(\"dock\", {\n height: 300,\n tabs: [\n { id: \"terminal\", kind: TabKind.TERMINAL, title: \"Terminal\", pinned: false },\n ],\n })\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"autoBind\"])(this);\n this.init();\n }\n get whenReady() {\n return this.storage.whenReady;\n }\n get isOpen() {\n return this.storage.get().isOpen;\n }\n set isOpen(isOpen) {\n this.storage.merge({ isOpen });\n }\n get height() {\n return this.storage.get().height;\n }\n set height(height) {\n this.storage.merge({\n height: Math.max(this.minHeight, Math.min(height || this.minHeight, this.maxHeight)),\n });\n }\n get tabs() {\n return this.storage.get().tabs;\n }\n set tabs(tabs) {\n this.storage.merge({ tabs });\n }\n get selectedTabId() {\n var _a;\n return this.storage.get().selectedTabId\n || (this.tabs.length > 0\n ? (_a = this.tabs[0]) === null || _a === void 0 ? void 0 : _a.id\n : undefined);\n }\n set selectedTabId(tabId) {\n if (tabId && !this.getTabById(tabId))\n return; // skip invalid ids\n this.storage.merge({ selectedTabId: tabId });\n }\n get selectedTab() {\n return this.tabs.find(tab => tab.id === this.selectedTabId);\n }\n init() {\n // adjust terminal height if window size changes\n window.addEventListener(\"resize\", lodash_throttle__WEBPACK_IMPORTED_MODULE_3___default()(this.adjustHeight, 250));\n }\n get maxHeight() {\n const mainLayoutHeader = 40;\n const mainLayoutTabs = 33;\n const mainLayoutMargin = 16;\n const dockTabs = 33;\n const preferredMax = window.innerHeight - mainLayoutHeader - mainLayoutTabs - mainLayoutMargin - dockTabs;\n return Math.max(preferredMax, this.minHeight); // don't let max < min\n }\n adjustHeight() {\n if (this.height < this.minHeight)\n this.height = this.minHeight;\n if (this.height > this.maxHeight)\n this.height = this.maxHeight;\n }\n onResize(callback, options) {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => [this.height, this.fullSize], callback, options);\n }\n onTabClose(callback, options = {}) {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => dockStore.tabs.map(tab => tab.id), (tabs, prevTabs) => {\n if (!Array.isArray(prevTabs)) {\n return; // tabs not yet modified\n }\n const closedTabs = prevTabs.filter(id => !tabs.includes(id));\n if (closedTabs.length > 0) {\n Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"runInAction\"])(() => {\n closedTabs.forEach(tabId => callback({ tabId }));\n });\n }\n }, Object.assign({ equals: mobx__WEBPACK_IMPORTED_MODULE_1__[\"comparer\"].structural }, options));\n }\n onTabChange(callback, options = {}) {\n const { tabKind, dockIsVisible = true } = options, reactionOpts = __rest(options, [\"tabKind\", \"dockIsVisible\"]);\n return Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => this.selectedTab, ((tab, prevTab) => {\n if (!tab)\n return; // skip when dock is empty\n if (tabKind && tabKind !== tab.kind)\n return; // handle specific tab.kind only\n if (dockIsVisible && !this.isOpen)\n return;\n callback({\n tab, prevTab,\n tabId: tab.id,\n });\n }), reactionOpts);\n }\n hasTabs() {\n return this.tabs.length > 0;\n }\n open(fullSize) {\n this.isOpen = true;\n if (typeof fullSize === \"boolean\") {\n this.fullSize = fullSize;\n }\n }\n close() {\n this.isOpen = false;\n }\n toggle() {\n if (this.isOpen)\n this.close();\n else\n this.open();\n }\n toggleFillSize() {\n if (!this.isOpen)\n this.open();\n this.fullSize = !this.fullSize;\n }\n getTabById(tabId) {\n return this.tabs.find(tab => tab.id === tabId);\n }\n getTabIndex(tabId) {\n return this.tabs.findIndex(tab => tab.id === tabId);\n }\n getNewTabNumber(kind) {\n const tabNumbers = this.tabs\n .filter(tab => tab.kind === kind)\n .map(tab => {\n const tabNumber = +tab.title.match(/\\d+/);\n return tabNumber === 0 ? 1 : tabNumber; // tab without a number is first\n });\n for (let i = 1;; i++) {\n if (!tabNumbers.includes(i))\n return i;\n }\n }\n createTab(rawTabDesc, addNumber = true) {\n const { id = uuid__WEBPACK_IMPORTED_MODULE_0__[\"v4\"](), kind, pinned = false } = rawTabDesc, restOfTabFields = __rest(rawTabDesc, [\"id\", \"kind\", \"pinned\"]);\n let { title = kind } = rawTabDesc;\n if (addNumber) {\n const tabNumber = this.getNewTabNumber(kind);\n if (tabNumber > 1) {\n title += ` (${tabNumber})`;\n }\n }\n const tab = Object.assign(Object.assign({}, restOfTabFields), { id,\n kind,\n pinned,\n title });\n this.tabs.push(tab);\n this.selectTab(tab.id);\n this.open();\n return tab;\n }\n closeTab(tabId) {\n const tab = this.getTabById(tabId);\n if (!tab || tab.pinned) {\n return;\n }\n this.tabs = this.tabs.filter(tab => tab.id !== tabId);\n if (this.selectedTabId === tab.id) {\n if (this.tabs.length) {\n const newTab = this.tabs.slice(-1)[0]; // last\n this.selectTab(newTab.id);\n }\n else {\n this.selectedTabId = null;\n this.close();\n }\n }\n }\n closeTabs(tabs) {\n tabs.forEach(tab => this.closeTab(tab.id));\n }\n closeAllTabs() {\n this.closeTabs([...this.tabs]);\n }\n closeOtherTabs(tabId) {\n const index = this.getTabIndex(tabId);\n const tabs = [...this.tabs.slice(0, index), ...this.tabs.slice(index + 1)];\n this.closeTabs(tabs);\n }\n closeTabsToTheRight(tabId) {\n const index = this.getTabIndex(tabId);\n const tabs = this.tabs.slice(index + 1);\n this.closeTabs(tabs);\n }\n renameTab(tabId, title) {\n const tab = this.getTabById(tabId);\n tab.title = title;\n }\n selectTab(tabId) {\n var _a, _b;\n this.selectedTabId = (_b = (_a = this.getTabById(tabId)) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null;\n }\n reset() {\n var _a;\n (_a = this.storage) === null || _a === void 0 ? void 0 : _a.reset();\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"],\n __metadata(\"design:type\", Object)\n], DockStore.prototype, \"fullSize\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], DockStore.prototype, \"selectedTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Boolean]),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"open\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"close\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"toggle\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"toggleFillSize\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object, Object]),\n __metadata(\"design:returntype\", Object)\n], DockStore.prototype, \"createTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [String]),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"closeTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [String]),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"selectTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"reset\", null);\nconst dockStore = new DockStore();\n\n\n//# sourceURL=webpack:///./src/renderer/components/dock/dock.store.ts?");
43433
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TabKind\", function() { return TabKind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DockStore\", function() { return DockStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dockStore\", function() { return dockStore; });\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/esm-browser/index.js\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/throttle */ \"./node_modules/lodash/throttle.js\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_3__);\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar __rest = (undefined && undefined.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nvar TabKind;\n(function (TabKind) {\n TabKind[\"TERMINAL\"] = \"terminal\";\n TabKind[\"CREATE_RESOURCE\"] = \"create-resource\";\n TabKind[\"EDIT_RESOURCE\"] = \"edit-resource\";\n TabKind[\"INSTALL_CHART\"] = \"install-chart\";\n TabKind[\"UPGRADE_CHART\"] = \"upgrade-chart\";\n TabKind[\"POD_LOGS\"] = \"pod-logs\";\n})(TabKind || (TabKind = {}));\nclass DockStore {\n constructor() {\n Object.defineProperty(this, \"minHeight\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 100\n });\n Object.defineProperty(this, \"fullSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n Object.defineProperty(this, \"storage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"createStorage\"])(\"dock\", {\n height: 300,\n tabs: [\n { id: \"terminal\", kind: TabKind.TERMINAL, title: \"Terminal\", pinned: false },\n ],\n })\n });\n Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"makeObservable\"])(this);\n Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"autoBind\"])(this);\n this.init();\n }\n get whenReady() {\n return this.storage.whenReady;\n }\n get isOpen() {\n return this.storage.get().isOpen;\n }\n set isOpen(isOpen) {\n this.storage.merge({ isOpen });\n }\n get height() {\n return this.storage.get().height;\n }\n set height(height) {\n this.storage.merge({\n height: Math.max(this.minHeight, Math.min(height || this.minHeight, this.maxHeight)),\n });\n }\n get tabs() {\n return this.storage.get().tabs;\n }\n set tabs(tabs) {\n this.storage.merge({ tabs });\n }\n get selectedTabId() {\n var _a;\n return this.storage.get().selectedTabId\n || (this.tabs.length > 0\n ? (_a = this.tabs[0]) === null || _a === void 0 ? void 0 : _a.id\n : undefined);\n }\n set selectedTabId(tabId) {\n if (tabId && !this.getTabById(tabId))\n return; // skip invalid ids\n this.storage.merge({ selectedTabId: tabId });\n }\n get selectedTab() {\n return this.tabs.find(tab => tab.id === this.selectedTabId);\n }\n init() {\n // adjust terminal height if window size changes\n window.addEventListener(\"resize\", lodash_throttle__WEBPACK_IMPORTED_MODULE_3___default()(this.adjustHeight, 250));\n }\n get maxHeight() {\n const mainLayoutHeader = 40;\n const mainLayoutTabs = 33;\n const mainLayoutMargin = 16;\n const dockTabs = 33;\n const preferredMax = window.innerHeight - mainLayoutHeader - mainLayoutTabs - mainLayoutMargin - dockTabs;\n return Math.max(preferredMax, this.minHeight); // don't let max < min\n }\n adjustHeight() {\n if (this.height < this.minHeight)\n this.height = this.minHeight;\n if (this.height > this.maxHeight)\n this.height = this.maxHeight;\n }\n onResize(callback, opts = {}) {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => [this.height, this.fullSize], callback, {\n fireImmediately: opts.fireImmediately,\n });\n }\n onTabClose(callback, opts = {}) {\n return Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => dockStore.tabs.map(tab => tab.id), (tabs, prevTabs) => {\n if (!Array.isArray(prevTabs)) {\n return; // tabs not yet modified\n }\n const closedTabs = prevTabs.filter(id => !tabs.includes(id));\n if (closedTabs.length > 0) {\n Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"runInAction\"])(() => {\n closedTabs.forEach(tabId => callback({ tabId }));\n });\n }\n }, {\n equals: mobx__WEBPACK_IMPORTED_MODULE_1__[\"comparer\"].structural,\n fireImmediately: opts.fireImmediately,\n });\n }\n onTabChange(callback, options = {}) {\n const { tabKind, dockIsVisible = true } = options, reactionOpts = __rest(options, [\"tabKind\", \"dockIsVisible\"]);\n return Object(mobx__WEBPACK_IMPORTED_MODULE_1__[\"reaction\"])(() => this.selectedTab, ((tab, prevTab) => {\n if (!tab)\n return; // skip when dock is empty\n if (tabKind && tabKind !== tab.kind)\n return; // handle specific tab.kind only\n if (dockIsVisible && !this.isOpen)\n return;\n callback({\n tab, prevTab,\n tabId: tab.id,\n });\n }), reactionOpts);\n }\n hasTabs() {\n return this.tabs.length > 0;\n }\n open(fullSize) {\n this.isOpen = true;\n if (typeof fullSize === \"boolean\") {\n this.fullSize = fullSize;\n }\n }\n close() {\n this.isOpen = false;\n }\n toggle() {\n if (this.isOpen)\n this.close();\n else\n this.open();\n }\n toggleFillSize() {\n if (!this.isOpen)\n this.open();\n this.fullSize = !this.fullSize;\n }\n getTabById(tabId) {\n return this.tabs.find(tab => tab.id === tabId);\n }\n getTabIndex(tabId) {\n return this.tabs.findIndex(tab => tab.id === tabId);\n }\n getNewTabNumber(kind) {\n const tabNumbers = this.tabs\n .filter(tab => tab.kind === kind)\n .map(tab => {\n const tabNumber = +tab.title.match(/\\d+/);\n return tabNumber === 0 ? 1 : tabNumber; // tab without a number is first\n });\n for (let i = 1;; i++) {\n if (!tabNumbers.includes(i))\n return i;\n }\n }\n createTab(rawTabDesc, addNumber = true) {\n const { id = uuid__WEBPACK_IMPORTED_MODULE_0__[\"v4\"](), kind, pinned = false } = rawTabDesc, restOfTabFields = __rest(rawTabDesc, [\"id\", \"kind\", \"pinned\"]);\n let { title = kind } = rawTabDesc;\n if (addNumber) {\n const tabNumber = this.getNewTabNumber(kind);\n if (tabNumber > 1) {\n title += ` (${tabNumber})`;\n }\n }\n const tab = Object.assign(Object.assign({}, restOfTabFields), { id,\n kind,\n pinned,\n title });\n this.tabs.push(tab);\n this.selectTab(tab.id);\n this.open();\n return tab;\n }\n closeTab(tabId) {\n const tab = this.getTabById(tabId);\n if (!tab || tab.pinned) {\n return;\n }\n this.tabs = this.tabs.filter(tab => tab.id !== tabId);\n if (this.selectedTabId === tab.id) {\n if (this.tabs.length) {\n const newTab = this.tabs.slice(-1)[0]; // last\n this.selectTab(newTab.id);\n }\n else {\n this.selectedTabId = null;\n this.close();\n }\n }\n }\n closeTabs(tabs) {\n tabs.forEach(tab => this.closeTab(tab.id));\n }\n closeAllTabs() {\n this.closeTabs([...this.tabs]);\n }\n closeOtherTabs(tabId) {\n const index = this.getTabIndex(tabId);\n const tabs = [...this.tabs.slice(0, index), ...this.tabs.slice(index + 1)];\n this.closeTabs(tabs);\n }\n closeTabsToTheRight(tabId) {\n const index = this.getTabIndex(tabId);\n const tabs = this.tabs.slice(index + 1);\n this.closeTabs(tabs);\n }\n renameTab(tabId, title) {\n const tab = this.getTabById(tabId);\n tab.title = title;\n }\n selectTab(tabId) {\n var _a, _b;\n this.selectedTabId = (_b = (_a = this.getTabById(tabId)) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null;\n }\n reset() {\n var _a;\n (_a = this.storage) === null || _a === void 0 ? void 0 : _a.reset();\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"observable\"],\n __metadata(\"design:type\", Object)\n], DockStore.prototype, \"fullSize\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"computed\"],\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], DockStore.prototype, \"selectedTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Boolean]),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"open\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"close\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"toggle\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"toggleFillSize\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object, Object]),\n __metadata(\"design:returntype\", Object)\n], DockStore.prototype, \"createTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [String]),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"closeTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [String]),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"selectTab\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_1__[\"action\"],\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], DockStore.prototype, \"reset\", null);\nconst dockStore = new DockStore();\n\n\n//# sourceURL=webpack:///./src/renderer/components/dock/dock.store.ts?");
43422
43434
 
43423
43435
  /***/ }),
43424
43436
 
@@ -44483,7 +44495,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
44483
44495
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
44484
44496
 
44485
44497
  "use strict";
44486
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Notifications\", function() { return Notifications; });\n/* harmony import */ var _notifications_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./notifications.scss */ \"./src/renderer/components/notifications/notifications.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/json-api */ \"./src/common/k8s-api/json-api.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _notifications_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./notifications.store */ \"./src/renderer/components/notifications/notifications.store.tsx\");\n/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../animate */ \"./src/renderer/components/animate/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n\n\n\n\n\n\n\n\nlet Notifications = class Notifications extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n }\n static ok(message) {\n _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add({\n message,\n timeout: 2500,\n status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].OK,\n });\n }\n static error(message, customOpts = {}) {\n _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ message, timeout: 10000, status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].ERROR }, customOpts));\n }\n static shortInfo(message, customOpts = {}) {\n this.info(message, Object.assign({ timeout: 5000 }, customOpts));\n }\n static info(message, customOpts = {}) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].INFO, timeout: 0, message }, customOpts));\n }\n componentDidMount() {\n Object(mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"disposeOnUnmount\"])(this, [\n Object(mobx__WEBPACK_IMPORTED_MODULE_2__[\"reaction\"])(() => _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].notifications.length, () => {\n this.scrollToLastNotification();\n }, { delay: 250 }),\n ]);\n }\n scrollToLastNotification() {\n if (!this.elem) {\n return;\n }\n this.elem.scrollTo({\n top: this.elem.scrollHeight,\n behavior: \"smooth\",\n });\n }\n getMessage(notification) {\n let { message } = notification;\n if (message instanceof _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__[\"JsonApiErrorParsed\"] || message instanceof Error) {\n message = message.toString();\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.Children.toArray(message);\n }\n render() {\n const { notifications, remove, addAutoHideTimer, removeAutoHideTimer } = _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"];\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"Notifications flex column align-flex-end\", ref: e => this.elem = e }, notifications.map(notification => {\n const { id, status, onClose } = notification;\n const msgText = this.getMessage(notification);\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_7__[\"Animate\"], { key: id },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"cssNames\"])(\"notification flex\", status), onMouseLeave: () => addAutoHideTimer(id), onMouseEnter: () => removeAutoHideTimer(id) },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"info_outline\" })),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"message box grow\" }, msgText),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"close\", className: \"close\", onClick: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"prevDefault\"])(() => {\n remove(id);\n onClose === null || onClose === void 0 ? void 0 : onClose();\n }) })))));\n })));\n }\n};\nNotifications = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"observer\"]\n], Notifications);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/notifications/notifications.tsx?");
44498
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Notifications\", function() { return Notifications; });\n/* harmony import */ var _notifications_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./notifications.scss */ \"./src/renderer/components/notifications/notifications.scss\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/k8s-api/json-api */ \"./src/common/k8s-api/json-api.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ \"./src/renderer/utils/index.ts\");\n/* harmony import */ var _notifications_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./notifications.store */ \"./src/renderer/components/notifications/notifications.store.tsx\");\n/* harmony import */ var _animate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../animate */ \"./src/renderer/components/animate/index.ts\");\n/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../icon */ \"./src/renderer/components/icon/index.ts\");\n/**\n * Copyright (c) 2021 OpenLens Authors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n\n\n\n\n\n\n\n\nlet Notifications = class Notifications extends react__WEBPACK_IMPORTED_MODULE_1___default.a.Component {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"elem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n }\n static ok(message) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add({\n message,\n timeout: 2500,\n status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].OK,\n });\n }\n static error(message, customOpts = {}) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ message, timeout: 10000, status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].ERROR }, customOpts));\n }\n static shortInfo(message, customOpts = {}) {\n return this.info(message, Object.assign({ timeout: 5000 }, customOpts));\n }\n static info(message, customOpts = {}) {\n return _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].add(Object.assign({ status: _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"NotificationStatus\"].INFO, timeout: 0, message }, customOpts));\n }\n componentDidMount() {\n Object(mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"disposeOnUnmount\"])(this, [\n Object(mobx__WEBPACK_IMPORTED_MODULE_2__[\"reaction\"])(() => _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"].notifications.length, () => {\n this.scrollToLastNotification();\n }, { delay: 250 }),\n ]);\n }\n scrollToLastNotification() {\n if (!this.elem) {\n return;\n }\n this.elem.scrollTo({\n top: this.elem.scrollHeight,\n behavior: \"smooth\",\n });\n }\n getMessage(notification) {\n let { message } = notification;\n if (message instanceof _common_k8s_api_json_api__WEBPACK_IMPORTED_MODULE_4__[\"JsonApiErrorParsed\"] || message instanceof Error) {\n message = message.toString();\n }\n return react__WEBPACK_IMPORTED_MODULE_1___default.a.Children.toArray(message);\n }\n render() {\n const { notifications, remove, addAutoHideTimer, removeAutoHideTimer } = _notifications_store__WEBPACK_IMPORTED_MODULE_6__[\"notificationsStore\"];\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"Notifications flex column align-flex-end\", ref: e => this.elem = e }, notifications.map(notification => {\n const { id, status, onClose } = notification;\n const msgText = this.getMessage(notification);\n return (react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_animate__WEBPACK_IMPORTED_MODULE_7__[\"Animate\"], { key: id },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"cssNames\"])(\"notification flex\", status), onMouseLeave: () => addAutoHideTimer(id), onMouseEnter: () => removeAutoHideTimer(id) },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"info_outline\" })),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"message box grow\" }, msgText),\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(\"div\", { className: \"box\" },\n react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_icon__WEBPACK_IMPORTED_MODULE_8__[\"Icon\"], { material: \"close\", className: \"close\", onClick: Object(_utils__WEBPACK_IMPORTED_MODULE_5__[\"prevDefault\"])(() => {\n remove(id);\n onClose === null || onClose === void 0 ? void 0 : onClose();\n }) })))));\n })));\n }\n};\nNotifications = __decorate([\n mobx_react__WEBPACK_IMPORTED_MODULE_3__[\"observer\"]\n], Notifications);\n\n\n\n//# sourceURL=webpack:///./src/renderer/components/notifications/notifications.tsx?");
44487
44499
 
44488
44500
  /***/ }),
44489
44501